Get ffmpeg information in friendly way
- by JBernardo
Every time I try to get some information about my video files with ffmpeg, it pukes a lot of useless information mixed with good things.
I'm using ffmpeg -i name_of_the_video.mpg.
There are any possibilities to get that in a friendly way? I mean JSON would be great (and even ugly XML is fine).
By now, I made my application parse the data with regex but there are lots of nasty corners that appear on some specific video files. I fixed all that I encountered, but there may be more.
I wanted something like:
{
"Stream 0": {
"type": "Video",
"codec": "h264",
"resolution": "720x480"
},
"Stream 1": {
"type": "Audio",
"bitrate": "128 kbps",
"channels": 2
}
}