Re: Length of a video file (.avi, .mpg) from the command line
Jean-Baptiste Thomas wrote:
> Can anyone recommend a command line program that could tell me
> the length of the video stream in a .avi or .mpg file ? Thanks
> in advance.
If you invoke
mplayer -vo none -ao none <filename>
you will get a set of statistics which include the resolution,
frame rate, and encoding rate for both video and audio streams.
A little addition and division with the total size of the file
should get you a good idea.
ffmpeg -i <filename>
will do a similar set of stats, including doing some math for
you. (Look at "duration" in the output.)
However, everything is only *likely* to be correct, because
there are a number of encodings which can cause variable length.
-dsr-
Reply to: