Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 02-12-2012, 02:18 PM   #1
HectorC
Human being with feelings
 
Join Date: Dec 2010
Posts: 23
Default Replace audio in video without reencoding

Hello,

I'm using Reaper for audio post for indie films and I find that it's very time consuming to have to reencode the video stream each time a render has to be done (it also has its issues, for instance I haven't been able to control the kbps video bitrate when exporting H.264 mov files). During the work process I have to send preview videos to the director or producer so it would be great if Reaper had a "export audio to movie" (without reencoding) function the same way Logic Pro has.

Cheers for an otherwise amazing tool!

Hector

Last edited by HectorC; 02-12-2012 at 02:33 PM.
HectorC is offline   Reply With Quote
Old 02-12-2012, 03:19 PM   #2
Kearley
Human being with feelings
 
Join Date: Sep 2008
Posts: 344
Default

Great idea!
__________________
kearley.bandcamp.com/
Kearley is offline   Reply With Quote
Old 02-13-2012, 04:47 AM   #3
Nixon
Human being with feelings
 
Nixon's Avatar
 
Join Date: Dec 2011
Posts: 406
Default

yeah +1!
Nixon is offline   Reply With Quote
Old 02-13-2012, 11:03 AM   #4
Fran Guidry
Human being with feelings
 
Fran Guidry's Avatar
 
Join Date: Dec 2007
Location: Walnut Creek, CA
Posts: 805
Default

ffmpeg command line supports this with the "copy" codec.

Fran
Fran Guidry is offline   Reply With Quote
Old 02-14-2012, 02:59 PM   #5
UberMario
Human being with feelings
 
Join Date: Oct 2011
Posts: 28
Default

I agree that this should definitely be incorporated into reaper!
UberMario is offline   Reply With Quote
Old 02-14-2012, 03:11 PM   #6
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 11,817
Default

For muxing audio tracks in to existing videos, replacing the audio track that's already there :

If you've got an AVI, you can use VirtualDub.

If it's a Quicktime, you can use Quicktime Pro and probably some other apps out there, since virtually all post productions in the world use Quicktime.

If it's an MKV, use the mkvtools.

If it's an MP4, use MP4box or one of its frontends like YAMB.

I know you guys want an all-in-one package, but this stuff probably is not getting that level of focus, when there's so much other stuff people need to make workflows happen.

Making it happen by yourself is no excuse, if enough people do make it happen in a reasonable amount of time is where your solution currently is. Being too lazy not to try and make it happen when other people do is your choice to make or not.


Some advice on what kind of audio to use in videos.

AAC encoding is pure shit for sync. It produces a significant delay on encoding. It's aweful. Every time you upload to Youtube, and the site transcodes it(always), the sound is sample-rate-converted to 44kHz and delayed by 1000-3000 samples. I've had to deal with this for quite some time.

If you're going to send a client some video, test your workflow to make sure you don't screw up your audio in the process, because MP3 and AAC encoding do that. For that reason 16-bit PCM audio is amongst the safest choices, as is OGG audio(sample accurate) if the client can effortlessly play it.

For example. I mix stuff for Extelevisions Youtube channel and we finally figured out the latency after going throught the complete tool chain. Luc, the video producer, encodes the audio to AAC separately(free Nero AAC encoder iirc), and then muxes that with YAMB and the H264 MP4 video in to an MP4 video file, which is what gets uploaded to Youtube.

When I redownload the MP4 from Youtube, the resulting decoded audio shows a consistent latency of 2704 samples. So, I move the resulting mix up by that amount, and we're completely in sync.
__________________
Using Latch Preview (Video) - Faderport 16 setup for CSI 1.1 , CSI 3.10
Website
"My ego comes pre-shrunk" - Randy Thom

Last edited by airon; 02-14-2012 at 03:18 PM.
airon is offline   Reply With Quote
Old 02-14-2012, 03:43 PM   #7
UberMario
Human being with feelings
 
Join Date: Oct 2011
Posts: 28
Default

I didn't know that it was very difficult to add an option for this feature! I'll definitely look into your suggestions. Thanks for such an informative post!
UberMario is offline   Reply With Quote
Old 02-14-2012, 04:11 PM   #8
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 11,817
Default

Be sure to get back here with any problems. We can probably figure something out.
__________________
Using Latch Preview (Video) - Faderport 16 setup for CSI 1.1 , CSI 3.10
Website
"My ego comes pre-shrunk" - Randy Thom
airon is offline   Reply With Quote
Old 02-14-2012, 04:27 PM   #9
jas
Human being with feelings
 
jas's Avatar
 
Join Date: Oct 2008
Location: a zonzo
Posts: 473
Default

Good post, Airon. Very informative.
jas is offline   Reply With Quote
Old 01-03-2015, 07:34 AM   #10
aminvanda
Human being with feelings
 
Join Date: Jan 2015
Posts: 1
Default

Quote:
Originally Posted by Fran Guidry View Post
ffmpeg command line supports this with the "copy" codec.

Fran
Is there a way to use ffmpeg on non-UNIX OS-es?!
The command line looks cool. But, we don't have such a command line in windows7!

Quote:
Originally Posted by airon View Post
For muxing audio tracks in to existing videos, replacing the audio track that's already there :
...
AAC encoding is pure shit for sync. It produces a significant delay on encoding. It's aweful. Every time you upload to Youtube, and the site transcodes it(always), the sound is sample-rate-converted to 44kHz and delayed by 1000-3000 samples. I've had to deal with this for quite some time.

If you're going to send a client some video, test your workflow to make sure you don't screw up your audio in the process, because MP3 and AAC encoding do that. For that reason 16-bit PCM audio is amongst the safest choices, as is OGG audio(sample accurate) if the client can effortlessly play it.

For example. I mix stuff for Extelevisions Youtube channel and we finally figured out the latency after going throught the complete tool chain. Luc, the video producer, encodes the audio to AAC separately(free Nero AAC encoder iirc), and then muxes that with YAMB and the H264 MP4 video in to an MP4 video file, which is what gets uploaded to Youtube.

When I redownload the MP4 from Youtube, the resulting decoded audio shows a consistent latency of 2704 samples. So, I move the resulting mix up by that amount, and we're completely in sync.
This is great advice! I have been wandering around over a week about this. I have an SONY smartphone. And it records MP4/AAC. Now, after editing and rendering in After Effects, the H264 MP4 file gets a shitty syncing problem. I have to generate the audio file separately and time-stretch it so that it gets the exact time length as the video, and re-encode the files together to get what I want.
But this whole process sucks. Because it takes a long time to make the files. Yet there are some echoes in the generated file's audio.

So, you're suggesting that I use PCM in the final file instead of AAC?
__________________
CODE IS POETRY!
طراحی سایت ارزان خدمات سئو
aminvanda is offline   Reply With Quote
Old 01-03-2015, 09:29 AM   #11
airon
Human being with feelings
 
airon's Avatar
 
Join Date: Aug 2006
Location: Berlin
Posts: 11,817
Default

No.

AAC encoders produce the offending latency, so all you need to do is test for it and compensate for that for your final AAC encode.

For example, the encoder that Luc uses for the encoding of soundtracks for the Extelevision Youtube channel produces a latency of x samples.

Youtube transcoding no longer adds to that latency by the way.

In Reaper I use a template session that simply contains two markers. One for where I drop in the file at first, and a second for where I shift the file to. For example, if the latency you're trying to compensate is 1000 samples, th at second marker sits 1000 samples to the left of the first marker.

Now I drop the mix at the first marker, create a region from it, and then move the file to the second marker. I cut and fader the file at the first marker if necessary. Then I make a time selection from region (double click on region), and render that time selection. In my case I also loudness normalize and. have a safety limiter on the track.

Concerning FFMPEG commandline executables, the Shared or Static compiles have those commandline programs, so just get the latest compile and you're good to go.

I'm sure Fran will share his commandline ideas with you.
__________________
Using Latch Preview (Video) - Faderport 16 setup for CSI 1.1 , CSI 3.10
Website
"My ego comes pre-shrunk" - Randy Thom
airon is offline   Reply With Quote
Old 01-03-2015, 12:24 PM   #12
Fran Guidry
Human being with feelings
 
Fran Guidry's Avatar
 
Join Date: Dec 2007
Location: Walnut Creek, CA
Posts: 805
Default

Quote:
Originally Posted by aminvanda View Post
Is there a way to use ffmpeg on non-UNIX OS-es?!
The command line looks cool. But, we don't have such a command line in windows7!
...
http://windows.microsoft.com/en-us/w...-prompt-window

Start menu
command

You'll need to either put an ffmpeg executable in the path or drop it into the directory where you're operating.

There's a world of info out there on ffmpeg, as airon says there are a number of graphic front end tools that can be used to drive ffmpeg as well. There's a list of tools here: http://www.videohelp.com/tools/ffmpeg

Fran
Fran Guidry is offline   Reply With Quote
Old 01-03-2015, 02:09 PM   #13
cyrano
Human being with feelings
 
cyrano's Avatar
 
Join Date: Jun 2011
Location: Belgium
Posts: 5,246
Default

Quote:
Originally Posted by airon View Post
For muxing audio tracks...

Some advice on what kind of audio to use in videos...
I haven't seen so much info in any post in a very long time. Thanks for the insights!

I've been trying out youtube for a while and was getting ready to abandon. Your info makes it all a lot clearer now.
cyrano is offline   Reply With Quote
Old 09-21-2018, 12:50 AM   #14
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Bumping this old thread.

As Fran mentioned above, ffmpeg already has such an option. VLC also has a "Keep original video track" option when converting videos. Hopefully this means that it would be easy for Cockos to add this feature.
juliansader is offline   Reply With Quote
Old 09-21-2018, 02:33 AM   #15
poplomop
Human being with feelings
 
Join Date: Jan 2010
Posts: 201
Default

ffmpeg is awesome. awesome wiki page too... https://trac.ffmpeg.org/wiki
poplomop is offline   Reply With Quote
Old 09-21-2018, 10:04 AM   #16
ericgoetz
Human being with feelings
 
Join Date: Mar 2016
Posts: 26
Default ffmpeg

This week I've been using an ffmpeg one-liner to do this is batch, after learning that Reaper won't. It works fine, though I'm very comfortable with the command line. I personally would love to see it in Reaper, but if it's hard, then there are a lot of other features that are much higher priority for me.
ericgoetz is offline   Reply With Quote
Old 04-09-2019, 02:16 PM   #17
akademie
Human being with feelings
 
Join Date: Mar 2007
Posts: 3,978
Default

another big +1
for adding "copy" codec video option
akademie is offline   Reply With Quote
Old 06-03-2020, 07:23 AM   #18
Infrabass
Human being with feelings
 
Join Date: Apr 2014
Posts: 398
Default

It would be awesome!
+1
Infrabass is offline   Reply With Quote
Old 06-03-2020, 08:07 AM   #19
Ideosound
Human being with feelings
 
Ideosound's Avatar
 
Join Date: Oct 2017
Location: U.K
Posts: 542
Default

Quote:
Originally Posted by aminvanda View Post
Is there a way to use ffmpeg on non-UNIX OS-es?!
The command line looks cool. But, we don't have such a command line in windows7!
Sure you do, well better a GUI version - https://www.myffmpeg.com/

I use the mac version - https://www.ffworks.net/

When you add a video to this software it will ask you if you want do a pass-through encode - which will just add the audio (mux) into the video container without re-encoding the video.

Having the ability to do this directly in Reaper would be great however.
Ideosound is offline   Reply With Quote
Old 06-03-2020, 09:27 AM   #20
akademie
Human being with feelings
 
Join Date: Mar 2007
Posts: 3,978
Default

bumpin'
akademie is offline   Reply With Quote
Old 06-01-2022, 11:58 AM   #21
cetopi
Human being with feelings
 
Join Date: Mar 2020
Posts: 20
Default

is this thing possible?
I'm editing video in adobe premiere, but I'd like some audio processing in reaper.
at the moment I have to render video, edit in reaper, render audio, import audio in premiere... render video

:P
cetopi is offline   Reply With Quote
Old 06-02-2022, 12:05 AM   #22
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

I use MKVToolNix for this. Simple and nice. output as MKV.
X-Raym is offline   Reply With Quote
Old 06-02-2022, 12:36 PM   #23
PMS67
Human being with feelings
 
PMS67's Avatar
 
Join Date: Oct 2019
Posts: 13
Default

+1 for this feature!

When rendering a video file, re-encoding is a resource intensive and time consuming task. Worse yet, being the codecs "lossy", it's also detrimental for quality. Offering the possibility to avoid re-encoding the video stream(s) when/where that's technically possible would be really a great feature.

For example, let say you have an already finished video that you (or someone else) have created using a specialized video software, and you will have to add / modify / replace / (re)sync the audio (possibly from different sources). To do so you load the video track in Reaper, then do whatever is needed for the audio. Next you'll have to render the project, producing the video with the new audio.

Problem is, even if you have just a single, unmodified video track, no video FX, and you have carefully set Reaper's video settings to match those of the source video file, when Reaper renders the project the video stream will be unnecessarily decoded and re-encoded. In such situation decoding & re-encoding are not really needed: all you have to do is simply to demux the original video stream and remux it with the new audio stream.

That would drastically reduce the time (and resources) required for rendering, as well as avoid unnecessary deterioration of the video quality (which would remain untouched).

Given that such possibility is not currently supported by Reaper, in such cases what I do instead is to render only the audio and then replace it manually using ffmpeg from the CLI (using "vc:copy" from the original video file while taking the audio from the new audio file created with Reaper). E.g.:

first extract video only:
Code:
ffmpeg -hide_banner -v info -i original_video.mp4 -c copy -an myvideo.silent.mp4
then add the new audio:
Code:
ffmpeg -hide_banner -v info -i myvideo.silent.mp4 -i mynewaudio.flac -c:v copy -c:a copy -strict -2 video.mp4

That works just fine, but it would be really nice (easier, and faster) to have Reaper offering the option to obtain the same result without the need for any additional external processing.

I guess that this should not be too difficult to be implemented. Basically all you have to do is to check whether in the project there's only one (active) video item and no video FX have been added. If that's the case, in the render window add "copy" to the video codec options (of course choosing that option will override any other video setting).

Next step (which may be a bit more complex to implement) could be to allow the same even if there are more than one (active) video item, by checking whether all of the corresponding "source" files are compatible with each other (that is, if they can be cut and joined without decoding and re-encoding using FFMPEG).

Once (if) so done, an even further step could be to allow to do the same (partially...) even if there are different / incompatible active video files. That implies choosing one of the different source files format for the output, then transcoding only the others (basically much like what you do when importing audio files with different sampling rate WRT the one set for the project).

Eventually there could be yet another, final step... way more general (but unfortunately a lot more complex to implement, I'm afraid). That is, to allow the option to avoid re-encoding video where not required even if there are some video FX!

Let me explain the idea. In a typical Reaper audio/video project you will likely have some video processing applied here and there (e.g. video fade-in/out, crossfades and/or other transitions, added titles, etc). But (unless you apply some FX to the whole video), for the most part of the timeline the source video stream(s) would be rendered as-is.

Thus, when rendering, technically it would be possible to decode, process and re-encode the video stream only where that's required. That is, in those places along the timeline where some kind of video processing is actually to be applied. For the remaining parts of the timeline the video stream could be simply copied from the source, without decoding & re-encoding it (as in the previous cases).

Once again (particularly on long videos, such as concerts, etc) this would save plenty of time during rendering, as well as allow for better quality (where there's no processing, which may likely be almost everywhere except for titles and transitions).

Now the latter may be non trivial to implement, and the required effort could be overkill for a software like Reaper where video is definitely not the primary target. Anyway, the ideas are there... just in case... (would need a blushing smiley here)

My 2¢.
__________________
“If you have an apple and I have an apple and we exchange these apples then you and I will still each have one apple. But if you have an idea and I have an idea and we exchange these ideas, then each of us will have two ideas.”

Last edited by PMS67; 06-02-2022 at 12:55 PM.
PMS67 is offline   Reply With Quote
Old 06-07-2022, 09:26 AM   #24
BogdanS
Human being with feelings
 
Join Date: Aug 2013
Location: Ukraine
Posts: 60
Default

Quote:
Originally Posted by HectorC View Post
Hello,

I'm using Reaper for audio post for indie films and I find that it's very time consuming to have to reencode the video stream each time a render has to be done (it also has its issues, for instance I haven't been able to control the kbps video bitrate when exporting H.264 mov files). During the work process I have to send preview videos to the director or producer so it would be great if Reaper had a "export audio to movie" (without reencoding) function the same way Logic Pro has.

Cheers for an otherwise amazing tool!

Hector
+1
BogdanS is offline   Reply With Quote
Old 11-22-2022, 12:45 PM   #25
Lynx_TWO
Human being with feelings
 
Lynx_TWO's Avatar
 
Join Date: Dec 2019
Location: St Petersburg FL
Posts: 996
Default

+1 on this!

I have about 163 mastered tracks I've done, and I want to simply encode the video I'm using for all of them one time, import it into Reaper, then import all the songs as separate tracks, select the song tracks, go to the render dialog, select "Render Media Items", and select MUX in the video dropdown options. Currently, Reaper is encoding the video over and over again for each track which takes forever.
__________________
My mixes from the Cambridge multitracks library
SoundCloud link & Youtube (ThemTube?) link
My preferred adjectives are “Handsome” and “Brilliant”

Last edited by Lynx_TWO; 11-22-2022 at 12:46 PM. Reason: spelling, clarity
Lynx_TWO 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 12:31 PM.


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