[FFmpeg-user] Using -filter_complex instead of lavfi with amerge hangs.

Tim Nicholson nichot20 at yahoo.com
Tue Jun 26 13:42:57 CEST 2012

On 26/06/12 11:54, Nicolas George wrote:
> Le nonidi 9 messidor, an CCXX, Tim Nicholson a écrit :
>> Trying to update some scripts to use the new filter_complex syntax, but
>> am finding it hangs the process....
>> Original version to extract first 2 audio streams from a 4 stream file
>> and convert to a single stereo stream:-
>> ffmpeg -i LTA01631701.mxf -f lavfi -i "
>> amovie=LTA01631701.mxf:si=1 , aconvert=s16:mono:planar [a1];
>> amovie=LTA01631701.mxf:si=2 , aconvert=s16:mono:planar [a2];
>> [a1][a2] amerge" -map 0:0 -map 1:0 \
>> -c:v dvvideo -pix_fmt yuv420p \
>> -c:a pcm_s16le -ar 48k -ac 2 \
>> -t 10 -y ./LTA01631701-V1.mov
>> This works fine however:-
>> ffmpeg -i LTA01631701.mxf -map 0:0 -filter_complex "
>> amovie=LTA01631701.mxf:si=1, aconvert=s16:mono:planar [a1];
>> amovie=LTA01631701.mxf:si=2, aconvert=s16:mono:planar [a2];
>> [a1] [a2] amerge" \
>> -c:v dvvideo -pix_fmt yuv420p \
>> -c:a pcm_s16le -ar 48k -ac 2 -t 10 -y ./LTA01631701-4-1.mov
>> Hangs after producing the followng console output and has to be killed
>> pressing q or <CTL> q or anything less than SIGKILL is ignored.
> -filter_complex is not just an alias for -f lavfi. It has inputs and

I understand that.

> outputs. Yours has no inputs. Since ffmpeg's streams are currently

I do not understand that, as I thought that

"amovie=LTA01631701.mxf:si=1, aconvert=s16:mono:planar [a1]"

defined an input and assigned it to pad a1. Having extra sources in a
filtergraph is not uncommon, take the overlay filter for example, so
expecting the use of amovie to define a source is not unreasonable in
this circumstance, although possibly not the best way to do it.

> input-driven (this needs to be fixed, but this is not urgent), your filter
> graph does not fit its scheduling.
> Rule of thumb: do not use (a)movie with -filter_complex, use the ffmpeg -i
> option instead (and second rule of thumb: do not use the same inputs several
> times).

Just to clarify, with -vf it usual to add extra inputs (whether audio or
video) using (a)movie, but with -filter_complex you just use multiple -i
options and then pick the streams with the usual [file:stream] syntax?

> I need to add examples for amerge with -filter_complex. The syntax should be
> something like that:
> -i LTA01631701.mxf -filter_complex '[0.1] [0.2] amerge [audio]' \
>   -map 0.0 -map '[audio]'

something like, but use ":" not "." in the mappings...;)

Would using "join" with the mapping option be more appropriate for this

I think more examples would be handy, happy to help once I am sure I
have my head round it. I thought you would know the answer though,
thanks for the quick response.


More information about the ffmpeg-user mailing list