transitive-bullshit / ffmpeg-gl-transition

FFmpeg filter for applying GLSL transitions between video streams.
647 stars 125 forks source link

error: ‘AVFilter’ {aka ‘struct AVFilter’} has no member named ‘query_formats’ #75

Open 4n70w4 opened 1 year ago

4n70w4 commented 1 year ago
libavfilter/vf_gltransition.c: At top level:
libavfilter/vf_gltransition.c:572:4: error: ‘AVFilter’ {aka ‘struct AVFilter’} has no member named ‘query_formats’
  572 |   .query_formats = query_formats,
      |    ^~~~~~~~~~~~~
make
CC      libavfilter/vf_gltransition.o
libavfilter/vf_gltransition.c: In function ‘build_shader’:
libavfilter/vf_gltransition.c:150:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statemen
]
  150 |   GLint status;
      |   ^~~~~
libavfilter/vf_gltransition.c: In function ‘build_program’:
libavfilter/vf_gltransition.c:166:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statemen
]
  166 |   char *source = NULL;
      |   ^~~~
libavfilter/vf_gltransition.c:177:5: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statemen
]
  177 |     unsigned long fsize = ftell(f);
      |     ^~~~~~~~
libavfilter/vf_gltransition.c:187:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statemen
]
  187 |   const char *transition_source = source ? source : f_default_transition_source;
      |   ^~~~~
libavfilter/vf_gltransition.c:213:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statemen
]
  213 |   GLint status;
      |   ^~~~~
libavfilter/vf_gltransition.c: In function ‘setup_vbo’:
libavfilter/vf_gltransition.c:224:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statemen
]
  224 |   GLint loc = glGetAttribLocation(c->program, "position");
      |   ^~~~~
libavfilter/vf_gltransition.c: In function ‘setup_gl’:
libavfilter/vf_gltransition.c:351:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statemen
]
  351 |   int ret;
      |   ^~~
libavfilter/vf_gltransition.c: In function ‘apply_transition’:
libavfilter/vf_gltransition.c:390:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statemen
]
  390 |   const float ts = ((fs->pts - c->first_pts) / (float)fs->time_base.den) - c->offset;
      |   ^~~~~
libavfilter/vf_gltransition.c: At top level:
libavfilter/vf_gltransition.c:572:4: error: ‘AVFilter’ {aka ‘struct AVFilter’} has no member named ‘query_formats’
  572 |   .query_formats = query_formats,
      |    ^~~~~~~~~~~~~
