-
Notifications
You must be signed in to change notification settings - Fork 126
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
general uniforms support #21
base: master
Are you sure you want to change the base?
Conversation
need more test |
This looks awesome @turengege! Will have some time to view more in-depth this weekend 💯 Thanks!! |
Int and float vectors are supported now: ffmpeg -i media/0.mp4 -i media/1.mp4 -filter_complex "gltransition=duration=2:offset=1.5:source=fadecolor.glsl:uniforms='color=vec3(0.0,0.5,0.0)',format=yuv420p" -y out.mp4 I don't have much C Coding experience. Hope for code reviewing and suggestions. @transitive-bullshit |
if(sa.len >0){ | ||
for(int i = 0;i<sa.len;i+=2){ | ||
GLint location = glGetUniformLocation(c->program, sa.strings[i]); | ||
if (location >= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's throw an error if this is not the case; better to be strict with potential errors here rather than ignoring it silently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an err message can't get location of uniform ..
if location is not valid, but I agree that throwing an error is the right choice.
@@ -98,6 +99,7 @@ typedef struct { | |||
double duration; | |||
double offset; | |||
char *source; | |||
char *uniforms; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these uniforms should be freed in uninit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think FFmpeg will do this cleaning up. I am not sure, will check it out later.
Added a few quick comments -- overall, this looks really great! |
int cursor_start = 0; | ||
int cursor_end= 0; | ||
int cnt_seg = 1; | ||
auto len = (int) (strlen(str_query)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's opt for strnlen_s
here, as it's safer, and str_query
may be NULL
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will require users to use C11 if we choose strnlen_s
, because FFmpeg seems to be built on C99 by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
str_query
may be NULL
awesome! why not merge it ? |
Hello, which ffmpeg version were you using? |
+1 |
I think I use the latest version at that time. |
@transitive-bullshit @xinghuolei What's missing here to merge? I am willing to step in and help finish this one |
Hi
This feature is unfinished but I think it should help.
Usage:
Limits:
only
int
andfloat
are supported