[FFmpeg-user] using an audio+video filter at the same time

Nicolas George nicolas.george at normalesup.org
Wed Jul 18 10:22:23 CEST 2012


Le decadi 30 messidor, an CCXX, Hans-Christoph Steiner a écrit :
> I'm using ffmpeg 0.10.4  on Linux Mint, built from source since I'm

If you build from source, you should certainly use Git head.

> trying to use our two custom filters af_aredact and vf_redact.

What do they do? If they are useful, submitting them to the devel
mailing-list would be nice, and would probably also reduce the maintenance
burden for you.

> 
> Here's my build info:
>   configuration: --target-os=linux --enable-runtime-cpudetect
> --enable-pic --disable-shared --enable-static --enable-small
> --enable-version3 --enable-gpl --enable-memalign-hack --disable-doc
> --enable-yasm --enable-decoder=mjpeg --enable-decoder=rawvideo
> --enable-encoder=libx264 --enable-muxer=mp4 --enable-demuxer=image2
> --enable-demuxer=mjpeg --enable-demuxer=mp4 --enable-demuxer=mov
> --enable-parser=mjpeg --enable-filter=buffer --enable-filter=buffersink
> --enable-filter=drawbox --enable-filter=overlay --enable-filter=redact
> --enable-protocol=file --enable-hwaccels --enable-ffmpeg

I do not think you need all these --enable since you did not --disable them
before.

> This works for the video filter and leaves the audio untouched:
> ./ffmpeg/ffmpeg -y -i test.mp4 \
>     -filter:v 'redact=ffmpeg/redact_unsort.txt' \
>     -acodec copy \
>     output-test-vf_redact.mp4

Normal.

> This runs audio filter properly, but strips the video entirely:
> ./ffmpeg/ffmpeg \
>     -f lavfi -i 'amovie=test.mp4,aredact=ffmpeg/aredact_unsort.txt' \
>     -b:a 32k -strict experimental \
>     -acodec aac -vcodec copy \
>     -y output-test-af_aredact.mp4

Normal: amovie only reads audio, that is what the "a" means.

Also, note that the aac encoder has very poor quality for bitrate, that is
the reason "-strict experimental" is needed.

> This runs the video filter fine, but strips the audio entirely:
> ./ffmpeg/ffmpeg \
>     -f lavfi -i 'amovie=test.mp4,aredact=ffmpeg/aredact_unsort.txt' \
>     -f lavfi -i 'movie=test.mp4,redact=ffmpeg/redact_unsort.txt' \
>     -acodec aac -b:a 32k -strict experimental \
>     -vcodec libx264 -b:v 1000k -an -f mp4 \
>     -y output-test-redact.mp4

That is what "-an" does, I guess it crept there during some testing and you
forgot to remove it.

Also, you should consider using -filter_complex for that: using movie and
amovie will result in the file being read twice.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20120718/41b8880e/attachment.asc>


More information about the ffmpeg-user mailing list