[FFmpeg-user] Get video info with ffmpeg, then exit

André Hänsel andre at webkr.de
Tue May 29 21:40:20 EEST 2018

I'd like to get the media info, specifically the duration, with ffmpeg (not

I can parse this from the "Input" output:

> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
>   Metadata:
>   ...
>   Duration: 00:00:33.41, start: 0.000000, bitrate: 5778 kb/s

The videos in question have their moov atom at the beginning. I'd like
ffmpeg to read as little as possible from the video (I'm reading over a slow

According to -v trace, the command `ffmpeg -I test.mp4 -f null -` reads the
whole file (24 MB), which makes sense. I brought it down to 4 MB with
-frames:v 0.

Does anyone know if I can disable even more of the decoding? I think most of
the information displayed is contained in the moov atom, which is only about
2 kB large.

More information about the ffmpeg-user mailing list