Page 1 of 1

Muxing audio to video

Posted: Thu Sep 22, 2016 8:33 pm
by rholm
Hi,

Trying to create a workflow that takes separate wav files and mux them together to a .mov file using a watch folder. For example:

filename.L.wav
filename.R.wav

Should be muxed to

filename.mov

I am running into problem everywhere on this one... Can someone guide me so t least I can get it working with static script? Trying something like
-i filename.L.wav -i filename.R.wav -map 0:1 -map 1:1 -format mov

Thanks for anything that can get e started...

Re: Muxing audio to video

Posted: Fri Sep 23, 2016 9:46 am
by admin
First, create the user variable "right_file" as string then import the attached workflow. You should of course change the in/out folders to suit your need. Study the workflow and it should kick you in the right direction, and maybe even work straight out of the box.
The "Populate variables"-node uses an undocumented feature that will be fully available in 0.8.0. So you must use it at your own "risk"...although the actual "risk" should be negligible ;-)

Now, I don't know if your initial command works or not but please read this regarding generic FFmpeg questions:viewtopic.php?f=5&t=235

-steinar

Re: Muxing audio to video

Posted: Tue Sep 27, 2016 1:44 pm
by rholm
Thanks so much for this, your script worked almost straight out of the box. Have edited the script to support surround files as well.

Robert

Re: Muxing audio to video

Posted: Sat Dec 17, 2016 2:15 pm
by wvku
Related, I want to monitor for filexyz.mov and filexyz.wav and once they are both there, map the video from the MOV and the audio from the WAV. The ffmpeg command would be:

Code: Select all

ffmpeg -y -i filexyz.mov -i filexyz.wav -c copy -map 0:v:0 -map 1:a:0 filexyz_wav.mov
I have the feeling I can use the workflow from this thread for that (and slightly customize it).
But: how do I set up the monitor so it waits until both files have arrived (and stopped growing)?

Re: Muxing audio to video

Posted: Sun Dec 18, 2016 2:30 pm
by admin
With the current version you can only monitor one file to kick of a job. To overcome this now you would need to incorporate a script run from the "Command executor"-node that waits for another before continuing; something like:

:loop
if exist "<full path to file file>" exit
ping 127.0.0.1
goto loop

In the next version there will be a new node for this kind of functionality.

-steinar

Re: Muxing audio to video

Posted: Sun Dec 18, 2016 3:03 pm
by wvku
Sounds interesting. Do you happen to have a timeframe for the next version? :D

Re: Muxing audio to video

Posted: Sun Dec 18, 2016 3:08 pm
by wvku
Can the scripts read / set variables?
This so can check in the script if %s_filename%.wav exists (as opposed to a hardcoded <full path to file> )

Re: Muxing audio to video

Posted: Sun Dec 18, 2016 9:34 pm
by admin
:loop
if exist "%1" exit
ping 127.0.0.1
goto loop


Start the script in the "Command executor" node with f.ex. %comspec% /c "wait.bat "%s_original_path%\%s_original_name%.wav""
You might ned to use the full path to the .bat-file.

The next version will hopefully be out in january.

-steinar

Re: Muxing audio to video

Posted: Mon Dec 19, 2016 6:00 am
by wvku
Great, thanks Steinar!