PDA

View Full Version : CLI video file query tool?


stuinzuri
24th September 2009, 23:15
I'm looking for a command line tool to query video files for information on their tracks, codecs, lengths, etc. My immediate concern is MP4 files, but want to expand to others later.

I had been using mp4info (part of the seemingly defunct mpeg4ip project) but getting that running on my target installations has been...problematic. E.g.:

manoa:Movies stu$ mp4info cochlear.mp4
mp4info version 1.5.0.1
cochlear.mp4:
Track Type Info
1 video H264 Baseline@2.1, 2676.760 secs, 811 kbps, 496x280 @ 25.000000 fps
2 audio MPEG-4 AAC LC, 2676.703 secs, 0 kbps, 44100 Hz
Metadata Tool: Lavf52.38.0
manoa:Movies stu$

ffmpeg does not, to my knowledge, have a query mode. (If it does, please edumacate me.)

The output will be consumed by my own code.

tia,

stu

LoRd_MuldeR
24th September 2009, 23:25
MediaInfo

http://mediainfo.sourceforge.net/en

J_Darnley
25th September 2009, 21:14
ffmpeg does not, to my knowledge, have a query mode. (If it does, please edumacate me.)

ffmpeg -i file

Not a very detailed report but...

stuinzuri
29th September 2009, 17:18
Cool. Mediainfo looks like what I want, but it broken on Snow Leopard (along with another zillion projects.)


ffmpeg -i file

Yea...but what bugs me there is ffmpeg does not exit 0, which I'd like for correctness's sake. More info is desirable too. But thanks anyway.

LoRd_MuldeR
29th September 2009, 17:25
Cool. Mediainfo looks like what I want, but it broken on Snow Leopard (along with another zillion projects.)

You should talk to Zenitram (http://forum.doom9.org/member.php?u=16626) about the issue...

J_Darnley
29th September 2009, 22:50
Yea...but what bugs me there is ffmpeg does not exit 0, which I'd like for correctness's sake. More info is desirable too. But thanks anyway.

True, but ffmpeg shouldn't return 0 in this case, it didn't finish correctly. :)

stuinzuri
12th November 2009, 13:01
True, but ffmpeg shouldn't return 0 in this case, it didn't finish correctly. :)
Since I want to do this programatically, that makes error detection difficult and fuzzy. What is the difference between a successful completion, and a true error condition? (Like path errors, etc.)