Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Complex Filter Graphs #5

Open
federicocarboni opened this issue Oct 22, 2020 · 5 comments
Open

Support Complex Filter Graphs #5

federicocarboni opened this issue Oct 22, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@federicocarboni
Copy link
Owner

federicocarboni commented Oct 22, 2020

Description

Simplify the use of the -filter_complex option.

Related Issues

#4

@federicocarboni federicocarboni self-assigned this Oct 22, 2020
@federicocarboni federicocarboni added the enhancement New feature or request label Oct 22, 2020
@federicocarboni
Copy link
Owner Author

federicocarboni commented Feb 4, 2021

Filter escaping is currently broken in the library
https://ffmpeg.org/ffmpeg-filters.html#Filtergraph-syntax-1

@jallen
Copy link

jallen commented Feb 24, 2021

This is such a great library. Thanks for putting it out there!

Is there are workaround to support -filter_complex right now?

I'm trying to overlay an image over a video.

@federicocarboni
Copy link
Owner Author

federicocarboni commented Feb 24, 2021

@jallen You can still add custom arguments to the output like so

const cmd = ffmpeg();
cmd.input('video.mkv');
cmd.input('image.png');
// you can add extra options to the overlay filter, check ffmpeg's docs ;)
cmd.output('out.mkv').args('-filter_complex', 'overlay');

const proc = await cmd.spawn();
await proc.complete();

Currently, the library doesn't expose any fancy helpers for working with complex filters. The syntax that FFmpeg uses for complex filters can't be easily and meaningfully be represented by JavaScript values. Or at least, it's more difficult than with simple filters. The bare minimum would be exposing some escape functions to work with complex filters. I've even considered using template literals, but it would be a bit more complicated to implement and still not very easy to use. I'm taking a long time because I want to get it right.

If you have any idea or advice I'll appreciate it. Have a nice day.

@jallen
Copy link

jallen commented Feb 24, 2021

The args on the output worked! Thanks again.

@laggingreflex
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants