Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER for Video Editing/Mangling

Reply
 
Thread Tools Display Modes
Old 08-21-2019, 10:36 AM   #1
mehmethan
Human being with feelings
 
mehmethan's Avatar
 
Join Date: Jun 2011
Posts: 445
Default How can I replace audio of a video file in Reaper?

Hi I want to replace audio of a video file in Reaper.I don't want to effect video quality, format or properties at rendering process. So no changes on video but only change will be the audio.

Video file is .MOV format size 514 MB and properties are like this.
Length: 5:22.920
Video: 1920x1080@25.00fps, Aspect=1.00, Decoding format=I420/YV12
Audio: 48000Hz 2ch 32bps
Video: 1920x1080, h264, 25.00fps
Audio: 48000hz, 32bps, 2ch, mp4a
Video data rate : 12859kb/s
Video bit rate : 12989 kb/s
Audio bit rate : 130 kb/s

How should I render this video with new audio file so the final render will be exactly the same with the original except audio ?

Last edited by mehmethan; 08-21-2019 at 11:02 AM.
mehmethan is offline   Reply With Quote
Old 08-22-2019, 03:39 AM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 7,858
Default

I don't think you can avoid re-encoding the video completely when rendering the video from Reaper. You will likely need to do something like render the new audio as an audio file and replace the audio in the video file with some external program.
__________________
For info on SWS Reaper extension plugin (including Xenakios' previous extension/actions) :
http://www.sws-extension.org/
https://github.com/Jeff0S/sws
--
Xenakios blog (about HourGlass, Paul(X)Stretch and λ) :
http://xenakios.wordpress.com/
Xenakios is online now   Reply With Quote
Old 08-22-2019, 07:28 AM   #3
mehmethan
Human being with feelings
 
mehmethan's Avatar
 
Join Date: Jun 2011
Posts: 445
Default

Quote:
Originally Posted by Xenakios View Post
I don't think you can avoid re-encoding the video completely when rendering the video from Reaper. You will likely need to do something like render the new audio as an audio file and replace the audio in the video file with some external program.
Thank you for the the answer.
mehmethan is offline   Reply With Quote
Old 08-29-2019, 10:20 PM   #4
superblonde.org
Human being with feelings
 
Join Date: Jul 2019
Posts: 772
Default

use ffmpeg directly on command line, you can split the streams and rejoin with new streams 'losslessly' (i.e. no decode, reencode)
superblonde.org is offline   Reply With Quote
Old 09-13-2019, 06:00 PM   #5
SonicAxiom
Human being with feelings
 
SonicAxiom's Avatar
 
Join Date: Dec 2012
Location: Germany
Posts: 1,859
Default

AVIDemux can replace the audio stream in a video file without re-encoding (only re-muxing). You can also add another audio stream to a video while keeping the original audio stream. The resulting video will have 2 (selectable) audio streams (like a DVD that offers to choose from multiple languages). I'm using this feature after remastering a video's original audio so that the client can toggle between the original and my remastered version for convenient A/B comparison. He only needs a video player that can toggle between audio streams, preferably via a single keystroke like PotPlayer.

.
__________________
[Check out my free VST plugin collection here.]
SonicAxiom is offline   Reply With Quote
Old 09-15-2019, 11:26 AM   #6
sveinpetter
Human being with feelings
 
Join Date: Dec 2011
Location: Norway
Posts: 78
Default Encode Videos with FFmpeg

This is a good one for: Encode Videos with FFmpeg
https://digitalfortress.tech/tricks/...s-with-ffmpeg/


I have copy / paste this:

6. Add/Remove Audio from a Video

While adding audio, there are 2 possibilities depending on the expected end result.

A. Replace the original Audio
You can overwrite the original audio with a new audio as shown below. By default, the duration of the output will be that of the longer input. That means that if the audio is longer than the video, the video will freeze when it reaches its end whereas the audio will continue until it reaches the end of its duration, and vice-versa.

To avoid that, you could use either use the -shortest option which truncates the output to the same duration as the shortest input or use the -t 300 option which will truncate the output at the 300th second.

1 ffmpeg -i inputAudio.mp3 -i inputVideo.avi outputVideo.avi
2 ffmpeg -i inputAudio.mp3 -i inputVideo.avi -shortest outputVideo.avi
3 ffmpeg -i inputAudio.mp3 -i inputVideo.avi -t 300 outputVideo.avi
4 /**
5 * -i => Input file
6 * -shortest => Makes output to be the same duration as the shortest input
7 * -t => time in seconds
8 */

B. Add an additional Audio track

If you wish to conserve the original audio, and only add a new audio track, it can be done by mapping the audio streams.

1 ffmpeg -i input_video_with_audio.avi -i new_audio.ac3 -map 0 -map 1 -c copy outputVideo.avi
2 /**
3 * -i => Input file
4 * -c => Codec (both audio + video)
5 * -map => maps the input files
6 */

Here, -map 0 copies all streams(audio + video) from the first input file (input_video_with_audio.avi) and -map 1 copies all streams (in this case, one i.e. audio) from the second input file (new_audio.ac3). Hence the output video will now have 2 audio streams. During playback, the user can choose the audio track to listen. (Works with players that support it, like VLC player) By default, it uses the first audio track that was mapped. (-map 0, where 0 refers to the first input file)

Remove Audio
To strip the Audio, use the -an option which tells FFmpeg to exclude all audio streams from the input.

1 ffmpeg -i inputVideo.avi -c copy -an outputVideo.avi
2 /**
3 * -i => Input file
4 * -c => codec (audio + video)
5 * -an => exclude audio streams
6 */
sveinpetter is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:08 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.