multimedia/ffmpeg & multimedia/vlc: fix ffmpeg support in VLC.

Thierry Thomas thierry at FreeBSD.org
Sat Aug 11 21:21:40 UTC 2007


>Submitter-Id:	current-users
>Originator:	Thierry Thomas
>Organization:	Kabbale Eros
>Confidential:	no 
>Synopsis:	multimedia/ffmpeg & multimedia/vlc: fix ffmpeg support in VLC.
>Severity:	non-critical
>Priority:	medium
>Category:	ports
>Class:		update
>Release:	FreeBSD 6.2-STABLE i386
>Environment:
System: FreeBSD graf.pompo.net 6.2-STABLE


	
>Description:
	VLC 0.8.6c does not support ffmeg when it has been built with
	swscaler; that means that you cannot watch TV streams with VLC
	(e.g. from http://tv.freebox.fr/).

	The following patches:

	- add a knob WITHOUT_SWSCALER to disable the software scaler;

	- add a warning message in VLC if ffmeg has been built with
	swscaler.

	Note: this won't fix the problem for packages, but anyway to use
	the concerned features you have to enable many knobs and build
	them from ports.

	Since I'm there:

	- re-activate Theora support in ffmpeg (seems OK now);

	- remove ancient bits from DTS;

	- define CONFIGURE_LOG to track possible failures.

>How-To-Repeat:
	Before applying these patches, run

	vlc --list | grep ffmpeg

	it won't report anything.

	Run it again after these patches, and it should report something
	like:

	VLC media player 0.8.6c Janus
	  ffmpeg                FFmpeg audio/video decoder/encoder ((MS)MPEG4,SVQ1,H263,WMV,WMA)
	  ffmpeg                FFmpeg chroma conversion
	  ffmpeg                FFmpeg audio/video encoder
	  ffmpeg                FFmpeg demuxer
	  ffmpeg                FFmpeg muxer
	  ffmpeg                FFmpeg video filter
	  ffmpeg                FFmpeg crop padd filter
	  ffmpeg                FFmpeg deinterlace video filter

	And then you can enjoy TV broadcasts ;-)

>Fix:
	Please apply the following patches:

--- ffmpeg.diff begins here ---
diff -urN multimedia/ffmpeg.orig/Makefile multimedia/ffmpeg/Makefile
--- multimedia/ffmpeg.orig/Makefile	Tue Jul 31 21:36:46 2007
+++ multimedia/ffmpeg/Makefile	Sat Aug 11 19:33:22 2007
@@ -7,7 +7,7 @@
 
 PORTNAME=	ffmpeg
 DISTVERSION=	2007-07-12
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	multimedia audio ipv6 net
 MASTER_SITES=	${MASTER_SITE_LOCAL}
 MASTER_SITE_SUBDIR=	ahze
@@ -16,6 +16,7 @@
 COMMENT=	Hyper fast realtime audio/video encoder/converter, streaming server
 
 HAS_CONFIGURE=	yes
+CONFIGURE_LOG=	config.err
 USE_BZIP2=	yes
 USE_GMAKE=	yes
 WANT_SDL=	yes
@@ -32,8 +33,7 @@
 		--extra-ldflags="-L${LOCALBASE}/lib" \
 		--extra-libs="${PTHREAD_LIBS}" \
 		--enable-gpl \
-		--enable-pthreads \
-		--enable-swscaler
+		--enable-pthreads
 CONFIGURE_ENV+=	LANG=C
 MAKE_ENV=	INSTALL="${INSTALL}"
 SHLIB_VER=	1
@@ -96,9 +96,6 @@
 .endif
 USE_RC_SUBR=		ffserver
 
-#### BROKEN LIST #####
-WITHOUT_THEORA=	yes
-
 .if ${MACHINE_CPU:Mmmx}==""
 CONFIGURE_ARGS+=	--disable-mmx
 
@@ -134,6 +131,19 @@
 .else
 CONFIGURE_ARGS+=	--disable-ffplay
 .endif
+
+## swscaler
+.if exists(${LOCALBASE}/bin/vlc)
+WITHOUT_SWSCALER=	yes
+.endif
+.if !defined(WITHOUT_SWSCALER)
+CONFIGURE_ARGS+=	--enable-swscaler
+PLIST_SUB+=	SWSCAL=""
+.else
+PLIST_SUB+=	SWSCAL="@comment "
+.endif
+
+## theora
 .if !defined(WITHOUT_THEORA)
 WITH_OGG=	yes
 LIB_DEPENDS+=		theora.2:${PORTSDIR}/multimedia/libtheora
