5.1 AC3 to Stereo MP3 Produces Severe Distortion

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
randomreuben
Veteran User
Posts: 468
Joined: Mon Nov 02, 2009 2:18 pm

5.1 AC3 to Stereo MP3 Produces Severe Distortion

Post by randomreuben »

I have a reproducible error in converting 5.1 AC3 to Stereo MP3 where you can hear severe distortion at any point in the movie where the subwoofer might be used. Examples are points with explosions, gun shots, etc. This problem does not exist in the stereo AAC or stereo OGG Vorbis sound conversions and only in the MP3 conversions.

I think the problem is in the downmixing of the 5.1 AC3 to MP3 file format in Handbrake. If the AC3 source does not have any explosions, but simply conversation, this problem does not exist. This problem is exclusively in downmixing 5.1 AC3 sources. The AAC and OGG Vorbis soundtracks were fine when I tested them. This strikes me as odd. Why don't they have the same downmixing schemes?

This is not a problem in VLC because the sound is distorted when using FFMPEG Tryout + Haali Media Splitter. I have tried changing the various sound output modes in VLC but the distortion is still there. I have included the log file below.

Edit: Remove DVD name and replaced with generic dvd folder "dvd".

Code: Select all

### CLI Query:  -i "C:\dvd" -t 1 --angle 1 -c 1-21 -o "C:\mkv\disc_a_mp3.mkv" -f mkv -w 720 --loose-anamorphic  -e x264 -q 20 -a 1 -E lame -6 stereo -R Auto -B 256 -D 0 -x ref=3:bframes=3:subq=9:mixed-refs=1:8x8dct=1:trellis=2:me=umh:analyse=all:b-adapt=2:direct=auto:weightb=1:b-pyramid=1:merange=24:no-fast-pskip=1:no-dct-decimate=1 -v 2

### User Query: False

#########################################

[01:56:36] hb_init: checking cpu count
[01:56:36] hb_init: starting libhb thread
HandBrake svn2907 (2009103101) - MinGW i386 - http://handbrake.fr
2 CPUs detected
Opening C:\dvd...
[01:56:36] hb_scan: path=C:\dvd, title_index=1
[01:56:36] scan: trying to open with libdvdread
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Encrypted DVD support unavailable.
libdvdread: Device (null) inaccessible, CSS authentication not available.
NAME OPEN FAILED
libdvdnav: Unable to find home directorylibdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 1 2 3 4 5 6 7 8
libdvdread: Encrypted DVD support unavailable.
libdvdread: Device (null) inaccessible, CSS authentication not available.
[01:56:36] scan: DVD has 1 title(s)
[01:56:36] scan: scanning title 1
[01:56:36] scan: opening IFO for VTS 1
[01:56:36] pgc_id: 1, pgn: 1: pgc: 0x157ce68
[01:56:36] scan: vts=1, ttn=1, cells=0->21, blocks=0->2622581, 2622582 blocks
[01:56:36] scan: duration is 01:58:56 (7136143 ms)
[01:56:36] scan: checking audio 1
[01:56:36] scan: id=80bd, lang=English (AC3), 3cc=eng ext=0
[01:56:36] scan: title 1 has 21 chapters
[01:56:36] scan: chap 1 c=0->0, b=0->115994 (115995), 300451 ms
[01:56:36] scan: chap 2 c=1->1, b=115995->219673 (103679), 269383 ms
[01:56:36] scan: chap 3 c=2->2, b=219674->346228 (126555), 317430 ms
[01:56:36] scan: chap 4 c=3->3, b=346229->452890 (106662), 300551 ms
[01:56:36] scan: chap 5 c=4->4, b=452891->669196 (216306), 562633 ms
[01:56:36] scan: chap 6 c=5->5, b=669197->838636 (169440), 425327 ms
[01:56:36] scan: chap 7 c=6->6, b=838637->1014702 (176066), 470595 ms
[01:56:36] scan: chap 8 c=7->7, b=1014703->1141305 (126603), 345276 ms
[01:56:36] scan: chap 9 c=8->8, b=1141306->1276709 (135404), 349269 ms
[01:56:36] scan: chap 10 c=9->9, b=1276710->1361586 (84877), 224473 ms
[01:56:36] scan: chap 11 c=10->10, b=1361587->1476418 (114832), 316286 ms
[01:56:36] scan: chap 12 c=11->11, b=1476419->1578401 (101983), 268349 ms
[01:56:36] scan: chap 13 c=12->13, b=1578402->1672910 (94509), 259408 ms
[01:56:36] scan: chap 14 c=14->14, b=1672911->1871304 (198394), 544419 ms
[01:56:36] scan: chap 15 c=15->15, b=1871305->2038023 (166719), 459564 ms
[01:56:36] scan: chap 16 c=16->16, b=2038024->2184724 (146701), 398483 ms
[01:56:36] scan: chap 17 c=17->17, b=2184725->2378834 (194110), 538591 ms
[01:56:36] scan: chap 18 c=18->18, b=2378835->2413116 (34282), 100097 ms
[01:56:36] scan: chap 19 c=19->19, b=2413117->2537488 (124372), 344265 ms
[01:56:36] scan: chap 20 c=20->20, b=2537489->2622576 (85088), 340282 ms
[01:56:36] scan: chap 21 c=21->21, b=2622577->2622581 (5), 1000 ms
[01:56:36] scan: aspect = 0
[01:56:36] scan: decoding previews for title 1
[01:56:36] scan: title angle(s) 1
[01:56:36] scan: audio 0x80bd: AC-3, rate=48000Hz, bitrate=448000 English (AC3) (5.1 ch)
Scanning title 1...
Scanning title 1...
Scanning title 1...
Scanning title 1...
[01:56:37] scan: 10 previews, 720x480, 23.976 fps, autocrop = 58/60/0/0, aspect 16:9, PAR 32:27
[01:56:37] scan: title (0) job->width:720, job->height:304
[01:56:37] libhb: scan thread found 1 valid title(s)
+ title 1:
  + vts 1, ttn 1, cells 0->21 (2622582 blocks)
  + angle(s) 1
  + duration: 01:58:56
  + size: 720x480, pixel aspect: 32/27, display aspect: 1.78, 23.976 fps
  + autocrop: 58/60/0/0
  + chapters:
    + 1: cells 0->0, 115995 blocks, duration 00:05:00
    + 2: cells 1->1, 103679 blocks, duration 00:04:29
    + 3: cells 2->2, 126555 blocks, duration 00:05:17
    + 4: cells 3->3, 106662 blocks, duration 00:05:01
    + 5: cells 4->4, 216306 blocks, duration 00:09:23
    + 6: cells 5->5, 169440 blocks, duration 00:07:05
    + 7: cells 6->6, 176066 blocks, duration 00:07:51
    + 8: cells 7->7, 126603 blocks, duration 00:05:45
    + 9: cells 8->8, 135404 blocks, duration 00:05:49
    + 10: cells 9->9, 84877 blocks, duration 00:03:44
    + 11: cells 10->10, 114832 blocks, duration 00:05:16
    + 12: cells 11->11, 101983 blocks, duration 00:04:28
    + 13: cells 12->13, 94509 blocks, duration 00:04:19
    + 14: cells 14->14, 198394 blocks, duration 00:09:04
    + 15: cells 15->15, 166719 blocks, duration 00:07:40
    + 16: cells 16->16, 146701 blocks, duration 00:06:38
    + 17: cells 17->17, 194110 blocks, duration 00:08:59
    + 18: cells 18->18, 34282 blocks, duration 00:01:40
    + 19: cells 19->19, 124372 blocks, duration 00:05:44
    + 20: cells 20->20, 85088 blocks, duration 00:05:40
    + 21: cells 21->21, 5 blocks, duration 00:00:01
  + audio tracks:
    + 1, English (AC3) (5.1 ch) (iso639-2: eng), 48000Hz, 448000bps
  + subtitle tracks:
