Код отслеживания Google Analytics.

Oct 11, 2008

New audio track in avi

I had two version of film - one with good video quality and terrible russian translation and second with middling video and original audio. The task was compile from them one avi with two tracks

The easiest way is evident - copy to file from ./badVideo.avi sound track and add it to ./goodVideo.avi.
mkfifo tmpFifo   #creating fifo
mplayer -vc null -vo null -ao pcm:fast:file=tmpFifo ./badVideo.avi
lame --preset standard ./tmpFifo ./originalSound.mp3 #convert to mp3 
rm tmpFifo
mp3gain -a ./originalSound.mp3 #normalize 
avimerge -i ./goodVideo.avi -p ./originalSound.mp3 -o ./resultVideo.avi #the resultVideo contains two audio track

But in my case the ./badVideo.avi had different length (from badVideo was removed 30 seconds scene) and I've used the audacity for synchronize them. For better performance the wav was used:
mplayer -vc null -vo null -ao pcm:fast:file=originalSound.wav ./badVideo.avi
mplayer -vc null -vo null -ao pcm:fast:file=translatedSound.wav ./goodVideo.avi
normalize-audio originalSound.wav #normalize (we can use it for wav instead mp3gain from previous example)
normalize-audio translatedSound.wav
audacity originalSound.wav translatedSound.wav
..... manual synchronization .....
lame --preset standard correctedSound.wav correctedSound.mp3
avimerge -i ./goodVideo.avi -p ./correctedSound.mp3 -o ./resultVideo.avi #the resultVideo contains two audio track

No comments: