Opened 12 months ago

Last modified 12 months ago

#6028 open defect

Wrong duration & other artifacts in captured mpeg stream

Reported by: larber Owned by:
Priority: minor Component: avformat
Version: git-master Keywords: mpegts duration
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Hello,

I'm using ffmpeg to post-process tv tuner captures. I have a capture that appears to be corrupt in some subtle way. If I just play the file, it plays ok. However, numerous things are broken (eg, skipping to an arbitrary point in time doesn't work, cutting with ffmpeg -ss/-t and using -acodec copy/-vcodec copy results in clips that have 0 audio channels).

The simplest way to demonstrate how broken the file is is that ffprobe reports a duration of 17:57:32.95, when the real recording is only ~2 hours long. Furthermore, if I cut out the first ~300kb from the file (a trick I came across on another forum), ffprobe correctly picks up the duration as 02:00:29.68. Maybe the capture started in the middle of some frame that confused ffmpeg.

If I truncate the original capture to a 10Mb file, it still shows the large 17 hour duration, so, if helpful, I can provide a sample file as well.

Thanks.

How to reproduce:

$ ffprobe -v 9 -loglevel 99 bad_duration_file.ts
ffprobe version 3.2-2 Copyright (c) 2007-2016 the FFmpeg developers
  built with gcc 6.2.0 (Debian 6.2.0-10) 20161027
  configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/i386-linux-gnu --incdir=/usr/include/i386-linux-gnu --enable-gpl --disable-libtesseract --disable-stripping --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-opengl --enable-sdl2 --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-openal --enable-frei0r --enable-libopencv --enable-libx264 --enable-chromaprint --enable-shared
  WARNING: library configuration mismatch
  avutil      configuration: --cc='ccache cc' --disable-decoder=amrnb --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --disable-mips32r2 --disable-mips32r6 --disable-mips64r6 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-msa --disable-libopencv --disable-podpages --disable-stripping --enable-avfilter --enable-avresample --enable-gcrypt --enable-gnutls --enable-gpl --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libkvazaar --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libxvid --enable-libzvbi --enable-nonfree --enable-opengl --enable-openssl --enable-postproc --enable-pthreads --enable-shared --enable-version3 --incdir=/usr/include/i386-linux-gnu --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --toolchain=hardened --enable-frei0r --enable-chromaprint --enable-libx264 --enable-libiec61883 --enable-libdc1394 --enable-vaapi --enable-libmfx --disable-altivec --shlibdir=/usr/lib/i386-linux-gnu
  avcodec     configuration: --cc='ccache cc' --disable-decoder=amrnb --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --disable-mips32r2 --disable-mips32r6 --disable-mips64r6 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-msa --disable-libopencv --disable-podpages --disable-stripping --enable-avfilter --enable-avresample --enable-gcrypt --enable-gnutls --enable-gpl --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libkvazaar --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libxvid --enable-libzvbi --enable-nonfree --enable-opengl --enable-openssl --enable-postproc --enable-pthreads --enable-shared --enable-version3 --incdir=/usr/include/i386-linux-gnu --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --toolchain=hardened --enable-frei0r --enable-chromaprint --enable-libx264 --enable-libiec61883 --enable-libdc1394 --enable-vaapi --enable-libmfx --disable-altivec --shlibdir=/usr/lib/i386-linux-gnu
  avformat    configuration: --cc='ccache cc' --disable-decoder=amrnb --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --disable-mips32r2 --disable-mips32r6 --disable-mips64r6 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-msa --disable-libopencv --disable-podpages --disable-stripping --enable-avfilter --enable-avresample --enable-gcrypt --enable-gnutls --enable-gpl --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libkvazaar --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libxvid --enable-libzvbi --enable-nonfree --enable-opengl --enable-openssl --enable-postproc --enable-pthreads --enable-shared --enable-version3 --incdir=/usr/include/i386-linux-gnu --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --toolchain=hardened --enable-frei0r --enable-chromaprint --enable-libx264 --enable-libiec61883 --enable-libdc1394 --enable-vaapi --enable-libmfx --disable-altivec --shlibdir=/usr/lib/i386-linux-gnu
  avfilter    configuration: --cc='ccache cc' --disable-decoder=amrnb --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --disable-mips32r2 --disable-mips32r6 --disable-mips64r6 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-msa --disable-libopencv --disable-podpages --disable-stripping --enable-avfilter --enable-avresample --enable-gcrypt --enable-gnutls --enable-gpl --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libkvazaar --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libxvid --enable-libzvbi --enable-nonfree --enable-opengl --enable-openssl --enable-postproc --enable-pthreads --enable-shared --enable-version3 --incdir=/usr/include/i386-linux-gnu --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --toolchain=hardened --enable-frei0r --enable-chromaprint --enable-libx264 --enable-libiec61883 --enable-libdc1394 --enable-vaapi --enable-libmfx --disable-altivec --shlibdir=/usr/lib/i386-linux-gnu
  avresample  configuration: --cc='ccache cc' --disable-decoder=amrnb --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --disable-mips32r2 --disable-mips32r6 --disable-mips64r6 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-msa --disable-libopencv --disable-podpages --disable-stripping --enable-avfilter --enable-avresample --enable-gcrypt --enable-gnutls --enable-gpl --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libkvazaar --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libxvid --enable-libzvbi --enable-nonfree --enable-opengl --enable-openssl --enable-postproc --enable-pthreads --enable-shared --enable-version3 --incdir=/usr/include/i386-linux-gnu --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --toolchain=hardened --enable-frei0r --enable-chromaprint --enable-libx264 --enable-libiec61883 --enable-libdc1394 --enable-vaapi --enable-libmfx --disable-altivec --shlibdir=/usr/lib/i386-linux-gnu
  swscale     configuration: --cc='ccache cc' --disable-decoder=amrnb --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --disable-mips32r2 --disable-mips32r6 --disable-mips64r6 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-msa --disable-libopencv --disable-podpages --disable-stripping --enable-avfilter --enable-avresample --enable-gcrypt --enable-gnutls --enable-gpl --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libkvazaar --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libxvid --enable-libzvbi --enable-nonfree --enable-opengl --enable-openssl --enable-postproc --enable-pthreads --enable-shared --enable-version3 --incdir=/usr/include/i386-linux-gnu --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --toolchain=hardened --enable-frei0r --enable-chromaprint --enable-libx264 --enable-libiec61883 --enable-libdc1394 --enable-vaapi --enable-libmfx --disable-altivec --shlibdir=/usr/lib/i386-linux-gnu
  swresample  configuration: --cc='ccache cc' --disable-decoder=amrnb --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --disable-mips32r2 --disable-mips32r6 --disable-mips64r6 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-msa --disable-libopencv --disable-podpages --disable-stripping --enable-avfilter --enable-avresample --enable-gcrypt --enable-gnutls --enable-gpl --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libkvazaar --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libxvid --enable-libzvbi --enable-nonfree --enable-opengl --enable-openssl --enable-postproc --enable-pthreads --enable-shared --enable-version3 --incdir=/usr/include/i386-linux-gnu --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --toolchain=hardened --enable-frei0r --enable-chromaprint --enable-libx264 --enable-libiec61883 --enable-libdc1394 --enable-vaapi --enable-libmfx --disable-altivec --shlibdir=/usr/lib/i386-linux-gnu
  postproc    configuration: --cc='ccache cc' --disable-decoder=amrnb --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --disable-mips32r2 --disable-mips32r6 --disable-mips64r6 --disable-mipsdsp --disable-mipsdspr2 --disable-mipsfpu --disable-msa --disable-libopencv --disable-podpages --disable-stripping --enable-avfilter --enable-avresample --enable-gcrypt --enable-gnutls --enable-gpl --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libkvazaar --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librubberband --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx265 --enable-libxvid --enable-libzvbi --enable-nonfree --enable-opengl --enable-openssl --enable-postproc --enable-pthreads --enable-shared --enable-version3 --incdir=/usr/include/i386-linux-gnu --libdir=/usr/lib/i386-linux-gnu --prefix=/usr --toolchain=hardened --enable-frei0r --enable-chromaprint --enable-libx264 --enable-libiec61883 --enable-libdc1394 --enable-vaapi --enable-libmfx --disable-altivec --shlibdir=/usr/lib/i386-linux-gnu
  libavutil      55. 34.100 / 55. 34.100
  libavcodec     57. 64.100 / 57. 64.100
  libavformat    57. 56.100 / 57. 56.100
  libavdevice    57.  1.100 / 57.  1.100
  libavfilter     6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale      4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc    54.  1.100 / 54.  1.100
