I've just found out about the -newaudio / -newvideo switches. I've managed to take two imputs ie. input.avi and 2ndaudio.mp3 and pull -acodec copy on the second input (the .mp3) so that the output.avi gets 2 audio tracks. However, now I'm curious if there is somehow possible to only take the video from input.avi, and use the audio from the .mp3 (ie. like "mp4box -add input.avi#video -add 2ndaudio.mp3" would have done. I try and try, but all command line strings seem to keep the audio stream from the .avi input, although I want to discard it, thus keep the .mp3 stream like the one 'n only for outcome.avi.
I've read the ffmpeg documentation, but there are few examples, and I can't follow the lead.
Thanks!
+ Reply to Thread
Results 1 to 3 of 3
-
Drop dead gorgeous!
-
Just tried this myself
ffmpeg -i video.avi -map 0:0 -an -i audio.mp3 -map 1:0 -vcodec copy -acodec copy out.avi -newaudio
The above makes no sense to me why it works. The mapping should be 0:0 0:1, but doesn't work, -newaudio (by logic) should go before the newaudio audio, not at the end. But hey it works so .....Linux _is_ user-friendly. It is not ignorant-friendly and idiot-friendly. -
With stream mapping specified on the command line it isn't necessary to use the -newaudio switch. This should work:
ffmpeg -i video.avi -i audio.mp3 -map 0:0 -map 1:0 -vcodec copy -acodec copy out.avi
The -newaudio switch is useful for changing the audio in some way from the original. For example if your input file has 44100hz 224kbs mp2 audio and you want it to be 48000hz 192kbs mp3 you can do this:
ffmpeg -i video.avi -vcodec copy -an -acodec libmp3lame -ab 192000 -ar 48000 out.avi -newaudio
The old audio stream is disabled via the -an switch and the newly encoded version is substituted.PB
Similar Threads
-
FFmpeg on Win only - FAQ can ffmpeg realize screen capture
By feelart in forum Capturing and VCRReplies: 1Last Post: 14th Feb 2012, 04:11 -
Using the DGAVCdec audio delay value when muxing with ffmpeg
By johnnyquid in forum Video ConversionReplies: 2Last Post: 23rd Jul 2011, 09:58 -
Difference between ffmpeg -threads and ffmpeg-mt
By Calidore in forum Video ConversionReplies: 2Last Post: 7th Mar 2010, 22:44 -
ffmpeg -- encoding while muxing new audio w/out source's audio, how ?
By vhelp in forum AudioReplies: 8Last Post: 21st Nov 2007, 19:53 -
FFMPEG QUESTION :How do I take one frame and make a jpeg with FFMPEG?
By goheadtry in forum Newbie / General discussionsReplies: 1Last Post: 18th Sep 2007, 02:55