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

[fix] filter: add args modify #2304

Merged
merged 4 commits into from
Nov 27, 2024

Conversation

fastZhe
Copy link
Contributor

@fastZhe fastZhe commented Nov 25, 2024

Recently, I created an overlay filter and found that the size of each input and pixelFormat cannot be customized, resulting in incorrect output video. Therefore, I added the following code, which can be modified after the original configuration is generated.

@saudet
Copy link
Member

saudet commented Nov 25, 2024

We can already change the value of each of those arguments. Could you give a concrete example of why this is needed?

@saudet
Copy link
Member

saudet commented Nov 25, 2024

Ah, I see, you need to set different inputs/outputs differently. What about making imageWidth, imageHeight, and pixelFormat into array properties instead?

@fastZhe
Copy link
Contributor Author

fastZhe commented Nov 25, 2024

Yes, I need to add a foreground image to the background video, but I found that the size of the foreground image is the same as the original video when outputting it.

outputs

@fastZhe
Copy link
Contributor Author

fastZhe commented Nov 25, 2024

Ah, I see, you need to set different inputs/outputs differently. What about making imageWidth, imageHeight, and pixelFormat into array properties instead?

I didn't quite understand, do you mean you need to replace the current object array with a pojo array? Or do you need to modify the imageWidth, imageHeight, and pixelFormat properties in the filter to array?

@saudet
Copy link
Member

saudet commented Nov 26, 2024

I was thinking of modifying existing properties, but this gets ugly. I think we could simply add a couple of new properties to FrameFilter.java like:

String[] videoFilterArgs = null;
String[] audioFilterArgs = null;

I don't think we need callbacks?

@fastZhe
Copy link
Contributor Author

fastZhe commented Nov 26, 2024

I was thinking of modifying existing properties, but this gets ugly. I think we could simply add a couple of new properties to FrameFilter.java like:

String[] videoFilterArgs = null;
String[] audioFilterArgs = null;

I don't think we need callbacks?

Okay, I got it. Before starting, if these two parameters are set, all input arg strings for video or audio are allowed to be customized by the user. Otherwise, the previous template will be used for filling. Do I understand correctly? If there is no problem, I will modify it according to this.

@fastZhe
Copy link
Contributor Author

fastZhe commented Nov 26, 2024

@saudet Thanks for the suggestion. I have already pushed a version and implemented it using properties.Please help me take a look, thank you.

@saudet
Copy link
Member

saudet commented Nov 26, 2024

Thanks! That looks alright, but is it OK for your needs?

@fastZhe
Copy link
Contributor Author

fastZhe commented Nov 27, 2024

Thanks! That looks alright, but is it OK for your needs?

Yes, it meets my needs very well.

@saudet saudet merged commit 2b64c33 into bytedeco:master Nov 27, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants