[FFmpeg-user] Some guidence on finding this problem.

Peter White peter.white at posteo.net
Wed Aug 3 13:30:01 EEST 2016


JULIAN GARDNER wrote:
> Well I have managed to copy a .ts which has the problem, had to record over 8 hours of tv just for this.

Since you just mentioned it, how do yoou record the files in question,
because to me it looks like the error could just as well happen at that
stage already.

Judging by this output:

> encoder at encoder:~$ ffmpeg -i failure_chomped.ts -c:v libx265 -c:a libfaac -y -f mpegts a.ts
 > ...
> [hls,mpegts @ 0x2c36dc0] Packets poorly interleaved, failed to avoid negative timestamp -5280 in stream 0.
> Try -max_interleave_delta 0 as a possible workaround.
> [hls,mpegts @ 0x2c36dc0] Packets poorly interleaved, failed to avoid negative timestamp -1680 in stream 0.
> Try -max_interleave_delta 0 as a possible workaround.
> [h264 @ 0x2f13640] left block unavailable for requested intra4x4 mode -1 at 0 0/s dup=7 drop=1 speed=0.718x
> [h264 @ 0x2f13640] error while decoding MB 0 0, bytestream 90043
> [h264 @ 0x2d225a0] Reference 2 >= 2
> [h264 @ 0x2d225a0] error while decoding MB 20 0, bytestream 12154
> [h264 @ 0x2d69500] Reference 2 >= 2
> [h264 @ 0x2d69500] error while decoding MB 20 1, bytestream 11501
> [h264 @ 0x2db0460] Reference 2 >= 2
> [h264 @ 0x2db0460] error while decoding MB 68 12, bytestream 5526
> [h264 @ 0x2df73c0] Reference 4 >= 2
> [h264 @ 0x2df73c0] error while decoding MB 99 13, bytestream 5991
> [h264 @ 0x2e3e460] Reference 2 >= 2
> [h264 @ 0x2e3e460] error while decoding MB 39 14, bytestream 5495
> [h264 @ 0x2ecc5a0] Reference 2 >= 2
> [h264 @ 0x2ecc5a0] error while decoding MB 1 0, bytestream 22016
> [h264 @ 0x2f13640] Reference 4 >= 2
> [h264 @ 0x2f13640] error while decoding MB 2 1, bytestream 17445
> [h264 @ 0x2d225a0] top block unavailable for requested intra4x4 mode -1 at 1 1
> [h264 @ 0x2d225a0] error while decoding MB 1 1, bytestream 7127
> [h264 @ 0x2d69500] top block unavailable for requested intra4x4 mode -1 at 10 0
> [h264 @ 0x2d69500] error while decoding MB 10 0, bytestream 4482
> [h264 @ 0x2df73c0] Reference 2 >= 2
> [h264 @ 0x2df73c0] error while decoding MB 25 16, bytestream 4664
> [h264 @ 0x2e3e460] Reference 2 >= 2
> [h264 @ 0x2e3e460] error while decoding MB 85 13, bytestream 4554
> [h264 @ 0x2e85500] Reference 8 >= 4
> [h264 @ 0x2e85500] error while decoding MB 26 0, bytestream 11033
> [h264 @ 0x2ecc5a0] Reference 5 >= 2
> [h264 @ 0x2ecc5a0] error while decoding MB 7 1, bytestream 9995
> [h264 @ 0x2f13640] Reference 2 >= 2
> [h264 @ 0x2f13640] error while decoding MB 11 0, bytestream 6345
> [h264 @ 0x2c6b040] Reference 2 >= 2
> [h264 @ 0x2c6b040] error while decoding MB 22 1, bytestream 5825
> [h264 @ 0x2d69500] Reference 2 >= 2  344kB time=00:00:09.13 bitrate= 308.7kbits/s dup=7 drop=1 speed=0.719x
> [h264 @ 0x2d69500] error while decoding MB 81 11, bytestream 2716
> [h264 @ 0x2db0460] Reference 3 >= 2
> [h264 @ 0x2db0460] error while decoding MB 118 12, bytestream 2138
> [h264 @ 0x2e3e460] top block unavailable for requested intra mode at 45 0
> [h264 @ 0x2e3e460] error while decoding MB 45 0, bytestream 10651
> [h264 @ 0x2ecc5a0] Reference 2 >= 2
> [h264 @ 0x2ecc5a0] error while decoding MB 11 0, bytestream 5889
> [h264 @ 0x2f13640] Reference 2 >= 2
> [h264 @ 0x2f13640] error while decoding MB 6 1, bytestream 5593
> [h264 @ 0x2d225a0] Reference 2 >= 2
> [h264 @ 0x2d225a0] error while decoding MB 94 13, bytestream 2835

So maybe it is not the decoding at fault but the recording application
you use. The sample you provided makes ffmpeg shout just for trying to
copy the streams. Copying to another .ts works somewhat, anyway. But
make that a .mkv target file and ffmpeg errors out, see below.

$ ffmpeg -i failure_chomped.ts -c copy failure_chomped.2.ts
ffmpeg version N-81177-ga170365 Copyright (c) 2000-2016 the FFmpeg 
developers
   built with gcc 4.9.2 (Debian 4.9.2-10)
   configuration: --extra-cflags='-march=native' --enable-gpl 
