[FFmpeg-user] ffprobe reporting a strange duration from a 3-second .ts (transport-stream) file

Tom Sheffler tom.sheffler at gmail.com
Tue Dec 18 23:44:29 CET 2012


Hello group:

I have not had any trouble with ffprobe with many sources of files,  but I
recently encountered one video source that consistently generates 3-second
.TS files whose durations are incorrectly reported by ffprobe.  (See the
output below from ffprobe version 1.0.1.)  The duration is reported
as 95443.717678 seconds, or 26:30:43.71, when it should be 3 seconds.  The
audio track seems ok.

Here is a link to an example .ts file:
http://tsheffler.com/site_media/strange_duration_example.ts

If I am using ffprobe incorrectly, please let me know.  The purpose of the
ffprobe run is to find the file's type and quickly parse it for
correctness.  This bogus-looking duration is confusing the rest of my
system.  If there is another way to quickly identify the file type and
compute its duration, I'm open to that.

I'm enclosing the output of ffprobe with no options, and also with
-show_streams to show a little bit more information.

P.S. - if I use the "-show_streams" option, the audio track has the correct
duration but not the video track.

Thanks for any help.
-Tom

$ ffprobe strange_duration_example.ts
ffprobe version 1.0.1 Copyright (c) 2007-2012 the FFmpeg developers
  built on Dec 14 2012 14:26:39 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --prefix=/Users/sheffler/video/myffmpeg05 --enable-gpl
--enable-nonfree --enable-pthreads --enable-libmp3lame --enable-libtheora
--enable-libfaac --enable-libvorbis --enable-libvpx --enable-libx264
--enable-version3 --disable-mmx --arch=x86_64 --cpu=core2
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mpegts, from 'strange_duration_example.ts':
  Duration: 26:30:43.71, start: 2537.535011, bitrate: 0 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (Main) (HDMV / 0x564D4448), yuv420p,
432x240 [SAR 1:1 DAR 9:5], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x1100]: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, s16, 130 kb/s



=== and also with the -show_streams option ===

$ ffprobe -show_streams strange_duration_example.ts
ffprobe version 1.0.1 Copyright (c) 2007-2012 the FFmpeg developers
  built on Dec 14 2012 14:26:39 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --prefix=/Users/sheffler/video/myffmpeg05 --enable-gpl
--enable-nonfree --enable-pthreads --enable-libmp3lame --enable-libtheora
--enable-libfaac --enable-libvorbis --enable-libvpx --enable-libx264
--enable-version3 --disable-mmx --arch=x86_64 --cpu=core2
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 59.100 / 54. 59.100
  libavformat    54. 29.104 / 54. 29.104
  libavdevice    54.  2.101 / 54.  2.101
  libavfilter     3. 17.100 /  3. 17.100
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mpegts, from 'strange_duration_example.ts':
  Duration: 26:30:43.71, start: 2537.535011, bitrate: 0 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (Main) (HDMV / 0x564D4448), yuv420p,
432x240 [SAR 1:1 DAR 9:5], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x1100]: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, s16, 130 kb/s
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=Main
codec_type=video
codec_time_base=1001/60000
codec_tag_string=HDMV
codec_tag=0x564d4448
width=432
height=240
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=9:5
pix_fmt=yuv420p
level=21
timecode=N/A
is_avc=0
nal_length_size=0
id=0x1011
r_frame_rate=30000/1001
avg_frame_rate=30000/1001
time_base=1/90000
start_pts=228378151
start_time=2537.535011
duration_ts=8589934591
duration=95443.717678
bit_rate=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
[/STREAM]
[STREAM]
index=1
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=unknown
codec_type=audio
codec_time_base=1/48000
codec_tag_string=[15][0][0][0]
codec_tag=0x000f
sample_fmt=s16
sample_rate=48000
channels=2
bits_per_sample=0
id=0x1100
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/90000
start_pts=228378240
start_time=2537.536000
duration_ts=268800
duration=2.986667
bit_rate=130875
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
[/STREAM]


More information about the ffmpeg-user mailing list