Log in

View Full Version : eac3to - audio conversion tool


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 [302] 303 304 305 306 307 308

Legremlins_Keitaro
17th December 2020, 17:02
eac3to "filename.dts" "filename_withcoreonly.dts" -core

Ok so simple to do it in command, so complicated with GUI lol

Thanks ;)

user8235
4th January 2021, 13:07
Maybe a stupid question, but is there a way to force eac3to into silent mode ? I haven't been able to find any commandline option to disable to "buzzer" sound after an error has occurred or the other sound after completion.

I'm using eac3to in a video transcoding tool I'm writing and these sounds are, I won't say annoying.... , but not preferred... ;-)

I spent many weeks trying to find an answer to this exact question. The solution for me was to delete the 2 wav files in your eac3to install directory. Of course, you could probably rename them if you want to keep them around.

tebasuna51
4th January 2021, 18:18
@user8235
Welcome to Doom9's forum.

[EDIT]
The answer was in next post:

I think you can just delete the two wav files that eac3to uses.

(some other off topic posts deleted)

Harrenkyym
7th January 2021, 23:22
I've been looking all over the forum and in the internet. How to use eac3to via powershell? I want to use the qaac codec and using UsEac3to (what I've been using for years) the command line output would be:

"eac3to.exe path" "input mkv path" tracknumber: stdout.wav delayapplied video frame rate frame rate change -progressnumbers -log = "file.mkv_Job_n.log"
| "qaac.exe path" -V n --ignorelength --adts --no-delay -o "fileoutput.mkv_0lang.aac" -
I've underlined every "unit" of info of the code to make ir clearer.

I've tried to do something like:


$convert_eac3to = -join ($moviefile, " ", $numbertrack, ": stdout.wav ", $frameratechange, " -log = 'logfile path' ", $qaac_path, " -V ", $audioquality,
" --ignorelength --adts --no-delay -o ", $audiooutput)

which is an exact copy of the other code but with variables so I can play with them, but, as expected, it doesn't work with: & $eac3to $convert_eac3to ($eac3to is the path where the exe is)

How would be the code? I guess @stax76 knows the answer as he looks almost the only one "fighting" for using Powershell. ^^

Thanks

EDIT

I've tried to understand much better the behavior of the command and I've tried to adapt it to Powershell, but it's not my lucky day.


& $eac3to $moviefile $numbertrack $stdout $timedelay $frameratechange > $qaac_path $audiooutput -v $audioquality --ignorelength --adts --no-delay

$eac3to: eac3to.exe with path
$moviefile: movie.mkv with path
$stdout: stdout.wav with same path as moviefile
$timedelay: i.e. +340ms
$frameratechange: i.e. -24.000 -changeTo23.976
$qaac_path: qaac.exe with path
$audiooutput: i.e. movie.2spa.aac
$audioquality i.e. 99

stax76
8th January 2021, 11:44
Sometimes it's necessary to call cmd from powershell:

1. using built in cmd functionality like mklink (powershell 5 has New-Item for symlinks)
2. certain kind of pipe

I've never researched the reason of the pipe problem, but I know how to call cmd from powershell, have a look at /s /c in the cmd console help:

cmd /?

If this does not work then you might additionally need a stop parsing command:

--%

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-5.1

Some of these ideas are originally from qyot27 btw.

Snowknight26
8th January 2021, 23:41
$eac3toPath = "C:\path\to\eac3to\eac3to.exe"
$input = "D:\"
$chapterTrackNumber = 1
$videoTrackNumber = 2
$audioTrackNumber = 3
$audioFormat = "flac"
& ${eac3toPath} "$input" ${chapterTrackNumber}: "Z:\temp.txt" ${videoTrackNumber}: "Z:\temp.mkv" ${audioTrackNumber}: "Z:\temp.$audioFormat" -log=nul > $null


Adjust as necessary.

tebasuna51
9th January 2021, 00:19
@Snowknight26

That may work for extract, Harrenkyym try to recode to AAC with a pipe ("|" in command line, ">" in powershell syntax) from eac3to.exe to qaac.exe.
And seems that don't work.

stax76
9th January 2021, 16:01
Let's say you got a complex command line that does pipe and also has paths with spaces:

ffmpeg -i "D:\aa aa_temp\aa aa.avs" -f yuv4mpegpipe -strict -1 -loglevel fatal -hide_banner - | x265 --crf 18 --frames 4069 --y4m --output "D:\aa aa_temp\aa aa_out.hevc" -

If this command line is in a variable or for instance in the clipboard, you can run it in powershell like so:

cmd /c (Get-Clipboard)

Snowknight26
10th January 2021, 18:24
@Snowknight26

That may work for extract, Harrenkyym try to recode to AAC with a pipe ("|" in command line, ">" in powershell syntax) from eac3to.exe to qaac.exe.
And seems that don't work.

Piping is the done same way Powershell as it is in cmd. | is pipe, > is redirect. However, since Powershell treats the results of all outputs as objects/strings, new lines get added to the piped data, so you can't do it directly by calling "process1.exe | process2.exe" without adverse effects.

You either have to use C# in Powershell or launch cmd via Powershell which doesn't have the issue.


$eac3toPath = "C:\path\to\eac3to.exe"
$ffmpegPath = "C:\path\to\ffmpeg.exe"
$input = "C:\path\to\input.ext"
$output = "C:\path\to\output.ext"
$trackNumber = 2

& cmd @('/c', $eac3toPath, $input, "${trackNumber}:", 'stdout.wav', '|', $ffmpegPath, '-i', 'pipe:', $output) 2> $null


Adjust as necessary.

tebasuna51
10th January 2021, 21:48
Yes, I see.

BTW execute cmd is the same than create a cmd file and launch it.

stax76
11th January 2021, 00:32
Yes, I see.

BTW execute cmd is the same than create a cmd file and launch it.

Not exactly, cmd and bat by default use a legacy dos code page:

https://de.wikipedia.org/wiki/Codepage_850

On Win 10 it can be changed to UTF-8

Calling cmd with arguments gives full Unicode support.

Bgalakazam
23rd January 2021, 13:46
Is there still no way to combine a TrueHD track with a core track? Instead a thd+core needs to be encoded with libAften every time? Some tracks fail that way.

Certain devices can't play the TrueHD track alone and need the core embedded. Either use a full BluRay rip structure or a MKV rip THD track and have to encode with libAften and then merge into a .TS/.M2TS which preserves the thd+core.

tebasuna51
23rd January 2021, 23:36
Is there still no way to combine a TrueHD track with a core track? Instead a thd+core needs to be encoded with libAften every time?
I don't know other way.

Some tracks fail that way.
I don't know tracks than fail.
If is 7.1 add -down6
If is 96 KHz add -resampleTo48000
If there are a clip add -no2ndpass

dm9656
18th March 2021, 23:12
Hi,

I recently used eac3to for reencoding a 24bit DTS-HD MA stream to 16bit (DTS-HA MA 24bit => eac3to => WAV 16bit => DTS MAS => DTS-HD MA 16bit); however, I noticed this 2017 discussion in a forum about the "eac3to does not manage the DTS-HD codec delay of 1024 samples" : https://forum.fanres.com/thread-1531.html

The solution at the times seemed to be something along the lines of "eac3to input output -21ms"... (to be precise it should be measured in number of samples, not in ms, as the delay is 2 frames = 1024 samples)

So, my question is: the "delay problem" being known for a few years now, is the current release of eac3to able to handle this "codec delay" by itself now ? Or is it still needed to care about managing that delay "by hand" when converting from DTS-HD audio ?

Thanks !

tebasuna51
19th March 2021, 00:57
A standard dts stream doesn't have a global header with the "Codec delay" tag, only the dts's created by the encoder Master Audio Suite have these headers.

Inside a container doesn't exist that header and the authoring soft must cut these frames (at least MkvMerge do so).

Is a encoder (all encoders insert some delay) problem but streams extracted from containers by eac3to doesn't have that delay.

AC3's encoders add 5ms of delay, ffdcaenc add 11ms to dts's, some AAC encoders 26ms ...

Kokka
1st April 2021, 17:54
Hello,

i am getting the error message from eac3to "Unable to convert DTS track to wav"

The two audio files are "DTS XBR" and "DTS XLL X"

Do you have any ideas?

Here is the MediaInfo of the file:

Format : Matroska
Format version : Version 4
File size : 80,0 GiB
Duration : 3 h 20 min
Overall bit rate mode : variabel
Overall bit rate : 57,2 Mb/s
Movie name : King.Kong.2005.EXTENDED.GERMAN.DL.2160p.UHD.BluRay.HEVC-4K
Encoded date : UTC 2018-04-21 11:06:32
Writing application : mkvmerge v22.0.0 ('At The End Of The World') 64-bit
Writing library : libebml v1.3.5 + libmatroska v1.4.8

Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main 10@L5.1@High
HDR format : SMPTE ST 2086, HDR10 compatible
Codec ID : V_MPEGH/ISO/HEVC
Duration : 3 h 20 min
Bit rate : 46,2 Mb/s
Width : 3 840 Pixel
Height : 2 160 Pixel
Display aspect ratio : 16:9
Frame rate mode : konstant
Frame rate : 23,976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0 (Type 2)
Bit depth : 10 bits
Bits/(Pixel*Frame) : 0.232
Stream size : 64,5 GiB (81%)
Writing library : ATEME Titan File 3.7.9 (4.7.9.0)
Default : Ja
Forced : Nein
Color range : Limited
Color primaries : BT.2020
Transfer characteristics : PQ
Matrix coefficients : BT.2020 non-constant
Mastering display color primaries : Display P3
Mastering display luminance : min: 0.0050 cd/m2, max: 1000 cd/m2
Maximum Content Light Level : 1000 cd/m2
Maximum Frame-Average Light Level : 96 cd/m2

Audio #1
ID : 2
Format : DTS XBR
Format/Info : Digital Theater Systems
Commercial name : DTS-HD High Resolution Audio
Codec ID : A_DTS
Duration : 3 h 20 min
Bit rate mode : konstant
Bit rate : 3 456 kb/s
Channel(s) : 8 Kanäle
Channel layout : C L R LFE Lb Rb Lss Rss
Sampling rate : 48,0 kHz
Frame rate : 93,750 FPS (512 SPF)
Bit depth : 24 bits
Compression mode : Lossy
Stream size : 4,83 GiB (6%)
Language : Deutsch
Default : Nein
Forced : Nein

Audio #2
ID : 3
Format : DTS XLL X
Format/Info : Digital Theater Systems
Commercial name : DTS-HD Master Audio
Codec ID : A_DTS
Duration : 3 h 20 min
Bit rate mode : variabel
Bit rate : 7 413 kb/s
Channel(s) : 8 Kanäle
Channel(s)_Original : Object Based
ChannelLayout_Original : Object Based
Sampling rate : 48,0 kHz
Frame rate : 93,750 FPS (512 SPF)
Bit depth : 24 bits
Stream size : 10,4 GiB (13%)
Language : Englisch
Default : Ja
Forced : Nein

Text #1
ID : 4
Format : UTF-8
Codec ID : S_TEXT/UTF8
Codec ID/Info : UTF-8 Plain Text
Duration : 3 h 16 min
Bit rate : 0 b/s
Count of elements : 39
Stream size : 867 Bytes (0%)
Title : Forced SRT
Language : Deutsch
Default : Ja
Forced : Ja

Text #2
ID : 5
Format : PGS
Codec ID : S_HDMV/PGS
Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs
Duration : 3 h 16 min
Bit rate : 443 b/s
Count of elements : 78
Stream size : 639 KiB (0%)
Title : Forced PGS
Language : Deutsch
Default : Nein
Forced : Nein

Text #3
ID : 6
Format : PGS
Codec ID : S_HDMV/PGS
Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs
Duration : 3 h 18 min
Bit rate : 19,0 kb/s
Count of elements : 2594
Stream size : 27,0 MiB (0%)
Language : Deutsch
Default : Nein
Forced : Nein

Text #4
ID : 7
Format : PGS
Codec ID : S_HDMV/PGS
Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs
Duration : 3 h 20 min
Bit rate : 78,4 kb/s
Count of elements : 7166
Stream size : 112 MiB (0%)
Language : Deutsch
Default : Nein
Forced : Nein

Text #5
ID : 8
Format : PGS
Codec ID : S_HDMV/PGS
Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs
Duration : 3 h 9 min
Bit rate : 21,8 kb/s
Count of elements : 3438
Stream size : 29,5 MiB (0%)
Language : Englisch
Default : Nein
Forced : Nein

Text #6
ID : 9
Format : PGS
Codec ID : S_HDMV/PGS
Codec ID/Info : Picture based subtitle format used on BDs/HD-DVDs
Duration : 3 h 19 min
Bit rate : 80,1 kb/s
Count of elements : 7162
Stream size : 114 MiB (0%)
Language : Englisch
Default : Nein
Forced : Nein

Thank you for any help!

Kokka

Richard1485
1st April 2021, 18:05
Use ffmpeg instead.

Devilman1
5th June 2021, 13:11
I was converting an audio stream from AC3 to wav and while doing it, it shows a delay and that a delay would be applied to the raw PCM

MKV, 1 video track, 1 audio track, 0:43:16, 25p
1: h264/AVC, 720x522p (16:9)
2: AC3, 2.0 channels, 320kbps, 44.1kHz, -108ms
"Stereo"
[v01] The video track doesn't contain framerate information. <WARNING>
[a02] Extracting audio track number 2...
[a02] Decoding with libav/ffmpeg...
[a02] Applying RAW/PCM delay...
[a02] Changing FPS from 25.000 to 23.976...
[a02] Reducing depth from 64 to 24 bits...
[a02] Writing WAV...

Would it mean that the output file has the delay (-108 ms) already applied?

Richard1485
5th June 2021, 21:42
Would it mean that the output file has the delay (-108 ms) already applied?

Yes. That's what the text that you highlighted in green means:
[a02] Applying RAW/PCM delay...

There should be no need for you to do anything else unless you experience some sort of problem with the output.

tebasuna51
7th June 2021, 23:19
Because when eac3to was created there was no free aec3 encoder.

Use ffmpeg now.

Richard1485
8th June 2021, 20:07
If it is not possible officially, then is there any way to add it manually?

No, because eac3to is closed source. But you can encode E-AC-3 with ffmpeg, so just use that instead.

asarian
9th June 2021, 13:17
Because when eac3to was created there was no free aec3 encoder.

Use ffmpeg now.

Is there a way to convert "DDP Atmos" to, say, LPCM, though? Currently says 'Bitstream parsing for track 2 failed.'

tebasuna51
9th June 2021, 15:07
Is there a way to convert "DDP Atmos" to, say, LPCM, though? Currently says 'Bitstream parsing for track 2 failed.'

eac3to was created to decode EAC3 from EVO containers but new EAC3 implementations, of course Atmos, can't be decoded.

Please use ffmpeg instead eac3to:

ffmpeg -i "ANY_INPUT" -map 0:TRACK -acodec pcm_s24le "OUTPUT.w64"

ffmpeg support many more containers and codecs for input, and output, than eac3to

asarian
9th June 2021, 15:28
eac3to was created to decode EAC3 from EVO containers but new EAC3 implementations, of course Atmos, can't be decoded.

Please use ffmpeg instead eac3to:

ffmpeg -i "ANY_INPUT" -map 0:TRACK -acodec pcm_s24le "OUTPUT.w64"

ffmpeg support many more containers and codecs for input, and output, than eac3to


Thanks! :thanks:

LigH
19th June 2021, 08:09
Dolby Atmos is a parameter set which depends on the layout of speakers in your room and the room's geometry. Once decoded, it won't match another room's layout.

Tass
20th June 2021, 05:55
Hi.

What is the best way to convert a DTSMA 7.1 to AC3 5.1 640kbps without losing the audio content of the 2 extra back channels of the 7.1 and get them downmixed into the 5.1 so the final AC3 5.1 ends with the 7.1 rears + surround channels mixed?

