View Full Version : eac3to DTS to AC3 produces crackling
LonelyPixel
2nd June 2015, 19:56
When I convert DTS HD Master Audio tracks (5.1 and 7.1) to AC3 (640 kbit/s), I get noticeable crackling in the audio when I play it on my Logitech 5.1 system with bitstreaming (AC3 pass-through).
Playing it on my PC stereo speakers is fine. Converting TrueHD/AC3 to AC3 is also fine on any speakers. Playing the DTS Core stream on the Logitech 5.1 system is also fine, but makes the resulting video almost twice the size!
It seems that eac3to 3.29 just can't read DTS correctly. Does anybody have the same problem?
Sparktank
2nd June 2015, 20:27
I've never had that problem.
I don't have any Logitech speakers.
What are you using to decode the DTSHDMA stream?
Arcsoft, what version? (if v1.1.0.0 what date)
DCAdec?
I'm not sure what media player you're using, but DTS core shouldn't affect video.
By "twice the size" do you mean the duration? Resolution? file size??
I suspect duration.
With updated software day, I never have that issue playing back on PC.
LonelyPixel
2nd June 2015, 20:35
I have no idea what eac3to uses to decode the DTS data. Does it find any third-party software on my computer? I just used it. Now I've called it again and paid more attention to what it said: "Decoding with libDcaDec DTS Decoder..." Is that what you mean?
Played the video with DVBViewer and MPC-HC (LAV Audio decoder), but the audio is not decoded on the PC but streamed to the speakers. TOSLINK doesn't allow anything else. That does crackle. Software decoding is fine, but stereo only because that's all I can connect. I don't have an HDMI audio decoder.
The dimensions of the video are okay, pixel count and duration is all correct. It's the file size in bytes that's doubled. The video is 5 GB, the two AC3 audio tracks are 1.6 GB (total), and the two DTS Core audio tracks are 10.5 GB! That's huge.
Sparktank
2nd June 2015, 21:01
Yes. libdcadec is what I meant.
But since you aren't sure how eac3to works, then I assume it's just a vanilla "install" (since it's portable) which would just use DCAdec to decode DTS streams. Which is just as good as Arcsoft decoder (better if you don't want to hunt down all dependancies for Arcsoft to work).
"two" of everything? not really sure what's going on.
Are you keeping original tracks and encoded tracks?
Can you post a sample of the problematic DTS?
if you want trim the first 56 MB
eac3to original.dthd trim.dts -56mb
Try to use an external hosting site, not upload sample to Doom9 and await approval (there's also size limits when uploading to forum as a host).
MediaFire, SendSpace, etc have no waiting time for others to download.
LonelyPixel
2nd June 2015, 21:13
Two tracks of many. There are multiple languages in some video streams, you know? But I only want some of them. That's the two. I don't care about the others so I didn't select them. Here's the beginning of one of the tracks.
Here's the DTS file: (15 MB)
http://expirebox.com/download/5629038cc4bb60f0f5716075b47d164d.html
Here's the AC3 file with crackle: (4 MB)
http://expirebox.com/download/15ccf9953db02c0ae9eaa59f956b0524.html
Available for 48 hours, they say. (It's the first free upload service I could find. I don't normally use those.)
Sparktank
2nd June 2015, 22:02
The Hobbit 1: An Unexpected Journey.
So assuming you're keeping English & German tracks only.
The movie is well over 2 hours, just over 3 if it's the Extended Edition.
the two DTS Cores are naturally going to be huge.
Is it just the German track that's "crackling" ?
Is it more like "clipping" where there's distortoin and audio destruction in loud action seqeuences?
Now that I know the movie, the beginning won't be much help since it's just soft music in the beginning.
There won't be any observable clipping in those samples.
Not sure how to cut at specific times where there's loud action seqeunce (Goblin Town).
I usually just remux manually in MKVtoolnix with its own trim.
It might be just poor mastering on the studio's part.
Tron: Legacy had observable clipping.
Do both language tracks react like that?
Do other movies converted from DTS to AC3?
If it's just that movie, then it's safer to say that it's the movie mastering.
Although, I've not really observed any severe clipping throughout the film. I may have but would have to look into it again.
LonelyPixel
2nd June 2015, 22:08
I've also noticed it in another movie that has DTS HD sound, but not in one with TrueHD/AC3 sound. Also it does not happen with original DTS playback, so the disc data should be fine. The error only comes after converting from DTS to AC3. It affects the English track as well, to the same extent.
The sample I uploaded does show the behaviour I described. The crackling seems to occur only when there is some audio level, not in silence. Didn't come to listening to loud scenes, I stopped and tried to fix it after that poor beginning.
Sparktank
2nd June 2015, 22:21
Interesting.
I didn't mean the disc itself. Mastering errors that produce clipping aren't per-disc basis.
Forget about that for now.
I've listened to your samples and converted the dtshdma myself and listened to all of them and there was nothing like crackling.
For all encodes, I used -dcadec to use the libDCAdec library.
I don't use toslink. I use 3 pairs of analogue RCA jacks to my old Kenwood 5.1.
MPC-HC (no internal filters --> LAV Filters (tMod) --> FFDShow --> Kenwood).
There's no observable crackling for me.
There only thing I can think of, and it's not to do with eac3to:
(I have no idea how newer receivers/sound systems handle Cinavia but) the first Hobbit film is Cinavia-protected.
That could be a factor, same as the other movie.
But, AFIK, Cinavia doesn't produce poor quality audio that crackles. It either silences it or intermittently stops it for short periods.
it could be Cinavia related or it could be the Logitech system or it could be the toslink cable (but it only happens with DTStoAC3 encodes; probably Cinavia content; which would also be a caveat on the Logitech system).
LonelyPixel
2nd June 2015, 22:30
I meant the source data from the disc in general, not my particular disc.
The other movie with such issues is Wüstenblume (Desert Flower). Not in silence, but also right at the beginning. Need to test some more.
Using analogue cables is not such a great idea when they're 20 metres long... But my TV playback software setup has fallen apart anyway and Intel Core i GPU can't handle two active HDMI outputs well (image gets a little jumpy), the older AMD card was better. I'm thinking about getting a dedicated small PC to put right to the TV, and then I could just use the analogue connection to the speakers. It's a Logitech z906 and it's THX-certified. But maybe it doesn't understand the AC3 encoded from eac3to. I never had such issues with it until today.
Sparktank
2nd June 2015, 22:57
Doing a quick search on your Logitech model, others have severe crackling issues.
Some with AC3 tracks but they don't provide enough details to prove anything.
But, at a quick glance, it seems to be a common Logitech issue.
https://forums.logitech.com/t5/forums/searchpage/tab/message?q=Crackling+z906+&nospellcheck=true&filter=labels
Some dating as far back as 2012.
Maybe it's time for a new sound system. A dedicated PC would also be nice and more convient.
tebasuna51
2nd June 2015, 23:23
Here's the AC3 file with crackle: (4 MB)
http://expirebox.com/download/15ccf9953db02c0ae9eaa59f956b0524.html
Sounds fine for me with my Yamaha receiver, I think is a Logitech 5.1 speaker problem like Sparktank say.
LonelyPixel
3rd June 2015, 08:00
Cross-reference: http://forums.logitech.com/t5/Speakers/Z906-AC3-DD5-1-crackling-noise/m-p/1196035/highlight/false#M34369
SquallMX
3rd June 2015, 08:20
Hi, test the five files inside this RAR:
https://mega.nz/#!h5RHjCRT!l3sA81GbokFgF-3u4dAxLx1bn1ZUXs8k8rOK5Kn6O6Q
Tell me which ones are affected.
Ghitulescu
3rd June 2015, 15:05
Cracks and stuff are documented for DTS and its HD siblings.
Some ICs (decoding chips inside real players) are more affected than the others. Onkyo is one of the most affected (of the big names).
It may be that the software decoding has the same issue (Onkyo is also certified).
LonelyPixel
3rd June 2015, 16:40
From the archive, "c" and "d" are okay, the others have equally intensive crackling. How did you make them?
LonelyPixel
3rd June 2015, 17:04
I have made one more test:
Converting from DTS-HD to AC3 caused crackling. Extracting DTS is fine.
Extracting AC3 from TrueHD is also fine. Now I completed the test with converting from TrueHD to lower-bitrate AC3 (to force eac3to to actually make a new AC3 file). That is also fine. So I guess the AC3 encoder in eac3to is not the problem, but the DTS-HD decoder.
Were your samples c and d made with another DTS-HD decoder? What options do I have here?
tebasuna51
3rd June 2015, 20:17
So I guess the AC3 encoder in eac3to is not the problem, but the DTS-HD decoder.
- Tested your sample with Dcadec and Arcsoft and the decoded outputs are bit-identical. Without "crackling", max peak at -6.74dB in center channel, normal wave forms.
- Tested the SquallMX samples in my Yamaha, all ok without differences, only less quality in the "d" (448 Kb/s).
"c" and "d" samples have 'RF atenuattion' then seems was made with a commercial encoder (not by free Aften or ffmpeg)
SquallMX
3rd June 2015, 21:55
I have made one more test:
Converting from DTS-HD to AC3 caused crackling. Extracting DTS is fine.
Extracting AC3 from TrueHD is also fine. Now I completed the test with converting from TrueHD to lower-bitrate AC3 (to force eac3to to actually make a new AC3 file). That is also fine. So I guess the AC3 encoder in eac3to is not the problem, but the DTS-HD decoder.
Were your samples c and d made with another DTS-HD decoder? What options do I have here?
Nop, the problem seems to be the outdated ac3 encoder used by eac3to, an old build (circa 2008) of aften.
A sample was made with libdcadec (default dts hd decoder) and aften at 640 kbps
B sample was made with Sonic (an alternative DTS HD decoder) and aften at 640 Kbps
C sample was made with lidbcadec, outputting to wave, and then endoded by a professional Dolby Encoder at 640 kbps.
D sample was made as C but using a lower (DVD compatible) bitrate of 448 Kbps
E sample was your own sample :D.
Is not the first time that people has reported problems with it, even the author recommended using other encoders, is lower quality than any official pro Dolby encoder, and has playback bugs on decoders that implement a very strict compliance with Dolby decoder guidelines, for example the volume is very low when decoded on PowerDVD vs the original file or a encode made with a official encoder.
I hear that the FFMPEG encoder is much better, I will upload a sample at night so you can test it.
Maybe is time for eac3to to implement a better and updated ac3 encoder:o.
tebasuna51
4th June 2015, 00:56
Here is your sample encoded with ffmpeg: https://www.sendspace.com/file/48ttky
LonelyPixel
4th June 2015, 01:24
Can I plug a better AC3 encoder into eac3to? Or where can I get another encoder at all? (I'll test your sample later, it's 2 am here right now... I just woke due to the heat...)
LonelyPixel
4th June 2015, 07:58
I'm just wondering why eac3to can encode to AC3 from AC3 and it works, where it doesn't if the source is DTS (HD).
Sample F is also fine.
How can I use ffmpeg to encode the AC3? I've found (http://en.wikibooks.org/wiki/Eac3to/How_to_Use) the following command:
"Convert a DTS track to a AC3 one, using libav encoder:
eac3to.exe input.dts output.ac3 -libav"
But it doesn't work, it's still using libAften to encode, just libav/ffmpeg to decode which doesn't help. I couldn't find any sources about how to convert dts to ac3 using ffmpeg.
nevcairiel
4th June 2015, 08:00
ffmpeg -i input.dts -b:a 640k output.ac3
ie. you don't use eac3to at all in that process.
LonelyPixel
4th June 2015, 08:44
Okay, meanwhile I've found out how to downmix the DTS from 7.1 to 5.1 (-down6 parameter) and write 6 .wav files with eac3to, then join them (http://forum.doom9.org/showthread.php?p=1643118#post1643118) into .ac3 with ffmpeg.
Then I also found out that ffmpeg can read dts files on its own. That saves me a lot of temporary disk space. Is the decoding quality of ffmpeg comparable or even better than eac3to's libDcaDec DTS Decoder?
I assume that none of these solutions will decode the "lossless" part of DTS-HD MA, so only the core will be used. I'm okay with that, 1.5 Mbit/s seem more than enough for a 640k ac3 target. I also imagine that directly converting from dts to ac3 will preserve all the metadata that may be inside the dts file.
tebasuna51
4th June 2015, 11:30
Seems ffmpeg only decode DTS core.
- You can use eac3to to decode lossless and downmix with:
eac3to input_7.1.dtshd output_5.1.w64 -down6
Remember use w64 for large audio tracks.
And after:
ffmpeg -i output_5.1.w64 -b:a 640k output.ac3
- There are other option for AviSynth users. Download the last BeHappy pre-release (http://forum.doom9.org/showthread.php?p=1724791#post1724791) and:
1) Load the DTSHD (Drag or Add)
2) Select the decoder LWLibavAudioSource (with libDcaDec) and Configure like Stream Index 0
3) Check DSP Downmix and Configure like 7.1 -> 5.1
This is a optimized Downmix than preserve the volume of first 4 channels, only mix the Side and Back channels and use the plugin AudioLimiter to avoid peak overflow.
4) Select the AC3 FFmpeg encoder and Configure at your choice.
5) Enqueue the Job
6) Go to tab Queue and Start
nevcairiel
4th June 2015, 15:08
You can also build ffmpeg with libdcadec support, which gives you all the power.
tebasuna51
4th June 2015, 15:36
You can also build ffmpeg with libdcadec support
Nope, I can't :) . Do you know any link to this build?
Sparktank
4th June 2015, 15:38
Zeranoe should be able to accept custom builds.
I thought for sure he would accept the libdcadec library by now.
The Atmos hack was easy enough.
sneaker_ger
4th June 2015, 15:41
Zeranoe has dcadec since end of March already.
LonelyPixel
4th June 2015, 15:50
I think I have that kind of ffmpeg, but went with the latest "release" 2.5.2 from 2014-12-30. I'll retry with the latest automatic build and compare its output. ffmpeg reading the full dts-hd sounds like a good idea, and it's easy enough to use. I've changed my workflow to include ffmpeg for dts->ac3 already.
sneaker_ger
4th June 2015, 15:51
You have to be careful since ffmpeg still defaults to its "native" decoder ("dca"). You have to explicitly set "libdcadec" as the input audio decoder.
LonelyPixel
4th June 2015, 16:08
Alright, I see the difference. This is my latest command:
ffmpeg -acodec libdcadec -i audio.dtshd -acodec ac3 -ab 640k audio.ac3
All work fine. I just hope that it decodes DTS HD because I really can't here the difference. ;-) "libdcadec" is a lot slower than "dca" which is used by default, some 3x the processing time.
sneaker_ger
4th June 2015, 16:14
All work fine.
What about the crackling?
LonelyPixel
4th June 2015, 16:18
That's what I meant. I've listened to all the produced files on my Logitech speakers and they're fine. That's how I wanted it to be. So thank you all for the great support and valuable information!
tebasuna51
4th June 2015, 18:08
Using -acodec libdcadec works fine for me.
BTW, still there are the downmix problem. Using:
ffmpeg -acodec libdcadec -i audio_7.1.dtshd -acodec ac3 -ab 640k audio.ac3
ffmpeg seems use a downmix like:
SL' = 0.707 x BL + SL
SR' = 0.707 x BR + SR
This can produce overflow's in surround channels.
tebasuna51
4th June 2015, 19:52
Other volume test (Soundout plugin) using your sample.
Decoded to wav with DcaDec:
DcaDec DTSHD -> WAV
FL Maximum:-15.86dB. Average:-35.74dB. RMS:-32.84dB.
FR Maximum:-15.59dB. Average:-36.02dB. RMS:-33.00dB.
FC Maximum: -6.74dB. Average:-38.37dB. RMS:-33.03dB.
LF Maximum:-30.56dB. Average:-50.48dB. RMS:-46.56dB.
BL Maximum:-26.50dB. Average:-45.99dB. RMS:-42.99dB.
BR Maximum:-27.50dB. Average:-45.83dB. RMS:-42.80dB.
SL Maximum:-20.98dB. Average:-40.46dB. RMS:-37.39dB.
SR Maximum:-21.00dB. Average:-41.26dB. RMS:-38.07dB.
All Maximum: -6.74dB. Average:-40.51dB. RMS:-36.06dB
Recoded to AC3 with BeHappy method:
BeHappy DTSHD -> AC3
FL Maximum:-15.88dB. Average:-35.75dB. RMS:-32.84dB
FR Maximum:-15.56dB. Average:-36.03dB. RMS:-33.00dB
FC Maximum: -6.76dB. Average:-38.37dB. RMS:-33.03dB
LF Maximum:-30.60dB. Average:-50.49dB. RMS:-46.57dB
SL Maximum:-18.51dB. Average:-38.00dB. RMS:-34.98dB
SR Maximum:-20.27dB. Average:-38.67dB. RMS:-35.59dB
All Maximum: -6.76dB. Average:-38.49dB. RMS:-34.49dB
Like you can see the first 4 channels have same volume.
Now there are only 2 surround channels SL-SR but the volume is higer (without overflows) than the 4 BL-BR-SL-SR because must supply, with only 2 speakers, the same acustic power than the 4 speakers in a 7.1 system.
Recoded with
ffmpeg -acodec libdcadec -i audio.dtshd -acodec ac3 -ab 640k audio.ac3
ffmpeg DTSHD -> AC3
FL Maximum:-20.49dB. Average:-40.39dB. RMS:-37.49dB.
FR Maximum:-20.24dB. Average:-40.67dB. RMS:-37.65dB.
FC Maximum:-11.40dB. Average:-43.02dB. RMS:-37.67dB.
LF Maximum:-35.21dB. Average:-55.14dB. RMS:-51.21dB.
SL Maximum:-23.75dB. Average:-43.40dB. RMS:-40.36dB.
SR Maximum:-25.43dB. Average:-44.13dB. RMS:-41.03dB.
All Maximum:-11.40dB. Average:-43.39dB. RMS:-39.33dB
Seems ffmpeg low the volume (maybe to avoid overflow in downmix).
All channels are at -5 dB than the 4 first channels in WAV or BeHappy AC3 and the 2 last BeHappy AC3 channels.
SquallMX
11th June 2015, 20:03
Does a fix exist for the irregular downmix values used by ffmpeg?
It uses -5db and -6db instead of the default Dolby values of -3db.
nevcairiel
11th June 2015, 22:39
FFmpeg uses pretty standard downmixing, with the only difference that it will usually apply a normalization to the mixing matrix so that overflows are impossible, reducing overall volume when downmixing.
You can however disable this normalization (if you know that its not going to overflow), or even tweak it to normalize to a different peak level using the rematrix_maxval and rematrix_volume options.
tebasuna51
12th June 2015, 17:15
FFmpeg uses pretty standard downmixing, with the only difference that it will usually apply a normalization to the mixing matrix so that overflows are impossible, reducing overall volume when downmixing.
You can however disable this normalization (if you know that its not going to overflow), or even tweak it to normalize to a different peak level using the rematrix_maxval and rematrix_volume options.
I search in https://www.ffmpeg.org/documentation.html and don't found any reference to normalize or parameters like rematrix_maxval and rematrix_volume.
Can you, please, help me with a link?
I found audio filters (https://www.ffmpeg.org/ffmpeg-filters.html) to especify the downmix required, for instance for 7.1 to 5.1:
ffmpeg -i INPUT -af "pan=5.1| FL < FL | FR < FR | FC < FC | LFE < LFE | SL < 0.707*BL + SL | SR < 0.707*BR + SR" OUTPUT
With some samples ffmpeg seems apply this downmix by default, without Normalize, with overflow.
With the sample in this thread seems apply, by default, a Normalize and here is not necessary at all:
BL Maximum:-26.50dB.
BR Maximum:-27.50dB.
SL Maximum:-20.98dB.
SR Maximum:-21.00dB.
How we can control this ffmpeg behaviour?
co5mo
6th October 2016, 11:09
is there a way to "repair" old AC3 encodes using this method?
ffmpeg -acodec libdcadec -i audio.dtshd -acodec ac3 -ab 640k audio.ac3
thank you!
tebasuna51
6th October 2016, 11:44
is there a way to "repair" old AC3 encodes using this method?
ffmpeg -acodec libdcadec -i audio.dtshd -acodec ac3 -ab 640k audio.ac3
Yep, but actual ffmpeg don't need -acodec libdcadec (now is the default) and produce a fatal ERROR, use instead:
ffmpeg -i audio.dtshd -acodec ac3 -ab 640k -center_mixlev 0.707 audio.ac3
-center_mixlev 0.707
because the default is too low and can produce low dialog volume if is downmixed with that parameter.
co5mo
6th October 2016, 12:08
ok thank you so could I use also some tool to do this automatically for some of my files?
imput file.mkv and it will end up as "repaired" mkv with the usable AC3 in my z906?
because I would like to do this to already encoded mkv files with ac3 audio
EDIT:
so this would do it propably:
ffmpeg -i input.mkv -c:v copy -c:a ac3 -ab 640k -center_mixlev 0.707 fixaudio.mkv
tebasuna51
6th October 2016, 17:28
But, have you the original dtshd track in these mkv's?
You can't repair "already encoded mkv files with ac3 audio"
co5mo
6th October 2016, 17:36
no I don't have any original files no DTS just already encoded finished MKV does it mean that even when I reencode the AC3 it will still crackle? just testing this will let you know asap
co5mo
6th October 2016, 17:59
the reencoding fixed the AC3 on Z906 I know it is lossy to lossy but there is no other way... right?
tebasuna51
6th October 2016, 21:22
the reencoding fixed the AC3 on Z906 I know it is lossy to lossy but there is no other way... right?
If that solve your problem, yes.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.