Two mono audio streams to one stereo audio stream

Questions and answers on how to get the most out of FFAStrans
vijm1972
Posts: 128
Joined: Fri Apr 24, 2015 7:35 am

Two mono audio streams to one stereo audio stream

Post by vijm1972 »

Hi,

I have two audio streams (Left and Right), I wanted to convert them to one track stereo. Please suggest how can I monitor two audio files in FFAStarns?

Using below FFMPEG command I am able to convert that to require output.

ffmpegx64.exe -i D:\DPP\TEST_1.wav -i D:\DPP\TEST_2.wav -acodec pcm_s24le -filter_complex "[0:a][1:a]amerge=inputs=2[aout]" -map "[aout]" D:\Output\Test_1.wav

Thanks,
Vijay
admin
Site Admin
Posts: 1658
Joined: Sat Feb 08, 2014 10:39 pm

Re: Two mono audio streams to one stereo audio stream

Post by admin »

I Vijay,

This task is easier in the new versions (0.8.x) so assume you have updated.

First, just monitor for *1.wav files.
Then add a "Populate variables" and create a user variable, f.ex. %s_my_user_var%.
Set the new user variable to $trimr("%s_original_full%", 5). This will strip the last 5 characters from the right.
Then you use your new user variables in the second line and set it to %s_my_user_var%2.wav. This will add "2.wav" to your user variable you got from the stripped path in the first line.
Now your user variable will contain the full path to your second audio file and so you use this as your second input to your custom ffmpeg node:
-i "%s_my_user_var%" -acodec pcm_s24le -filter_complex "[0:a][1:a]amerge=inputs=2[aout]" -map "[aout]"

Hope this helps :-)

-steinar
vijm1972
Posts: 128
Joined: Fri Apr 24, 2015 7:35 am

Re: Two mono audio streams to one stereo audio stream

Post by vijm1972 »

Hi Steinar,

Thanks for your help, I have downloaded 0.8.x version and created the workflow as you suggested. It's working perfectly, I just wanted to know if it is possible to rename the target file name without having track allocation number.

If my source files are
1) Test_L.wav
2) Test_R.wav

I am getting output
Test_L.wav

Is it possible to rename to
Test.wav

Please suggest.

Thanks,
Vijay
admin
Site Admin
Posts: 1658
Joined: Sat Feb 08, 2014 10:39 pm

Re: Two mono audio streams to one stereo audio stream

Post by admin »

You can construct a new name by f.ex. setting %s_my_user_var% to $trimr("%s_original_name%", 2). %s_my_user_var% is now set to "Test". *_L" is stripped away.

On the destination folder node check the "Drop original name" option and insert your variable %s_my_user_var% in the "Prefix" field. Now your output should be "Test.wav" if you input file was "Test_L.wav".

-steinar
vijm1972
Posts: 128
Joined: Fri Apr 24, 2015 7:35 am

Re: Two mono audio streams to one stereo audio stream

Post by vijm1972 »

Hello Steinar,

Now I am able to rename the destination file with require file name. I have also added %s_my_user_var% to destination folder path to create the folder name and create the destination file in that folder.
I am trying to move source files to another folder, I have added Command executor with below command.
%comspec% /c "move /y "%original_full%" "D:\DPP\Original_Source""
But it's moving only Test_L.wav to another folder, please suggest how can I move both the source files (Test_L.wav & Test_R.wav) to another location.

Thanks in advance.

Thanks,
Vijay
admin
Site Admin
Posts: 1658
Joined: Sat Feb 08, 2014 10:39 pm

Re: Two mono audio streams to one stereo audio stream

Post by admin »

Try and contruct the full path to the files you want to process in the command executor node by using variables, as you already have done. If you have set %s_my_user_var% to "Test" then:

%comspec% /c "move /y "%s_original_path%\%s_my_user_var%_L.wav" "D:\DPP\Original_Source""
%comspec% /c "move /y "%s_original_path%\%s_my_user_var%_R.wav" "D:\DPP\Original_Source""



-steinar
vijm1972
Posts: 128
Joined: Fri Apr 24, 2015 7:35 am

Re: Two mono audio streams to one stereo audio stream

Post by vijm1972 »

Hi Steinar,

I am getting below error while using suggested commands, I am getting output but source files not moving.
Error.JPG
Error.JPG (18.16 KiB) Viewed 14295 times
I have also attached workflow for your reference, kindly check and suggest if any changes require.
Workflow_Mono_to_Stereo.rar
(1.56 KiB) Downloaded 566 times
Thanks,
Vijay
admin
Site Admin
Posts: 1658
Joined: Sat Feb 08, 2014 10:39 pm

Re: Two mono audio streams to one stereo audio stream

Post by admin »

Oh, I should have seen this coming, sorry. The two lines must be set up as two different nodes, OR you can see if this works in ONE node:

%comspec% /c "move /y "%s_original_path%\%s_my_user_var%_L.wav" "D:\DPP\Original_Source" & move /y "%s_original_path%\%s_my_user_var%_R.wav" "D:\DPP\Original_Source""

The "Command executor" does only one execution, thus the input field in the node is seen as one continuous command and must be treated as such.

-steinar
vijm1972
Posts: 128
Joined: Fri Apr 24, 2015 7:35 am

Re: Two mono audio streams to one stereo audio stream

Post by vijm1972 »

I have tried both option it's showing same error.

Thanks,
Vijay
vijm1972
Posts: 128
Joined: Fri Apr 24, 2015 7:35 am

Re: Two mono audio streams to one stereo audio stream

Post by vijm1972 »

Also wanted to know if in the same workflow can I monitor for Folders?

Thanks,
Vijay
Post Reply