Skip to content

Support filters without input #111

Open
@CNugteren

Description

@CNugteren

I 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?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions