# $Id: Portfile 35765 2008-04-05 11:21:18Z reiffert@macports.org $ PortSystem 1.0 name ffmpeg version 0.4.9-pre1 revision 7 categories multimedia maintainers acho@macports.org openmaintainer description Digital VCR and streaming server long_description FFmpeg is a complete solution to record, convert and \ stream audio and video. It includes libavcodec, the \ leading audio/video codec library. \ \ The project is made of several components: \ \ ffmpeg is a command line tool to convert one video \ file format to another. It also supports grabbing and \ encoding in real time from a TV card. \ \ ffserver is an HTTP (RTSP is being developped) \ multimedia streaming server for live broadcasts. Time \ shifting of live broadcast is also supported. \ \ ffplay is a simple media player based on SDL and on \ the ffmpeg libraries. \ \ libavcodec is a library containing all the ffmpeg \ audio/video encoders and decoders. Most codecs were \ developped from scratch to ensure best performances \ and high code reusability. \ \ libavformat is a library containing parsers and \ generators for all common audio/video formats. homepage http://ffmpeg.sourceforge.net/ master_sites {} fetch.type svn svn.url svn://svn.mplayerhq.hu/ffmpeg/trunk svn.tag 12276 worksrcdir trunk depends_build bin:svn:subversion platforms darwin configure.cflags-append -DHAVE_LRINTF ${configure.cppflags} configure.args --prefix=${prefix} --disable-vhook \ --mandir=${prefix}/share/man \ --enable-shared --enable-pthreads default_variants +a52 pre-configure { if {[variant_isset universal]} { configure.args-delete --disable-dependency-tracking } } post-destroot { file mkdir ${destroot}${prefix}/share/doc/${name} file copy ${worksrcpath}/doc/TODO ${destroot}${prefix}/share/doc/${name} foreach f [glob ${worksrcpath}/doc/*.txt ${worksrcpath}/doc/*.html] { file copy $f ${destroot}${prefix}/share/doc/${name} } } platform darwin i386 { # Fix Leopard problems by disabling assembly for now; see #13019. configure.args-append --disable-mmx post-patch { reinplace "s|defined\(ARCH_X86\) \&\& defined\(CONFIG_GPL\)|defined\(ARCH_X86\) \\\&\\\& defined\(CONFIG_GPL\) \\\&\\\& \\\!defined\(__APPLE__\)|g" ${worksrcpath}/libswscale/rgb2rgb.c } } variant gpl description {allow use of GPL code, the resulting libav* and ffmpeg will be under GPL} { configure.args-append --enable-gpl } variant postproc requires gpl description {enable GPLed postprocessing support} { configure.args-append --enable-pp } # Adds MP3 support variant lame description {enable MP3 encoding via libmp3lame} { depends_lib-append port:lame configure.args-append --enable-libmp3lame } variant extvorbis description {enable Vorbis encoding via libvorbis, native implementation exists} { depends_lib-append port:libvorbis port:libogg configure.args-append --enable-libvorbis } variant theora description {enable Theora encoding via libtheora} { depends_lib-append port:libtheora port:libogg configure.args-append --enable-libtheora } variant faac requires gpl description {enable FAAC support via libfaac} { depends_lib-append port:faac configure.args-append --enable-libfaac } variant faad requires gpl description {enable FAAD support via libfaad} { depends_lib-append port:faad2 configure.args-append --enable-libfaad } variant xvid requires gpl description {enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists} { depends_lib-append port:XviD configure.args-append --enable-libxvid } # depends build until x264 port supports shared libraries variant x264 requires gpl description {enable H.264 encoding via x264} { depends_build-append port:x264 configure.args-append --enable-libx264 } variant a52 requires gpl description {enable GPLed liba52 support} { depends_lib-append port:a52dec configure.args-append --enable-liba52 post-destroot { file mkdir ${destroot}${prefix}/include/ffmpeg foreach f [glob ${destroot}${prefix}/include/libavcodec/*.h ${destroot}${prefix}/include/libavformat/*.h ${destroot}${prefix}/include/libavutil/*.h] { regsub -all $destroot ${f} "" srclink ln -s ${srclink} ${destroot}${prefix}/include/ffmpeg/[lindex [split ${f} /] end] } } } variant avfilter requires gpl description {video filter support (replaces vhook)} { patchfiles-append patch-libswscale-Makefile.diff \ patch-Makefile.diff patch-libavfilter-Makefile.diff configure.args-append --enable-swscaler --enable-avfilter # keep vhook as long as avfilter isnt working fully configure.args-delete --disable-vhook }