Will the audio conversion tool do the downmix? I can put -down6 in command line conversion but not in the conversion tool.

Thanks!

tebasuna51
20th June 2021, 10:09
What is the best way...
Forum rule:
12) How NOT to post on this forum:
...
Do not ask "what's best" because this question cannot be answered objectively. Each and everyone has their own view about what's best in a certain area. The best is what works best for you!

I can put -down6 in command line conversion but not in the conversion tool.
What conversion tool?

1) The eac3to -down6 make the mix of surround channels with floats:
SL' = SL + BL
SR' = SR + BR
and check if there are over volume (clip signal) and do a full (all channels) normalize to avoid distort.
Advantage: The balance between front and surround channels are preserved.
Disadvantage: The full volume can be reduced.

2) We can do a special normalize only to the surround channels only when it is needed.
Advantage: The full volume is preserved, only the surround channels are reduced to avoid clip (it is not possible the same volume with 5 speakers than with 7)
Disadvantage: The balance between front and surround channels are preserved most the time, only changed in points needed for avoid distort.

A implementation of this method (https://forum.doom9.org/showthread.php?p=1920191#post1920191) can be:

ffmpeg -i "ANY_INPUT" -map 0:TRACK -FILTER -acodec ac3 -ab 640K "OUTPUT.ac3"

with FILTER, for example:
-filter_complex "asplit [f][s]; [f] pan=3.1|c0=c0|c1=c1|c2=c2|c3=c3 [r]; [s] pan=stereo|c0=0.5*c4+0.5*c6|c1=0.5*c5+0.5*c7, compand=attacks=0:decays=0:points=-90/-84|-8/-2|-6/-1|-0/-0.1, aformat=channel_layouts=stereo [d]; [r][d] amerge [a]" -map "[a]"

Select your choice, I recommend 2).

SeeMoreDigital
20th June 2021, 20:48
What is the best way to convert a DTSMA 7.1 to AC3 5.1 640kbps without losing the audio content of the 2 extra back channels of the 7.1 and get them downmixed into the 5.1 so the final AC3 5.1 ends with the 7.1 rears + surround channels mixed?

Is there any particular reason why you don't want to extract the lossy 5.1 channel DTS (core) stream from the lossless DTS-HD MA stream and play that instead?

asarian
27th June 2021, 23:23
I am having trouble these days getting eac3to to correctly extract audio streams from my UHD multi-part disks. Which is to say, audio gets out of sync. So far this has happened to Wreck-it-Ralph, Ralph breaks the Internet, The Incredibles, Monsters University, etc. What happens is, eac3to will detect the need for, and start second pass (as per usual), and then audio is borked, aka, gets out of sync.

For most UHD movies, I still have my HD counterparts lying around to take their audio stream from, but this is not ideal, and doesn't always fit properly.

All very strange, as I've been doing this for literally years (eac3to 3.34).

Richard1485
28th June 2021, 07:33
Have you tried -no2ndpass?

