-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add ffmpeg audio filter support enable -af flag pass through
Signed-off-by: Stephen Grable <[email protected]>
- Loading branch information
1 parent
a89eb1d
commit 1a7f0dd
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
## Unreleased (on "next" branch) | ||
|
||
### Added | ||
* FfmpegOutput support custom audio filter | ||
|
||
### Changed | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/python3 | ||
import time | ||
|
||
from picamera2 import Picamera2 | ||
from picamera2.encoders import H264Encoder | ||
from picamera2.outputs import FfmpegOutput | ||
|
||
picam2 = Picamera2() | ||
video_config = picam2.create_video_configuration() | ||
picam2.configure(video_config) | ||
encoder = H264Encoder(10000000) | ||
|
||
# audio filter takes the left channel and copies it to the right channel | ||
# below example copies c0 (left channel) to c1 (right channel) - convert mono to stereo | ||
|
||
# or add audio delay on left channel like this: audio_filter="pan=stereo|adelay=1500|0" | ||
# source for more examples: https://ffmpeg.org/ffmpeg-filters.html#Examples-2 | ||
output = FfmpegOutput( | ||
'ffmpeg_audio_filter_test.mp4', | ||
audio=True, | ||
audio_filter="pan=stereo|c0=c0|c1=c0" | ||
) | ||
|
||
picam2.start_recording(encoder, output) | ||
time.sleep(10) | ||
picam2.stop_recording() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters