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

Bug: 2.4.1 and ffmpeg7.1 need issue #1586

Open
Pro-pra opened this issue Nov 16, 2024 · 5 comments
Open

Bug: 2.4.1 and ffmpeg7.1 need issue #1586

Pro-pra opened this issue Nov 16, 2024 · 5 comments

Comments

@Pro-pra
Copy link

Pro-pra commented Nov 16, 2024

Observed Behavior

On build stage this error:

decklink_producer.cpp:641:52: error: 'AVFilterLink' {aka 'struct AVFilterLink'} has no member named 'min_samples'
  641 |                     audio_filter_.sink->inputs[0]->min_samples = audio_cadence_[0];

Expected behaviour

In ffmpeg7 min_samples i see in libavfilter/filters.h but it is not installed by default
https://github.com/FFmpeg/FFmpeg/blob/a5f0daf8433899d7d644523156ad1078301543f8/libavfilter/filters.h#L153

Ok, i patch ffmpeg7 and install libavfilter/filters.h

Also patch casparcg-server:

--- a/modules/decklink/producer/decklink_producer.cpp	2024-10-08 23:45:44.000000000 +0900
+++ b/modules/decklink/producer/decklink_producer.cpp	2024-11-16 10:57:32.174492429 +0900
@@ -51,7 +51,7 @@
 #endif
 extern "C" {
 #include <libavcodec/avcodec.h>
-#include <libavfilter/avfilter.h>
+#include <libavfilter/filters.h>
 #include <libavfilter/buffersink.h>
 #include <libavfilter/buffersrc.h>
 #include <libavformat/avformat.h>

And this not help me :(( AVFilterLink not have min_samples
https://github.com/FFmpeg/FFmpeg/blob/a5f0daf8433899d7d644523156ad1078301543f8/libavfilter/avfilter.h#L578

Steps to reproduce

build with ffmpeg7

Environment

gcc-14
ffmpeg-7.1

@Pro-pra Pro-pra changed the title Bug: 2.4.1 and ffmpeg7 need issue Bug: 2.4.1 and ffmpeg7.1 need issue Nov 21, 2024
@Julusian
Copy link
Member

What distro are you compiling on? (trying the same will be the easiest way for me to try it)

The newest ffmpeg I have tried is 7 in ubuntu 24.04 and that is happy.

@Pro-pra
Copy link
Author

Pro-pra commented Jan 12, 2025

I use Rosa 13 linux for build.

Now check version 2.4.2 - build fail. My compile options:

cd /var/lib/notamock/rpmbuild/BUILD/server-2.4.2-stable/src/build/modules/decklink && /usr/bin/g++ -DBOOST_ALL_DYN_LINK -DBOOST_LOCALE_HIDE_AUTO_PTR -DBOOST_NO_SWPRINTF -DDIAG_FONT_PATH=\"LiberationMono-Regular.ttf\" -DGLEW_NO_GLU -DNDEBUG -DSFML_STATIC -DTBB_USE_CAPTURED_EXCEPTION=1 -DUNICODE -D_UNICODE -D__NO_INLINE__ -Ddecklink_EXPORTS -I/var/lib/notamock/rpmbuild/BUILD/server-2.4.2-stable/src/build/generated -I/var/lib/notamock/rpmbuild/BUILD/server-2.4.2-stable/src/modules/decklink/.. -I/var/lib/notamock/rpmbuild/BUILD/server-2.4.2-stable/src/modules/decklink/../.. -O2 -fomit-frame-pointer -gdwarf-4 -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -fstack-protector-strong --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -O3 -DNDEBUG -fPIC -O3 -msse3 -mssse3 -msse4.1 -fnon-call-exceptions -Wno-deprecated-declarations -Wno-write-strings -Wno-multichar -Wno-cpp -Werror -Wno-terminate -Winvalid-pch -include /var/lib/notamock/rpmbuild/BUILD/server-2.4.2-stable/src/build/modules/decklink/CMakeFiles/decklink.dir/cmake_pch.hxx -MD -MT modules/decklink/CMakeFiles/decklink.dir/producer/decklink_producer.cpp.o -MF CMakeFiles/decklink.dir/producer/decklink_producer.cpp.o.d -o CMakeFiles/decklink.dir/producer/decklink_producer.cpp.o -c /var/lib/notamock/rpmbuild/BUILD/server-2.4.2-stable/src/modules/decklink/producer/decklink_producer.cpp
/var/lib/notamock/rpmbuild/BUILD/server-2.4.2-stable/src/modules/decklink/producer/decklink_producer.cpp: In member function 'virtual HRESULT caspar::decklink::decklink_producer::VideoInputFrameArrived(IDeckLinkVideoInputFrame*, IDeckLinkAudioInputPacket*)':
/var/lib/notamock/rpmbuild/BUILD/server-2.4.2-stable/src/modules/decklink/producer/decklink_producer.cpp:640:52: error: 'AVFilterLink' {aka 'struct AVFilterLink'} has no member named 'min_samples'
  640 |                     audio_filter_.sink->inputs[0]->min_samples = audio_cadence_[0];

@Pro-pra
Copy link
Author

Pro-pra commented Jan 12, 2025

This commit in ffmpeg make build casparcg-server failed:
FFmpeg/FFmpeg@99ee7a9#diff-4a686e1241a6e9bc014aee81bb55e652e021a10256ef06ba734e03d97835195eR1225

@Pro-pra
Copy link
Author

Pro-pra commented Jan 14, 2025

may be need not use min_samples, libavfilter/filters.h is not installed by default

@Julusian
Copy link
Member

It might be enough to simply comment out the offending line, but I don't know what the side effects of that would be.

It appears that property is an internal property of ffmpeg and we shouldn't be touching it, and they moved it so that we can no longer access it.

Looking at the ffmpeg source, it looks like av_buffersink_set_frame_size would have the same effect, so is probably the correct way to do this.

Before making this change myself, I want to test it with some 59.94 content/channels to make sure it at least appears to work, I wouldn't be surprised if isn't as simple as it looks like it might be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants