Old 10-10-2019, 07:38 AM   #1
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 250
Default Video muxing?

Would muxing be a faster opton to embedd audio into videos existing on a session? As a sound dude, i never do edits to the video so basically i just wanna add my rendered audio track to the video i previously imported in the session, which i have been adding music/osunds to.


I think i saw someone posting or maybe asking for a script to do that long time ago. Is there anything? If not, what muxer would you use? I i guess it requires cmd operation (windows here) to be able to get triggered by a lua script

Thanks!
reapero is offline   Reply With Quote
Old 10-10-2019, 06:38 PM   #2
dsyrock
Human being with feelings
 
dsyrock's Avatar
 
Join Date: Sep 2018
Location: China
Posts: 202
Default

You don't need any script.REAPER can render project to Video directly, including all your sound and music. If you don't need the origin audio track inside the video, uncheck the parent send of the video track.
dsyrock is offline   Reply With Quote
Old 10-10-2019, 09:49 PM   #3
ashcat_lt
Human being with feelings
 
Join Date: Dec 2012
Posts: 4,360
Default

Quote:
Originally Posted by dsyrock View Post
You don't need any script.REAPER can render project to Video directly, including all your sound and music. If you don't need the origin audio track inside the video, uncheck the parent send of the video track.
As I understand it, rendering a whole new video via reaper in most formats is like rendering the video and the audio and then essentially zipping the two files up into whatever container you've chosen. I think that "muxing" as the OP is using it means just replacing the audio file in that container without necessarily re-rendering the video part.


Whether that even can be done I think depends on what the final format is, but I don't think Reaper will do it natively either way.
ashcat_lt is offline   Reply With Quote
Old 10-10-2019, 11:35 PM   #4
dsyrock
Human being with feelings
 
dsyrock's Avatar
 
Join Date: Sep 2018
Location: China
Posts: 202
Default

Quote:
Originally Posted by ashcat_lt View Post
I think that "muxing" as the OP is using it means just replacing the audio file in that container without necessarily re-rendering the video part.
Oh I see. Sorry I misunderstanding it. I think it need at least 2 steps to make it. First render an audio file. Second, using ffmpeg or other tools to mux the video and audio together. The second step is scriptable.
dsyrock is offline   Reply With Quote
Old 10-11-2019, 12:11 AM   #5
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 250
Default

And the first one too, using mespotine's awesome ultraschall API

I'll give this a try with ffmpeg. I have to export 4m videos on a daily basis and I am already sick of export times.
reapero is offline   Reply With Quote
Old 10-11-2019, 02:37 AM   #6
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,852
Default

This has been requested many times. Since both VLC and ffmpeg offer "no video transcoding" options, it should be straightforward for REAPER to implement it too.
juliansader is online now   Reply With Quote
Old 10-11-2019, 10:57 AM   #7
akademie
Human being with feelings
 
Join Date: Mar 2007
Posts: 605
Default

Quote:
Originally Posted by juliansader View Post
This has been requested many times. Since both VLC and ffmpeg offer "no video transcoding" options, it should be straightforward for REAPER to implement it too.
Sure. And it needs some bump, so +1 for "no video transcoding" in render option in Reaper :-)
akademie is offline   Reply With Quote
Old 10-14-2019, 06:28 PM   #8
junh1024
Human being with feelings
 
Join Date: Feb 2014
Posts: 127
Default

Just use mkvmerge to mux?
junh1024 is offline   Reply With Quote
Old 10-15-2019, 09:15 AM   #9
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 250
Default

If anyone is interested: this kinda works with ffmpeg(include it in Windows path). Didnt check for errors and stuff so dont send a hitman to my place if it doesnt work please. I am a human being with feelings.

Just render the audio as usual then select the video item in Reaper and then launch the script. Your new muxed video will appear next to your audio file.

The script uses the last modified file in the render folder as the audio file to mux to the video file, so make sure you dont generate extra files in there between the 2 steps
Attached Files
File Type: lua EDU_Mux last rendered audio with selected video item.lua (940 Bytes, 17 views)
reapero is offline   Reply With Quote
Old 10-16-2019, 07:25 AM   #10
akademie
Human being with feelings
 
Join Date: Mar 2007
Posts: 605
Default

Quote:
Originally Posted by reapero View Post
If anyone is interested: this kinda works with ffmpeg(include it in Windows path). Didnt check for errors and stuff so dont send a hitman to my place if it doesnt work please. I am a human being with feelings.

Just render the audio as usual then select the video item in Reaper and then launch the script. Your new muxed video will appear next to your audio file.

