Replace audio + sync + save all to a new video file – VLC

80,751

Solution 1

Save doesn't work for what you are trying. This is because audio/video tracks aren't like photos that can be modified and saved immediately. They need to be "streamed" and recorded again. This is available in VLC in the "Convert" option.

Once you save the converted file and play it again it will contain both the audio files. Go to Audio> Audio Track> Track 2 (Click on this one). Basically, VLC adds the new audio track as the Track 2 which does not play by default.

But if you want to replace the existing audio file with the new file then you can follow the following instructions instead:

  1. Install FFmpeg on your system (follow the guide How to Install FFmpeg on Windows)

  2. Open command prompt and go to the folder where video1.mp4 is saved and audio_replace.m4a (or mp3 whatever it is) is saved.

  3. Type the following command:

    ffmpeg -i "video1.mp4 " -i "audio_replace.m4a" -vcodec copy -acodec copy -map 0:0 -map 1:0 output.mp4
    

Hope this solves your problem.

Solution 2

Replace Movie Audio (i.e. Language Track) on OS X (2019)

  • Consider ffpmeg (Step 0)
  • Get VLC (Step 1)
  • "Convert" to video only (Steps 2-5)
  • Add both video and audio that you want (Steps 6-9)
  • Bonus: Syncing audio and video
  • Bonus: burn to DVD

0. Have you considered ffmpeg?

Just as an FYI, this entire process is probably a lot simpler using ffmpeg instead.

1. Download VLC

https://www.videolan.org/vlc/index.html

2. File > Convert/Stream

File > Convert Stream

3. Open media...

Open media...

4. Set output stream

Encapsulation

Choose a compatible container format (probably mp4 if you want it to work on blu-ray players with usb slots, or mkv for hipster stuff)

Encapsulation

You want Video and Keep original video track selected.

Video codec

You DO NOT want Audio selected

Audio Codec

Add Subtitles if you've got 'em.

Add Subtitles

5. Save output

Choose the output file. I called mine the same as prior but with video-only just before the extension.

save

Important: The playback bar represents the stream progress. That's CPU/memory bound. It may save to memory very quickly, but still take another few minutes to actually sync to disc.

Don't be alarmed if your disc shows something ridiculous like "76MB". It'll catch up in a minute.

playback stream

6. File > Advanced Open File

Now you're going to open two files at once.

File > Advanced Open File

7. Select files, check Stream

Now you select the video only file (otherwise the audio will not be replaced, but will be added to the end of the audio track listing) and the audio language track you want:

enter image description here

Don't forget to check the "Stream" option.

8. Select joint output file

Ideally you won't be doing any encoding or changing encapsulation in this step (uncheck those), you'll just set the name.

In my case I'm just changing .video-only.mp4 to .lv.m4v (for Latvian and just because VLC prefers the .m4v to .mp4 - it's the same thing)

output stream options

9. Save output, again

Important: The playback bar represents the stream progress. That's CPU/memory bound. It may save to memory very quickly, but still take another few minutes to actually sync to disc.

Don't be alarmed if your disc shows something ridiculous like "76MB". It'll catch up in a minute.

stream output to save file

Bonus: Syncing Audio + Video

If the audio and video are out-of-sync when watching the video, VLC makes it easy to adjust - so you can easily discover the exact offset that you need.

enter image description here

Note:

  • Positive means "move track forward", as in delay its start time.
  • Negative means "move track backwards", as in advance its start time.

However, in the version I have, those settings don't apply to saving the stream.

Instead, you'll have to use ffmpeg:

If you need to delay video by 3.84 seconds, use a command like this:

ffmpeg.exe -i "movie.mp4" -itsoffset 3.84 -i "movie.mp4" -map 1:v -map 0:a -c copy "movie-video-delayed.mp4"

If you need to delay audio by 3.84 seconds, use a command like this:

ffmpeg.exe -i "movie.mp4" -itsoffset 3.84 -i "movie.mp4" -map 0:v -map 1:a -c copy "movie-audio-delayed.mp4"

Bonus: Burn to DVD

An oldie, but a goodie (the best kind, in fact):

http://burn-osx.sourceforge.net/Pages/English/home.html

It can easily convert from mp4 to DVD format for you.

Other thoughts

It is, of course, possible to add multiple language tracks to a single mp4 file. It's easy to select that in VLC. I don't know how easy it may or may not be for other video players (including DVD, Blu-Ray, Roku?, and other things with USB sticks) to read those, so I've just created multiple copies of the file for multiple languages so far.

I'll eventually experiment with multiple audio and subtitle tracks, but I'll probably forget to come back and update with my progress.

Solution 3

With VLC 3.x on Windows

  • menu: Media/Open Multiple Files
  • click: Show more options
  • check: Play another media synchronously
  • pick audio first
  • pick video
  • open dropdown next to [Play] and pick Convert
  • Make new profile (default profile can bloat the result)
    • last icon is for new profile
    • Encapsulation: MP4/MOV (or MKV)
    • Video codec: check: Video, Keep original track
    • Audio codec: check: Audio, Keep original track
    • save profile (with a short name like "Keep Original")
  • Destination file name

If you need more adjustments (like that synchronization) stop "playing" as soon as it starts, delete the file, then open "Effects and filters" and enter what you need.

click: [Play] and it will start conversion again (and complain if you haven't deleted or renamed the file)

This part is a life saver if you need to do N rounds and try and adjust things. Make sure that VLC is not in "one instance" mode (Tools/Preferences) - so that you can use 2nd VLC process to open and check partial merges without having to fear whether it might obliterate your conversion data.

Share:
80,751

Related videos on Youtube

Mosh Feu
Author by

Mosh Feu

Updated on September 18, 2022

Comments

  • Mosh Feu
    Mosh Feu over 1 year

    I have a video with audio. I have an .mp3 file of the same video but in another language. I need to do two things.

    1. Replace the built-in audio with the new audio.
    2. Because the new audio is not exactly in sync, I need to add 900 ms delay.

    I can do all of that, but my problem is that I cannot save the result.  I can watch the movie perfectly, but not save.

    I tried to use the “Save” option, and it makes some process but the result is the same (except the file size which is much bigger).

    My steps:

    Open Multiple Files...
    enter image description here

    Play another media synchronously (extra audio file, ...)
    enter image description here

    Then click “Convert”.

    • Mugen
      Mugen over 6 years
      I'm not sure why people downvoted your question. It's pretty clear what you're asking. I'm going to edit your question to make it more comprehensible.
  • coolaj86
    coolaj86 about 5 years
    Could you provide a screenshot? The menu item names have changed, but if I saw the screen I might be able to find it.
  • tvt173
    tvt173 almost 5 years
    This is a great technique. I had to use the ffmpeg command outlined here to get the audio to work in my case superuser.com/questions/1137612/ffmpeg-replace-audio-in-vide‌​o
  • MarianD
    MarianD almost 5 years
    Maybe it would be good to add that output.mp4 is the resulting file.
  • mhrsalehi
    mhrsalehi over 3 years
    this worked for my case, Mkv video, and mp3 audio. thank you! perfect
  • jayarjo
    jayarjo over 3 years
    For me it doesn't copy video track - only audio.
  • Greg Martin
    Greg Martin about 2 years
    I had the same issue as @jayarjo and found the solution here: superuser.com/questions/1137612/ffmpeg-replace-audio-in-vide‌​o