View Full Version : How to upmix Dolby TrueHD 3.1 to AC-3 5.1 with Audacity
PixelPirate
4th May 2024, 08:12
Does anyone know how to upmix Dolby TrueHD 3.1 to AC-3 5.1 with Audacity? I'm asking because Audacity does not seem to complete a task on audio streams that are longer than around 30 minutes.
tebasuna51
4th May 2024, 19:31
I don't know about the Audacity problem, but I suggest you try with ffmpeg with something like that:
ffmpeg -i 3.1.thd -filter_complex "asplit [f][s]; [f] pan=3.1|c0=c0|c1=c1|c2=c2|c3=c3 [r]; [s] pan=stereo|c0=0.5*c0|c1=0.5*c1, adelay=delays=20:all=1, aformat=channel_layouts=stereo [d]; [r][d] amerge [a]" -map "[a]" -acodec ac3 -center_mixlev 0.707 -ab 640k output.ac3
PixelPirate
5th May 2024, 07:21
I don't know about the Audacity problem, but I suggest you try with ffmpeg with something like that:
ffmpeg -i 3.1.thd -filter_complex "asplit [f][s]; [f] pan=3.1|c0=c0|c1=c1|c2=c2|c3=c3 [r]; [s] pan=stereo|c0=0.5*c0|c1=0.5*c1, adelay=delays=20:all=1, aformat=channel_layouts=stereo [d]; [r][d] amerge [a]" -map "[a]" -acodec ac3 -center_mixlev 0.707 -ab 640k output.ac3tebasuna51,
First of all, thanks for the reply. But could you please, if possible, answer the following questions?
In my opinion, Audacity does a fairly good job iwhen either isolating or removing the center channel from the FL and FR channels (stereo). But like I said, this procedure only works if the audio file is not longer than around 30 minutes. So if you were to insert a typical 2-hour audio stream from a movie, Audacity will simply not complete any of the effects you try to apply to the audio stream. I don't know why this happens. So can you please tell me if it is possible to remove the center channel from the FL and FR channels with FFmpeg, but like Audacity? Is there a syntax for this?
Is it also possible for FFmpeg to isolate the center channel from a stereo audio stream like Audacity? Is there a syntax for this?
The FFmpeg syntax which you have provided for me seems to work when the sounce file has 3.1 channels, which is what I had asked for. But can you please modify it so that it also works when upmixing from stereo 2.0 audio streams?
Here is the download link to the Dolby TrueHD 3.1 sample file:
https://uploadnow.io/f/lBDvHxt
SeeMoreDigital
5th May 2024, 09:48
Does anyone know how to upmix Dolby TrueHD 3.1 to AC-3 5.1 with Audacity? I'm asking because Audacity does not seem to complete a task on audio streams that are longer than around 30 minutes.
Out of interest... Where are people able to find Dolby TrueHD 3.1 sources?
PixelPirate
5th May 2024, 10:01
Out of interest... Where are people able to find Dolby TrueHD 3.1 sources?I think Blu-ray discs with Dolby TrueHD 3.1 audio streams are rare like the Blu-ray movie Shin Godzilla.
richardpl
5th May 2024, 10:41
Librempeg's truehd encoder can encode 3.1 audio.
I think Blu-ray discs with Dolby TrueHD 3.1 audio streams are rare like the Blu-ray movie Shin Godzilla.
I would suggest that you give this a try...
clever FFmpeg-GUI
https://forum.doom9.org/showthread.php?p=1905666#post1905666
PixelPirate
5th May 2024, 11:47
I would suggest that you give this a try...
clever FFmpeg-GUI
https://forum.doom9.org/showthread.php?p=1905666#post1905666The problem with clever FFmpeg-GUI is that it does not show what syntax is being used.
The problem with clever FFmpeg-GUI is that it does not show what syntax is being used.
I don't know what you mean by that, but you could ask the dev, "ProWo", he's good with helping users :)
tebasuna51
5th May 2024, 18:22
Audacity does a fairly good job iwhen either isolating or removing the center channel from the FL and FR channels (stereo).
Do you use Effect->Vocal Reduction and Isolation->Remove Center and Isolate Center?
I will do a test with more than 30 minutes to see if I can reproduce the problem.
I don't know how do this with ffmpeg but it have a surround filter (https://ffmpeg.org/ffmpeg-filters.html#toc-surround) to convert 2.0 to 5.1 with many parameters.
There are other methods like the foobar2000 plugin foo_dsp_TripleStereo (https://www.foobar2000.org/components/view/foo_dsp_TripleStereo) or the old CenterCut (http://www.moitah.net/download/latest/Center_Cut_GUI.zip)
PixelPirate
5th May 2024, 18:39
Do you use Effect->Vocal Reduction and Isolation->Remove Center and Isolate Center?
I will do a test with more than 30 minutes to see if I can reproduce the problem.
I don't know how do this with ffmpeg but it have a surround filter (https://ffmpeg.org/ffmpeg-filters.html#toc-surround) to convert 2.0 to 5.1 with many parameters.
There are other methods like the foobar2000 plugin foo_dsp_TripleStereo (https://www.foobar2000.org/components/view/foo_dsp_TripleStereo) or the old CenterCut (http://www.moitah.net/download/latest/Center_Cut_GUI.zip)tebasuna51,
Please follow the instructions here:
https://lisati.wordpress.com/2018/06/02/converting-2-0-stereo-to-5-1-surround/
Step number 5 says that it is optional. But please do this step. Don't skip it.
I myself get stuck on step number 8 onwards because I don't know how to set the SL and SR channels with Audacity. But maybe you can figure it out.
tebasuna51
5th May 2024, 19:46
Step number 5 says that it is optional. But please do this step. Don't skip it.
Of course it is necesary, but the steps 6 and 7 are wrong:
6 - Mix the isolated center channel from stereo to mono can duplicate the volume with clip risk, with my sample (59 m and work fine without problems) I have 0.7 volume in each identical channel, the mix can go until 1.4 with wrong clips.
7 - The LFE channel never must be obtained from the front channels.
The 5.1 audio equipment extract the low frequencies to subwoofer from ALL channels, then can be dupped or cancelled with the LFE channel generated by you. The LFE channel from a 2.0 must be empty always, it is not low frequencies but Low Frequency EFFECTS never present in a 2.0.
Instead these steps I recommend this:
The isolated center stereo must be converted in the Center-LFE channels, Normalize the first channel and mute the second channel, that is all.
I myself get stuck on step number 8 onwards because I don't know how to set the SL and SR channels with Audacity. But maybe you can figure it out.
To create the surround channels we need use the pair with the removed center channel, not the original front channels to avoid echo with voices in center channel.
And how create them is a personal taste, my recomendation is a lower volume (0.5 like I suggest in my ffmpeg command line) and a little delay of 20 ms.
PixelPirate
5th May 2024, 20:18
Of course it is necesary, but the steps 6 and 7 are wrong:
6 - Mix the isolated center channel from stereo to mono can duplicate the volume with clip risk, with my sample (59 m and work fine without problems) I have 0.7 volume in each identical channel, the mix can go until 1.4 with wrong clips.
7 - The LFE channel never must be obtained from the front channels.
The 5.1 audio equipment extract the low frequencies to subwoofer from ALL channels, then can be dupped or cancelled with the LFE channel generated by you. The LFE channel from a 2.0 must be empty always, it is not low frequencies but Low Frequency EFFECTS never present in a 2.0.
Instead these steps I recommend this:
The isolated center stereo must be converted in the Center-LFE channels, Normalize the first channel and mute the second channel, that is all.
To create the surround channels we need use the pair with the removed center channel, not the original front channels to avoid echo with voices in center channel.
And how create them is a personal taste, my recomendation is a lower volume (0.5 like I suggest in my ffmpeg command line) and a little delay of 20 ms.But is the result of the 5.1 surround file that you created with Audacity the same or at least very similar to the AC3 5.1 surround file that is created with FFmpeg?
tebasuna51
5th May 2024, 21:06
But is the result of the 5.1 surround file that you created with Audacity the same or at least very similar to the AC3 5.1 surround file that is created with FFmpeg?
Nope, I don't know how tune the surround filter to cancel the common part of front channels to obtain a good center channel.
BTW I never convert 2.0 to 5.1, only sometimes with BD's with parts 2.0 and the main movie 5.1 and I use this method https://forum.doom9.org/showthread.php?p=1640451#post1640451
PixelPirate
5th May 2024, 21:17
Nope, I don't know how tune the surround filter to cancel the common part of front channels to obtain a good center channel.
BTW I never convert 2.0 to 5.1, only sometimes with BD's with parts 2.0 and the main movie 5.1 and I use this method https://forum.doom9.org/showthread.php?p=1640451#post1640451What about this method?
https://forum.doom9.org/showthread.php?s=&postid=395801#post395801
or
https://originaltrilogy.com/topic/You-can-convert-your-stereo-audio-to-51-channelDTS-audio/id/15177
tebasuna51
5th May 2024, 21:23
Forget both.
Any manual method must do:
- Create a Center channel with the common parts of L and R channel, not a mix.
- Substract that Center from the original L an R to create the new L and R
You can use the Audacity method explained or CenterCut or foo_dsp_TripleStereo.
That is the more important job .
- Create a empty LFE channel
- Create a SL, SR channels from the news L and R at your taste (it is not important), but forget useless frequency filters, a little delay can be enough.
Maybe a slight Hall reverb or other effect but with low volume (100% not recommended).
PixelPirate
5th May 2024, 22:52
- Create a SL, SR channels from the news L and R at your taste (it is not important), but forget useless frequency filters, a little delay can be enough.
Maybe a slight Hall reverb or other effect but with low volume (100% not recommended).So you disagree with MaroonMike when he uses a highband filter at 100hz for both SL and SR channels? But I think that the center channel should also be removed for the SL and SR channels, not just from the FL and FR channels, am I right?
OK, maybe you already answered this question when you said:
To create the surround channels we need use the pair with the removed center channel, not the original front channels to avoid echo with voices in center channel.
And how create them is a personal taste, my recomendation is a lower volume (0.5 like I suggest in my ffmpeg command line) and a little delay of 20 ms.
But the question is whether or not FFmpeg actually does remove the center channel from the FL and FR channels. If I were to guess, I would say probably not. I don't know.
tebasuna51
6th May 2024, 09:54
So you disagree with MaroonMike when he uses a highband filter at 100hz for both SL and SR channels?
You can do it but is unnecesary, the low frequencies are extracted to subwoofer and the SL/SR speakers can't play that frequencies
But I think that the center channel should also be removed for the SL and SR channels, not just from the FL and FR channels, am I right?
If you use the new FL/FR channels to create SL/SR the Center channel is already removed.
"- Create a SL, SR channels from the news L and R"
I used ffmpeg with a 3.1, FL/FR/FC/LFE with the FC already separated but from a 2.0 I don't know how do this.
PixelPirate
6th May 2024, 10:55
You can do it but is unnecesary, the low frequencies are extracted to subwoofer and the SL/SR speakers can't play that frequencies
If you use the new FL/FR channels to create SL/SR the Center channel is already removed.
"- Create a SL, SR channels from the news L and R"
I used ffmpeg with a 3.1, FL/FR/FC/LFE with the FC already separated but from a 2.0 I don't know how do this.So when creating the SL and SR channels, all that needs to be done is to make sure that the center channel has been removed and add a little reverb with 20ms delay?
tebasuna51
6th May 2024, 11:32
Try yourself.
PixelPirate
6th May 2024, 11:37
Try yourself.If I may ask you, is there any way of finding out the delay of the surround channels if the source file already has the surround channels? Can for example FFmpeg provide the delay information?
richardpl
6th May 2024, 14:18
I do not think full FL/FR/FC separation is smart idea.
tebasuna51
6th May 2024, 22:00
True surround channels not need to have a fix delay over front channels. Can change with the movie action but we can't do changes automatically.
Do a delay, or any effect like reverb, is only a way to create a difference than, of course, can't be a real surround effect.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.