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

FFmpeg trac at avcodec.org
Thu Feb 14 04:06:01 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 agni451):

 Okay, I'm going to upload a 2.5 minute (205MB) clip copied from the
 original in a 7z file.  I am also uploading the ffprobe -show_frames csv
 file in which I have indicated (with '-->') where the audio changes from
 6ch to stereo and vice versa.  ffmpeg gets confused a bit by the
 6ch-->stereo, but REALLY gets confused by the stereo-->6ch.  To reproduce
 the problem, and what you should see:

 1. run command
 {{{
 ffmpeg -v verbose -y -i "C:\PATH\ORIG_short.ts" -c:v mpeg2video -q:vscale
 0 -flags +ilme+ildct -top 1 -c:a ac3 -ab 384k -ac 6 -async 48000
 "C:\PATH\FIX.ts"
 }}}

 2. Demux FIX.ts with dgindex, tsmuxer, whatever to get mpeg2 video and ac3
 audio files.

 3. Mux them in mkvmerge

 4. Play in mpc


 Between steps 2 and 3 are where I would normally re-encode to x264 and pad
 the audio, etc.

 You should notice that the fixed video file duration is 00:02:30.050.
 However, the length of the audio is 00:03:44.032, and putting it in
 audacity clearly shows that an unnecessary 6sec (approx) of silent audio
 has been added where the channels change from 6ch to stereo.  A further 1
 minute and 9 seconds (approx) of silent audio have been added where the
 audio changes from stereo back to 6ch.

 Playing the FIX.ts file in mpc should result in a pause of the video and
 silence around 5 secs in.  If you just let it sit there and continue
 playing, it would remain "paused" for the 6sec mentioned above as it plays
 the audio with no video.  The same thing happens again at 1:07 for 1min 9
 secs.  Seeking through the video makes it seem as if it plays normally, so
 please just let the thing play until it's done (mpc says 2:30, which is
 the true duration of the ''video'', but it's actually the length of the
 "fixed" ''audio'', 3:44). However, when it's demuxed, re-encoded and
 brought back together, the extra silent audio is still there, causing a
 massive sync problem.

 Files included in "Ticket 2210 AC3 Channel Change.7z":
 ORIG_short.ts [the 2.5min clip]
 probeOrigShort.csv [the stdout when running ORIG_short.ts through ffprobe
 -show_frames]
 fix_short_log.txt [the stderr and stdout that I get when running the
 command listed in step 1]
 Bad Audio Fix.png [audacity screenshot showing errors]

 I'll begin upload as soon as I post, so it will take a while for the 7z
 file to appear.

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


More information about the FFmpeg-trac mailing list