[FFmpeg-user] Using amerge to convert dual mono to stereo
Tim Nicholson
tim.nicholson at bbc.co.uk
Fri Jan 13 11:46:31 CET 2012
On 13/01/12 09:27, Tim Nicholson wrote:
> On 13/01/12 07:59, Tim Nicholson wrote:
>> On 12/01/12 18:01, Nicolas George wrote:
>>> Le tridi 23 nivôse, an CCXX, Tim Nicholson a écrit :
>>>> I am trying to use the amerge filter to convert dual mono to stereo,
>>>> but get a warning from amerge:-
>>>>
>>>> "[amerge @ 0x1933a80] Inputs overlap: output layout will be
>>>> meaningless"
>>>>
>>>> and sure enough what I get is stream 1 on both channels of the
>>>> stereo output with no stream 2 at all....
>>>
>>> I[...]
>>
>> Well what I wanted was the first mono stream to be left and the second
>> mono stream to be right. What I got was the first mono stream on both
>> channels.
>>
>
> Running again (with simpler parameters) and looking at the console
> output when I ran it I notice the following:-
>
> [...]
> [amovie @ 0x1791e80] seek_point:0 format_name:(null)
> file_name:glitz4-DV.mov stream_index:1
> [amovie @ 0x17f8fc0] seek_point:0 format_name:(null)
> file_name:glitz4-DV.mov stream_index:2
> [amerge @ 0x17f9a60] Inputs overlap: output layout will be meaningless
>
>
> This is presumably because they are both flagged as "mono" rather than
> "left" and "right"
>
> [abuffersink @ 0x1791e00] auto-inserting filter 'auto-inserted aconvert
> 0' between the filter 'Parsed_amerge_2' and the filter 'out'
> [amerge @ 0x17f9a60] in1:mono + in2:mono -> out:stereo
>
> That is what I would expect. based on the docs saying:-
> "If the channel layouts of the inputs are not disjoint, the output will
> have all the channels of the first input then all the channels of the
> second input, in that order", and what I want
>
> However the next line is:-
>
> [aconvert @ 0x17ef2e0] fmt:s32 cl:stereo planar:0 -> fmt:s16 cl:mono
> planar:0
>
> This last line suggests that aconvert is being invoked automatically and
> turning the stereo back into mono which is not what is wanted. The
> question is why, and how to avoid it?
>
...and to answer my own question, manually add an "aconvert" thus turning:-
ffmpeg -i in.mov -f lavfi -i "
amovie=in.mov:si=0 [a1];
amovie=in.mov:si=1 [a2];
[a1][a2] amerge" -vf " scale=720:576 "
-c:v dvvideo -pix_fmt yuv420p -c:a pcm_s16le -ar 48k -ac 2 out.mov
into:-
ffmpeg -i in.mov -f lavfi -i "
amovie=in.mov:si=0 , aconvert=s16:mono:planar [a1];
amovie=in.mov:si=1 , aconvert=s16:mono:planar [a2];
[a1][a2] amerge" -vf " scale=720:576 "
-c:v dvvideo -pix_fmt yuv420p -c:a pcm_s16le -ar 48k -ac 2 out.mov
--
Tim
http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
More information about the ffmpeg-user
mailing list