You could also try DGDemux (http://rationalqm.us/dgdemux/dgdemux.html). It's now free.

asarian
28th June 2021, 09:40
Have you tried -no2ndpass?

You could also try DGDemux (http://rationalqm.us/dgdemux/dgdemux.html). It's now free.


Thx. I'll give these a try. :)

EDIT: -no2ndpass doesn't even get listed as option, but it did solve the issue for me.

Richard1485
28th June 2021, 12:29
EDIT: -no2ndpass doesn't even get listed as option, but it did solve the issue for me.

Great! Yeah, eac3to correctly drops frames in the first pass, but it tends to go wrong in the second pass by dropping frames unnecessarily. These days, I always try -no2ndpass first. For TrueHD, use mlp (https://github.com/domyd/mlp) or CloneBD instead.

asarian
29th June 2021, 23:02
Great! Yeah, eac3to correctly drops frames in the first pass, but it tends to go wrong in the second pass by dropping frames unnecessarily. These days, I always try -no2ndpass first. For TrueHD, use mlp (https://github.com/domyd/mlp) or CloneBD instead.

MLP worked like a charm! It can't remove dialogue normalization yet, sadly. So, I figured I do a second pass on the newly formed .thd stream then, with eac3to, but then, LOL, eac3to starts complaining about gaps again (which I expected to no longer exist again, btw).

Richard1485
30th June 2021, 21:12
So, I figured I do a second pass on the newly formed .thd stream then, with eac3to, but then, LOL, eac3to starts complaining about gaps again (which I expected to no longer exist again, btw).

Given that eac3to has problems with such tracks, I don't know how much credence to attach to that error message. If your track is in sync and plays fine, maybe you can ignore it. My preference with branching discs is to extract the AC-3 track with eac3to (-no2ndpass), so in suggesting mlp/CloneBD, I'm just passing on what's considered best practice.

The only other method known to me to remove dialnorm from TrueHD is to load the MKV or playlist (mpls) into MKVToolNIx, click the audio track, scroll down, and check "Remove dialog normalization gain" under "Audio properties". It works for me. The downside is that the AC-3 "core" will become a separate track, not one that remains interleaved with the TrueHD, which might or might not matter to you when it comes to playback. Perhaps you want to avoid MKV output.

asarian
30th June 2021, 23:07
Given that eac3to has problems with such tracks, I don't know how much credence to attach to that error message. If your track is in sync and plays fine, maybe you can ignore it. My preference with branching discs is to extract the AC-3 track with eac3to (-no2ndpass), so in suggesting mlp/CloneBD, I'm just passing on what's considered best practice.

The only other method known to me to remove dialnorm from TrueHD is to load the MKV or playlist (mpls) into MKVToolNIx, click the audio track, scroll down, and check "Remove dialog normalization gain" under "Audio properties". It works for me. The downside is that the AC-3 "core" will become a separate track, not one that remains interleaved with the TrueHD, which might or might not matter to you when it comes to playback. Perhaps you want to avoid MKV output.


To start with the latter, I love the MKV container. Or rather, Kodi loves it (it has trouble playing individual UHD .m2ts files properly here, sans stuttering, for some reason, but plays MKV very smoothly).

And I want the HD audio stream, of course. :) So, I will start just ignoring the gap warnings given by eac3to for the dialogue normalization removal (sorry, can't test now: inthe middle of huge render job).

Richard1485
1st July 2021, 00:13
And I want the HD audio stream, of course. :)

Of course! :) What I was explaining is that if you use MKVToolNIx to remove the dialnorm from the TrueHD, you will end up with a track without an AC-3 "core" (the interleaved track), in other words, a thd track on its own, rather than thd+ac3 (as found on BD), which the eac3to method allows you to keep. But since you are happy with MKV, you can use either method.

Tass
15th July 2021, 15:05
Is there any particular reason why you don't want to extract the lossy 5.1 channel DTS (core) stream from the lossless DTS-HD MA stream and play that instead?

Yep, thanks to LG, DTS won't be passthru to my AVR from the TV via optical because for a few years LG TVs stoped DTS compatibilty, so I have no option other than modify my setup or convert to AC3, for now, converting to AC3 is the less hassle since modifying my setup would involve geting a new AVR with eARC and laying new cables INSIDE my walls :eek:

SeeMoreDigital
15th July 2021, 18:31
Yep, thanks to LG, DTS won't be passthru to my AVR from the TV via optical because for a few years LG TVs stoped DTS compatibilty,...
Indeed, LG dropped support for onboard DTS decoding and pass-through, from 2020 onwards...

Sakura-chan
24th July 2021, 04:37
Is there any way to ignore the delay when extracting/re-encoding? Currently when eac3to detects a delay it automatically applies it to the extracted files with no way to ignore it. I see no switch to extract/re-encode as is. Like an -ignoredelay switch or something.

tebasuna51
24th July 2021, 10:02
Just add the inverse delay, for instance:
eac3to "test(+300).mkv" 2: "test(+300).mkv_2eng.ac3" -300ms
------------------------------------------------------------------------------
MKV, 1 video track, 1 audio track, 0:00:22, 25p
1: h264/AVC, English, 720p25
2: AC3 Surround, English, 2.0 channels, 448kbps, 48kHz, 300ms
[a02] Extracting audio track number 2...
[a02] Creating file "D:\Temp\t\00_test (+300).mkv_2eng.ac3"....

or

eac3to "test(-80).mkv" 2: "test(-80).mkv_2eng.ac3" +80ms
------------------------------------------------------------------------------
MKV, 1 video track, 1 audio track, 0:00:22, 25p
1: h264/AVC, English, 720p25
2: AC3 Surround, English, 2.0 channels, 448kbps, 48kHz, -80ms
[a02] Extracting audio track number 2...
[a02] Creating file "D:\Temp\t\00_test (2).mkv_2eng.ac3"...

Asmodian
26th July 2021, 00:04
Why would you want to ignore delay? It is a flag telling all players to add/subtract that much audio before playing, so unless it is normally out of sync, what is the use case for ignoring that field? Is it that the flag smaller than Xms of silence and you will reapply it when muxing?

Maybe some other reason I haven't thought of?

Pochka
17th August 2021, 01:05
Hi guys, i'm new here, asking for help, does eac3to supports .mka audio file? I have a audio file for video 25 Framerate .mka, which I need to recode into same as .mka audio file but in 23.976fps and keep all original bit rate and sampling rate and channels. I use command eac3to [input.mka] [output.mka] -24.000 -changeTo23.976 but I get an error. I'm a wrong entering the command line?

tebasuna51
17th August 2021, 08:37
Show the full log to know the audio inside the .mka file.

If is something like:

MKA, 1 audio track...
1: AC3, 5.1 channels, 448kbps, 48kHz

eac3to input.mka 1: output.ac3 -25.000 -changeTo23.976

(25 or 24 input?)

eac3to need the output bitrate and code, if supported.
Here for ac3 the bitrate 448 is the default, not the read in the input file than must be decoded to perform the timestretch.

Pochka
22nd August 2021, 00:53
to tebasuna51 Here is log to know the audio .mka file it's 25fps audio and i need change to 23.976fps what is eac3to command for it?

Audio
ID : 1
Format : E-AC-3
Format/Info : Enhanced AC-3
Commercial name : Dolby Digital Plus
Codec ID : A_EAC3
Duration : 59 min 34 s
Bit rate mode : Constant
Bit rate : 320 kb/s
Channel(s) : 6 channels
Channel layout : L R C LFE Ls Rs
Sampling rate : 48.0 kHz
Frame rate : 31.250 FPS (1536 SPF)
Compression mode : Lossy
Stream size : 136 MiB (100%)

tebasuna51
22nd August 2021, 10:38
Sorry but eac3to only can decode eac3 from EVO container, and can't encode to eac3.
You must use ffmpeg instead, with two options:

1) Like eac3to do, changing the pitch of the audio (maybe recovering the original pitch):

ffmpeg -i "eac3.mka" -af "aresample=50050, asetrate=48000" -acodec eac3 -ab 320k "eac3_r.eac3"

2) Or preserving the pitch of the audio, changing only duration:

