[FFmpeg-trac] #2210(undetermined:new): AC3 channel layout change midstream causes severe errors

FFmpeg trac at avcodec.org
Sun Feb 24 10:44:58 CET 2013


#2210: AC3 channel layout change midstream causes severe errors
-------------------------------------+-------------------------------------
             Reporter:  agni451      |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
              Version:  git-master   |  undetermined
             Keywords:  async        |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by cehoyos):

 Thank you for the sample! (I did not realize -async helps with transport
 streams that have reception errors.)

 The following command line produces an output file with heavy A/V desync
 (several seconds) because of decoding errors after ~5 seconds:
 {{{
 $ ffmpeg -skip_initial_bytes 170M -i Ticket2210.ts -qscale 2 -t 25 out.avi
 ffmpeg version N-50203-g73fce25 Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Feb 23 2013 22:41:12 with gcc 4.7 (SUSE Linux)
   configuration: --enable-gpl --disable-indev=jack
   libavutil      52. 17.103 / 52. 17.103
   libavcodec     54. 92.100 / 54. 92.100
   libavformat    54. 63.100 / 54. 63.100
   libavdevice    54.  3.103 / 54.  3.103
   libavfilter     3. 39.101 /  3. 39.101
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  2.100 / 52.  2.100
 [mpeg2video @ 0x294b060] 0x0 is invalid
     Last message repeated 11 times
 Input #0, mpegts, from 'Ticket2210.ts':
   Duration: 00:02:19.09, start: 77.403367, bitrate: 26800 kb/s
   Program 1
     Metadata:
       service_name    : Service01
       service_provider: FFmpeg
     Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
 yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn,
 59.94 tbc
     Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000
 Hz, 5.1(side), fltp, 448 kb/s
 Please use -q:a or -q:v, -qscale is ambiguous
 Output #0, avi, to 'out.avi':
   Metadata:
     ISFT            : Lavf54.63.100
     Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1920x1080 [SAR
 1:1 DAR 16:9], q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc
     Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz,
 5.1(side), fltp, 448 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (mpeg2video -> mpeg4)
   Stream #0:1 -> #0:1 (ac3 -> ac3)
 Press [q] to stop, [?] for help
 frame CRC mismatch0 q=2.0 size=   10877kB time=00:00:02.91
 bitrate=30598.0kbits/s
 [ac3 @ 0x294b9a0] frame sync error
 Error while decoding stream #0:1: Operation not permitted
 [mpeg2video @ 0x294b060] ac-tex damaged at 82 17
 [mpeg2video @ 0x294b060] Warning MVs not available
 [mpeg2video @ 0x294b060] concealing 6087 DC, 6087 AC, 6087 MV errors in I
 frame
 frame=  555 fps=175 q=2.0 Lsize=   40535kB time=00:00:25.02
 bitrate=13269.3kbits/s
 video:39452kB audio:1038kB subtitle:0 global headers:0kB muxing overhead
 0.113509%
 }}}
 The same desync can be seen when transcoding from the beginning:
 {{{
 $ ffmpeg -i Ticket2210.ts -qscale 2 -t 100 out100.avi
 ffmpeg version N-50203-g73fce25 Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Feb 23 2013 22:41:12 with gcc 4.7 (SUSE Linux)
   configuration: --enable-gpl --disable-indev=jack
   libavutil      52. 17.103 / 52. 17.103
   libavcodec     54. 92.100 / 54. 92.100
   libavformat    54. 63.100 / 54. 63.100
   libavdevice    54.  3.103 / 54.  3.103
   libavfilter     3. 39.101 /  3. 39.101
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  2.100 / 52.  2.100
 Input #0, mpegts, from 'Ticket2210.ts':
   Duration: 00:03:35.09, start: 1.403367, bitrate: 17330 kb/s
   Program 1
     Metadata:
       service_name    : Service01
       service_provider: FFmpeg
     Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
 yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn,
 59.94 tbc
     Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000
 Hz, stereo, fltp, 192 kb/s
 Please use -q:a or -q:v, -qscale is ambiguous
 Output #0, avi, to 'out100.avi':
   Metadata:
     ISFT            : Lavf54.63.100
     Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1920x1080 [SAR
 1:1 DAR 16:9], q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc
     Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo,
 fltp, 192 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (mpeg2video -> mpeg4)
   Stream #0:1 -> #0:1 (ac3 -> ac3)
 Press [q] to stop, [?] for help
 Input stream #0:1 frame changed from rate:48000 fmt:fltp ch:2 chl:stereo
 to rate:48000 fmt:fltp ch:6 chl:5.1(side)
 ac-tex damaged at 44 54.0 size=  118160kB time=00:00:57.08
 bitrate=16955.7kbits/s
 [mpeg2video @ 0x2e920a0] Warning MVs not available
 [mpeg2video @ 0x2e920a0] concealing 1680 DC, 1680 AC, 1680 MV errors in I
 frame
 frame CRC mismatch9 q=2.0 size=  158309kB time=00:01:18.41
 bitrate=16539.2kbits/s
 [ac3 @ 0x2e929e0] frame sync error
 Error while decoding stream #0:1: Operation not permitted
 [mpeg2video @ 0x2e920a0] ac-tex damaged at 82 17
 [mpeg2video @ 0x2e920a0] concealing 6087 DC, 6087 AC, 6087 MV errors in I
 frame
 frame= 2816 fps=180 q=2.0 Lsize=  188541kB time=00:01:40.03
 bitrate=15440.1kbits/s
 video:186184kB audio:2202kB subtitle:0 global headers:0kB muxing overhead
 0.082094%
 }}}
 The following command line produces an output file that plays without
 visible desync:
 {{{
 $ ffmpeg -async 1 -skip_initial_bytes 170M -i Ticket2210.ts -qscale 2 -t
 25 outasync1.avi
 ffmpeg version N-50203-g73fce25 Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Feb 23 2013 22:41:12 with gcc 4.7 (SUSE Linux)
   configuration: --enable-gpl --disable-indev=jack
   libavutil      52. 17.103 / 52. 17.103
   libavcodec     54. 92.100 / 54. 92.100
   libavformat    54. 63.100 / 54. 63.100
   libavdevice    54.  3.103 / 54.  3.103
   libavfilter     3. 39.101 /  3. 39.101
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  2.100 / 52.  2.100
 [mpeg2video @ 0x2911080] 0x0 is invalid
     Last message repeated 11 times
 Input #0, mpegts, from 'Ticket2210.ts':
   Duration: 00:02:19.09, start: 77.403367, bitrate: 26800 kb/s
   Program 1
     Metadata:
       service_name    : Service01
       service_provider: FFmpeg
     Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
 yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn,
 59.94 tbc
     Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000
 Hz, 5.1(side), fltp, 448 kb/s
 Please use -q:a or -q:v, -qscale is ambiguous
 -async is forwarded to lavfi similarly to -af
 aresample=async=1:min_hard_comp=0.100000.
 Output #0, avi, to 'outasync1.avi':
   Metadata:
     ISFT            : Lavf54.63.100
     Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1920x1080 [SAR
 1:1 DAR 16:9], q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc
     Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz,
 5.1(side), fltp, 448 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (mpeg2video -> mpeg4)
   Stream #0:1 -> #0:1 (ac3 -> ac3)
 Press [q] to stop, [?] for help
 frame CRC mismatch0 q=2.0 size=   11174kB time=00:00:02.94
 bitrate=31093.9kbits/s
 [ac3 @ 0x29119c0] frame sync error
 Error while decoding stream #0:1: Operation not permitted
 [mpeg2video @ 0x2911080] ac-tex damaged at 82 17
 [mpeg2video @ 0x2911080] Warning MVs not available
 [mpeg2video @ 0x2911080] concealing 6087 DC, 6087 AC, 6087 MV errors in I
 frame
 frame=  555 fps=174 q=2.0 Lsize=   40866kB time=00:00:25.02
 bitrate=13377.6kbits/s
 video:39452kB audio:1368kB subtitle:0 global headers:0kB muxing overhead
 0.112589%
 }}}
 The following does not work due to channel count switch after a few
 seconds:
 {{{
 $ ffmpeg -async 1 -i Ticket2210.ts -qscale 2 -t 100 out100async.avi
 ffmpeg version N-50203-g73fce25 Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Feb 23 2013 22:41:12 with gcc 4.7 (SUSE Linux)
   configuration: --enable-gpl --disable-indev=jack
   libavutil      52. 17.103 / 52. 17.103
   libavcodec     54. 92.100 / 54. 92.100
   libavformat    54. 63.100 / 54. 63.100
   libavdevice    54.  3.103 / 54.  3.103
   libavfilter     3. 39.101 /  3. 39.101
   libswscale      2.  2.100 /  2.  2.100
   libswresample   0. 17.102 /  0. 17.102
   libpostproc    52.  2.100 / 52.  2.100
 Input #0, mpegts, from 'Ticket2210.ts':
   Duration: 00:03:35.09, start: 1.403367, bitrate: 17330 kb/s
   Program 1
     Metadata:
       service_name    : Service01
       service_provider: FFmpeg
     Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
 yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn,
 59.94 tbc
     Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000
 Hz, stereo, fltp, 192 kb/s
 Please use -q:a or -q:v, -qscale is ambiguous
 -async is forwarded to lavfi similarly to -af
 aresample=async=1:min_hard_comp=0.100000.
 Output #0, avi, to 'out100async.avi':
   Metadata:
     ISFT            : Lavf54.63.100
     Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 1920x1080 [SAR
 1:1 DAR 16:9], q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc
     Stream #0:1(eng): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo,
 fltp, 192 kb/s
 Stream mapping:
   Stream #0:0 -> #0:0 (mpeg2video -> mpeg4)
   Stream #0:1 -> #0:1 (ac3 -> ac3)
 Press [q] to stop, [?] for help
 frame=  120 fps=0.0 q=2.0 size=    6285kB time=00:00:04.13
 bitrate=12444.3kbits/s
 frame=  228 fps=226 q=2.0 size=   14514kB time=00:00:07.74
 bitrate=15359.5kbits/s
 Input stream #0:1 frame changed from rate:48000 fmt:fltp ch:2 chl:stereo
 to rate:48000 fmt:fltp ch:6 chl:5.1(side)
 -async is forwarded to lavfi similarly to -af
 aresample=async=1:min_hard_comp=0.100000.
 [avi @ 0x2bf4a60] st:0 PTS: 0 DTS: 0 < 295 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 1 DTS: 1 < 296 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 2 DTS: 2 < 297 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3 DTS: 3 < 298 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 4 DTS: 4 < 299 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 5 DTS: 5 < 300 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 6 DTS: 6 < 301 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 7 DTS: 7 < 302 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 8 DTS: 8 < 303 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 9 DTS: 9 < 304 invalid, clipping

 ...

 [avi @ 0x2bf4a60] st:0 PTS: 3100 DTS: 3100 < 3395 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3101 DTS: 3101 < 3396 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3102 DTS: 3102 < 3397 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3103 DTS: 3103 < 3398 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3104 DTS: 3104 < 3399 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3105 DTS: 3105 < 3400 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3106 DTS: 3106 < 3401 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3107 DTS: 3107 < 3402 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3108 DTS: 3108 < 3403 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3109 DTS: 3109 < 3404 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3110 DTS: 3110 < 3405 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3111 DTS: 3111 < 3406 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3112 DTS: 3112 < 3407 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3113 DTS: 3113 < 3408 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3114 DTS: 3114 < 3409 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3115 DTS: 3115 < 3410 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3116 DTS: 3116 < 3411 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3117 DTS: 3117 < 3412 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3118 DTS: 3118 < 3413 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3119 DTS: 3119 < 3414 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3120 DTS: 3120 < 3415 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3121 DTS: 3121 < 3416 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3122 DTS: 3122 < 3417 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3123 DTS: 3123 < 3418 invalid, clipping
 [avi @ 0x2bf4a60] st:0 PTS: 3124 DTS: 3124 < 3419 invalid, clipping
 frame= 2816 fps=177 q=2.0 Lsize=  188911kB time=00:01:49.44
 bitrate=14140.7kbits/s
 video:186184kB audio:2565kB subtitle:0 global headers:0kB muxing overhead
 0.085587%
 }}}
 The output file starts with 10sec desync after the channel count change at
 ~10s.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2210#comment:19>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list