1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-21 08:42:23 +00:00

FFmpeg is a complete, cross-platform solution to record, convert and

stream audio and video. It includes libavcodec - the leading audio/video
codec library.

This is the development version from a SVN snapshot.

WWW: http://ffmpeg.mplayerhq.hu/
This commit is contained in:
Martin Matuska 2009-08-12 10:40:47 +00:00
parent a027199419
commit 7881ed2a4a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=239384
9 changed files with 542 additions and 0 deletions

View File

@ -50,6 +50,7 @@
SUBDIR += etoile-mediakit
SUBDIR += etoile-multimediakit
SUBDIR += ffmpeg
SUBDIR += ffmpeg-devel
SUBDIR += ffmpeg2theora
SUBDIR += ffmpegthumbnailer
SUBDIR += flv2mpeg4

View File

@ -0,0 +1,347 @@
# New ports collection makefile for: ffmpeg-devel
# Date created: 2009-08-12
# Whom: Martin Matuska <mm@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= ffmpeg
DISTVERSION= 2009-08-12
CATEGORIES= multimedia audio ipv6 net
MASTER_SITES= http://people.freebsd.org/~mm/distfiles/
PKGNAMESUFFIX= -devel
MAINTAINER= mm@FreeBSD.org
COMMENT= Realtime audio/video encoder/converter and streaming server
BUILD_DEPENDS= yasm:${PORTSDIR}/devel/yasm
CONFLICTS= ffmpeg-0.*
WRKSRC= ${WRKDIR}/ffmpeg-export-${DISTVERSION}
HAS_CONFIGURE= yes
CONFIGURE_LOG= config.err
USE_BZIP2= yes
USE_GMAKE= yes
MAKE_JOBS_SAFE= yes
WANT_SDL= yes
OPTIONS= AMR_NB "AMR Narrow Band encoder" on \
AMR_WB "AMR Wide Band decoder" on \
DIRAC "Dirac codec via libdirac" off \
FAAC "FAAC mp4/aac audio encoder" off \
FAAD "FAAD mp4/aac audio decoder" on \
FFSERVER "Build and install ffserver" on \
GSM "GSM audio codec" off \
IPV6 "IPV6 network support" on \
LAME "LAME MP3 encoder" off \
OPENJPEG "JPEG 2000 decoder" off \
OPTIMIZED_CFLAGS "Additional optimizations" off \
SCHROEDINGER "Dirac codec via libschroedinger" on \
SDL "SDL support (build ffplay)" off \
SPEEX "Speex audio decoder" off \
THEORA "Theora encoder (implies OGG)" on \
VORBIS "Vorbis encoder via libvorbis (implies OGG)" on \
X264 "H.264 encoder" on \
XVID "Xvid encoder via xvidcore" on
COMPAT_HEADERS=libavcodec/avcodec.h \
libavcodec/opt.h \
libavcodec/vdpau.h \
libavcodec/xvmc.h \
libavdevice/avdevice.h \
libavfilter/avfilter.h \
libavformat/avformat.h \
libavformat/avio.h \
libavutil/adler32.h \
libavutil/avstring.h \
libavutil/avutil.h \
libavutil/base64.h \
libavutil/common.h \
libavutil/crc.h \
libavutil/fifo.h \
libavutil/intfloat_readwrite.h \
libavutil/log.h \
libavutil/lzo.h \
libavutil/mathematics.h \
libavutil/md5.h \
libavutil/mem.h \
libavutil/pixfmt.h \
libavutil/rational.h \
libavutil/sha1.h \
libpostproc/postprocess.h \
libswscale/swscale.h
.include <bsd.port.pre.mk>
CONFIGURE_ARGS+=--prefix="${PREFIX}" \
--mandir="${PREFIX}/man" \
--enable-shared \
--enable-gpl \
--enable-postproc \
--enable-avfilter \
--enable-avfilter-lavf \
--enable-pthreads \
--enable-x11grab \
--enable-memalign-hack \
--cc="${CC}" \
--extra-cflags="${FFMPEG_CFLAGS} -I${LOCALBASE}/include" \
--extra-ldflags="-L${LOCALBASE}/lib ${FFMPEG_LDFLAGS}" \
--extra-libs="${PTHREAD_LIBS}" \
--disable-debug
SHLIB_VER= 1
PLIST_SUB= SHLIB_VER=${SHLIB_VER}
USE_LDCONFIG= yes
DOC_FILES= Changelog COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv2.1 \
COPYING.LGPLv3 CREDITS INSTALL MAINTAINERS README
# under doc subdirectory
DOC_DOCFILES= APIchanges avutil.txt faq.html ffmpeg-doc.html \
ffmpeg_powerpc_performance_evaluation_howto.txt \
ffplay-doc.html ffserver-doc.html general.html \
issue_tracker.txt optimization.txt \
snow.txt soc.txt swscale.txt TODO
PORTDOCS= *
.ifndef(WITHOUT_FFSERVER)
USE_RC_SUBR= ffserver
.endif
# sse hardware vector support
.if (defined(MACHINE_CPU) && ${MACHINE_CPU:Msse} == "sse")
WITH_BUILTIN_VECTOR= yes
.else
CONFIGURE_ARGS+= --disable-sse
.endif
# mmx support
.if ${MACHINE_CPU:Mmmx} == ""
CONFIGURE_ARGS+= --disable-mmx
WITHOUT_BUILTIN_VECTOR= yes
.endif
# builtin vector, requires mmx
.if !defined(WITHOUT_BUILTIN_VECTOR) && defined(WITH_BUILTIN_VECTOR)
FFMPEG_CFLAGS+= -msse
.endif
# PORTDOCS
.ifndef(NOPORTDOCS)
BUILD_DEPENDS+= texi2html:${PORTSDIR}/textproc/texi2html
MAN1+= ffmpeg.1
. ifndef(WITHOUT_FFSERVER)
MAN1+= ffserver.1
. endif
.endif
# optimizations
.ifdef(WITH_OPTIMIZED_CFLAGS)
CFLAGS:= ${CFLAGS:N-O*} -O3 -ffast-math -fno-finite-math-only -fomit-frame-pointer
.else
CFLAGS:= ${CFLAGS:N-O0} -O2
DEBUG_FLAGS+= -O2
.endif
# amr
# amr
.if defined(WITH_AMR_NB) || defined (WITH_AMR_WB)
LIB_DEPENDS+= opencore-amrnb.0:${PORTSDIR}/audio/opencore-amr
.endif
.ifdef(WITH_AMR_NB)
CONFIGURE_ARGS+= --enable-libopencore-amrnb --enable-version3
.else
CONFIGURE_ARGS+= --disable-libopencore-amrnb
.endif
.ifdef(WITH_AMR_WB)
CONFIGURE_ARGS+= --enable-libopencore-amrwb --enable-version3
.else
CONFIGURE_ARGS+= --disable-libopencore-amrwb
.endif
# dirac
.ifdef(WITH_DIRAC)
LIB_DEPENDS+= dirac_encoder.1:${PORTSDIR}/multimedia/dirac
CONFIGURE_ARGS+= --enable-libdirac
.else
CONFIGURE_ARGS+= --disable-libdirac
.endif
# faac
.ifdef(WITH_FAAC)
LIB_DEPENDS+= faac.0:${PORTSDIR}/audio/faac
CONFIGURE_ARGS+= --enable-libfaac --enable-nonfree
.else
CONFIGURE_ARGS+= --disable-libfaac
.endif
# faad
.ifndef(WITHOUT_FAAD)
LIB_DEPENDS+= faad.2:${PORTSDIR}/audio/faad
CONFIGURE_ARGS+= --enable-libfaad \
--enable-libfaadbin
.else
CONFIGURE_ARGS+= --disable-libfaad
.endif
# ffserver
.ifndef(WITHOUT_FFSERVER)
PLIST_SUB+= FFSERVER=""
.else
PLIST_SUB+= FFSERVER="@comment "
CONFIGURE_ARGS+= --disable-ffserver
.endif
# gsm
.ifdef(WITH_GSM)
LIB_DEPENDS+= gsm.1:${PORTSDIR}/audio/gsm
CONFIGURE_ARGS+= --enable-libgsm
.else
CONFIGURE_ARGS+= --disable-libgsm
.endif
# ipv6
.ifndef(WITHOUT_IPV6)
CONFIGURE_ARGS+= --enable-ipv6
.else
CONFIGURE_ARGS+= --disable-ipv6
.endif
# mp3
.ifdef(WITH_LAME)
LIB_DEPENDS+= mp3lame.0:${PORTSDIR}/audio/lame
CONFIGURE_ARGS+= --enable-libmp3lame
.else
CONFIGURE_ARGS+= --disable-libmp3lame
.endif
# openjpeg
.ifdef(WITH_OPENJPEG)
LIB_DEPENDS+= openjpeg.2:${PORTSDIR}/graphics/openjpeg
CONFIGURE_ARGS+= --enable-libopenjpeg
.else
CONFIGURE_ARGS+= --disable-libopenjpeg
.endif
# schroedinger
.ifndef(WITHOUT_SCHROEDINGER)
LIB_DEPENDS+= schroedinger-1.0.2:${PORTSDIR}/multimedia/schroedinger
CONFIGURE_ARGS+= --enable-libschroedinger
.else
CONFIGURE_ARGS+= --disable-libschroedinger
.endif
# sdl
.ifdef(WITH_SDL)
USE_SDL+= sdl
PLIST_FILES+= bin/ffplay
.if !defined(NOPORTDOCS)
MAN1+= ffplay.1
.endif
.else
CONFIGURE_ARGS+= --disable-ffplay
.endif
# speex
.ifdef(WITH_SPEEX)
LIB_DEPENDS+= speex.1:${PORTSDIR}/audio/speex
CONFIGURE_ARGS+= --enable-libspeex
.else
CONFIGURE_ARGS+= --disable-libspeex
.endif
# theora
.ifndef(WITHOUT_THEORA)
LIB_DEPENDS+= theora.0:${PORTSDIR}/multimedia/libtheora
CONFIGURE_ARGS+= --enable-libtheora
.else
CONFIGURE_ARGS+= --disable-libtheora
.endif
# vorbis
.ifndef(WITHOUT_VORBIS)
LIB_DEPENDS+= vorbisenc.2:${PORTSDIR}/audio/libvorbis
CONFIGURE_ARGS+= --enable-libvorbis
FFMPEG_CFLAGS+= -I${LOCALBASE}/include/vorbis
.else
CONFIGURE_ARGS+= --disable-libvorbis
.endif
# x264
.ifndef(WITHOUT_X264)
LIB_DEPENDS+= x264.65:${PORTSDIR}/multimedia/x264
CONFIGURE_ARGS+= --enable-libx264
.else
CONFIGURE_ARGS+= --disable-libx264
.endif
# xvid
.ifndef(WITHOUT_XVID)
LIB_DEPENDS+= xvidcore.4:${PORTSDIR}/multimedia/xvid
CONFIGURE_ARGS+= --enable-libxvid
.else
CONFIGURE_ARGS+= --disable-libxvid
.endif
pre-configure:
.if defined(WITHOUT_OGG) && (!defined(WITHOUT_VORBIS) || !defined(WITHOUT_THEORA))
@${ECHO_MSG} WITH_VORBIS or WITH_THEORA defined, libogg will be built
.endif
post-patch:
# faad compat
@${REINPLACE_CMD} -e 's|faacD|NeAACD|' ${WRKSRC}/libavcodec/libfaad.c
# {C,LD}FLAGS safeness
@${REINPLACE_CMD} -e 's|$$(LIBDIR)/pkgconfig|${PREFIX}/libdata/pkgconfig|' \
${WRKSRC}/subdir.mak
@${REINPLACE_CMD} -e 's|/etc/ffserver.conf|${PREFIX}/etc/ffserver.conf|' \
${WRKSRC}/ffserver.c
@${REINPLACE_CMD} -E \
-e "s|(EXTRALIBS[[:space:]]*=)|\1-L${LOCALBASE}/lib |g; \
s|%%LOCALBASE%%|${LOCALBASE}|g; \
s|-pthread|${PTHREAD_LIBS}|g" \
${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
@${REINPLACE_CMD} -e 's|-ldl||; s|$$(LIBMAJOR)|${SHLIB_VER}|g;' \
${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
.ifdef(WITH_SDL)
@${REINPLACE_CMD} -E \
-e 's|sdl-config|${SDL_CONFIG}|g' \
${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}
@${FIND} ${WRKSRC} -type f | \
${XARGS} -n 10 ${REINPLACE_CMD} -E \
-e 's|#include <SDL|#include <SDL/SDL|'
.endif
post-configure:
.ifdef(WITHOUT_THEORA)
@${REINPLACE_CMD} -E \
-e 's|^(CONFIG_LIBTHEORA).*$$|\1=no|' \
${WRKSRC}/config.mak
.endif
post-install:
.ifndef(WITHOUT_FFSERVER)
${INSTALL_DATA} ${WRKSRC}/doc/ffserver.conf ${PREFIX}/etc/ffserver.conf-dist
if [ ! -f ${PREFIX}/etc/ffserver.conf ]; then \
${INSTALL_DATA} ${WRKSRC}/doc/ffserver.conf ${PREFIX}/etc; \
fi
.endif
.ifndef(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
.for FILE in ${DOC_FILES}
${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR}
.endfor
.for FILE in ${DOC_DOCFILES}
${INSTALL_DATA} ${WRKSRC}/doc/${FILE} ${DOCSDIR}
.endfor
.endif
${MKDIR} ${PREFIX}/include/ffmpeg
.for FILE in ${COMPAT_HEADERS}
${CP} -f ${PREFIX}/include/${FILE} ${PREFIX}/include/ffmpeg/${FILE:C,^[^/]+/([^/]+).*,\1,}
.endfor
${MKDIR} ${PREFIX}/include/postproc
${CP} -f ${PREFIX}/include/libpostproc/postprocess.h \
${PREFIX}/include/postproc/
.include <bsd.port.post.mk>

View File

@ -0,0 +1,3 @@
MD5 (ffmpeg-2009-08-12.tar.bz2) = 1cb4e913f2e6708e332a460c04eba784
SHA256 (ffmpeg-2009-08-12.tar.bz2) = 952e3ca78405be51d4c8ba4a0059b130fa6237463cadeda6b41664309a4a15df
SIZE (ffmpeg-2009-08-12.tar.bz2) = 2846957

View File

@ -0,0 +1,26 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: ffserver
# REQUIRE: NETWORKING
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable ffserver:
#
#ffserver_enable="YES"
#
ffserver_enable="${ffserver_enable-NO}"
. %%RC_SUBR%%
name=ffserver
rcvar=`set_rcvar`
command="%%PREFIX%%/bin/${name} &"
required_files=%%PREFIX%%/etc/ffserver.conf
load_rc_config ${name}
run_rc_command "$1"

View File

@ -0,0 +1,14 @@
--- libavdevice/bktr.c.orig 2009-05-15 17:34:55.000000000 +0200
+++ libavdevice/bktr.c 2009-05-15 17:38:01.000000000 +0200
@@ -24,6 +24,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+
#define _BSD_SOURCE 1
#include "libavformat/avformat.h"
#if HAVE_DEV_BKTR_IOCTL_METEOR_H && HAVE_DEV_BKTR_IOCTL_BT848_H

View File

@ -0,0 +1,14 @@
--- libavdevice/oss_audio.c.orig 2009-05-15 17:38:35.000000000 +0200
+++ libavdevice/oss_audio.c 2009-05-15 17:41:27.000000000 +0200
@@ -19,6 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+
#include "config.h"
#include <stdlib.h>
#include <stdio.h>

View File

@ -0,0 +1,11 @@
--- libavformat/udp.c.orig 2009-05-15 17:24:45.000000000 +0200
+++ libavformat/udp.c 2009-05-15 17:27:17.000000000 +0200
@@ -45,6 +45,8 @@
#define IN6_IS_ADDR_MULTICAST(a) (((uint8_t *) (a))[0] == 0xff)
#endif
+#define IPPROTO_IPV6 41
+
typedef struct {
int udp_fd;
int ttl;

View File

@ -0,0 +1,7 @@
FFmpeg is a complete, cross-platform solution to record, convert and stream
audio and video. It includes libavcodec - the leading audio/video codec
library.
This is the development version from SVN snapshos.
WWW: http://ffmpeg.mplayerhq.hu/

View File

@ -0,0 +1,119 @@
bin/ffmpeg
%%FFSERVER%%bin/ffserver
%%FFSERVER%%@unexec if cmp -s %D/etc/ffserver.conf %D/etc/ffserver.conf-dist; then rm -f %D/etc/ffserver.conf; fi
%%FFSERVER%%etc/ffserver.conf-dist
%%FFSERVER%%@exec [ -f %B/ffserver.conf ] || cp %B/%f %B/ffserver.conf
include/ffmpeg/adler32.h
include/ffmpeg/avcodec.h
include/ffmpeg/avdevice.h
include/ffmpeg/avfilter.h
include/ffmpeg/avformat.h
include/ffmpeg/avio.h
include/ffmpeg/avstring.h
include/ffmpeg/avutil.h
include/ffmpeg/base64.h
include/ffmpeg/common.h
include/ffmpeg/crc.h
include/ffmpeg/fifo.h
include/ffmpeg/intfloat_readwrite.h
include/ffmpeg/log.h
include/ffmpeg/lzo.h
include/ffmpeg/mathematics.h
include/ffmpeg/md5.h
include/ffmpeg/mem.h
include/ffmpeg/opt.h
include/ffmpeg/pixfmt.h
include/ffmpeg/postprocess.h
include/ffmpeg/rational.h
include/ffmpeg/sha1.h
include/ffmpeg/swscale.h
include/ffmpeg/vdpau.h
include/ffmpeg/xvmc.h
include/libavcodec/avcodec.h
include/libavcodec/opt.h
include/libavcodec/vdpau.h
include/libavcodec/xvmc.h
include/libavdevice/avdevice.h
include/libavfilter/avfilter.h
include/libavformat/avformat.h
include/libavformat/avio.h
include/libavutil/adler32.h
include/libavutil/avstring.h
include/libavutil/avutil.h
include/libavutil/base64.h
include/libavutil/common.h
include/libavutil/crc.h
include/libavutil/fifo.h
include/libavutil/intfloat_readwrite.h
include/libavutil/log.h
include/libavutil/lzo.h
include/libavutil/mathematics.h
include/libavutil/md5.h
include/libavutil/mem.h
include/libavutil/pixfmt.h
include/libavutil/rational.h
include/libavutil/sha1.h
include/libpostproc/postprocess.h
include/postproc/postprocess.h
include/libswscale/swscale.h
lib/libavcodec.a
lib/libavcodec.so
lib/libavcodec.so.1
lib/libavcodec.so.52.32.0
lib/libavdevice.a
lib/libavdevice.so
lib/libavdevice.so.1
lib/libavdevice.so.52.2.0
lib/libavfilter.a
lib/libavfilter.so
lib/libavfilter.so.0.5.0
lib/libavfilter.so.1
lib/libavformat.a
lib/libavformat.so
lib/libavformat.so.1
lib/libavformat.so.52.37.0
lib/libavutil.a
lib/libavutil.so
lib/libavutil.so.1
lib/libavutil.so.50.3.0
lib/libpostproc.a
lib/libpostproc.so
lib/libpostproc.so.1
lib/libpostproc.so.51.2.0
lib/libswscale.a
lib/libswscale.so
lib/libswscale.so.0.7.1
lib/libswscale.so.1
libdata/pkgconfig/libavcodec.pc
libdata/pkgconfig/libavdevice.pc
libdata/pkgconfig/libavfilter.pc
libdata/pkgconfig/libavformat.pc
libdata/pkgconfig/libavutil.pc
libdata/pkgconfig/libpostproc.pc
libdata/pkgconfig/libswscale.pc
%%DATADIR%%/libx264-baseline.ffpreset
%%DATADIR%%/libx264-default.ffpreset
%%DATADIR%%/libx264-fastfirstpass.ffpreset
%%DATADIR%%/libx264-hq.ffpreset
%%DATADIR%%/libx264-ipod320.ffpreset
%%DATADIR%%/libx264-ipod640.ffpreset
%%DATADIR%%/libx264-lossless_fast.ffpreset
%%DATADIR%%/libx264-lossless_max.ffpreset
%%DATADIR%%/libx264-lossless_medium.ffpreset
%%DATADIR%%/libx264-lossless_slow.ffpreset
%%DATADIR%%/libx264-lossless_slower.ffpreset
%%DATADIR%%/libx264-lossless_ultrafast.ffpreset
%%DATADIR%%/libx264-main.ffpreset
%%DATADIR%%/libx264-max.ffpreset
%%DATADIR%%/libx264-normal.ffpreset
%%DATADIR%%/libx264-slowfirstpass.ffpreset
@dirrm %%DATADIR%%
@dirrm include/postproc
@dirrm include/libswscale
@dirrm include/libpostproc
@dirrm include/libavutil
@dirrm include/libavformat
@dirrm include/libavfilter
@dirrm include/libavdevice
@dirrm include/libavcodec
@dirrm include/ffmpeg