VideoHelp Forum




+ Reply to Thread
Results 1 to 3 of 3
  1. 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!
    Drop dead gorgeous!
    Quote Quote  
  2. Get Slack disturbed1's Avatar
    Join Date
    Apr 2001
    Location
    init 4
    Search Comp PM
    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.
    Quote Quote  
  3. Member
    Join Date
    Feb 2004
    Location
    United States
    Search Comp PM
    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
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!