I have developed a method to use MEncoder to transcode some HD h.264 files to mpg. The picture looks really good and the audio sync is close, just not quite close enough (for every 2 hours of video, the video component comes out about a second shorter than the audio).
Before proceeding, I thought I'd take a deep breath and say that I've done quite a bit of research on this, but so far I'm stumped.
OK, I want to increase the tempo of the audio file just enough that it correctly syncs with the video.
The good news is that I can do it!
I've devised a method to demux, convert my audio, a 6 channel (dolby 5.1) ac3 file, into a stereo wav file using a52dec, change the tempo using SoX (the most recent version of which is quite robust), convert back to ac3 with ffmpeg, then re-mux. So far so good.
Now here's the problem. The method I just described requires that I accept a stereo version mix-down of the audio when it is converted to wav, which is fine for most of the old video content I routinely convert, but now I have some stuff that's newer and I'd like to preserve the 6 channels through the tempo change process.
I can't find a way to separate those 6 channels into discrete files, perform the tempo change on each and then combine them again into a single ac3 file containing all 6 channels.
Audacity comes close, because I can use it to open the original ac3 file in separate tracks and change the tempo. But when I try to export to ac3 using the ffmpeg libraries, Audacity warns me that it will bounce the tracks down to 2 channels when performing the export. Bummer!
That pretty much covers it. Is there a way to change the tempo of my audio file which preserves all 6 channels? How?
Thanks very much!
(edited spelling only)
Results 1 to 12 of 12
-
-
Thanks very much for that information! I'm not sure I know how to get the channels separated into the 6 discrete files. What are possible methods? Audacity? Also, I'm not sure I know how to combine the discrete files using QuickTime Pro. Can you elaborate please? Thanks again.
(edited spelling only)
-
Also, when I try exporting to AIFF using your suggestion, I get this error in QuickTime Pro:
Failed: qtKitErrorCatchAll (-1309)
That would appear to mean there's some kind of incompatibility with my source AC3 file (the file seems to work fine in Audacity, only I'm not sure if exporting in Audacity is possible). Thanks again.
-
I discovered that the reason for the export error in QuickTime Pro is related to the input file's long duration. I was able to overcome that by splitting the file, however, when I open an exported file in Audacity, it appears that although 6 tracks exist, only two of them contain any audio. It appears that the export process in QuickTime Pro still doesn't accomplish the goal.
If I try to export the original ac3 file after I've opened it in Audacity, there doesn't seem to be a way to specify the export settings corresponding to those you suggested for QuickTime Pro, and Audacity displays the warning that all 6 tracks will be mixed down to one mono channel during the export.
It appears that I might be able to export individual tracks to 6 discrete files using Audacity, however. How do I go about combining them (in QuickTime Pro, as you first suggested, or using some other method)?
Any further suggestions will be greatly appreciated. Thanks!
-
If you have Perian installed, make sure in its PrefPane Audio Ouput is set to 'Multi-Channel Output' for this project. (If you had it set to one of the others, any QT conversion would be limited to two channels!)
Open the foo.ac3 file in QuickTime Pro. Export Sound to AIFF. Options: Format: Linear PCM, Channels: 5.1 (L R C LFE Ls Rs), Rate: 48000 Hz, sample size: 16 bits. This will generate an uncompressed version of the multi-channel file that will open in audio editors that do not natively support AC3, but do support more than two channels.
Open foo.aiff in Audacity. Edit how you want.
Combine Left and Right into a stereo track. This avoids some nastiness later on.
Name/label all tracks, so they're easy to recognize (L-R, C, LFE, Ls, Rs).
File > Export Multiple > Export format: WAV, Split file based on: Tracks, Using Label/track name.
As that finishes, you should have: L-R.wav, C.wav, LFE.wav, Ls.wav, Rs.wav.
Open the first file in QuickTime Player Pro. Left and right channel are already correct.
Open the second file in QuickTime Player Pro. Show movie properties. Set channel correct. Close. Select all. Copy.
Switch to first file. Select all. Jump to the beginning. Add to movie (from menu).
Open the third file in QuickTime Player Pro. Show movie properties. Set channel correct. Close. Select all. Copy.
Switch to first file. Select all. Jump to the beginning. Add to movie (from menu).
Open the forth file in QuickTime Player Pro. Show movie properties. Set channel correct. Close. Select all. Copy.
Switch to first file. Select all. Jump to the beginning. Add to movie (from menu).
Open the fifth file in QuickTime Player Pro. Show movie properties. Set channel correct. Close. Select all. Copy.
Switch to first file. Select all. Jump to the beginning. Add to movie (from menu).
Export Sound to AIFF. Options: Format: Linear PCM, Channels: 5.1 (L R C LFE Ls Rs), Rate: 48000 Hz, sample size: 16 bits. Now the discrete files are back into one.
-
Thanks very much for this useful information!
I certainly will try it, the only reluctance I have is the need to workaround the QuickTime Pro export error by splitting the source file into smaller chunks. I'm planning to ask the MEncoder users list if there's a way to use the dumpaudio option in MPlayer to separate channels into files that I can edit then put back into one ac3 file with MPlayer or MEncoder. Using the MPlayer commands I've tried so far, I can only produce one file that contains all the tracks.
Thanks again.
-
BeSweet will do it. Split the AC3 to 6 WAV files, do your conversion elsewhere, then re-combine the 6 WAVs back into AC3. Several GUI's available.
-
Your first post suggests you were able to open the AC3 file in Audacity as a multi-track file. If so, then you won't need the first step that I described of exporting as AIFF (which failed).
If you "Export Multiple", you should be able to continue with the other steps, right?
Note that exporting as multiple uncompressed WAV files, needs lots of disk space. So make sure you have enough room.
-
Your first post suggests you were able to open the AC3 file in Audacity as a multi-track file. If so, then you won't need the first step that I described of exporting as AIFF (which failed).
If you "Export Multiple", you should be able to continue with the other steps, right?
But anyway, I'm assuming QuickTime Player will let me convert back to one ac3 so I can re-mux, right? If not, I'll still need to find a way to do that.
Note that exporting as multiple uncompressed WAV files, needs lots of disk space.
Thanks!
-
I think I've found an extremely simple solution that was supplied to my through the MEncoder users mailing list. In preliminary testing, it works splendidly. Of course the challenge for me is keeping an updated and properly configured version of ffmpeg, but I have gotten used to managing that, hopefully.
Here's an example. It's just a pipe from ffmpeg to sox and back again.
ffmpeg -v 0 -i "$AUDIOFILE" -f sox - | sox -S -V -p -p tempo 1.04270833333333 | ffmpeg -v 0 -i - -acodec ac3 -ab 448000 -y "$AUDIOFILE2"
That should really save some time. Thanks again for your help!
Similar Threads
-
Time Stretch VIDEO, like "Change Tempo" in Audacity - Software? H
By djmoon in forum EditingReplies: 14Last Post: 18th Nov 2013, 14:47 -
Changing the Tempo (not the pitch) of .f4v videos (in a Mac)
By zzz83 in forum MacReplies: 10Last Post: 22nd Jan 2012, 19:33 -
How Could I change the default audio stream in a Dual or Multi Audio AVI fi
By worldperseus in forum AudioReplies: 3Last Post: 17th Jan 2011, 05:53 -
How to figure out the tempo of an mp3?
By sdsumike619 in forum AudioReplies: 2Last Post: 29th Mar 2009, 15:11 -
change audio
By jerseydre in forum Newbie / General discussionsReplies: 1Last Post: 5th Jul 2007, 05:00