[FFmpeg-user] Retrieve duration of an m2v >MPEG>2 elementary stream file

Ferdi Scholten ferdi at sttc-nlp.nl
Wed Mar 1 17:07:36 EET 2023


Hi,
> if I invoke ffmpeg on an M2V MPEG-2 elementary stream, I get "N/A" for the
> duration. I guess this is because this file doesn't contain a header that
> contains the duration. Is it possible to force ffmpeg to parse the entire
> file to obtain the duration?
>
> Full command line and output:
>
> ffmpeg -i
> /Users/krueger/lesspain/samples/software/compressor/compressor_dvd_mpeg2_480_24p.m2v
>
> ffmpeg version N-109938-g67fd1b79e7 Copyright (c) 2000-2023 the FFmpeg
> developers
>    built with Apple clang version 11.0.0 (clang-1100.0.33.17)
>    configuration:
>    libavutil      58.  3.100 / 58.  3.100
>    libavcodec     60.  5.100 / 60.  5.100
>    libavformat    60.  4.100 / 60.  4.100
>    libavdevice    60.  2.100 / 60.  2.100
>    libavfilter     9.  4.100 /  9.  4.100
>    libswscale      7.  2.100 /  7.  2.100
>    libswresample   4. 11.100 /  4. 11.100
> Input #0, mpegvideo, from
> '/Users/krueger/lesspain/samples/software/compressor/compressor_dvd_mpeg2_480_24p.m2v':
>    Duration: N/A, bitrate: N/A
>    Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, smpte170m,
> progressive), 720x480 [SAR 32:27 DAR 16:9], 30 fps, 59.94 tbr, 1200k tbn
>      Side data:
>        cpb: bitrate max/min/avg: 7700000/0/0 buffer size: 1835008 vbv_delay:
> N/A
> At least one output file must be specified
>
> Thanks,
> Robert
>
You can use  -analyzeduration 10000000M -probesize 10000000M for example 
to scan more of the input file. like this:

ffmpeg -i -analyzeduration 10000000M -probesize 10000000M /Users/krueger/lesspain/samples/software/compressor/compressor_dvd_mpeg2_480_24p.m2v



More information about the ffmpeg-user mailing list