Invalid sample rate 0, using input rate 48000
[01:56:37] 1 job(s) to process
[01:56:37] starting job
[01:56:37] job configuration:
[01:56:37]  * source
[01:56:37]    + C:\dvd
[01:56:37]    + title 1, chapter(s) 1 to 21
[01:56:37]  * destination
[01:56:37]    + C:\mkv\disc_a_mp3.mkv
[01:56:37]    + container: Matroska (.mkv)
[01:56:37]  * video track
[01:56:37]    + decoder: mpeg2
[01:56:37]      + bitrate 9800 kbps
[01:56:37]    + frame rate: same as source (around 23.976 fps)
[01:56:37]    + loose anamorphic
[01:56:37]      + modulus: 0
[01:56:37]      + storage dimensions: 720 * 480 -> 720 * 368, crop 58/60/0/0
[01:56:37]      + pixel aspect ratio: 289 / 240
[01:56:37]      + display dimensions: 867 * 368
[01:56:37]    + encoder: x264
[01:56:37]      + options: ref=3:bframes=3:subq=9:mixed-refs=1:8x8dct=1:trellis=2:me=umh:analyse=all:b-adapt=2:direct=auto:weightb=1:b-pyramid=1:merange=24:no-fast-pskip=1:no-dct-decimate=1
[01:56:37]      + quality: 20.00 (RF)
[01:56:37]  * audio track 0
[01:56:37]    + decoder: English (AC3) (5.1 ch) (track 1, id 80bd)
[01:56:37]      + bitrate: 448 kbps, samplerate: 48000 Hz
[01:56:37]    + mixdown: Stereo
[01:56:37]    + encoder: lame
[01:56:37]      + bitrate: 256 kbps, samplerate: 48000 Hz
libdvdnav: Using dvdnav version 4.1.3
libdvdread: Encrypted DVD support unavailable.
libdvdread: Device (null) inaccessible, CSS authentication not available.
NAME OPEN FAILED
libdvdnav: Unable to find home directorylibdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 1 2 3 4 5 6 7 8
libdvdread: Encrypted DVD support unavailable.
[01:56:37] encx264: keyint-min: 24, keyint-max: 240
libdvdread: Device (null) inaccessible, CSS authentication not available.
[01:56:37] encx264: encoding with stored aspect 289/240
[01:56:37] encx264: Encoding at constant RF 20.000000
x264 [warning]: b-pyramid + mb-tree is not supported
x264 [info]: using SAR=289/240
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
[01:56:37] reader: first SCR 146 id 224 DTS 22254
x264 [info]: profile High, level 3.0
No accelerated IMDCT transform found
[01:56:37] enclame: opening libmp3lame
[01:56:37] mpeg2: "" (1) at frame 0 time 3003
[01:56:37] sync: expecting 171120 video frames
[01:56:37] sync: first pts is 3003
[02:04:52] mpeg2: "" (2) at frame 7222 time 27112585
[02:12:45] mpeg2: "" (3) at frame 13689 time 51387336
[02:21:29] mpeg2: "" (4) at frame 21317 time 80020941
[02:30:04] mpeg2: "" (5) at frame 28542 time 107142535
[02:49:27] mpeg2: "" (6) at frame 42033 time 157783626
[03:01:38] mpeg2: "" (7) at frame 52233 time 196071876
[03:12:57] mpeg2: "" (8) at frame 63519 time 238435197
[03:20:25] mpeg2: "" (9) at frame 71807 time 269546277
[03:29:35] mpeg2: "" (10) at frame 80183 time 300987687
[03:35:16] mpeg2: "" (11) at frame 85568 time 321202381
[03:42:52] mpeg2: "" (12) at frame 93159 time 349696347
[03:51:26] mpeg2: "" (13) at frame 99604 time 373890016
[03:59:01] mpeg2: "" (14) at frame 105831 time 397263867
[04:14:40] mpeg2: "" (15) at frame 118887 time 446272827
[04:28:34] mpeg2: "" (16) at frame 129916 time 487672185
[04:39:20] mpeg2: "" (17) at frame 139480 time 523573050
[04:53:20] mpeg2: "" (18) at frame 152404 time 572086515
[04:56:00] mpeg2: "" (19) at frame 154820 time 581155575
[05:06:05] mpeg2: "" (20) at frame 163076 time 612146535
[05:11:33] 7135.294833s: Film -> Video
[05:11:38] reader: done. 2 scr changes
[05:11:41] mpeg2: "" (21) at frame 171296 time 642837195
[05:11:41] 7142.635500s: Video -> Film
[05:11:41] sync: got 171296 frames, 171120 expected
[05:11:41] work: average encoding speed for job is 14.634109 fps
[05:11:42] mux: track 0, 171296 frames, 773905933 bytes, 866.80 kbps, fifo 64
[05:11:42] mux: track 1, 297609 frames, 228565248 bytes, 256.00 kbps, fifo 512
[05:11:42] mpeg2 done: 171297 frames
[05:11:42] render: lost time: 0 (0 frames)
[05:11:42] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: frame I:2093  Avg QP:16.55  size: 31060  PSNR Mean Y:47.56 U:50.67 V:51.38 Avg:48.26 Global:47.87
x264 [info]: frame P:62360 Avg QP:20.22  size:  8260  PSNR Mean Y:44.66 U:49.93 V:50.58 Avg:45.54 Global:44.95
x264 [info]: frame B:106843 Avg QP:23.89  size:  1815  PSNR Mean Y:43.66 U:50.01 V:50.75 Avg:44.62 Global:44.08
x264 [info]: consecutive B-frames:  2.9% 19.6% 57.6% 19.9%
x264 [info]: mb I  I16..4:  7.9% 78.4% 13.6%
x264 [info]: mb P  I16..4:  1.1%  5.3%  0.6%  P16..4: 53.4% 14.9% 16.3%  0.5%  0.3%    skip: 7.6%
x264 [info]: mb B  I16..4:  0.0%  0.5%  0.1%  B16..8: 43.1%  1.3%  1.6%  direct: 2.7%  skip:50.8%  L0:38.5% L1:53.0% BI: 8.5%
x264 [info]: 8x8 transform intra:76.8% inter:67.4%
x264 [info]: direct mvs  spatial:99.3% temporal:0.7%
x264 [info]: coded y,uvDC,uvAC intra: 79.6% 71.4% 46.2% inter: 19.2% 19.8% 9.1%
x264 [info]: i16 v,h,dc,p: 31% 16% 13% 39%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11%  8%  5% 10% 14% 14% 13% 13% 12%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10%  5%  3% 12% 17% 16% 13% 12% 12%
x264 [info]: ref P L0: 73.8% 15.5% 10.7%
x264 [info]: ref B L0: 85.8% 14.2%
x264 [info]: SSIM Mean Y:0.9805630
x264 [info]: PSNR Mean Y:44.073 U:49.989 V:50.695 Avg:44.999 Global:44.412 kb/s:866.68
[05:11:42] libhb: work result = 0

Rip done!
HandBrake has exited.
Last edited by TedJ on Fri Nov 06, 2009 5:40 pm, edited 1 time in total.
Reason: Activity logs should be enclosed in [code] blocks.
Post Reply