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

Carl Eugen Hoyos ceffmpeg at gmail.com
Wed May 30 01:31:16 EEST 2018


2018-05-29 20:40 GMT+02:00, André Hänsel <andre at webkr.de>:
> I'd like to get the media info, specifically the duration, with ffmpeg (not
> ffprobe).
>
> 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
> network).
>
> 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.

You can play with "ffmpeg -probesize 1000 -i input" and try different values
(possibly also for "-analyze-duration").

Carl Eugen


More information about the ffmpeg-user mailing list