[FFmpeg-user] ffprobe duration analysis and -analyzeduration and -probesize

Robert Krüger krueger at lesspain.de
Tue Jul 15 17:09:32 CEST 2014


Hi,

I am trying to get ffprobe to correctly extract durations from some
MTS files. My understanding is that the transport stream format does
not provide a cheap way to obtain the duration but one has to parse
each packet from start to end to reliably get the duration. Since
ffmpeg and ffprobe only do that by default to a certain extend they
have to "guess" (no idea how that is implemented for ts atm) the
correct duration. Now the command line options -analyzeduration and
-probesize exist and so I naively thought, if I just specified them
large enough so the entire file is parsed, durations must be exact but
that does not seem to be the case (I compared the values to the ones
obtained by adding up all packet durations of a given stream and those
make more sense).

Where is my mistake?

Command line and uncut output below:

ffprobe -analyzeduration 1000000000 -probesize 1000000000 -i
~/samples/cameras/canon/hf_100/canon_hf_100_fxp_1080_25i_10s.MTS
-show_streams -select_streams v:0
ffprobe version git-2014-07-11-96a860a Copyright (c) 2007-2014 the
FFmpeg developers
  built on Jul 11 2014 16:33:17 with Apple LLVM version 5.1
(clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --enable-shared --disable-static --disable-doc
--disable-avdevice
--prefix=/Users/admin/repos/de.lesspain/de.lesspain.ffmpeg/ffmpeg/build/ffmpeg
--extra-cflags=-I/Users/admin/repos/de.lesspain/de.lesspain.ffmpeg/ffmpeg/build/libmp3lame/include/
--extra-ldflags=-L/Users/admin/repos/de.lesspain/de.lesspain.ffmpeg/ffmpeg/build/libmp3lame/lib/
--extra-ldflags='-Wl,-rpath, at loader_path/../lib' --enable-libmp3lame
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 45.100 / 55. 45.100
  libavfilter     4. 10.100 /  4. 10.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
Input #0, mpegts, from
'/Users/krueger/samples/cameras/canon/hf_100/canon_hf_100_fxp_1080_25i_10s.MTS':
  Duration: 00:00:10.56, start: 0.860000, bitrate: 16346 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) (HDMV / 0x564D4448),
yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
stereo, fltp, 256 kb/s
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1/50
codec_tag_string=HDMV
codec_tag=0x564d4448
width=1920
height=1080
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=40
color_range=N/A
color_space=unknown
timecode=N/A
id=0x1011
r_frame_rate=25/1
avg_frame_rate=25/1
time_base=1/90000
start_pts=84600
start_time=0.940000
duration_ts=939600
duration=10.440000
bit_rate=N/A
max_bit_rate=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
[/STREAM]

Best regards,

Robert


More information about the ffmpeg-user mailing list