Support filters without input
See original GitHub issueI have a video file (with audio) and I want to prepend a few seconds of still background (i.e. black) image without sound. I’m trying to do this with ffmpeg-python
, but no success yet.
First thing I stumbled upon is the missing support for the color input file (see my remark here), however, I can work around that by creating a black PNG image and loading that in, e.g. using ffmpeg.input("black.png", t=10)
.
However, now I need to concatenate the background video with the original video, but I can’t because the background video doesn’t have audio, and concat requires a matching number of audio/video streams. So then I found the aevalsrc
filter in ffmpeg, which generates a (silent) audio stream, but I can’t make it work with ffmpeg-python
, since it is a filter that doesn’t require input. E.g. this doesn’t work:
stream = ffmpeg.input("black.png", t=10)
stream.filter("aevalsrc", exprs="0", duration=10)
Is there any way to achieve such a thing?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top GitHub Comments
Any updates on this?
For those also wanting this feature, I have worked around it by creating a simple black .png file and an small .mp3 file with no sound. Then I load them in with
ffmpeg.input(filename, ...)
and a certain duration. Of course a bit hacky, but this way at least it is possible withffmpeg-python
.