[file @ 0x8170c0e0] Setting default whitelist 'file,crypto'
Probing mp3 score:1 size:2048
Probing mpeg score:25 size:2048
Probing mpegts score:50 size:2048
[mpegts @ 0x8170ba20] Format mpegts probed with size=2048 and score=50
score: 44, dvhs_score: -2, fec_score: -2
[mpegts @ 0x8170ba20] Filter: pid=0x11 type=1
[mpegts @ 0x8170ba20] Filter: pid=0x0 type=1
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] sid=0x5 pid=0x50
[mpegts @ 0x8170ba20] new_program: id=0x0005
[mpegts @ 0x8170ba20] Filter: pid=0x50 type=1
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] sid=0x5 sec_num=0/0 version=1 tid=2
[mpegts @ 0x8170ba20] pcr_pid=0x51
[mpegts @ 0x8170ba20] Filter: pid=0x51 type=0
[mpegts @ 0x8170ba20] stream=0 stream_type=2 pid=51 prog_reg_desc=
[mpegts @ 0x8170ba20] Filter: pid=0x54 type=0
[mpegts @ 0x8170ba20] stream=1 stream_type=81 pid=54 prog_reg_desc=
[mpegts @ 0x8170ba20] tag: 0x0a len=4
[mpegts @ 0x8170ba20] tag: 0x6a len=1
[mpegts @ 0x8170ba20] tuning done
[mpegts @ 0x8170ba20] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0 nb_streams:2
[mpegts @ 0x8170ba20] Skipping after seek
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] Continuity check failed for pid 81 expected 4 got 7
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpeg2video @ 0x8170fee0] Invalid frame dimensions 0x0.
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] sid=0x5 pid=0x50
[mpegts @ 0x8170ba20] new_program: id=0x0005
[mpegts @ 0x8170ba20] Filter: pid=0x1ffb type=0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] sid=0x5 sec_num=0/0 version=1 tid=2
[mpegts @ 0x8170ba20] pcr_pid=0x51
[mpegts @ 0x8170ba20] tag: 0x0a len=4
[mpegts @ 0x8170ba20] tag: 0x6a len=1
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpeg2video @ 0x8170fee0] Invalid frame dimensions 0x0.
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpeg2video @ 0x8170fee0] Invalid frame dimensions 0x0.
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpeg2video @ 0x8170fee0] Invalid frame dimensions 0x0.
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpeg2video @ 0x8170fee0] Invalid frame dimensions 0x0.
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpeg2video @ 0x8170fee0] Invalid frame dimensions 0x0.
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpeg2video @ 0x8170fee0] Invalid frame dimensions 0x0.
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpeg2video @ 0x8170fee0] Invalid frame dimensions 0x0.
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpeg2video @ 0x8170fee0] Invalid frame dimensions 0x0.
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpeg2video @ 0x8170fee0] Invalid frame dimensions 0x0.
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpeg2video @ 0x8170fee0] Invalid frame dimensions 0x0.
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpeg2video @ 0x8170fee0] Invalid frame dimensions 0x0.
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 3 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 3 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 5 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 3 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 5 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 3 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 3 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] max_analyze_duration 5000000 reached at 5024000 microseconds st:1
[mpegts @ 0x8170ba20] Skipping after seek
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] sid=0x5 sec_num=0/0 version=1 tid=2
[mpegts @ 0x8170ba20] pcr_pid=0x51
[mpegts @ 0x8170ba20] tag: 0x0a len=4
[mpegts @ 0x8170ba20] tag: 0x6a len=1
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 2 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
[mpegts @ 0x8170ba20] pid=54 pes_code=0x1bd
[mpegts @ 0x8170ba20] pid=51 pes_code=0x1e0
    Last message repeated 1 times
[mpegts @ 0x8170ba20] PAT:
[mpegts @ 0x8170ba20] PMT: len 35
[mpegts @ 0x8170ba20] PES packet size mismatch
[mpegts @ 0x8170ba20] stream 0: start_time: 90535.296 duration: 64652.951
[mpegts @ 0x8170ba20] stream 1: start_time: 147957.927 duration: 7229.632
[mpegts @ 0x8170ba20] format: start_time: 90535.296 duration: 64652.951 bitrate=329 kb/s
[mpegts @ 0x8170ba20] After avformat_find_stream_info() pos: 0 bytes read:2183312 seeks:2 frames:319
Input #0, mpegts, from 'bad_duration_file.ts':
  Duration: 17:57:32.95, start: 90535.295800, bitrate: 329 kb/s
  Program 5
    Stream #0:0[0x51], 160, 1/90000: Video: mpeg2video (Main), 1 reference frame ([2][0][0][0] / 0x0002), yuv420p(tv, smpte170m, top first, left), 720x480 [SAR 8:9 DAR 4:3], 0/1, Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x54](eng), 159, 1/90000: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
[AVIOContext @ 0x817142e0] Statistics: 2183312 bytes read, 2 seeks

Attachments (1)

bad_duration_file_small.ts (2.0 MB) - added by larber 12 months ago.
mpegts file with wrong duration

Download all attachments as: .zip

Change History (5)

comment:1 Changed 12 months ago by cehoyos

  • Keywords mpegts added; duration corrupt removed

Please provide a sample if the issue is reproducible with current FFmpeg git head.

Changed 12 months ago by larber

mpegts file with wrong duration

comment:2 Changed 12 months ago by larber

Confirmed that this happens with the latest git head too (ffprobe version N-82880-g02aa070). I've attached the original file truncated to 2MB. ffprobe shows a duration of 15:57:08.77. If I strip the first 300kb of the attached file like so:

dd if=bad_duration_file_small.ts bs=1c skip=300000 of=bad_duration_file_strip.ts

Then ffprobe reports the duration correctly as 00:00:05.34.

Last edited 12 months ago by larber (previous) (diff)

comment:3 Changed 12 months ago by cehoyos

  • Component changed from undetermined to avformat
  • Keywords duration added
  • Priority changed from normal to minor
  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from unspecified to git-master

Workaround is to use -skip_initial_bytes 189

comment:4 Changed 12 months ago by larber

This worked and is much cleaner than the dd. Thanks.

Note: See TracTickets for help on using tickets.