Page 1 of 1

FFmpeg: Filtering and streamcopy cannot be used together.

PostPosted: Wed Jun 19, 2019 4:23 pm
by peter_b
[PROBLEM]
I was trying to generate framemd5 for video and audio in one step:

Code: Select all
$ ffmpeg -i bars.mov -map 0 -c copy -flags +ildct+ilme -field_order bb rewrap.mkv \
-an -f framemd5 bars.video.framemd5 \
-vn -c:a pcm_s24le -filter_complex "asetnsamples=n=48000" -f framemd5 bars.audio.framemd5


But the part for audio (that included "-filter_complex") triggers this error message:
Streamcopy requested for output stream 0:0, which is fed from a complex filtergraph. Filtering and streamcopy cannot be used together.


This error message suggests that FFmpeg thinks "filter_complex" is to be applied to video too (stream 0:0), but we only want to apply it to audio.
How to tell FFmpeg that we don't touch video, but only want to group the audio samples for frameMD5 hashing them?


[SOLUTION]
It seems that "-filter_complex" for audio can be replaced by "-af" (audio filter) to make this work:

Code: Select all
$ ffmpeg -i bars.mov -map 0 -c copy -flags +ildct+ilme -field_order bb rewrap.mkv \
-an -f framemd5 bars.video.framemd5 \
-vn -c:a pcm_s24le -af "asetnsamples=n=48000" -f framemd5 bars.audio.framemd5


Works! :D