Muxing audio to video

Questions and answers on how to get the most out of FFAStrans
Post Reply
rholm
Posts: 27
Joined: Wed Jun 01, 2016 10:23 am

Muxing audio to video

Post 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...
admin
Site Admin
Posts: 1680
Joined: Sat Feb 08, 2014 10:39 pm

Re: Muxing audio to video

Post 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
Attachments
Mov from 2 audio files.7z
(1.51 KiB) Downloaded 641 times
rholm
Posts: 27
Joined: Wed Jun 01, 2016 10:23 am

Re: Muxing audio to video

Post 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
wvku
Posts: 13
Joined: Sat Dec 17, 2016 1:16 pm

Re: Muxing audio to video

Post 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)?
admin
Site Admin
Posts: 1680
Joined: Sat Feb 08, 2014 10:39 pm

Re: Muxing audio to video

Post 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
wvku
Posts: 13
Joined: Sat Dec 17, 2016 1:16 pm

Re: Muxing audio to video

Post by wvku »

Sounds interesting. Do you happen to have a timeframe for the next version? :D
wvku
Posts: 13
Joined: Sat Dec 17, 2016 1:16 pm

Re: Muxing audio to video

Post 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> )
admin
Site Admin
Posts: 1680
Joined: Sat Feb 08, 2014 10:39 pm

Re: Muxing audio to video

Post 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
wvku
Posts: 13
Joined: Sat Dec 17, 2016 1:16 pm

Re: Muxing audio to video

Post by wvku »

Great, thanks Steinar!
Post Reply