Hi all,
I am new on videohelp, and have a problem to ask to you.
Is there is a batch program to swap audio between Left and Right Channel for an AVI file?
Cause in all my AVI file, 5% of those files have the voice channel at the left side. They are AVI Karaoke files.
And it will be more convenient for me if I could have all of my AVI Karaoke files with the voice channel affected at the Right Channel.
A Batch programm will really help me, cause I have an huge files in that case.
Thank you in advance for all your helps.
Noon.
+ Reply to Thread
Results 1 to 30 of 34
-
-
I doubt you will find ONE software that does this.
But you could use ffmpeg(demux and multiplex) and sox(swap channels) and write a custom batch file for this. They are command lines tools.
Something like
Code:ffmpeg -i video.avi -acodec copy audio.mp3 sox audio.mp3 audioswap.mp3 swap 2 1 ffmpeg -i video.avi -i audioswap.mp3 -vcodec copy -acodec copy newvideo.avi
-
Thank Baldrick. But I am not so good to write those code.
Are those line there usable? or there is just a sample from you?
I have seen the place to download there are static version, dev version which one I have to use, there are also 32 bits and 64 bits...
I am a novice in high level computerize... -
I guess it will work. If now the audio is in mp3 format. I have never tried the sox swap command though.
You can try it. Put the ffmpeg.exe and sox.exe in for example c:\temp together with a video.avi file. Open a command prompt. Type cd c:\temp . Then copy and paste each command line and see what it says. -
Try the 32 bit static versions for windows. It will work fine in both 32bit and 64bit systems.
-
After a first test I have an error for the second command line as below
1. ffmpeg -i video.avi -acodec copy audio.mp3
executed
OK
2. sox audio.mp3 audioswap.mp3 swap 2 1
Executed
Error The Application was unable to start correctly (0xc000007b)
3. ffmpeg -i video.avi -i audioswap.mp3 -vcodec copy -acodec copy newvideo.avi
Not yet test -
You can just copy all the files in the version above to the temp folder.
-
That is just a warning and it should have made a newaudio.mp3. It can take some minutes.
-
In the 2. case line code I use Remix instead of SWAP It's works
for MP3 new file is works, the voice is on the right channel (on the MP3 files)
But the 3. case line command, after executed, the sound come back to the left side again. -
I see. It doesn't use the new audio. It should look like
Code:ffmpeg -i video.avi -i newaudio.mp3 -map 0 -map 1 -codec copy newvideo.avi
-
the swap MP3 filename is audioswap.mp3
I have change it in your new command line, after executed.
I have the same video from the beginning (voice on the left channel).
But my audioswap.mp3 file play right (voice on the right channel)... we are nearly succeed...
I think I know the problem, cause I hear the VOICE on boths channel, Left and Right.
So the command line copy the newaudio.mp3 to the video.avi of the beginning.
that already have VOICE on left channel.
So we have VOICE on both channel with a delay created by the process.
But I don't know who to write the command line for that.
Perhaps it might have for command line.
cause it is needed a video.avi without any sound.
then mix with the newaudio.mp3 that have the right sound that I need.Last edited by noon; 7th Mar 2013 at 05:20.
-
Hmm...they have changed it a bit. Try
Code:ffmpeg -i audioswap.mp3 -i video.avi -map 0.0 -map 1.0 -acodec copy -vcodec copy newvideo.avi
-
I have tried there is a message error "Invalide stream speficier: .0.
But Baldrick, how about my idea to have a command line to create a video_unsound.avi file then mix with the audioswap.mp3 file that is what I really need? -
Yes, GREAAAAAAAAAAAAT!
It works Baldrick.
I can have it with all your helps. Thank you soooooo MUCH!
It is the first time that I am member of videohelp, you are so kind and helpfull to me. Thank you, thank you. -
You can now make a .bat batch for that to fix all avi files. I can help write it also.
Last edited by Baldrick; 7th Mar 2013 at 05:50.
-
Thank you in advance for that.
I have just send you a private message for a Web Media player, just in case... -
Code:
FOR %%f IN (*.avi) DO ( ffmpeg -i %%~nf.avi -acodec copy %%~nf.mp3 ffmpeg -i %%~nf.avi -vcodec copy -an %%~nf_unsound.avi sox %%~nf.mp3 %%~nf-swap.mp3 swap 2 1 ffmpeg -i %%~nf_unsound.avi -i %%~nf-swap.mp3 -vcodec copy -acodec copy c:\temp\newfolder\%%~nf-new.avi )
Make a file called swap.bat in the c:\temp folder and open in notepad. Copy and paste the code above. Save.
Run the swap.bat file from the command line and you will see if you get any errors.
If it creates a video-new.avi in the folder it works.
Copy some more avi files to the c:\temp folder and test run the swap.bat. -
for 3rd line I replace SWAP by REMIX, it works (sox %%~nf.mp3 %%~nf-swap.mp3 remix 2 1)
There is an error on 4th Line (final step). But I don't know where?
Here is the one that work by manual for mix video and audio swapped.
ffmpeg -i video_unsound.avi -i audioswap.mp3 -vcodec copy -acodec copy newvideo.aviLast edited by noon; 7th Mar 2013 at 07:53.
-
Yes now it works.
The mistake from my side was : new folder (per default windows create it with a space).
You are a Master with the bath code Baldrick
Now I will try with few avi in one time -
Well Mr.Baldrick, you have just created for me a bath to swap Audio for AVI for me. It works good.
I will save time in front of my computer.
Thank you so much...
Wishing helping all of those people like me always.
Wishing a good luck and a good heath for such kindness you give to other people like me.
Have a nice day.
Noon. -
Great!
If anyone else finds this thread it might be good to know that you could also swap channels directly when you play, in for example vlc media player, audio->audio channels->reverse stereo. But you have do it manually for each file then.
Similar Threads
-
Premiere: Duplicate left audio channel to the right channel?
By ash_melb in forum EditingReplies: 7Last Post: 21st Oct 2015, 11:32 -
Swap Left/Right images in a 3D SBS mkv
By Ziad87 in forum Video ConversionReplies: 5Last Post: 7th Mar 2013, 12:37 -
Force left audio channel to both speakers
By encodingmonkey in forum EditingReplies: 15Last Post: 30th Nov 2012, 17:56 -
AC3 File: Audio only on left channel
By koberulz in forum AudioReplies: 10Last Post: 25th May 2011, 12:07 -
Audio Stream Swap in WMV video files
By a1s2d3f4 in forum Newbie / General discussionsReplies: 17Last Post: 15th Sep 2008, 10:57