aboutsummaryrefslogtreecommitdiff
path: root/multimedia
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2004-11-06 20:17:06 +0000
committerPav Lucistnik <pav@FreeBSD.org>2004-11-06 20:17:06 +0000
commit3c844061b7eaef26c34da7d62ea26c56efae29fd (patch)
tree2d43d3d332184d089bbafad27a3c916417b296e9 /multimedia
parent23081cfb30bd8cc32f7fc9bea8f21724045af6c7 (diff)
downloadports-3c844061b7eaef26c34da7d62ea26c56efae29fd.tar.gz
ports-3c844061b7eaef26c34da7d62ea26c56efae29fd.zip
Add exportvideo, an utility extracts the video data from a nuppelvideo
file and writes a YUV4MPEG stream which can be piped to mpeg2enc. In other words, it exports the nuppelvideo .nuv format for encoding (S)VCD/DVD compliant MPEGs with mjpegtools. PR: ports/73417 Submitted by: Frank W. Josellis <frank@dynamical-systems.org>
Notes
Notes: svn path=/head/; revision=120991
Diffstat (limited to 'multimedia')
-rw-r--r--multimedia/Makefile1
-rw-r--r--multimedia/exportvideo/Makefile72
-rw-r--r--multimedia/exportvideo/distinfo2
-rw-r--r--multimedia/exportvideo/files/README.FreeBSD20
-rw-r--r--multimedia/exportvideo/files/nuv4dvd109
-rw-r--r--multimedia/exportvideo/files/patch-Makefile92
-rw-r--r--multimedia/exportvideo/files/patch-configure22
-rw-r--r--multimedia/exportvideo/files/patch-libmpeg3_Makefile22
-rw-r--r--multimedia/exportvideo/files/patch-libmpeg3_configure13
-rw-r--r--multimedia/exportvideo/files/patch-libmpeg3_ifo.h10
-rw-r--r--multimedia/exportvideo/files/patch-libmpeg3_mpeg3ifo.c21
-rw-r--r--multimedia/exportvideo/files/patch-libmpeg3_mpeg3io.c49
-rw-r--r--multimedia/exportvideo/files/patch-quicktime_configure13
-rw-r--r--multimedia/exportvideo/files/patch-quicktime_libdv_Makefile17
-rw-r--r--multimedia/exportvideo/files/patch-quicktime_libdv_oss.c11
-rw-r--r--multimedia/exportvideo/files/patch-quicktime_libdv_parse.c14
-rw-r--r--multimedia/exportvideo/files/patch-quicktime_libmjpeg.c10
-rw-r--r--multimedia/exportvideo/files/patch-quicktime_qtprivate.h13
-rw-r--r--multimedia/exportvideo/files/patch-rtjpeg_Makefile24
-rw-r--r--multimedia/exportvideo/files/patch-rtjpeg_RTjpeg.c11
-rw-r--r--multimedia/exportvideo/files/patch-rtjpeg_RTjpegN.c11
-rw-r--r--multimedia/exportvideo/files/patch-video_Makefile29
-rw-r--r--multimedia/exportvideo/files/patch-video_global.h11
-rw-r--r--multimedia/exportvideo/files/patch-video_memmem.c62
-rw-r--r--multimedia/exportvideo/files/patch-video_rtjpeg_plugin.h9
-rw-r--r--multimedia/exportvideo/pkg-descr6
-rw-r--r--multimedia/exportvideo/pkg-plist3
27 files changed, 677 insertions, 0 deletions
diff --git a/multimedia/Makefile b/multimedia/Makefile
index aa9642b292f9..87ee83516830 100644
--- a/multimedia/Makefile
+++ b/multimedia/Makefile
@@ -21,6 +21,7 @@
SUBDIR += dvts
SUBDIR += emovix
SUBDIR += enjoympeg
+ SUBDIR += exportvideo
SUBDIR += ffmpeg
SUBDIR += fxtv
SUBDIR += gaim-xmms-remote
diff --git a/multimedia/exportvideo/Makefile b/multimedia/exportvideo/Makefile
new file mode 100644
index 000000000000..4aa1c841c9ce
--- /dev/null
+++ b/multimedia/exportvideo/Makefile
@@ -0,0 +1,72 @@
+# New ports collection makefile for: exportvideo
+# Date created: 24 October 2004
+# Whom: Frank W. Josellis <frank@dynamical-systems.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= exportvideo
+PORTVERSION= 1.0
+CATEGORIES= multimedia
+MASTER_SITES= http://131.130.199.155/~aoe/mystuff/mpeg2_movie-avipatch/
+DISTNAME= ${PORTNAME}.7e-pre9
+
+MAINTAINER= frank@dynamical-systems.org
+COMMENT= Writes yuv4mpeg streams for mpeg2enc from nuppelvideo files
+
+BUILD_DEPENDS= nasm:${PORTSDIR}/devel/nasm
+LIB_DEPENDS= png.5:${PORTSDIR}/graphics/png
+
+USE_GNOME= gtk12
+USE_XLIB= yes
+USE_GMAKE= yes
+HAS_CONFIGURE= yes
+CONFIGURE_ARGS= --no-avi
+
+WRKSRC= ${WRKDIR}/${DISTNAME}
+
+PORTDOCS= README README.links
+
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} != "i386"
+IGNORE= "Supported for i386 architecture only"
+.endif
+
+# Compiling with MMX extensions fails on FreeBSD 5.x
+.if ${OSVERSION} >= 500000
+WITHOUT_MMX= yes
+.endif
+
+.if defined(WITHOUT_MMX)
+CONFIGURE_ARGS+= --no-mmx
+.endif
+
+.if defined(WITH_OPTIMIZED_CFLAGS)
+CFLAGS+= -O3 -fomit-frame-pointer -funroll-loops -ffast-math
+.endif
+
+pre-everything::
+.if !defined(WITHOUT_MMX)
+ @${ECHO_MSG}
+ @${ECHO_MSG} "You can disable MMX optimizations by defining WITHOUT_MMX."
+.endif
+.if !defined(WITH_OPTIMIZED_CFLAGS)
+ @${ECHO_MSG}
+ @${ECHO_MSG} "You can enable extra optimizations by defining WITH_OPTIMIZED_CFLAGS."
+.endif
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/video/exportvideo ${PREFIX}/bin
+ ${INSTALL_SCRIPT} ${FILESDIR}/nuv4dvd ${PREFIX}/bin
+
+post-install:
+.if !defined(NOPORTDOCS)
+ ${MKDIR} ${DOCSDIR}
+ ${INSTALL_MAN} ${FILESDIR}/README.FreeBSD ${DOCSDIR}
+.for i in ${PORTDOCS}
+ ${INSTALL_MAN} ${WRKSRC}/${i} ${DOCSDIR}
+.endfor
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/multimedia/exportvideo/distinfo b/multimedia/exportvideo/distinfo
new file mode 100644
index 000000000000..abf9c40a898e
--- /dev/null
+++ b/multimedia/exportvideo/distinfo
@@ -0,0 +1,2 @@
+MD5 (exportvideo.7e-pre9.tar.gz) = 8b6b256c0b3c43ef4cc71c3bca86cb98
+SIZE (exportvideo.7e-pre9.tar.gz) = 1185266
diff --git a/multimedia/exportvideo/files/README.FreeBSD b/multimedia/exportvideo/files/README.FreeBSD
new file mode 100644
index 000000000000..67405ac58958
--- /dev/null
+++ b/multimedia/exportvideo/files/README.FreeBSD
@@ -0,0 +1,20 @@
+
+NOTE: For this implementation of exportvideo no attempt has been made to
+support input formats other than .nuv, in which respect it differs from
+the original software. In particular, the '--no-avi' configure flag is
+mandatory for the port to build, and any references to .avi input found
+in the documentation should be ignored!
+
+
+How to use it
+-------------
+Invoke exportvideo without arguments to see what options are available.
+As mpeg2enc's input format is actually YUV4MPEG2, the flag '-Y 2' is a
+canonical choice for transcoding with mjpegtools (cf. yuv4mpeg(5) for
+further details).
+
+This port also provides the script nuv4dvd which can be used to transcode
+nuppelvideos to DVD compliant MPEGs (PAL or NTSC). Running this script
+requires that nuppelvideo, lame, and the mjpegtools are installed. --
+More sample applications can be found in the nuppelvideo documentation.
+
diff --git a/multimedia/exportvideo/files/nuv4dvd b/multimedia/exportvideo/files/nuv4dvd
new file mode 100644
index 000000000000..f4989aa1e96f
--- /dev/null
+++ b/multimedia/exportvideo/files/nuv4dvd
@@ -0,0 +1,109 @@
+#!/bin/sh
+#
+# Trancode NUV to DVD compliant MPEG2 (PAL or NTSC)
+#
+
+usage(){
+ echo "Usage: `basename $0` [-h] | [-N] [-G WxH] nuvfile"
+ echo
+ echo " -N Set TV norm to NTSC (default: PAL)"
+ echo
+ echo " -G Set output geometry (Width x Height)"
+ echo " Admissible scales:"
+ echo " +---------------------------------------+"
+ echo " | PAL | NTSC |"
+ echo " +---------------------------------------+"
+ echo " | 352x288 (default) | 352x240 (default) |"
+ echo " | 352x576 | 352x480 |"
+ echo " | 704x576 | 704x480 |"
+ echo " | 720x576 | 720x480 |"
+ echo " +---------------------------------------+"
+}
+
+args=`getopt hNG: $*`
+if [ $? != 0 ]; then
+ usage
+ exit 1
+fi
+set -- $args
+
+for i ; do
+ case "$i" in
+ -h)
+ usage
+ exit 1
+ ;;
+ -N)
+ tvnorm="NTSC"
+ shift
+ ;;
+ -G)
+ scale="$2"
+ shift ; shift
+ ;;
+ --) shift ; break
+ ;;
+ esac
+done
+
+if [ "$tvnorm" = "NTSC" ]; then
+ res="352x240"
+else
+ res="352x288"
+ tvnorm="PAL"
+fi
+
+if [ "$scale" ]; then
+ case $tvnorm in
+ PAL)
+ case $scale in
+ 352x288|352x576|704x576|720x576) res=$scale
+ ;;
+ *)
+ echo "Scale \"$scale\" is not admissible for $tvnorm." >&2
+ exit 1
+ ;;
+ esac
+ ;;
+ NTSC)
+ case $scale in
+ 352x240|352x480|704x480|720x480) res=$scale
+ ;;
+ *)
+ echo "Scale \"$scale\" is not admissible for $tvnorm." >&2
+ exit 1
+ ;;
+ esac
+ ;;
+ esac
+fi
+
+# Allow to specify the input filename
+# with or without the .nuv extension.
+movie=""
+[ "${1%.*}.nuv" = "$1" ] && movie=${1%.*}
+[ "$movie" ] || movie=$1
+if [ "$movie" -a ! -e $movie.nuv ]; then
+ echo "No such file: $movie.nuv" >&2
+ exit 1
+elif [ -z "$movie" ]; then
+ usage
+ exit 1
+fi
+
+# We need nuvplay (provided by nuppelvideo), lame, as well as
+# mpeg2enc and mplex (provided by mjpegtools) for transcoding.
+retval=0
+for PROG in nuvplay lame mpeg2enc mplex ; do
+ which -s $PROG || retval=$?
+ if [ $retval -ne 0 ]; then
+ echo "Error: could't find '$PROG' on this system." >&2
+ exit 1
+ fi
+done
+
+nuvplay -e $movie.nuv | lame -s 44.1 -b 192 -q 2 -rx - $movie.mp3
+exportvideo -Y 2 -G $res $movie.nuv | mpeg2enc -f 8 -o $movie.m2v
+mplex -f 8 -o ${movie}_%d.mpg $movie.m2v $movie.mp3
+
+exit 0
diff --git a/multimedia/exportvideo/files/patch-Makefile b/multimedia/exportvideo/files/patch-Makefile
new file mode 100644
index 000000000000..bf21b2912419
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-Makefile
@@ -0,0 +1,92 @@
+--- Makefile.orig Fri Oct 26 03:29:20 2001
++++ Makefile Mon Nov 1 09:41:06 2004
+@@ -11,36 +11,36 @@
+ include ./global_config
+
+ all:
+- +make -C libmpeg3
+- +make -C quicktime
+- +make -C rtjpeg
+- +make -C video
+- +if [ "x$(DONT_USE_AVI)" != "x1" ]; then make -C avifile_audiodecoder; fi
+- +if [ -d audiomp2 ]; then make -C audiomp2; fi
+- +if [ -d audiomp3 ]; then make -C audiomp3; fi
+- +if [ -d mplexhi ]; then make -C mplexhi; fi
+- +if [ -d mplexlo ]; then make -C mplexlo; fi
++ +$(MAKE) -C libmpeg3
++ +$(MAKE) -C quicktime
++ +$(MAKE) -C rtjpeg
++ +$(MAKE) -C video
++ +if [ "x$(DONT_USE_AVI)" != "x1" ]; then $(MAKE) -C avifile_audiodecoder; fi
++ +if [ -d audiomp2 ]; then $(MAKE) -C audiomp2; fi
++ +if [ -d audiomp3 ]; then $(MAKE) -C audiomp3; fi
++ +if [ -d mplexhi ]; then $(MAKE) -C mplexhi; fi
++ +if [ -d mplexlo ]; then $(MAKE) -C mplexlo; fi
+
+ exportvideo:
+- +make -C libmpeg3
+- +make -C quicktime
+- +make -C rtjpeg
+- +if [ "x$(DONT_USE_AVI)" != "x1" ]; then make -C avifile_audiodecoder; fi
+- +VIDEO_EXPORT_ONLY=1 make -C video exportvideo
+- +if [ -d audiomp2 ]; then make -C audiomp2; fi
+- +if [ -d mplexhi ]; then make -C mplexhi; fi
+- +if [ -d mplexlo ]; then make -C mplexlo; fi
++ +$(MAKE) -C libmpeg3
++ +$(MAKE) -C quicktime
++ +$(MAKE) -C rtjpeg
++ +if [ "x$(DONT_USE_AVI)" != "x1" ]; then $(MAKE) -C avifile_audiodecoder; fi
++ +VIDEO_EXPORT_ONLY=1 $(MAKE) -C video exportvideo
++ +if [ -d audiomp2 ]; then $(MAKE) -C audiomp2; fi
++ +if [ -d mplexhi ]; then $(MAKE) -C mplexhi; fi
++ +if [ -d mplexlo ]; then $(MAKE) -C mplexlo; fi
+
+ clean:
+- +make -C libmpeg3 clean
+- +make -C quicktime clean
+- +make -C rtjpeg clean
+- +make -C video clean
+- +make -C avifile_audiodecoder clean
+- +if [ -d audiomp2 ]; then make -C audiomp2 clean; fi
+- +if [ -d audiomp3 ]; then make -C audiomp3 clean; fi
+- +if [ -d mplexhi ]; then make -C mplexhi clean; fi
+- +if [ -d mplexlo ]; then make -C mplexlo clean; fi
++ +$(MAKE) -C libmpeg3 clean
++ +$(MAKE) -C quicktime clean
++ +$(MAKE) -C rtjpeg clean
++ +$(MAKE) -C video clean
++ +$(MAKE) -C avifile_audiodecoder clean
++ +if [ -d audiomp2 ]; then $(MAKE) -C audiomp2 clean; fi
++ +if [ -d audiomp3 ]; then $(MAKE) -C audiomp3 clean; fi
++ +if [ -d mplexhi ]; then $(MAKE) -C mplexhi clean; fi
++ +if [ -d mplexlo ]; then $(MAKE) -C mplexlo clean; fi
+
+ backup: clean
+ $(CD) .. && \
+@@ -74,7 +74,7 @@
+
+ bin-release:
+ ./configure && \
+- make exportvideo && \
++ $(MAKE) exportvideo && \
+ $(CD) .. && \
+ $(RM) -rf $(NAME).bin.$(VERSION) && \
+ $(MKDIR) $(NAME).bin.$(VERSION) && \
+@@ -86,7 +86,7 @@
+ $(LN) -s mplexfast $(NAME).bin.$(VERSION)/mplexhi && \
+ $(CP) $(NAME)/avifile_audiodecoder/decoder $(NAME).bin.$(VERSION)/avifile_audiodecoder && \
+ tar -czvf $(NAME).bin.$(VERSION).tar.gz $(NAME).bin.$(VERSION)
+-
++
+ ../$(NAME).$(VERSION):
+ $(CD) .. && \
+ $(RM) -rf $(NAME).$(VERSION) && \
+@@ -104,7 +104,7 @@
+ $(LN) -s mplexfast $(NAME).bin.$(VERSION)/mplexhi && \
+ $(CP) $(NAME)/avifile_audiodecoder/decoder $(NAME).bin.$(VERSION)/avifile_audiodecoder && \
+ tar -czvf $(NAME).bin.$(VERSION).tar.gz $(NAME).bin.$(VERSION)
+-
++
+ test-compile: exportvideo
+ @echo "all ok."
+
diff --git a/multimedia/exportvideo/files/patch-configure b/multimedia/exportvideo/files/patch-configure
new file mode 100644
index 000000000000..116eb9b3e1e3
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-configure
@@ -0,0 +1,22 @@
+--- configure.orig Tue Oct 9 18:14:28 2001
++++ configure Mon Nov 1 09:41:06 2004
+@@ -1,7 +1,9 @@
++#!/bin/sh
++
+ echo "Configuring mpeg2_movie"
+
+ USE_MMX=1
+-CODEC_DIR=/usr/lib/mpeg2_movie/codecs/
++CODEC_DIR=
+ PREFIX=/usr/local
+ LDSTATIC=
+
+@@ -168,6 +170,8 @@
+ if [ "x$LDSTATIC" != "x" ]; then
+ echo >> global_config "LDFLAGS += $LDSTATIC"
+ fi
++
++egrep "^LDFLAGS|^DONT_USE_AVI|^VIDEO_EXPORT_ONLY" global_config > video/global_config
+
+ echo "done"
+
diff --git a/multimedia/exportvideo/files/patch-libmpeg3_Makefile b/multimedia/exportvideo/files/patch-libmpeg3_Makefile
new file mode 100644
index 000000000000..6a195eeaf2d2
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-libmpeg3_Makefile
@@ -0,0 +1,22 @@
+--- libmpeg3/Makefile.orig Thu Mar 8 01:11:07 2001
++++ libmpeg3/Makefile Mon Nov 1 09:41:06 2004
+@@ -44,7 +44,7 @@
+
+ OUTPUT = libmpeg3.a
+ UTILS = dump mpeg3cat mpeg3toc mpeg3split
+-LIBS = -lm -lpthread
++LIBS = -lm -pthread
+
+ all: $(OUTPUT) util
+
+@@ -71,8 +71,8 @@
+ $(CC) -c `./c_flags` $*.c
+
+ clean:
+- make -C audio clean
+- make -C video clean
++ $(MAKE) -C audio clean
++ $(MAKE) -C video clean
+ rm -f core *.o $(OUTPUT)
+ rm -f $(UTILS)
+
diff --git a/multimedia/exportvideo/files/patch-libmpeg3_configure b/multimedia/exportvideo/files/patch-libmpeg3_configure
new file mode 100644
index 000000000000..8a543840cdb1
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-libmpeg3_configure
@@ -0,0 +1,13 @@
+--- libmpeg3/configure.orig Mon Feb 12 22:35:19 2001
++++ libmpeg3/configure Mon Nov 1 09:41:06 2004
+@@ -43,8 +43,8 @@
+ EOF
+
+
+-if test -z "$CFLAGS"; then
+- echo >> global_config "CFLAGS = -O2 -D_FILE_OFFSET_BITS=64 -funroll-loops -fomit-frame-pointer -malign-loops=2 -malign-jumps=2 -malign-functions=2 -march=i486 -I/usr/local/include"
++if true; then
++ echo >> global_config "CFLAGS = $CFLAGS -D_FILE_OFFSET_BITS=64 -I/usr/local/include"
+ fi
+
+ cat >> global_config << EOF
diff --git a/multimedia/exportvideo/files/patch-libmpeg3_ifo.h b/multimedia/exportvideo/files/patch-libmpeg3_ifo.h
new file mode 100644
index 000000000000..dfe6bffaf12d
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-libmpeg3_ifo.h
@@ -0,0 +1,10 @@
+--- libmpeg3/ifo.h.orig Mon Feb 12 22:35:19 2001
++++ libmpeg3/ifo.h Mon Nov 1 09:41:06 2004
+@@ -194,6 +194,7 @@
+ #define ID_TITLE_CELL_ADDR 7
+ #define ID_TITLE_VOBU_ADDR_MAP 8
+
++typedef off_t __off64_t;
+
+ /**
+ * Information Table - for internal use only
diff --git a/multimedia/exportvideo/files/patch-libmpeg3_mpeg3ifo.c b/multimedia/exportvideo/files/patch-libmpeg3_mpeg3ifo.c
new file mode 100644
index 000000000000..27bf876cb076
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-libmpeg3_mpeg3ifo.c
@@ -0,0 +1,21 @@
+--- libmpeg3/mpeg3ifo.c.orig Mon Feb 12 22:35:19 2001
++++ libmpeg3/mpeg3ifo.c Mon Nov 1 09:41:06 2004
+@@ -1,4 +1,3 @@
+-#include <byteswap.h>
+ #include <dirent.h>
+ #include <fcntl.h>
+ #include <stdlib.h>
+@@ -69,6 +68,13 @@
+ #define OFF_VMG_MENU_PGCI mpeg3_ifo_get4bytes (ifo->data[ID_MAT] + 0xC8)
+ #define OFF_VMG_TMT mpeg3_ifo_get4bytes (ifo->data[ID_MAT] + 0xD0)
+
++#define bswap_16(x) ((((x) << 8) & 0xff00) | \
++ (((x) >> 8) & 0x00ff))
++
++#define bswap_32(x) ((((x) << 24) & 0xff000000) | \
++ (((x) << 8) & 0x00ff0000) | \
++ (((x) >> 8) & 0x0000ff00) | \
++ (((x) >> 24) & 0x000000ff))
+
+ inline u_int mpeg3_ifo_get4bytes(u_char *buf)
+ {
diff --git a/multimedia/exportvideo/files/patch-libmpeg3_mpeg3io.c b/multimedia/exportvideo/files/patch-libmpeg3_mpeg3io.c
new file mode 100644
index 000000000000..1ad4d1d44e3e
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-libmpeg3_mpeg3io.c
@@ -0,0 +1,49 @@
+--- libmpeg3/mpeg3io.c.orig Mon Feb 12 22:35:19 2001
++++ libmpeg3/mpeg3io.c Mon Nov 1 09:41:06 2004
+@@ -1,7 +1,7 @@
+ #include "mpeg3private.h"
+ #include "mpeg3protos.h"
+
+-#include <mntent.h>
++#include <fstab.h>
+ #include <sys/stat.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -89,8 +89,8 @@
+ int mpeg3io_device(char *path, char *device)
+ {
+ struct stat file_st, device_st;
+- struct mntent *mnt;
+- FILE *fp;
++ struct fstab *mnt;
++ int fp;
+
+ if(stat(path, &file_st) < 0)
+ {
+@@ -98,17 +98,17 @@
+ return 1;
+ }
+
+- fp = setmntent(MOUNTED, "r");
+- while(fp && (mnt = getmntent(fp)))
++ fp = setfsent();
++ while(fp && (mnt = getfsent()))
+ {
+- if(stat(mnt->mnt_fsname, &device_st) < 0) continue;
+- if(device_st.st_rdev == file_st.st_dev)
+- {
+- strncpy(device, mnt->mnt_fsname, MPEG3_STRLEN);
+- break;
+- }
++ if(stat(mnt->fs_spec, &device_st) < 0) continue;
++ if(device_st.st_rdev == file_st.st_dev)
++ {
++ strncpy(device, mnt->fs_spec, MPEG3_STRLEN);
++ break;
++ }
+ }
+- endmntent(fp);
++ endfsent();
+
+ return 0;
+ }
diff --git a/multimedia/exportvideo/files/patch-quicktime_configure b/multimedia/exportvideo/files/patch-quicktime_configure
new file mode 100644
index 000000000000..8d8f86f3fd22
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-quicktime_configure
@@ -0,0 +1,13 @@
+--- quicktime/configure.orig Mon Feb 12 22:35:19 2001
++++ quicktime/configure Mon Nov 1 09:41:06 2004
+@@ -39,8 +39,8 @@
+ # DO NOT EDIT. EDIT ./configure INSTEAD AND RERUN IT.
+ EOF
+
+-if test -z "$CFLAGS"; then
+- echo >> global_config "CFLAGS = -O2 -fomit-frame-pointer -malign-loops=2 -malign-jumps=2 -malign-functions=2 -march=i486 -I/usr/local/include"
++if true; then
++ echo >> global_config "CFLAGS = $CFLAGS -I/usr/local/include"
+ fi
+
+ if [ ${USE_FIREWIRE} = 1 ]; then
diff --git a/multimedia/exportvideo/files/patch-quicktime_libdv_Makefile b/multimedia/exportvideo/files/patch-quicktime_libdv_Makefile
new file mode 100644
index 000000000000..82eeb5e17d6d
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-quicktime_libdv_Makefile
@@ -0,0 +1,17 @@
+--- quicktime/libdv/Makefile.orig Mon Feb 12 22:35:19 2001
++++ quicktime/libdv/Makefile Mon Nov 1 09:41:06 2004
+@@ -1,7 +1,7 @@
+ include ../global_config
+
+ LFLAGS += $(shell glib-config --libs) $(shell gtk-config --libs)
+-LIBS = -lm -lraw1394 -lpthread
++LIBS = -lm -lraw1394 -pthread
+ CFLAGS += -DHAVE_LIBXV
+ export CFLAGS
+
+@@ -56,4 +56,4 @@
+
+ playdv: playdv.o
+ $(CC) -o playdv playdv.o ../libquicktime.a -L/usr/X11R6/lib -lm -lX11 \
+- -lXext -lXv -lgtk -lgdk -lSDL -lpthread
++ -lXext -lXv -lgtk -lgdk -lSDL -pthread
diff --git a/multimedia/exportvideo/files/patch-quicktime_libdv_oss.c b/multimedia/exportvideo/files/patch-quicktime_libdv_oss.c
new file mode 100644
index 000000000000..992132bcdba3
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-quicktime_libdv_oss.c
@@ -0,0 +1,11 @@
+--- quicktime/libdv/oss.c.orig Mon Feb 12 22:35:19 2001
++++ quicktime/libdv/oss.c Mon Nov 1 09:41:06 2004
+@@ -82,7 +82,7 @@
+ if(oss->arg_audio_device && oss->arg_audio_file) goto usage;
+ if(oss->arg_audio_file) {
+ if ((oss->fd = open(oss->arg_audio_file,
+- O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE,
++ O_WRONLY|O_CREAT|O_TRUNC,
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)) == -1) goto no_file;
+ } else {
+ device = (gchar *)(oss->arg_audio_device ? oss->arg_audio_device : default_device);
diff --git a/multimedia/exportvideo/files/patch-quicktime_libdv_parse.c b/multimedia/exportvideo/files/patch-quicktime_libdv_parse.c
new file mode 100644
index 000000000000..d3188cac50c4
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-quicktime_libdv_parse.c
@@ -0,0 +1,14 @@
+--- quicktime/libdv/parse.c.orig Mon Feb 12 22:35:41 2001
++++ quicktime/libdv/parse.c Mon Nov 1 19:40:00 2004
+@@ -376,8 +376,10 @@
+ vlc_trace("%s", (bitstream_get(bs,1)) ? "1" : "0");
+ } else { vlc_trace("\n\tno unused bits"); }
+ #endif // PARSE_VLC_TRACE
++ ;
+ } // for b
+- mb_done:
++ mb_done:
++ ;
+ } // for m
+ vlc_trace("\n");
+ } // for pass
diff --git a/multimedia/exportvideo/files/patch-quicktime_libmjpeg.c b/multimedia/exportvideo/files/patch-quicktime_libmjpeg.c
new file mode 100644
index 000000000000..4bd696bdcaa4
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-quicktime_libmjpeg.c
@@ -0,0 +1,10 @@
+--- quicktime/libmjpeg.c.orig Mon Feb 12 22:35:41 2001
++++ quicktime/libmjpeg.c Mon Nov 1 19:40:00 2004
+@@ -569,6 +569,7 @@
+ jpeg_finish_decompress(&engine->jpeg_decompress);
+ //printf("decompress_field 5\n");
+ finish:
++ ;
+ }
+
+ void mjpeg_decompress_loop(mjpeg_compressor *engine)
diff --git a/multimedia/exportvideo/files/patch-quicktime_qtprivate.h b/multimedia/exportvideo/files/patch-quicktime_qtprivate.h
new file mode 100644
index 000000000000..991e598f3859
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-quicktime_qtprivate.h
@@ -0,0 +1,13 @@
+--- quicktime/qtprivate.h.orig Mon Feb 12 22:35:19 2001
++++ quicktime/qtprivate.h Mon Nov 1 09:41:06 2004
+@@ -13,8 +13,8 @@
+ typedef int64_t longest;
+ typedef u_int64_t ulongest;
+
+-#define FTELL ftello64
+-#define FSEEK fseeko64
++#define FTELL ftello
++#define FSEEK fseeko
+
+ typedef struct
+ {
diff --git a/multimedia/exportvideo/files/patch-rtjpeg_Makefile b/multimedia/exportvideo/files/patch-rtjpeg_Makefile
new file mode 100644
index 000000000000..242b7053867d
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-rtjpeg_Makefile
@@ -0,0 +1,24 @@
+--- rtjpeg/Makefile.orig Thu Jun 21 23:28:03 2001
++++ rtjpeg/Makefile Mon Nov 1 09:41:06 2004
+@@ -1,5 +1,5 @@
+ CC=gcc
+-CFLAGS= -g -Wall -O3 -mcpu=pentium -march=pentium -funroll-loops -fexpensive-optimizations -finline
++#CFLAGS= -g -Wall -O3 -mcpu=pentium -march=pentium -funroll-loops -fexpensive-optimizations -finline
+
+ V4LDIR=/usr/src/linux/drivers/char/
+ COPTS=$(CFLAGS) -I$(V4LDIR)
+@@ -8,12 +8,12 @@
+ all: RTjpeg.o minilzo.o
+
+ RTjpeg.o:
+- $(CC) -c $(COPTS) -fPIC RTjpeg.c
++ $(CC) -c $(CFLAGS) -fPIC RTjpeg.c
+
+ # $(CC) -c $(COPTSRT) -fPIC RTjpeg.c
+
+ minilzo.o: minilzo.c minilzo.h
+- $(CC) $(COPTS) -fPIC -O3 -fexpensive-optimizations -funroll-loops -finline-functions -c minilzo.c
++ $(CC) $(CFLAGS) -fPIC -c minilzo.c
+
+ clean:
+ rm -f *.o
diff --git a/multimedia/exportvideo/files/patch-rtjpeg_RTjpeg.c b/multimedia/exportvideo/files/patch-rtjpeg_RTjpeg.c
new file mode 100644
index 000000000000..83bcf9b7544b
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-rtjpeg_RTjpeg.c
@@ -0,0 +1,11 @@
+--- rtjpeg/RTjpeg.c.orig Thu Jun 21 23:27:12 2001
++++ rtjpeg/RTjpeg.c Mon Nov 1 19:40:00 2004
+@@ -352,7 +352,7 @@
+ data[i]= 0;
+ break;
+ default:
+-
++ break;
+ }
+
+ if( bitoff == 0 ) {
diff --git a/multimedia/exportvideo/files/patch-rtjpeg_RTjpegN.c b/multimedia/exportvideo/files/patch-rtjpeg_RTjpegN.c
new file mode 100644
index 000000000000..83692a47ac53
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-rtjpeg_RTjpegN.c
@@ -0,0 +1,11 @@
+--- rtjpeg/RTjpegN.c.orig Thu Jul 5 22:32:29 2001
++++ rtjpeg/RTjpegN.c Mon Nov 1 19:40:00 2004
+@@ -352,7 +352,7 @@
+ data[i]= 0;
+ break;
+ default:
+-
++ break;
+ }
+
+ if( bitoff == 0 ) {
diff --git a/multimedia/exportvideo/files/patch-video_Makefile b/multimedia/exportvideo/files/patch-video_Makefile
new file mode 100644
index 000000000000..3e3afe9783e4
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-video_Makefile
@@ -0,0 +1,29 @@
+--- video/Makefile.orig Fri Oct 26 03:26:40 2001
++++ video/Makefile Mon Nov 1 09:41:06 2004
+@@ -1,4 +1,4 @@
+-include ../global_config
++include ./global_config
+ CC = gcc
+ #CFLAGS += -g -I../libmpeg3 -I../quicktime
+ CFLAGS += -I../libmpeg3 -I../quicktime
+@@ -17,7 +17,8 @@
+ ifneq ($(strip $(DYNAMIC_LOADING)),)
+ PLUGINS+= codecs/rtjpeg_input.so
+ else
+- OBJ+= rtjpeg_input.o \
++ OBJ+= memmem.o \
++ rtjpeg_input.o \
+ rtjpeg_plugin.o \
+ ../rtjpeg/RTjpegN.o \
+ ../rtjpeg/minilzo.o
+@@ -99,8 +100,8 @@
+ encode: $(PLUGINS) $(OBJ) ../global_config
+ $(CXX) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJ) ../libmpeg3/libmpeg3.a ../quicktime/libquicktime.a -lpthread -lpng -lz -lm -L/usr/local/lib $(LIBAVIPLAYORNOT)
+
+-exportvideo: $(PLUGINS) $(OBJ) ../global_config
+- if [ \"x$(VIDEO_EXPORT_ONLY)\" = \"x\" ]; then VIDEO_EXPORT_ONLY=1 make exportvideo; else $(CXX) $(CFLAGS) -o $@ $(OBJ) ../libmpeg3/libmpeg3.a ../quicktime/libquicktime.a -lpthread -lpng -lz -lm -L/usr/local/lib $(LIBAVIPLAYORNOT) $(LDFLAGS); fi
++exportvideo: $(PLUGINS) $(OBJ)
++ $(CXX) $(CFLAGS) -o $@ $(OBJ) ../libmpeg3/libmpeg3.a ../quicktime/libquicktime.a -pthread -lpng -lz -lm -L/usr/local/lib $(LIBAVIPLAYORNOT) $(LDFLAGS)
+
+ .s.o:
+ nasm -f elf $*.s
diff --git a/multimedia/exportvideo/files/patch-video_global.h b/multimedia/exportvideo/files/patch-video_global.h
new file mode 100644
index 000000000000..2671e0012bef
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-video_global.h
@@ -0,0 +1,11 @@
+--- video/global.h.orig Tue Oct 9 15:52:30 2001
++++ video/global.h Mon Nov 1 09:41:06 2004
+@@ -32,7 +32,7 @@
+ #include "quicktime.h"
+
+ #include <pthread.h>
+-#include <stdint.h>
++#include <inttypes.h>
+ #ifdef DYNAMIC_LOADING
+ #include <glib.h>
+ #include <gmodule.h>
diff --git a/multimedia/exportvideo/files/patch-video_memmem.c b/multimedia/exportvideo/files/patch-video_memmem.c
new file mode 100644
index 000000000000..57e8fa9f0ef9
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-video_memmem.c
@@ -0,0 +1,62 @@
+--- video/memmem.c.orig Mon Nov 1 09:41:06 2004
++++ video/memmem.c Mon Nov 1 09:41:06 2004
+@@ -0,0 +1,59 @@
++/* Copyright (C) 1991,92,93,94,96,97,98,2000 Free Software Foundation, Inc.
++ This file is part of the GNU C Library.
++
++ The GNU C Library is free software; you can redistribute it and/or
++ modify it under the terms of the GNU Lesser General Public
++ License as published by the Free Software Foundation; either
++ version 2.1 of the License, or (at your option) any later version.
++
++ The GNU C Library is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Lesser General Public License for more details.
++
++ You should have received a copy of the GNU Lesser General Public
++ License along with the GNU C Library; if not, write to the Free
++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++ 02111-1307 USA. */
++
++#include <stddef.h>
++#include <string.h>
++
++/* Prepare for the case that `__builtin_expect' is not available. */
++#ifndef HAVE_BUILTIN_EXPECT
++# define __builtin_expect(expr, val) (expr)
++#endif
++
++#undef memmem
++
++/* Return the first occurrence of NEEDLE in HAYSTACK. */
++void *
++memmem (haystack, haystack_len, needle, needle_len)
++ const void *haystack;
++ size_t haystack_len;
++ const void *needle;
++ size_t needle_len;
++{
++ const char *begin;
++ const char *const last_possible
++ = (const char *) haystack + haystack_len - needle_len;
++
++ if (needle_len == 0)
++ /* The first occurrence of the empty string is deemed to occur at
++ the beginning of the string. */
++ return (void *) haystack;
++
++ /* Sanity check, otherwise the loop might search through the whole
++ memory. */
++ if (__builtin_expect (haystack_len < needle_len, 0))
++ return NULL;
++
++ for (begin = (const char *) haystack; begin <= last_possible; ++begin)
++ if (begin[0] == ((const char *) needle)[0] &&
++ !memcmp ((const void *) &begin[1],
++ (const void *) ((const char *) needle + 1),
++ needle_len - 1))
++ return (void *) begin;
++
++ return NULL;
++}
diff --git a/multimedia/exportvideo/files/patch-video_rtjpeg_plugin.h b/multimedia/exportvideo/files/patch-video_rtjpeg_plugin.h
new file mode 100644
index 000000000000..6875fa0d1e86
--- /dev/null
+++ b/multimedia/exportvideo/files/patch-video_rtjpeg_plugin.h
@@ -0,0 +1,9 @@
+--- video/rtjpeg_plugin.h.orig Thu Jun 21 23:27:05 2001
++++ video/rtjpeg_plugin.h Mon Nov 1 09:41:06 2004
+@@ -52,3 +52,6 @@
+ int rtjpeg_end_of_video();
+ int rtjpeg_check_sig(char *fname);
+
++/* Stolen from glibc */
++void *memmem(const void *haystack, size_t haystacklen,
++ const void *needle, size_t needlelen);
diff --git a/multimedia/exportvideo/pkg-descr b/multimedia/exportvideo/pkg-descr
new file mode 100644
index 000000000000..74d2050b975a
--- /dev/null
+++ b/multimedia/exportvideo/pkg-descr
@@ -0,0 +1,6 @@
+The exportvideo utility extracts the video data from a nuppelvideo
+file and writes a YUV4MPEG stream which can be piped to mpeg2enc.
+In other words, it exports the nuppelvideo .nuv format for encoding
+(S)VCD/DVD compliant MPEGs with mjpegtools.
+
+WWW: 131.130.199.155/~aoe/mystuff/mpeg2_movie-avipatch/mpeg2_movie-avi.html
diff --git a/multimedia/exportvideo/pkg-plist b/multimedia/exportvideo/pkg-plist
new file mode 100644
index 000000000000..8967607d987d
--- /dev/null
+++ b/multimedia/exportvideo/pkg-plist
@@ -0,0 +1,3 @@
+bin/exportvideo
+bin/nuv4dvd
+%%PORTDOCS%%%%DOCSDIR%%/README.FreeBSD