Search code examples
pythonubuntuffmpegffprobe

Ffprobe with print json doesn't print anything


I am trying to get information about a movie (resolution, frame rate, bit rate, codecs, duration etc) in a human readable way. I found this commnad:

ffprobe -v quiet -print_format json -show_format -show_streams somefile.asf

In this Stack Overflow question: Get ffmpeg information in friendly way

But it doesn't work for me. When I try it in a terminal, the output is empty:

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$ 

Solution

  • Ok, the current version of ffmpeg in Ubuntu repos is not up to date.

    What I did was I added this more up to date repository:

    sudo add-apt-repository ppa:jon-severinsson/ffmpeg
    

    And then did:

    sudo apt-get remove ffmpeg
    sudo apt-get autoremove
    sudo apt-get update
    sudo apt-get install ffmpeg
    

    And voila. It works and I get correct JSON output from ffprobe :)