Hi, I have a use case for Theora encoding with ffmpeg and would like to bring this back to the port.
A brief history: * ffmpeg's Theora support was removed in 2015, arguing that VP8/VP9 are replacements. [1] * ffmpeg2theora was removed in January 2019 because of breakage with ffmpeg 4.x; claiming that "ffmpeg does the job nowadays" which in all my trying has not been the case, with ffmpeg compiled without Theora support. [2] While this may be true for decoding, encoding Theora is now impossible with the ffmpeg family. The FNA framework only uses Theora for video playback because of the very compact implementation in multimedia/libtheorafile: $ du -hs /usr/local/lib/lib{theorafile,vpx}.so* 28.0K /usr/local/lib/libtheorafile.so.1.0 2.1M /usr/local/lib/libvpx.so.12.0 libvpx only contains support for VP8/9, but not VP3 (Theora). I'm not sure what exactly the reasoning was for removing Theora support, in the absence of a full replacement of this still-used codec. Below is a diff to consider that would add a theora FLAVOR to ffmpeg. There is no relevant difference in package size, so I'm not sure if this should really be branched off into a flavor if it is considered: 23.2M ffmpeg-4.1.3p2v0-theora.tgz 23.2M ffmpeg-4.1.3p2v0.tgz So, my question is if this diff could be considered, or clarification if not. [1] https://marc.info/?l=openbsd-ports-cvs&m=143020279411648&w=2 [2] https://marc.info/?l=openbsd-ports-cvs&m=154834827813518&w=2 Index: Makefile =================================================================== RCS file: /cvs/ports/graphics/ffmpeg/Makefile,v retrieving revision 1.184 diff -u -p -r1.184 Makefile --- Makefile 23 May 2019 08:51:21 -0000 1.184 +++ Makefile 1 Jun 2019 17:37:44 -0000 @@ -4,7 +4,7 @@ COMMENT= audio/video converter and strea V= 4.1.3 DISTNAME= ffmpeg-${V} -REVISION= 1 +REVISION= 2 CATEGORIES= graphics multimedia MASTER_SITES= https://ffmpeg.org/releases/ EXTRACT_SUFX= .tar.xz @@ -162,8 +162,10 @@ VERSION_FLAGS= libavcodec_VERSION=${LIBa libswresample_VERSION=${LIBswresample_VERSION} \ libswscale_VERSION=${LIBswscale_VERSION} +AVCODEC_FLAGS= -lswresample -lavutil ${LIBavcodec_EXTRALIBS} + MAKE_FLAGS= ${VERSION_FLAGS} \ - LIBavcodec_EXTRALIBS="-lswresample -lavutil ${LIBavcodec_EXTRALIBS}" \ + LIBavcodec_EXTRALIBS="${AVCODEC_FLAGS}" \ LIBavdevice_EXTRALIBS="-lavfilter -lswscale -lpostproc -lavformat -lavcodec -lswresample -lavresample -lavutil ${LIBavdevice_EXTRALIBS}" \ LIBavfilter_EXTRALIBS="-lswscale -lpostproc -lavformat -lavcodec -lswresample -lavresample -lavutil ${LIBavfilter_EXTRALIBS}" \ LIBavformat_EXTRALIBS="-lavcodec -lswresample -lavutil ${LIBavformat_EXTRALIBS}" \ @@ -174,6 +176,16 @@ MAKE_FLAGS= ${VERSION_FLAGS} \ LIBswscale_EXTRALIBS="-lavutil ${LIBswscale_EXTRALIBS}" FAKE_FLAGS= ${VERSION_FLAGS} \ LDCONFIG=true + +FLAVORS = theora +FLAVOR ?= + +.if ${FLAVOR:Mtheora} +LIB_DEPENDS += multimedia/libtheora +CONFIGURE_ARGS+= --enable-libtheora +AVCODEC_FLAGS += -ltheora +WANTLIB += theora +.endif .ifdef DEBUG CONFIGURE_ARGS+=--disable-stripping