我正在尝试以人类可读的方式获取有关电影的信息(分辨率、帧速率、比特率、编解码器、持续时间等)。我发现了这个命令:
ffprobe -v quiet -print_format json -show_format -show_streams somefile.asf
在这个 Stack Overflow 问题中:Get ffmpeg information in friendly way
但这对我不起作用。当我在终端中尝试时,输出为空:
richard@richard-desktop:~/projects/hello-python$ ffprobe -v quiet -print_format json -show_format -show_streams tests/test_1.mpg
richard@richard-desktop:~/projects/hello-python$
最佳答案
好的,Ubuntu 存储库中的当前 ffmpeg 版本不是最新的。
我所做的是添加了这个更新的存储库:
sudo add-apt-repository ppa:jon-severinsson/ffmpeg
然后做了:
sudo apt-get remove ffmpeg
sudo apt-get autoremove
sudo apt-get update
sudo apt-get install ffmpeg
瞧。它有效,我从 ffprobe 得到正确的 JSON 输出 :)
关于python - 带有 print json 的 Ffprobe 不打印任何内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11229660/