View Full Version : Merge Multichannel Flac?
rack04
9th April 2010, 01:27
I'm trying to create a demo Blu-ray Disc using the open source film Elephants Dream (http://media.xiph.org/ED/). I need a little guidance on how exactly to merge the discrete channels into one FLAC file?
ED-CM-5.1-DVD-C.flac
ED-CM-5.1-DVD-L.flac
ED-CM-5.1-DVD-LFE.flac
ED-CM-5.1-DVD-LS.flac
ED-CM-5.1-DVD-R.flac
ED-CM-5.1-DVD-RS.flac
Music Fan
9th April 2010, 09:17
If you wanna do a Blu-ray, you can't use Flac, thus you have to decompress these 6 flac in 6 waves and then make a 5.1 wave.
Blue_MiSfit
11th April 2010, 07:11
Indeed. BluRay doesn't support FLAC. It does support PCM, and AC3, plus all the fancy schmancy "professional" formats, like DTS-MA, regular DTS, etc...
Personally, I'd just use AC3. There is an excellent freeware encoder that will do a great job of most any source at 640kbps. If you have access to a "pro" encoder, you can try some of the other formats of course.
The Dolby Digital Plus encoding software I'm familiar with is designed around multiple mono WAVs. In fact, I have to decode and split whatever my sources are into mono WAVs (usually via eac3to) to work with this painful app. Others (like Dolby's DP600 hardware) want interleaved WAVs.
If you need to decode and interleave these FLACs into one WAV, you can do so with AviSynth.
l=ffaudiosource("l.flac")
r=ffaudiosource("r.flac")
c=ffaudiosource("c.flac")
lfe=ffaudiosource("lfe.flac")
ls=ffaudiosource("ls.flac")
rs=ffaudiosource("rs.flac")
mergechannels(l,r,c,lfe,ls,rs)
soundout
And then you can use the SoundOut GUI to output an interleaved WAV. I suggest "wave format extensible" for larger files, eac3to seems to work with them happily. In the same GUI you can use Aften to make a 640kbps AC3.
~MiSfit
tebasuna51
11th April 2010, 10:31
And then you can use the SoundOut GUI to output an interleaved WAV. I suggest "wave format extensible" for larger files,...
For files >4GB SoundOut can output also .w64 files, if rack04 want use TsMuxer is recommended because don't accept wav > 4GB. Eac3to accept also .w64 files
Music Fan
11th April 2010, 10:51
By the way, can we merge 6 mono flac in 1 5.1 Flac ?
To decompress Flac in LPCM, I use Flac frontend but I don't know if he can merge mono Flac.
http://flac.sourceforge.net/
tebasuna51
11th April 2010, 11:34
By the way, can we merge 6 mono flac in 1 5.1 Flac ?
To decompress Flac in LPCM, I use Flac frontend but I don't know if he can merge mono Flac.
http://flac.sourceforge.net/
Nope, you need decompress, merge and recode without loss quality.
You can use the AviSynth method propossed before (SoundOut can output flac format), or flac.exe to decompress, WaveWizard (or Sox) to merge and flac.exe to recode.
rack04
12th April 2010, 21:42
Thanks for all the help. I've never heard of SoundOut so I'm excited to learn something new.
Is this the correct script to generate a single 5.1 w64 file?
LoadPlugin("C:\Program Files (x86)\ffms2\ffms2.dll")
l=FFAudioSource("E:\Work\ED-CM-5.1-DVD-L.flac")
r=FFAudioSource("E:\Work\ED-CM-5.1-DVD-R.flac")
c=FFAudioSource("E:\Work\ED-CM-5.1-DVD-C.flac")
lfe=FFAudioSource("E:\Work\ED-CM-5.1-DVD-LFE.flac")
ls=FFAudioSource("E:\Work\ED-CM-5.1-DVD-LS.flac")
rs=FFAudioSource("E:\Work\ED-CM-5.1-DVD-RS.flac ")
mergechannels(l,r,c,lfe,ls,rs)
SoundOut(output="wav", filename="E:\Work\ED-CM-5.1-DVD.wav", showprogress=true, overwritefile="yes", autoclose=true, type=5)
Is this the correct script to generate a single 5.1 ac3 file at CBR 640kbit/sec?
LoadPlugin("C:\Program Files (x86)\ffms2\ffms2.dll")
l=FFAudioSource("E:\Work\ED-CM-5.1-DVD-L.flac")
r=FFAudioSource("E:\Work\ED-CM-5.1-DVD-R.flac")
c=FFAudioSource("E:\Work\ED-CM-5.1-DVD-C.flac")
lfe=FFAudioSource("E:\Work\ED-CM-5.1-DVD-LFE.flac")
ls=FFAudioSource("E:\Work\ED-CM-5.1-DVD-LS.flac")
rs=FFAudioSource("E:\Work\ED-CM-5.1-DVD-RS.flac ")
mergechannels(l,r,c,lfe,ls,rs)
SoundOut(output="wav", filename="E:\Work\ED-CM-5.1-DVD.ac3", showprogress=true, overwritefile="yes", autoclose=true, cbrrate=640, acmod=7)
tebasuna51
13th April 2010, 03:02
...
Is this the correct script to generate a single 5.1 w64 file?
Maybe you can use .w64 extension:
filename="E:\Work\ED-CM-5.1-DVD.w64"
Is this the correct script to generate a single 5.1 ac3 file at CBR 640kbit/sec?
Select the correct output:
output="AC3"
acmod=7 is ok but not necesary here.
rack04
13th April 2010, 03:14
What else can be used to decode the flac in avisynth? I get an error "invalid initial pts and dts" with the script using ffaudiosource.
Midzuki
13th April 2010, 04:10
Try BassAudioSource().
Music Fan
13th April 2010, 07:36
Or simply Flac frontend to decompress it in LPCM and then avisynth (or eac3to, but I never tried it) to open these waves.
tebasuna51
13th April 2010, 09:59
You can use also the command line sox with -M (uppercase, for Merge):
sox -M L.flac R.flac C.flac LFE.flac LS.flac RS.flac output.flac
Or decode directly:
sox -M L.flac R.flac C.flac LFE.flac LS.flac RS.flac output.wav
Or recode directly:
sox -M L.flac R.flac C.flac LFE.flac LS.flac RS.flac -t wav - | aften -b 640 - output.ac3
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.