libavfilter/vf_gltransition.c:565:31: warning: missing braces around initializer [-Wmissing-braces]
  565 | AVFilter ff_vf_gltransition = {
      |                               ^
......
  572 |   .query_formats = query_formats,
      |                    {            }
libavfilter/vf_gltransition.c: In function ‘build_program’:
libavfilter/vf_gltransition.c:181:5: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
  181 |     fread(source, fsize, 1, f);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
make: *** [ffbuild/common.mak:81: libavfilter/vf_gltransition.o] Error 1
4n70w4 commented 1 year ago

The same if build via docker:

#15 30.83 libavfilter/vf_gltransition.c: At top level:
#15 30.97 libavfilter/vf_gltransition.c:572:3: error: unknown field 'query_formats' specified in initializer
#15 30.97    .query_formats = query_formats,
#15 30.97    ^
#15 30.99 libavfilter/vf_gltransition.c:565:31: warning: missing braces around initializer [-Wmissing-braces]
#15 30.99  AVFilter ff_vf_gltransition = {
#15 30.99                                ^
#15 30.99 libavfilter/vf_gltransition.c:565:31: note: (near initialization for 'ff_vf_gltransition')
#15 31.62 CC    libavfilter/vf_v360.o
#15 31.62 CC    libavfilter/vf_varblur.o
#15 31.62 CC    libavfilter/vf_vfrdet.o
#15 31.62 CC    libavfilter/vf_vibrance.o
#15 31.64 CC    libavfilter/vf_vaguedenoiser.o
#15 31.66 CC    libavfilter/vf_vectorscope.o
#15 31.68 CC    libavfilter/vf_vflip.o
#15 31.71 CC    libavfilter/vf_vif.o
#15 31.73 CC    libavfilter/vf_vignette.o
#15 31.83 CC    libavfilter/vf_vmafmotion.o
#15 31.85 CC    libavfilter/vf_w3fdif.o
#15 31.85 ffbuild/common.mak:81: recipe for target 'libavfilter/vf_gltransition.o' failed
#15 31.90 make: *** [libavfilter/vf_gltransition.o] Error 1
#15 31.90 make: *** Waiting for unfinished jobs....
------
executor failed running [/bin/sh -c (cd ffmpeg; make -j)]: exit code: 2
aus70 commented 1 year ago

it has to do with this commit: https://github.com/FFmpeg/FFmpeg/commit/b4f52019675159f303df05490ac5cf9972e279b2

Replacing query_formats with FILTER_QUERY_FUNC(query_formats) in vf_gltransition.c solves the issue.

aus70 commented 1 year ago

I could compile the binary, but it does not work properly: see issue #72

aus70 commented 1 year ago

The issue I found (likely - but not for sure - the same as #72) is related to https://github.com/FFmpeg/FFmpeg/commit/8be701d9f7f77ff2282cc7fe6e0791ca5419de70

Solved by removing { NULL } in static const AVFilterPad gltransition_outputs[] and static const AVFilterPad gltransition_inputs[] in vf_gltransition.c

TTV-DJMoleHill commented 1 year ago

The issue I found (likely - but not for sure - the same as #72) is related to FFmpeg/FFmpeg@8be701d

Solved by removing { NULL } in static const AVFilterPad gltransition_outputs[] and static const AVFilterPad gltransition_inputs[] in vf_gltransition.c

Hi. I am hitting this same issue. I implemented your suggested fix (https://github.com/transitive-bullshit/ffmpeg-gl-transition/issues/75#issuecomment-1360502410 and https://github.com/transitive-bullshit/ffmpeg-gl-transition/issues/75#issuecomment-1360617478). Doing so resulted in a successful build, as well as a successful ./ffmpeg -v 0 -filters | grep gltransition, however the resulting video from ./ffmpeg -i media/0.mp4 -i media/1.mp4 -filter_complex gltransition -y out.mp4 contains only the first video with no transition at all.

I was able to work around this issue by checking out commit d53d48c7993fe2e9ffcc4a638ebd2f4c5273c144 in my ffmpeg checkout (1 commit before 8be701d9f7f77ff2282cc7fe6e0791ca5419de70).

AnJoiner commented 1 year ago

I also modified it as above, but it didn't work. Later, I used ffmpeg 4.4 version successfully without modifying "query formats". You can also try!

aus70 commented 1 year ago

it's likely the last version that will ever work with ffmpeg-gl-transition if nobody updates the code

I also modified it as above, but it didn't work. Later, I used ffmpeg 4.4 version successfully without modifying "query formats". You can also try!

sujialin9527 commented 1 month ago

The issue I found (likely - but not for sure - the same as #72) is related to FFmpeg/FFmpeg@8be701d Solved by removing { NULL } in static const AVFilterPad gltransition_outputs[] and static const AVFilterPad gltransition_inputs[] in vf_gltransition.c

Hi. I am hitting this same issue. I implemented your suggested fix (#75 (comment) and #75 (comment)). Doing so resulted in a successful build, as well as a successful ./ffmpeg -v 0 -filters | grep gltransition, however the resulting video from ./ffmpeg -i media/0.mp4 -i media/1.mp4 -filter_complex gltransition -y out.mp4 contains only the first video with no transition at all.

I was able to work around this issue by checking out commit d53d48c7993fe2e9ffcc4a638ebd2f4c5273c144 in my ffmpeg checkout (1 commit before 8be701d9f7f77ff2282cc7fe6e0791ca5419de70).

Can you explain it in detail? Thank you