# $Id: Portfile 40473 2008-10-02 18:33:51Z macsforever2000@macports.org $ PortSystem 1.0 name ffmpeg version 0.4.9-pre1 revision 12 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 distfiles use_parallel_build yes worksrcdir trunk depends_build bin:svn:subversion port:gmake build.cmd gmake configure.compiler gcc-4.0 set svn_rev 14381 pre-fetch { if {[file isdirectory ${distpath}/${svn_rev}]} { if {![file isdirectory ${distpath}/${svn_rev}/trunk/.svn]} { file delete -force ${distpath}/${svn_rev} } } } fetch { if {![file isdirectory ${distpath}/${svn_rev}]} { file mkdir ${distpath}/${svn_rev} system "svn co -r${svn_rev} --ignore-externals svn://svn.mplayerhq.hu/ffmpeg/trunk ${distpath}/${svn_rev}/trunk" system "svn co -r27349 svn://svn.mplayerhq.hu/mplayer/trunk/libswscale ${distpath}/${svn_rev}/trunk/libswscale" } } extract { file copy ${distpath}/${svn_rev}/trunk ${worksrcpath} } platforms darwin configure.cflags-append -DHAVE_LRINTF ${configure.cppflags} configure.args --disable-vhook \ --mandir=${prefix}/share/man \ --enable-shared --enable-pthreads \ --disable-mmx --cc=gcc-4.0 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 { post-patch { reinplace "s|defined\(ARCH_X86\) \&\& defined\(CONFIG_GPL\)|defined\(ARCH_X86\) \\\&\\\& defined\(CONFIG_GPL\) \\\&\\\& \\\!defined\(__APPLE__\)|g" ${worksrcpath}/libswscale/rgb2rgb.c } } variant mmx description {enable mmx support, experimental; does not build in gcc-4.2 or xcode 3.0 gcc-4.0} { # make no-mmx default and allow mmx enabling for the brave. configure.args-delete --disable-mmx # Fix Leopard problems by disabling the cavs decoder for now configure.args-append --disable-decoder=cavs } 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-postproc } # 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-configure.diff configure.args-append --enable-swscale --enable-avfilter # keep vhook as long as avfilter isnt working fully configure.args-delete --disable-vhook }