[ale] audio sox and channels

arxaaron arxaaron at gmail.com
Sat Jun 25 20:33:43 EDT 2011


On 2011/06/25, at 10:53 , Narahari 'n' Savitha wrote:

> Friends:
>
> Some of you are audio video experts.  I want to pick your brains.
>
> I have a video file AustrianAlpsTyrol.mpg that I recorded from PBA  
> (Rick Steves)
>
> It is a good recording with Mono audio.(aka left channel only)
>
> I was able to extract audio from the .mpg file I used ffmpeg.
>
> I need help in the steps
>
> a.  Remove Audio from the original mpg file.
>
> b.  Copy Left channel to right channel of the audio (aka make Mono  
> to Stereo).
> I am told that SOX does this but not sure how.
>
> c. Put the Stereo audio back to the mpg file.
>
> Any inputs on where to find this info is appreciated.
>
> -Narahari

Well, you seem to have accomplished part "a", ideally
in a way that you also now have a video track with no
sound attached and ready for part "c"

For the SOX part of the equation (part "b") , I believe you are
looking for the REMIX option.  Interpreting the options and
examples for remix on the SOX man page as best I can,
I think that this would do what you need:

sox  input.[fmt]  output.[fmt] remix 1v0.5 1v0.5

(where [fmt] is the supported format specifier for the input
or output files. aka AIF or WAV or MP3, etc.)

This will copy a mono, single channel source to a stereo pair
of mono channels at the proper playback rate with volume
adjusted so that the overall level is not increased.  You can
use different values for the volume adjust, like v0.7, if the
dual channel playback seems quiet, but 0.5 is the technical
ideal. If the input and output formats are different, SOX will
do the format conversion at the same time.

I leave part "c" back to your ingenuity, but I believe that
re-multiplexing an audio track with a video track is something
that ffmpeg is able to do.  It might be something it can do
more easily or efficiently if the audio track is in the
appropriate format coming out of SOX and the video
track doesn't have any audio already attached.

In all cases, there is no guarantee that your audio and
video will play back in sync at any given time, but this
is only because, unlike every analog format, NONE of
the digital formats yet produced includes means or a
mechanism for insuring audio and video play in sync. :-P

peace
aaron




More information about the Ale mailing list