--enable-nonfree --enable-libfdk-aac --disable-runtime-cpudetect 
--enable-libx264 --enable-libvorbis --enable-gnutls --enable-opengl 
--enable-libopus --enable-libfreetype --enable-libfontconfig 
--enable-libfribidi --enable-libsoxr
   libavutil      55. 28.100 / 55. 28.100
   libavcodec     57. 51.100 / 57. 51.100
   libavformat    57. 44.100 / 57. 44.100
   libavdevice    57.  0.102 / 57.  0.102
   libavfilter     6. 49.100 /  6. 49.100
   libswscale      4.  1.100 /  4.  1.100
   libswresample   2.  1.100 /  2.  1.100
   libpostproc    54.  0.100 / 54.  0.100
[h264 @ 0x283b260] Increasing reorder buffer to 2
Input #0, mpegts, from 'failure_chomped.ts':
   Duration: 00:00:20.09, start: 0.009744, bitrate: 9985 kb/s
   Program 1
     Metadata:
       service_name    : Service01
       service_provider: FFmpeg
     Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), 
yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k 
tbn, 50 tbc
     Stream #0:1[0x101](NAR): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 
Hz, stereo, s16p, 192 kb/s
     Stream #0:2[0x102](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 
48000 Hz, stereo, fltp, 384 kb/s
[mpegts @ 0x2876460] Using AVStream.codec to pass codec parameters to 
muxers is deprecated, use AVStream.codecpar instead.
     Last message repeated 1 times
Output #0, mpegts, to 'failure_chomped.2.ts':
   Metadata:
     encoder         : Lavf57.44.100
     Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), 
yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 50 
tbr, 90k tbn, 90k tbc
     Stream #0:1(NAR): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 
stereo, 192 kb/s
Stream mapping:
   Stream #0:0 -> #0:0 (copy)
   Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mpegts @ 0x2876460] Timestamps are unset in a packet for stream 0. This 
is deprecated and will stop working in the future. Fix your code to set 
the timestamps properly
[mpegts @ 0x2876460] Non-monotonous DTS in output stream 0:0; previous: 
1283, current: 1283; changing to 1284. This may result in incorrect 
timestamps in the output file.
[NULL @ 0x283b260] missing picture in access unit with size 6
frame= 1000 fps=0.0 q=-1.0 Lsize=   23273kB time=00:00:20.03 
bitrate=9516.5kbits/s speed=59.2x
video:21013kB audio:481kB subtitle:0kB other streams:0kB global 
headers:0kB muxing overhead: 8.280689%

Now the same, but with an mkv as target file:

$ ffmpeg -i failure_chomped.ts -c copy failure_chomped.2.mkv
ffmpeg version N-81177-ga170365 Copyright (c) 2000-2016 the FFmpeg 
developers
   built with gcc 4.9.2 (Debian 4.9.2-10)
   configuration: --extra-cflags='-march=native' --enable-gpl 
--enable-nonfree --enable-libfdk-aac --disable-runtime-cpudetect 
--enable-libx264 --enable-libvorbis --enable-gnutls --enable-opengl 
--enable-libopus --enable-libfreetype --enable-libfontconfig 
--enable-libfribidi --enable-libsoxr
   libavutil      55. 28.100 / 55. 28.100
   libavcodec     57. 51.100 / 57. 51.100
   libavformat    57. 44.100 / 57. 44.100
   libavdevice    57.  0.102 / 57.  0.102
   libavfilter     6. 49.100 /  6. 49.100
   libswscale      4.  1.100 /  4.  1.100
   libswresample   2.  1.100 /  2.  1.100
   libpostproc    54.  0.100 / 54.  0.100
[h264 @ 0x2089260] Increasing reorder buffer to 2
Input #0, mpegts, from 'failure_chomped.ts':
   Duration: 00:00:20.09, start: 0.009744, bitrate: 9985 kb/s
   Program 1
     Metadata:
       service_name    : Service01
       service_provider: FFmpeg
     Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), 
yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 50 tbr, 90k 
tbn, 50 tbc
     Stream #0:1[0x101](NAR): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 
Hz, stereo, s16p, 192 kb/s
     Stream #0:2[0x102](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 
48000 Hz, stereo, fltp, 384 kb/s
[matroska @ 0x20c4460] Using AVStream.codec to pass codec parameters to 
muxers is deprecated, use AVStream.codecpar instead.
     Last message repeated 1 times
Output #0, matroska, to 'failure_chomped.2.mkv':
   Metadata:
     encoder         : Lavf57.44.100
     Stream #0:0: Video: h264 (Main) (H264 / 0x34363248), yuv420p(tv, 
bt709), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 50 tbr, 1k tbn, 
90k tbc
     Stream #0:1(NAR): Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, 
stereo, 192 kb/s
Stream mapping:
   Stream #0:0 -> #0:0 (copy)
   Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[matroska @ 0x20c4460] Timestamps are unset in a packet for stream 0. 
This is deprecated and will stop working in the future. Fix your code to 
set the timestamps properly
[matroska @ 0x20c4460] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
frame=    2 fps=0.0 q=-1.0 Lsize=      90kB time=00:00:00.04 
bitrate=15353.7kbits/s speed=9.12x
video:109kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB 
muxing overhead: unknown
Conversion failed!

So my money is on the recorder.

Peter


More information about the ffmpeg-user mailing list