@@ -216,6 +226,15 @@
 	@${ECHO_MSG} 'by defining WITH_OPTIMIZED_CFLAGS'
 	@${ECHO_MSG}
 .endif
+.ifndef(WITHOUT_SWSCALER)
+	@${ECHO_MSG} 'Define WITHOUT_SWSCALER to disable software scaler support'
+	@${ECHO_MSG} 'Warning: swscaler does not work with VLC!'
+	@${ECHO_MSG}
+.endif
+.ifndef(WITHOUT_THEORA)
+	@${ECHO_MSG} 'Define WITHOUT_THEORA to disable libtheora support'
+	@${ECHO_MSG}
+.endif
 .ifndef(WITHOUT_VORBIS)
 	@${ECHO_MSG} 'Define WITHOUT_VORBIS to enable libvorbisenc VORBIS codec'
 	@${ECHO_MSG}
@@ -289,13 +308,13 @@
 .endif
 
 post-configure:
-.ifdef(WITH_DTS)
-	@${REINPLACE_CMD} -E \
-		-e 's|-ldts|${LOCALBASE}/lib/libdts_pic.a|' \
-		-e 's|(-lx264)|-L${LOCALBASE}/lib \1|' \
-			${WRKSRC}/config.mak \
-			${WRKSRC}/libavcodec/Makefile
-.endif
+#.ifdef(WITH_DTS)
+#	@${REINPLACE_CMD} -E \
+#		-e 's|-ldts|${LOCALBASE}/lib/libdts_pic.a|' \
+#		-e 's|(-lx264)|-L${LOCALBASE}/lib \1|' \
+#			${WRKSRC}/config.mak \
+#			${WRKSRC}/libavcodec/Makefile
+#.endif
 .ifdef(WITHOUT_THEORA)
 	@${REINPLACE_CMD} -E \
 		-e 's|^(CONFIG_LIBTHEORA).*$$|\1=no|' \
diff -urN multimedia/ffmpeg.orig/pkg-plist multimedia/ffmpeg/pkg-plist
--- multimedia/ffmpeg.orig/pkg-plist	Tue Jul 31 21:36:46 2007
+++ multimedia/ffmpeg/pkg-plist	Sat Aug 11 19:32:06 2007
@@ -43,10 +43,10 @@
 lib/libpostproc.so
 lib/libpostproc.so.%%SHLIB_VER%%
 lib/libpostproc.so.51.1.0
-lib/libswscale.a
-lib/libswscale.so
-lib/libswscale.so.%%SHLIB_VER%%
-lib/libswscale.so.0.5.0
+%%SWSCAL%%lib/libswscale.a
+%%SWSCAL%%lib/libswscale.so
+%%SWSCAL%%lib/libswscale.so.%%SHLIB_VER%%
+%%SWSCAL%%lib/libswscale.so.0.5.0
 lib/vhook/fish.so
 lib/vhook/null.so
 lib/vhook/ppm.so
--- ffmpeg.diff ends here ---

--- vlc.diff begins here ---
diff -urN multimedia/vlc.orig/Makefile multimedia/vlc/Makefile
--- multimedia/vlc.orig/Makefile	Tue Jul 31 21:36:52 2007
+++ multimedia/vlc/Makefile	Sat Aug 11 19:57:07 2007
@@ -10,7 +10,7 @@
 
 PORTNAME=	vlc
 DISTVERSION=	0.8.6c
-PORTREVISION=	2
+PORTREVISION=	3
 PORTEPOCH=	2
 CATEGORIES=	multimedia audio ipv6 net www
 MASTER_SITES=	http://download.videolan.org/pub/videolan/vlc/${DISTVERSION}/ \
diff -urN multimedia/vlc.orig/Makefile.inc multimedia/vlc/Makefile.inc
--- multimedia/vlc.orig/Makefile.inc	Fri Jun 22 18:14:10 2007
+++ multimedia/vlc/Makefile.inc	Sat Aug 11 19:57:10 2007
@@ -225,6 +225,14 @@
 #  Do not install Vlc's Documents
 #
 
+pre-everything::
+.if exists(${LOCALBASE}/lib/libswscale.so)
+	@${ECHO_CMD}
+	@${ECHO_CMD} 'VLC cannot find ffmpeg if it has been built with the software scaler,'
+	@${ECHO_CMD} 'be sure to define WITHOUT_SWSCALER to build it.'
+	@${ECHO_CMD}
+.endif
+
 post-patch:
 # Subtitle default font
 	@${REINPLACE_CMD} -e \
--- vlc.diff ends here ---



More information about the freebsd-multimedia mailing list