ferdymercury / amide

AMIDE: a Medical Imaging Data Examiner
http://amide.sourceforge.net/
GNU General Public License v2.0
19 stars 12 forks source link

fly through fails to build from source with ffmpeg 5 #22

Closed emollier closed 2 years ago

emollier commented 2 years ago

Greetings,

For information, it has been noticed in bug #1004597 in Debian Sid that amide fails to build from source when ffmpeg support is enabled for the "fly through" functionality. The relevant part of the build log is the following:

libtool: link: g++ -O2 -I/usr/include […] -lavcodec -lavutil […]
/usr/bin/ld: mpeg_encode.o: in function `mpeg_encoding_init':
./amide-current/src/mpeg_encode.c:220: undefined reference to `avcodec_register_all'
/usr/bin/ld: ./amide-current/src/mpeg_encode.c:223: undefined reference to `avcodec_register_all'
/usr/bin/ld: mpeg_encode.o: in function `mpeg_encode_frame':
./amide-current/src/mpeg_encode.c:389: undefined reference to `avcodec_encode_video2'
collect2: error: ld returned 1 exit status

In Debian, the affected amide version is 1.0.5 with several Debian patches, but I could reproduce the symptoms with the amide version 1.0.6 available in the present git repository. The build fails with ffmpeg version 5.0.1 while build against the 4.y series worked okay.

It is possible to keep Amide natively supported in Debian 12 (to be released at some point in 2023) by disabling ffmpeg support, but I suppose you might be interested to fix the problem so the fly through option remains available.

Thanks for having taken over the maintenance of amide, Have a nice day, :) Étienne.

ferdymercury commented 2 years ago

Thanks for the report.

It seems similar to: https://github.com/FreeRDP/FreeRDP/issues/6985 https://github.com/mikebrady/shairport-sync/issues/1386

emollier commented 2 years ago

Yes, the avcodec_register_all does not seem to do anything anymore in ffmpeg 4, so it seems it can be plain removed. On the other hand, I have not been able to find an easy way to address or workaround the replacement of avcodec_encode_video2 (apart from not building the code at all).

ferdymercury commented 2 years ago

Ahh right.

Maybe we can take a look at https://stackoverflow.com/a/59856981/7471760 and https://issues.apache.org/jira/browse/GUACAMOLE-167 https://blog.fearcat.in/a?ID=01000-97990449-e9f9-4b26-839a-b8c4cad60efa

ferdymercury commented 2 years ago

Here: https://github.com/apache/guacamole-server/blob/master/src/guacenc/ffmpeg-compat.c#L145

emollier commented 2 years ago

Interesting, if you like I can try to have a closer look at this after a good night of sleep. :)