The script uses the last modified file in the render folder as the audio file to mux to the video file, so make sure you dont generate extra files in there between the 2 steps
Thanks reapero,
I just tried your script, but it gives this :-(
"...Mux last rendered audio with selected video item.lua:4: attempt to index a nil value"

Last edited by akademie; 10-16-2019 at 07:32 AM.
akademie is offline   Reply With Quote
Old 10-17-2019, 01:42 AM   #11
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 250
Default

Not sure whats happening. The only tricky thing might be your files or paths contain space bars. That could make the script fail. Also, do you have ffmpeg installed and added in windows path?

Can you tell in which line the script is crashing?
reapero is offline   Reply With Quote
Old 10-17-2019, 03:55 AM   #12
jrengmusic
Human being with feelings
 
jrengmusic's Avatar
 
Join Date: Jun 2015
Location: Indonesia Raya
Posts: 564
Default

Quote:
Originally Posted by reapero View Post
If anyone is interested: this kinda works with ffmpeg(include it in Windows path).
Would this script works on mac?
__________________
JRENG! | M E T R I C
jrengmusic is offline   Reply With Quote
Old 10-17-2019, 05:11 AM   #13
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 250
Default

Quote:
Originally Posted by jrengmusic View Post
Would this script works on mac?
Not sure. I dont have a Mac available here.

If you try it out let me know!
reapero is offline   Reply With Quote
Old 10-20-2019, 03:02 AM   #14
akademie
Human being with feelings
 
Join Date: Mar 2007
Posts: 605
Default

Quote:
Originally Posted by reapero View Post
Not sure whats happening. The only tricky thing might be your files or paths contain space bars. That could make the script fail. Also, do you have ffmpeg installed and added in windows path?

Can you tell in which line the script is crashing?
Hi reapero,
I think it is crashing at line nr.4 (which also error displays in error text after scriptname).

I will try with all paths short and no spaces, but I don't think it is a problem. Will report later, thanks.
akademie is offline   Reply With Quote
Old 10-21-2019, 09:48 AM   #15
akademie
Human being with feelings
 
Join Date: Mar 2007
Posts: 605
Default

OK, no spaces in path names but still the same error message :-/

It is on this line of code:
Code:
  for file in io.popen([[dir "]]..folderPath..[[" /B /O:-D /A:-D]]):lines() do

And BTW, I am using 32-bit Reaper (v5.983) in 32-bit Windows 7.
(there were some hints about broken io.popen function in 32 bit..????)

Last edited by akademie; 10-21-2019 at 10:16 AM. Reason: added OS/Reaper version and architecture
akademie is offline   Reply With Quote
Old 10-21-2019, 10:43 AM   #16
akademie
Human being with feelings
 
Join Date: Mar 2007
Posts: 605
Default

Well, it is a shame that that "io.popen" does not work

Because when I modified the script to be able to test it (I removed all the lines of the function to get last modified file etc. and somehow written the folder and filename directly into the script, then it does work.
Only would be fine to know how to set higher audio bitrate of aac, because default is , ehmnmmm, too low/bad quality.

Anyway, ffmpeg does work, now the thing is how to call it from within the reaper parametrically.
akademie is offline   Reply With Quote
Old 10-22-2019, 03:51 AM   #17
reapero
Human being with feelings
 
Join Date: Aug 2011
Posts: 250
Default

Hey akademie,

Yeah didnt try on a 32b OS, but glad you detected the problem. I guess you can try to get the name forthe rendered file with the existing API options, or with Mespotine´s Ueberschall extension for sure.

Regarding the loss of audio quality, get this new version. It generates a MOV file with the audio being WAV file as is (so no quality loss and no extra time spent in coding the audio part).

Cheers
reapero is offline   Reply With Quote
Old 10-22-2019, 06:10 PM   #18
akademie
Human being with feelings
 
Join Date: Mar 2007
Posts: 605
Default

Quote:
Originally Posted by reapero View Post
Hey akademie,

Yeah didnt try on a 32b OS, but glad you detected the problem. I guess you can try to get the name forthe rendered file with the existing API options, or with Mespotine´s Ueberschall extension for sure.

Regarding the loss of audio quality, get this new version. It generates a MOV file with the audio being WAV file as is (so no quality loss and no extra time spent in coding the audio part).

Cheers
I am not a scripting guy but thanks anyway reapero.
akademie is offline   Reply With Quote
Old 10-23-2019, 07:55 AM   #19
mespotine
Human being with feelings
 
mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig, Germany
Posts: 1,690
Default

Quote:
Originally Posted by reapero View Post
I guess you can try to get the name forthe rendered file with the existing API options, or with Mespotine´s Ueberschall extension for sure.
With Reaper's API it's not easy, so better use my functions, as I'm using some tricks to get the filenames.
And if it doesn't work for some reason: send me a bugreport in the Ultraschall-API-thread(link in my signature) and I'll see, what the problem is.
__________________
Ultraschall-API - a Lua-functions-library4Reaper: https://forum.cockos.com/showthread....98#post2067798
Reaper Internals - Developerdocs4Reaper: https://forum.cockos.com/showthread.php?t=207635
mespotine 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 03:25 PM.


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