You are not logged in.
Pages: 1
Hello, after some google searching to no avail, im wondering if it is possible (and how) I can do this;
i have one uncompressed avi file with video and audio, I want to render this into a mpeg4 compressed file with the original uncomp avi's sound and video, but with a mp3 song of my choice over the top. Anything i have tried has cancelled out the original files audio and swapped it for the new mp3 song. please help!
Offline
This is not really an Arch issue, you may also try asking on some general or multimedia-focused forums.
Offline
Take a look an mencoder (part of mplayer). The man file is a bit overwhelming (to say the least), but a quick Google search [keywords: add audio channel mencoder]came up with this http://www.xinotes.org/notes/note/505/
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
FFmpeg's map option will allow you to "stack" streams in compatible containers. I don't know if AVI is, but no one should use it anyway unless they have to because it's crap.
Offline
FFmpeg's map option will allow you to "stack" streams in compatible containers. I don't know if AVI is, but no one should use it anyway unless they have to because it's crap.
The game I am recording from records straight to an uncompressed avi, but the final output file will be mp4. thanks, ill check out the map option ![]()
Offline
You should mix the two audio streams together into a new one.
Offline
You should mix the two audio streams together into a new one.
The OP does rather need to clarify whether he would like to play the 2 audio streams simultaneously - which would require some audio editing work to mix down the 2 streams (either externally in audacity or with an editor which caters for multiple streams such as shotwell) or using the map functions of ffmpeg to select one or other (much in the same way as multilanguage dvd selections)
Both are do-able but require differing approaches ![]()
Offline
yngwin wrote:You should mix the two audio streams together into a new one.
The OP does rather need to clarify whether he would like to play the 2 audio streams simultaneously - which would require some audio editing work to mix down the 2 streams (either externally in audacity or with an editor which caters for multiple streams such as shotwell) or using the map functions of ffmpeg to select one or other (much in the same way as multilanguage dvd selections)
Both are do-able but require differing approaches
apologies, I should have been more clear. I'm looking for the 2 streams to play simultaneously (the sound from the uncompressed avi of the game, playing at the same time as the song of my choice) (:
Offline
So in other words:
We are more looking into a player which is capable to play back two audio streams simultaniously (original sound of the game plus some soundtrack).
I am not shure which player is able to play back multiple audio streams inside one container. I would either mix the original sound with the musik track in Audacity (as already suggested above) but then it is "hardcoded". The other approach would be using two mono soundtracks as stereo.
Game sound would be "left audio" and music "right audio". Both way would work.
Last edited by Darksoul71 (2011-09-07 08:43:41)
My archlinux x86_64 host:
AMD E350 (2x1.6GHz) / 8GB DDR3 RAM / GeForce 9500GT (passive) / Arch running from 16GB USB Stick
Offline
I would just use a video editting tool such as kdenlive to load in the original video and add in the mp3 track. Then you could just render it with any of the available mpeg4 profiles.
Offline
apologies, I should have been more clear. I'm looking for the 2 streams to play simultaneously (the sound from the uncompressed avi of the game, playing at the same time as the song of my choice) (:
If you have not done so already you will want to rip the existing audio track from your avi as an mp3 or wav (ffmpeg /shotwell or misc other video editor will do it)
You can then use audacity to mix the tracks together and get the respective levels as you like them ![]()
You can then specify your new audio track and existing video track to be compressed into your final avi
If you would also like to be able to have either just the original audio or just the mp3 tune playing you could use the map functions of ffmpeg to include multiple streams.
Apart from mixing the audio tracks together (setting the levels) the whole process can be achieved using ffmpeg - have a read through http://howto-pages.org/ffmpeg/ and you'll have everything you need ![]()
Offline
1. Extract the audio from the video file:
ffmpeg -i input.avi audio.wavor if the video file already contains wav type audio:
ffmpeg -i input.avi -acodec copy audio.wav2. Combine the audio using SoX:
sox -m audio.wav music.mp3 combined.wavOr avoid the intermediate file (audio.wav) and pipe from ffmpeg to sox:
ffmpeg -i input.avi -f wav - | sox -m -r 48k -c2 -t s16 - music.mp3 combined.wav3. Encode. I'm assuming H.264 video and AAC audio in MP4 container since you didn't give any specifics:
ffmpeg -i input.avi -i combined.wav -map 0:0 -map 1:0 -vcodec libx264 -preset medium -crf 22 -threads 0 -shortest -acodec aac -strict experimental -ab 128k output.mp4Tweak the command to fit your job:
use the slowest preset that you have patience for (see x264 --help for a preset list, and ignore the "placebo" preset as it's a joke and a waste of time).
use the highest crf value that still gives an acceptable quality.
use those settings for the rest of your "set" of inputs.
You may want to try a different AAC encoder than the native AAC encoder in FFmpeg. Some people say it isn't good compared to faac and others. You could compile FFmpeg with libfaac or vo-aacenc support. See ffmpeg-git (it supports libfaac), vo-aacenc (you compile this for ffmpeg-git), and neroaacenc in AUR for some other AAC encoders.
Offline
Pages: 1