FORUMS: list search recent posts

Mix 2 Mono Audio Stream in 1 Stereo Stream

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
lormeau bertrand
Mix 2 Mono Audio Stream in 1 Stereo Stream
on Apr 15, 2010 at 2:30:03 pm

Hi,

I search to convert GXF file to DVPRO50.

I use this command :

ffmpeg -i test.gxf -deinterlace -target dv50 testdv50.dv

I obtain this result:

Input #0, gxf, from 'test.gxf':
Duration: 00:00:47.36, start: 4770.000000, bitrate: 21225 kb/s
Stream #0.0: Video: mpeg2video, yuv422p, 720x576 [PAR 16:15 DAR 4:3], 18000
kb/s, 50 fps, 25 tbr, 50 tbn, 50 tbc
Stream #0.1: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
Stream #0.2: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
Stream #0.3: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
Stream #0.4: Audio: pcm_s16le, 48000 Hz, 1 channels, s16, 768 kb/s
Stream #0.5: Data: 0x0000
Assuming PAL for target.
Output #0, dv, to 'testdv50.dv':
Metadata:
encoder : Lavf52.54.0
Stream #0.0: Video: dvvideo, yuv422p, 720x576 [PAR 16:15 DAR 4:3], q=2-31, 2
00 kb/s, 90k tbn, 25 tbc
Stream #0.1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Press [q] to stop encoding


It is possible to obtain this result ?

Output #0, dv, to 'testdv50.dv':
Metadata:
encoder : Lavf52.54.0
Stream #0.0: Video: dvvideo, yuv422p, 720x576 [PAR 16:15 DAR 4:3], q=2-31, 2
00 kb/s, 90k tbn, 25 tbc
Stream #0.1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1 Left
Stream #0.2 -> #0.1 right

Press [q] to stop encoding



It's possible to add in sigle audio stream the stream #0.1 ( on the left ) and the stream #0.2 ( on the right )?

thank you for your help !!


BobTheChinese



Return to posts index

Michael Rampe
Re: Mix 2 Mono Audio Stream in 1 Stereo Stream
on Apr 16, 2010 at 9:29:28 am

Merging two mono streams into a left/right panned single stream....

short answer is: not yet;-)

I found this task on the google summer of code wiki related to ffmpeg:

Implement negotiation of sample format and number of channels analogously to the libavfilter colorspace negotiation
* Does this imply a channel mixing filter? This would be the second most desirable basic audio filter in my opinion.

http://wiki.multimedia.cx/index.php?title=FFmpeg_Summer_Of_Code_2010

As this states, this is a work in progress and a very much needed feature.

My question for you is: what are you trying to do with the output file?

If you intend to edit it in a NLE later, you CAN map two streams to two new streams. They will both be mono but will be separate tracks which will work in an NLE. I recreated a 4channel movie to test with similar in stream layout to your .gxf file. I then used this command line to map audio channel 1 and 2 to two new streams in the output file.

ffmpeg -i input.mov -map 0:0 -map 0:1 -map 0:2 -vcodec dvvideo -s 720x576 -aspect 5:4 -acodec copy output.mov -acodec copy -newaudio

This came into my NLE (Final Cut Pro) as two center panned mono tracks. It is then simple to pan them left and right respectively in the NLE. NOTE: I could not get it working with the .dv wrappper or -target dv50 settings which is why I set the codec/size/aspect myself.

Finally, from the research I have done, mencoder (another free command line tool) DOES have a pan function so you may want to investigate that.

Michael


"half-way to world domination A.K.A. the belligerent blue bike shed"


Return to posts index

lormeau bertrand
Re: Mix 2 Mono Audio Stream in 1 Stereo Stream
on Apr 19, 2010 at 11:18:12 am

Mickael,

Thank you for your reply.

I'm looking to convert GXF files in TS H264/AAC.

For this I use Carbon Coder which has a channel mixing, but i have problems with the de-interlacing filter.

So I'm looking for another way to get a better result.

That's why I wanted to convert GXF files in DV50 files for testing the ffmpeg de-interlacing filter. ( The result is not better :-( )

It is at this moment that I discovered that ffmpeg did not allow to select multiple single stream for make a stereo stream.

FFmpeg take the first stream mono and duplicate it in a stereo stream.

I'll try mencoder, and the yadif filter.

I hope he will accept GXF files in source.

I tried your command line, but it does not work with the GXF and dv.

Respectfully

BobTheChinese



Return to posts index


Alex Nesterov
Re: Mix 2 Mono Audio Stream in 1 Stereo Stream
on Jan 12, 2012 at 10:33:54 pm

Hi Michael!
Sorry I'm not an ffmpeg expert and not intend to be.
Everything works perfectly- i just want to send mic mono input to both channels out. Like normally programs do on default.
It's crazy: in my stupid project having 3 not so bad computers -including mac and windows- only ffmpeg does the job.
Here is the command which works great- I just don't know how.

ffmpeg -f oss -i /dev/audio3 -f video4linux2 -s 320x240 -i /dev/video1 out.mpg

Thank You in advance!
I simply don't know how to write the script. Sorry.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]