python如何调用ffmpeg?
去ffmpeg官网下载编译好的avcodec-57.dll、avutil-55.dll、swresample-2.dll,准备好了C语言写出的库。
相关推荐:《Python教程》
下面是用Python调用的例子。
importos importctypes dllHandler=ctypes.cdll.LoadLibrary(os.getcwd()+'\\avcodec-57.dll') ret=dllHandler.avcodec_configuration() data=ctypes.string_at(ret,-1).decode("utf-8") print(data)
我们可以看到打印出来了ffmpeg的配置参数,说明已经调用成功。
上一篇