AC-3 Re-encoding occuring with .thd+ac3 command in some Disc, while not occuring in some other discs

eac3to forked from madshi eac3to 3.36
Post Reply
DAE avatar
he_he09
Posts: 5
Joined: Thu Jan 18, 2024 2:44 pm

AC-3 Re-encoding occuring with .thd+ac3 command in some Disc, while not occuring in some other discs

Post by he_he09 »

Both eac3to 3.52 & 3.34 appears to re-encoding AC-3 from the Atmos/TrueHD track of Elemental UHD BD with file_name.thd+ac3 command.

v3.34

Code: Select all

eac3to v3.34
command line: eac3to  E:\Disc\Elemental.2023.2160p.UHD.Blu-ray.HDR.HEVC.TrueHD.Atmos.7.1-COYS 1) 3:English-3.34.thd+ac3
------------------------------------------------------------------------------
M2TS, 1 video track, 7 audio tracks, 3 subtitle tracks, 1:41:29, 11.988p
1: Chapters, 27 chapters
2: h265/HEVC, 2160p24 /1.001 (16:9), 10 bits
3: TrueHD/AC3 (Atmos), English, 7.1 channels, 48kHz, dialnorm: -27dB
   (embedded: AC3, 5.1 channels, 640kbps, 48kHz, dialnorm: -27dB)
4: E-AC3, English, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
   (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
5: AC3, English, 5.1 channels, 640kbps, 48kHz, dialnorm: -27dB
6: AC3, English, 2.0 channels, 320kbps, 48kHz, dialnorm: -27dB
7: AC3, English, 2.0 channels, 320kbps, 48kHz, dialnorm: -27dB
8: E-AC3, French, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
   (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
9: E-AC3, Spanish, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
   (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
10: Subtitle (PGS), English
11: Subtitle (PGS), French
12: Subtitle (PGS), Spanish
[a03] AC3 encoding doesn't support back channels. Will mix them into the surround.
[a03] Extracting audio track number 3...
[a03] Extracting TrueHD stream...
[a03] Removing TrueHD dialog normalization...
[a03] Decoding with libav/ffmpeg...
[a03] Extracting audio track number 3...
[a03] Mixing surround channels...
[a03] Remapping channels...
[a03] Encoding AC3 <640kbps> with libAften...
[a03] Extracting TrueHD stream...
[a03] Removing TrueHD dialog normalization...
[a03] Creating file "English-3.34.thd+ac3"...
[a03] Skipping identical AC3 frames (seamless branching)...
[a03] Skipping identical AC3 frames (seamless branching)...
[a03] Audio has a gap of 42ms at playtime 0:00:59.  <WARNING>
[a03] Audio has a gap of 43ms at playtime 0:01:31.  <WARNING>
[a03] Audio has a gap of 44ms at playtime 0:02:27.  <WARNING>
[a03] Audio has a gap of 73ms at playtime 0:03:11.  <WARNING>
[a03] Audio has a gap of 66ms at playtime 0:03:55.  <WARNING>
[a03] Audio has a gap of 69ms at playtime 0:04:21.  <WARNING>
[a03] Audio has a gap of 42ms at playtime 0:04:49.  <WARNING>
[a03] Audio has a gap of 54ms at playtime 0:05:03.  <WARNING>
[a03] Audio has a gap of 42ms at playtime 0:05:26.  <WARNING>
[a03] Audio has a gap of 65ms at playtime 0:06:07.  <WARNING>
[a03] Audio has a gap of 50ms at playtime 0:06:52.  <WARNING>
[a03] Audio has a gap of 43ms at playtime 0:07:13.  <WARNING>
[a03] Audio has a gap of 63ms at playtime 0:08:09.  <WARNING>
[a03] Audio has a gap of 60ms at playtime 0:08:22.  <WARNING>
[a03] Audio has a gap of 50ms at playtime 0:08:37.  <WARNING>
[a03] Audio has a gap of 56ms at playtime 0:08:56.  <WARNING>
[a03] Audio has a gap of 53ms at playtime 0:09:35.  <WARNING>
[a03] Audio has a gap of 57ms at playtime 0:09:50.  <WARNING>
[a03] Audio has a gap of 54ms at playtime 0:10:16.  <WARNING>
[a03] Audio has a gap of 58ms at playtime 0:10:30.  <WARNING>
[a03] Audio has a gap of 51ms at playtime 0:11:15.  <WARNING>
[a03] Audio has a gap of 64ms at playtime 0:11:43.  <WARNING>
[a03] Audio has a gap of 54ms at playtime 0:12:19.  <WARNING>
[a03] Audio has a gap of 53ms at playtime 0:13:06.  <WARNING>
[a03] Audio has a gap of 63ms at playtime 0:14:13.  <WARNING>
[a03] Audio has a gap of 52ms at playtime 0:18:20.  <WARNING>
[a03] Audio has a gap of 51ms at playtime 0:19:56.  <WARNING>
[a03] Audio has a gap of 59ms at playtime 0:20:10.  <WARNING>
[a03] Audio has a gap of 50ms at playtime 0:20:29.  <WARNING>
[a03] Audio has a gap of 61ms at playtime 0:23:13.  <WARNING>
[a03] Audio has a gap of 46ms at playtime 0:25:00.  <WARNING>
[a03] Audio has a gap of 46ms at playtime 0:26:25.  <WARNING>
[a03] Audio has a gap of 49ms at playtime 0:26:45.  <WARNING>
[a03] Audio has a gap of 62ms at playtime 0:28:17.  <WARNING>
[a03] Audio has a gap of 71ms at playtime 0:28:36.  <WARNING>
[a03] Audio has a gap of 54ms at playtime 0:29:10.  <WARNING>
[a03] Audio has a gap of 64ms at playtime 0:29:29.  <WARNING>
[a03] Audio has a gap of 57ms at playtime 0:31:28.  <WARNING>
[a03] Audio has a gap of 66ms at playtime 0:31:54.  <WARNING>
[a03] Audio has a gap of 49ms at playtime 0:32:08.  <WARNING>
[a03] Audio has a gap of 66ms at playtime 0:34:38.  <WARNING>
[a03] Audio has a gap of 53ms at playtime 0:35:10.  <WARNING>
[a03] Audio has a gap of 72ms at playtime 0:39:10.  <WARNING>
[a03] Audio has a gap of 52ms at playtime 0:39:26.  <WARNING>
[a03] Audio has a gap of 72ms at playtime 0:42:35.  <WARNING>
[a03] Audio has a gap of 58ms at playtime 0:42:59.  <WARNING>
[a03] Audio has a gap of 62ms at playtime 0:43:50.  <WARNING>
[a03] Audio has a gap of 72ms at playtime 0:45:23.  <WARNING>
[a03] Audio has a gap of 48ms at playtime 0:45:39.  <WARNING>
[a03] Audio has a gap of 64ms at playtime 0:47:09.  <WARNING>
[a03] Audio has a gap of 62ms at playtime 0:50:26.  <WARNING>
[a03] Audio has a gap of 65ms at playtime 0:50:42.  <WARNING>
[a03] Audio has a gap of 72ms at playtime 0:50:57.  <WARNING>
[a03] Audio has a gap of 62ms at playtime 0:51:24.  <WARNING>
[a03] Audio has a gap of 60ms at playtime 0:54:37.  <WARNING>
[a03] Audio has a gap of 43ms at playtime 0:54:51.  <WARNING>
[a03] Audio has a gap of 55ms at playtime 0:58:01.  <WARNING>
[a03] Audio has a gap of 59ms at playtime 0:58:14.  <WARNING>
[a03] Audio has a gap of 68ms at playtime 1:00:58.  <WARNING>
[a03] Audio has a gap of 51ms at playtime 1:01:11.  <WARNING>
[a03] Audio has a gap of 67ms at playtime 1:04:32.  <WARNING>
[a03] Audio has a gap of 68ms at playtime 1:05:12.  <WARNING>
[a03] Audio has a gap of 58ms at playtime 1:05:50.  <WARNING>
[a03] Audio has a gap of 50ms at playtime 1:06:13.  <WARNING>
[a03] Audio has a gap of 71ms at playtime 1:07:52.  <WARNING>
[a03] Audio has a gap of 45ms at playtime 1:08:06.  <WARNING>
[a03] Audio has a gap of 52ms at playtime 1:09:25.  <WARNING>
[a03] Audio has a gap of 59ms at playtime 1:09:39.  <WARNING>
[a03] Audio has a gap of 66ms at playtime 1:12:22.  <WARNING>
[a03] Audio has a gap of 53ms at playtime 1:12:35.  <WARNING>
[a03] Audio has a gap of 47ms at playtime 1:13:52.  <WARNING>
[a03] Audio has a gap of 62ms at playtime 1:14:05.  <WARNING>
[a03] Audio has a gap of 47ms at playtime 1:14:41.  <WARNING>
[a03] Audio has a gap of 62ms at playtime 1:14:58.  <WARNING>
[a03] Audio has a gap of 54ms at playtime 1:15:16.  <WARNING>
[a03] Audio has a gap of 67ms at playtime 1:15:38.  <WARNING>
[a03] Audio has a gap of 67ms at playtime 1:19:29.  <WARNING>
[a03] Audio has a gap of 60ms at playtime 1:20:07.  <WARNING>
[a03] Audio has a gap of 71ms at playtime 1:20:32.  <WARNING>
[a03] Audio has a gap of 42ms at playtime 1:21:04.  <WARNING>
[a03] Audio has a gap of 47ms at playtime 1:21:39.  <WARNING>
[a03] Audio has a gap of 58ms at playtime 1:21:52.  <WARNING>
[a03] Audio has a gap of 72ms at playtime 1:28:33.  <WARNING>
[a03] Audio has a gap of 66ms at playtime 1:29:35.  <WARNING>
[a03] Audio has a gap of 71ms at playtime 1:31:44.  <WARNING>
[a03] Audio has a gap of 45ms at playtime 1:33:57.  <WARNING>
[a03] Audio has a gap of 71ms at playtime 1:34:13.  <WARNING>
[a03] Audio has a gap of 66ms at playtime 1:34:42.  <WARNING>
[a03] Audio has a gap of 62ms at playtime 1:40:30.  <WARNING>
[a03] The audio gaps/overlaps can't be removed from the TrueHD bitstream.  <WARNING>
[a03] In order to remove them you'll have to transcode to another format.  <WARNING>
[a03] Original audio track, L: max 23 bits, average 16 bits.
[a03] Original audio track, R+C+BL+BR+SL+SR: max 24 bits, average 19 bits.
[a03] Original audio track, LFE: constant bit depth of 16 bits.
[a03] Processed audio track, L: max 23 bits, average 16 bits.
[a03] Processed audio track, R+C+SL+SR: max 24 bits, average 20 bits.
[a03] Processed audio track, LFE: constant bit depth of 16 bits.
Video track 2 contains 145943 frames.
eac3to processing took 10 minutes, 7 seconds.
Done.
v3.52

Code: Select all

eac3to v3.52
command line: eac3to  E:\Disc\Elemental.2023.2160p.UHD.Blu-ray.HDR.HEVC.TrueHD.Atmos.7.1-COYS 1) 3:English-3.52.thd+ac3 -log=Eanglish-3.52.txt"
------------------------------------------------------------------------------
Running in normal mode
Removing dialnorm
M2TS, 1 video track, 7 audio tracks, 3 subtitle tracks, 1:41:29
1: Chapters, 28 chapters
2: h265/HEVC, 2160p24/1.001 (16:9), 10 bits
3: TrueHD/AC3 (Atmos), English, 7.1 channels, 48kHz, dialnorm: -27dB
   (embedded: AC3, 5.1 channels, 640kbps, 48kHz, dialnorm: -27dB)
4: E-AC3, English, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
   (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
5: AC3, English, 5.1 channels, 640kbps, 48kHz, dialnorm: -27dB
6: AC3, English, 2.0 channels, 320kbps, 48kHz, dialnorm: -27dB
7: AC3, English, 2.0 channels, 320kbps, 48kHz, dialnorm: -27dB
8: E-AC3, French, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
   (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
9: E-AC3, Spanish, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
   (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
10: Subtitle (PGS), English
11: Subtitle (PGS), French
12: Subtitle (PGS), Spanish
[a03] AC3 encoding doesn't support back channels. Will mix them into the surround.
[a03] Extracting audio track number 3...
[a03] Extracting audio track number 3...
[a03] Extracting TrueHD stream...
[a03] Extracting TrueHD stream...
[a03] Removing TrueHD dialog normalization...
[a03] Decoding with libav/ffmpeg...
[a03] Removing TrueHD dialog normalization...
[a03] Mixing surround channels...
[a03] Remapping channels...
[a03] Encoding AC3 <640kbps> with libAften...
[a03] Creating file "English-3.52.thd+ac3"...
[a03] Skipping identical AC3 frames (seamless branching)...
[a03] Skipping identical AC3 frames (seamless branching)...
[a03] Original audio track, L: max 23 bits, average 16 bits.
[a03] Original audio track, R+C+BL+BR+SL+SR: max 24 bits, average 19 bits.
[a03] Original audio track, LFE: constant bit depth of 16 bits.
[a03] Processed audio track, L: max 23 bits, average 16 bits.
[a03] Processed audio track, R+C+SL+SR: max 24 bits, average 20 bits.
[a03] Processed audio track, LFE: constant bit depth of 16 bits.
Video track 2 contains 145943 frames.
eac3to processing took 9 minutes, 58 seconds.
Done.
Something to note is, This Elementals UHD BD has it's movie split into lot of .m2ts files.

Code: Select all

1) 01928.mpls, 1:41:28
   [705+736+739+740+744+745+748+749+752+753+756+757+760+761+764+765+768+769+963+964+967+968+971+972+975+976+979+980+983+984+987+988+991+992+995+996+999+1000+1003+1004+1007+1008+1011+1012+1015+1016+1019+1020+1023+1024+1027+1028+1031+1032+1035+1036+1039+1040+1043+1044+1047+1048+1051+1052+1055+1056+1059+1060+1063+1064+1067+1068+1071+1072+1075+1076+1079+1080+1083+1084+1087+1088+1091+1092+1095+1096+1100+1101+1104+1105].m2ts
If I try this with a single .m2ts from this Elementals UHD BD with thd+ac3 command, in this case it works fine. No re-encoding occurs.

Both eac3to 3.52 & 3.34 doesn't re-encode AC-3 in some other discs (single .m2ts) with same .thd+ac3 command. Here is an example -

v3.52

Code: Select all

eac3to v3.52
command line: eac3to  E:\Disc\Ant-Man.2015.UHD.BluRay.2160p.HEVC.TrueHD.Atmos.7.1-BeyondHD 1) 3:Antman-3.52.thd+ac3 -log="Antman-3.52.txt"
------------------------------------------------------------------------------
Running in normal mode
Removing dialnorm
M2TS, 1 video track, 8 audio tracks, 15 subtitle tracks, 1:57:06
1: Chapters, 17 chapters
2: h265/HEVC, 2160p24/1.001 (16:9), 10 bits
3: TrueHD/AC3 (Atmos), English, 7.1 channels, 48kHz, dialnorm: -27dB
   (embedded: AC3, 5.1 channels, 640kbps, 48kHz, dialnorm: -27dB)
4: AC3 Surround, English, 2.0 channels, 320kbps, 48kHz, dialnorm: -31dB, -28ms
5: AC3, French, 5.1 channels, 640kbps, 48kHz, dialnorm: -31dB, -28ms
6: E-AC3, French, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
   (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
7: E-AC3, Spanish, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
   (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
8: E-AC3, German, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
   (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
9: E-AC3, Italian, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
   (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
10: E-AC3, Japanese, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
    (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
11: Subtitle (PGS), English
12: Subtitle (PGS), French
13: Subtitle (PGS), French
14: Subtitle (PGS), Spanish
15: Subtitle (PGS), German
16: Subtitle (PGS), Italian
17: Subtitle (PGS), Japanese
18: Subtitle (PGS), Norwegian
19: Subtitle (PGS), Swedish
20: Subtitle (PGS), French
21: Subtitle (PGS), French
22: Subtitle (PGS), Spanish
23: Subtitle (PGS), German
24: Subtitle (PGS), Italian
25: Subtitle (PGS), Japanese
[a03] Extracting audio track number 3...
[a03] Removing AC3 dialog normalization...
[a03] Removing TrueHD dialog normalization...
[a03] Creating file "Antman-3.52.thd+ac3"...
Video track 2 contains 168445 frames.
eac3to processing took 11 minutes, 20 seconds.
Done.
3.34

Code: Select all

eac3to v3.34
command line: eac3to  E:\Disc\Ant-Man.2015.UHD.BluRay.2160p.HEVC.TrueHD.Atmos.7.1-BeyondHD 1) 3:Antman-3.34.thd+ac3
------------------------------------------------------------------------------
M2TS, 1 video track, 8 audio tracks, 15 subtitle tracks, 1:57:06, 11.988p
1: Chapters, 16 chapters
2: h265/HEVC, 2160p24 /1.001 (16:9), 10 bits
3: TrueHD/AC3 (Atmos), English, 7.1 channels, 48kHz, dialnorm: -27dB
   (embedded: AC3, 5.1 channels, 640kbps, 48kHz, dialnorm: -27dB)
4: AC3 Surround, English, 2.0 channels, 320kbps, 48kHz, -28ms
5: AC3, French, 5.1 channels, 640kbps, 48kHz, -28ms
6: E-AC3, French, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
   (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
7: E-AC3, Spanish, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
   (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
8: E-AC3, German, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
   (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
9: E-AC3, Italian, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
   (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
10: E-AC3, Japanese, 7.1 channels, 1024kbps, 48kHz, dialnorm: -27dB
    (core: AC3, 5.1 channels, 576kbps, 48kHz, dialnorm: -27dB)
11: Subtitle (PGS), English
12: Subtitle (PGS), French
13: Subtitle (PGS), French
14: Subtitle (PGS), Spanish
15: Subtitle (PGS), German
16: Subtitle (PGS), Italian
17: Subtitle (PGS), Japanese
18: Subtitle (PGS), Norwegian
19: Subtitle (PGS), Swedish
20: Subtitle (PGS), French
21: Subtitle (PGS), French
22: Subtitle (PGS), Spanish
23: Subtitle (PGS), German
24: Subtitle (PGS), Italian
25: Subtitle (PGS), Japanese
[a03] Extracting audio track number 3...
[a03] Removing AC3 dialog normalization...
[a03] Removing TrueHD dialog normalization...
[a03] Creating file "Antman-3.34.thd+ac3"...
Video track 2 contains 168445 frames.
eac3to processing took 9 minutes, 36 seconds.
Done.
So this re-encoding only occurs when you try this on a joined .m2ts (playlists).

But the problem (Elementals UHD) is fixed in both eac3to if we use commands like these, 3:name.thd 3:name.ac3. But -demux only works in 3.52. Re-ecnoding still occurs in 3.34 with -demux command.

So my question is, is it a bug or it's by design?
User avatar
Curly
Posts: 768
Joined: Sun Mar 15, 2020 11:05 am

AC-3 Re-encoding occuring with .thd+ac3 command in some Disc, while not occuring in some other discs

Post by Curly »

You probably won't like this answer, but because using the thd+ac3 extension is deprecated (help file: "use of the thd+ac3 extension is not recommended. Generate the thd+ac3 file externally using a fully correct procedure."), I have no time, energy, or motivation to change any functionality regarding use of the thd+ac3 extension.

I guess the difference between single and multi-M2TS is that single M2TS has no need for gaps correction.
Curly Howard
Director of EAC3TO Development
Post Reply