raspberrypi / picamera2

New libcamera based python library
BSD 2-Clause "Simplified" License
852 stars 181 forks source link

feat(FfmpegOutput): add audio filter support #1039

Open StephenGrable1 opened 4 months ago

StephenGrable1 commented 4 months ago

tldr; this pr enables support for ffmpeg audio filters so it is easy to configure and customize audio recordings.

I do this by adding a new audio_filter parameter to the FfmpegOutput interface which passes it to the -af flag for audio configuration.

ive also added a simple example where i convert a mono audio input into stereo while recording a 10 second video. but you can also do cool things like add delay or add echo

Ps. thanks for the awesome library, i love the pdf documentation and in-depth examples, it has helped me a ton.

davidplowman commented 4 months ago

Hi Stephen, thanks very much for this PR. It all looks good to me, I just notice a couple of complaints from flake8 (which I often find to complain over nothing much, but we seem to be using it...). Would you be able to patch those little things up and then I'd be OK to merge. Thanks again!