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

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”.


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.


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.

  • How to merge audio and video file in ffmpeg
  • In ffmpeg, how to delay only the audio of a .mp4 video without converting the audio?

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"
  • In ffmpeg, how to delay only the audio of a .mp4 video without converting the audio?
  • How to merge audio and video file in ffmpeg

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.