ffmpeg -i "eac3.mka" -af "atempo=0.959041" -acodec eac3 -ab 320k "eac3_t.eac3"

Pochka
24th August 2021, 07:02
То tebasuna51 thank you for help and command line, i will try sometime in ffmpeg. I don't understand where can i learn command line for eac3to or ffmpeg? I don't understand what mean is (-af -ab all this numbers 0.959041 and they can be different for other things.

Etroxamin
24th August 2021, 13:46
@Pochka - you should find out if your audio has the correct pitch as it is now, sometimes audio on 25 fps video, have the correct pitch, but it's more likely that it was recorded at 23,976 fps or 24 and has the wrong pitch.

Btw 320 kbps seems quite low bitrate, evtl. you can find a better audio source ...

however changing the pitch after slowing down the audio, usually doesnt sound great, there are expensive programms (and you may find some sort of "trail versions") giving slightly more acceptable results, but as you said:

"I need to recode into same as .mka audio file but in 23.976fps and keep all original bit rate and sampling rate and channels"

with some luck your audio may have the correct pitch, and you could stretch the audio in MKVToolNix instead. At least i know it is possible with ac3 files (I would guess e-ac3 too), i once added the PAL DVD audio of a movie to a bluray video source, the pitch was correct on DVD with 25 fps. I tried the MKVToolNix stretch and the quality was (imo) as good as on DVD (but well that was a movie from the 50s, so the audio quality wasnt the best to judge on this).

The good thing is you dont have to reencode, as lossy to lossy isnt the best thing you can do to audio files. I usually keep 25 fps ac3 audio, stretched with audacity or eac3to to 23,976 as lossless 24 bit, thats quite pointless but actually the only way to not lose more quality.

Etroxamin
24th August 2021, 14:08
То tebasuna51 thank you for help and command line, i will try sometime in ffmpeg. I don't understand where can i learn command line for eac3to or ffmpeg? I don't understand what mean is (-af -ab all this numbers 0.959041 and they can be different for other things.

you should first add a path to cmd, here is a guide for it:

https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/

you find cmd.exe in C:\Windows\System32

all you need to do then is starting cmd.exe and write:

eac3to

eac3to will output a list of commands to use, usually you define your source, like:

eac3to "C:\myfilesfolder\myfile.mka"

and then you can put the command behind, you can also join files like "file1"+"file2"

or even cut or fill audio within a track with -edit command. Best to try out a bit for yourself.

But if you just want to stretch the e-ac3 file, i think you can easily do it with mkvtoolnix gui, but tbh its been some time since i made that, guess you would need to add the number tebasuna51 mentioned (0.959041).

thats the slowdown in percent, to reach 23,976 fps, like 1.000000 is your current 25 fps, 0.959041 would be the tempo in percent to slowdown for your desired 23,976 fps.

tebasuna51
24th August 2021, 23:47
I don't understand where can i learn command line for eac3to or ffmpeg?
If you have problems with command line try my GUI UsEac3to to execute eac3to or ffmpeg. There are some help with eac3to parameters.

I don't understand what mean is (-af -ab all this numbers 0.959041 and they can be different for other things.
ffmpeg have many parameters (-af means Audio Filter, -ab Audio Bitrate).
https://ffmpeg.org/ffmpeg-filters.html
https://ffmpeg.org/ffmpeg-codecs.html

For atempo (https://ffmpeg.org/ffmpeg-filters.html#toc-atempo), for instance, the number is the cocient between the fps desired and the fps original:

(24/1.001)/25 = 0.959041

@Etroxamin
Thanks for your opinions. Only one thing:

I can't recommend the timestretching method used by MkvToolNix, is based in add timestamps to the audio track, and some frames can be ignored with problems inicializing correctly the decoder, and producing cliks.

The best option is always modify the video fps to obtain the same duration than the audio.

Etroxamin
25th August 2021, 22:46
I can't recommend the timestretching method used by MkvToolNix, is based in add timestamps to the audio track, and some frames can be ignored with problems inicializing correctly the decoder, and producing cliks.

The best option is always modify the video fps to obtain the same duration than the audio.

I think MKVToolNix also says it is not recommended :)
(well i know MKVToolNix warned me, not sure if it still does)

But i tried it anyway, imo it will sound better than applying a pitch correction, but it may change from case to case. I think the audio track that i used there was already pitch corrected. So the only other possebility i had, was to stretch with eac3to, then apply ANOTHER pitch corrections and keep a crapier sound lossless 24 bit or encode lossy again.

So that would be:

2x pitch correction + 2 lossy encode
vs
1x pitch correction + 1 lossy encode

i think its not wrong to say that this method can be useful, at least sometimes, but well, in such a case its of course better to compare the results.

Also this method doesn't change the file at all, even if you notice very minor problems later you could still just demux it and it is the file you started with as it was from the source.

Changing the video fps would be a better workaround, but not if you add additional audio tracks that are more or at least of the same importance, and are matching with 23,976 fps.

the MKV stretch is working, even if its not recommended, it could be the best choice in certain situations and as said is completely reverseable, so there is nothing to lose by giving it a try. At least if it fits for a certain situation.