- Install README

- Fix scripts nuv2mpg and nuv2vbr
- Add Tk dependency, nuvedit use it
- Don't split files to 2G in nuvrec
- Implement memmem() in nuvplay (taken from glibc)

PR:		ports/73419
Submitted by:	Frank W. Josellis <frank@dynamical-systems.org>
Approved by:	maintainer
This commit is contained in:
Pav Lucistnik 2004-11-25 18:08:57 +00:00
parent 27b113d488
commit be6c9f24dc
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=122417
9 changed files with 259 additions and 35 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= NuppelVideo
PORTVERSION= 0.52.a
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= multimedia audio
MASTER_SITES= http://frost.htu.tuwien.ac.at/~roman/nuppelvideo/
DISTNAME= ${PORTNAME}-${PORTVERSION:C/.(.)$/\1/}
@ -15,10 +15,14 @@ DISTNAME= ${PORTNAME}-${PORTVERSION:C/.(.)$/\1/}
MAINTAINER= steve@sohara.org
COMMENT= A very low CPU usage VCR/DVR application
RUN_DEPENDS= wish8.4:${PORTSDIR}/x11-toolkits/tk84
USE_XLIB= yes
USE_GMAKE= yes
USE_REINPLACE= yes
PORTDOCS= README
# find dependencies
CFLAGS+= -I${LOCALBASE}/include -I${X11BASE}/include \
-L${LOCALBASE}/lib -L${X11BASE}/lib
@ -70,4 +74,12 @@ post-patch:
-e 's|^(COPTSRT).*$$|\1=\$$(CFLAGS)|' \
${WRKSRC}/Makefile
post-install:
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
.for i in ${PORTDOCS}
${INSTALL_MAN} ${WRKSRC}/${i} ${DOCSDIR}
.endfor
.endif
.include <bsd.port.post.mk>

View File

@ -1,6 +1,20 @@
--- Makefile.orig Sat Jul 7 09:08:52 2001
+++ Makefile Wed Mar 5 19:10:28 2003
@@ -19,25 +19,25 @@
--- Makefile.orig Sat Jul 7 14:08:52 2001
+++ Makefile Thu Oct 28 02:47:40 2004
@@ -1,10 +1,10 @@
-CC=gcc
+#
#CFLAGS= -g -Wall -O3 -mcpu=pentium -march=pentium -funroll-loops -fexpensive-optimizations -finline
-CFLAGS= -Wall -O3 -DMMX -mcpu=pentium -march=pentium -funroll-loops -fexpensive-optimizations -finline-functions
+#
V4LDIR=/usr/src/linux/drivers/char/
COPTS=$(CFLAGS) -I$(V4LDIR)
-COPTSRT= -O3 -Wall -DMMX -mcpu=pentium -funroll-loops -fexpensive-optimizations -finline-functions
+COPTSRT=$(CFLAGS)
all: nuvplay nuvrec
@@ -19,32 +19,35 @@
soxfuncs.o: soxfuncs.c
@ -25,6 +39,9 @@
areaDeinterlace.o: areaDeinterlace.h areaDeinterlace.c
- $(CC) $(COPTS) -O3 -fexpensive-optimizations -funroll-loops -finline-functions -c areaDeinterlace.c
+ $(CC) $(COPTS) -c areaDeinterlace.c
+
+memmem.o: memmem.c
+ $(CC) $(COPTS) -c memmem.c
rtjpeg_plugin.o: rtjpeg_plugin.c rtjpeg_plugin.h
- $(CC) $(COPTS) -O3 -fexpensive-optimizations -funroll-loops -finline-functions -c rtjpeg_plugin.c
@ -32,7 +49,16 @@
nuvrec: nuvrec.c RTjpegN.h RTjpegN.o minilzo.o
$(CC) $(COPTS) -o nuvrec minilzo.o RTjpegN.o nuvrec.c
@@ -52,8 +52,8 @@
-nuvplay:nuvplay.c RTjpegN.h areaDeinterlace.o RTjpegN.o XJ.o minilzo.o yuv2rgb_mmx.o rtjpeg_plugin.o resample.o soxfuncs.o
+nuvplay:nuvplay.c RTjpegN.h areaDeinterlace.o RTjpegN.o XJ.o minilzo.o yuv2rgb_mmx.o memmem.o rtjpeg_plugin.o resample.o soxfuncs.o
$(CC) $(COPTS) -L/usr/X11R6/lib -lm -lXext -o nuvplay RTjpegN.o yuv2rgb_mmx.o \
- minilzo.o areaDeinterlace.o XJ.o soxfuncs.o resample.o rtjpeg_plugin.o nuvplay.c
+ minilzo.o areaDeinterlace.o XJ.o soxfuncs.o resample.o memmem.o rtjpeg_plugin.o nuvplay.c
static: rec-s nuvplay
@@ -52,8 +55,8 @@
$(CC) $(COPTS) -static -o nuvrec minilzo.o RTjpegN.o nuvrec.c
install: nuvrec nuvplay

View File

@ -0,0 +1,62 @@
--- memmem.c.orig Thu Jan 1 00:00:00 1970
+++ memmem.c Sun Oct 24 23:05:56 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;
+}

View File

@ -0,0 +1,50 @@
--- nuv2mpg.orig Mon Jun 25 21:33:41 2001
+++ nuv2mpg Thu Oct 28 16:30:47 2004
@@ -1,13 +1,30 @@
#!/bin/sh
+if [ $# = 0 ]; then
+ echo "Usage: $0 <nuvfile>"
+ exit 1
+fi
+name=${1%.nuv}
+
+retval=0
+for PROG in toolame exportvideo 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
+
echo "you have choosen to make a VCD compliant MPEG stream"
echo "please notice that VBR MPEG streams can have the same"
echo "visual quality with lower/low bitrates too (like divx)"
echo ""
-nuvplay -e $1.nuv | toolame -s 44100 -b 224 -p 2 -m s /dev/stdin $1.mp2
-exportvideo $1.nuv "|mpeg2enc -b 1152 -G 15 -g 15 -N -o $1.m1v"
-mplex -f 1 -s 2324 -p 1 -o $1.mpg $1.m1v $1.mp2
+nuvplay -e $name.nuv | toolame -s 44.1 -b 224 -p 2 -m s /dev/stdin $name.mp2
+exportvideo -Y 2 $name.nuv | mpeg2enc -f 1 -o $name.m1v
+mplex -f 1 -s 2324 -p 1 -o $name.mpg $name.m1v $name.mp2
+
+which -s vcdimager || exit 2
echo ""
echo "Press enter for making a BIN and CUE file from your MPG file or"
@@ -15,11 +32,11 @@
echo ""
read enter
-vcdimager -c $1.cue -b $1.bin $1.mpg
+vcdimager -c $name.cue -b $name.bin $name.mpg
echo "you can burn your bin/cue files with cdrdao, simple change the
echo "device parameter to your cdwriter id and type"
echo ""
-echo "cdrdao write --eject --device=0,3,0 $1.cue"
+echo "cdrdao write --eject --device=0,3,0 $name.cue"
echo ""
echo "have fun"

View File

@ -0,0 +1,48 @@
--- nuv2vbr.orig Mon Jun 25 21:35:49 2001
+++ nuv2vbr Thu Oct 28 18:43:41 2004
@@ -1,23 +1,39 @@
#!/bin/sh
+if [ $# = 0 ]; then
+ echo "Usage: $0 <nuvfile>"
+ exit 1
+fi
+name=${1%.nuv}
+
+retval=0
+for PROG in toolame exportvideo 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
+
echo "you have choosen to make a VBR MPEG stream"
echo "please notice that VBR MPEG streams cannot be burned to"
echo "a VCD for use with a DVD player, if you want that use nuv2mpg"
echo ""
echo "this is only an example script you should edit it to your"
-echo "quality needs. i'll make a better all purpose mpeg script
+echo "quality needs. i'll make a better all purpose mpeg script"
echo "in time. try to play around with -q and -b and read the"
echo "mpeg2enc man page!!!"
+echo
-nuvplay -e $1.nuv | toolame -s 44100 -b 192 -p 2 -m s /dev/stdin $1.mp2
-exportvideo $1.nuv "|mpeg2enc -b 1300 -q 7 -G 21 -g 21 -N -o $1.m1v"
-mplex -V -s 2324 -p 1 -o $1.mpg $1.m1v $1.mp2
+nuvplay -e $name.nuv | toolame -s 44.1 -b 192 -p 2 -m s /dev/stdin $name.mp2
+exportvideo -Y 2 $name.nuv | mpeg2enc -b 1300 -q 7 -G 21 -g 21 -o $name.m1v
+mplex -V -r 2000 -s 2324 -p 1 -o $name.mpg $name.m1v $name.mp2
-echo "you can burn your mpg files with cdrecord, simple change the
+echo "you can burn your mpg files with cdrecord, simple change the"
echo "device parameter to your cdwriter id and type"
echo ""
echo "mkdir disk1"
-echo "mv $1.mpg disk1/"
+echo "mv $name.mpg disk1/"
echo "cd disk1/"
echo "md5sum * >disk.md5"
echo "cd .."

View File

@ -0,0 +1,10 @@
--- nuvedit.orig Wed Jul 4 13:17:18 2001
+++ nuvedit Thu Oct 28 14:08:14 2004
@@ -1,6 +1,6 @@
#!/bin/sh
# \
-exec wish "$0" "$@"
+exec wish8.4 "$0" "$@"
set procfil {}

View File

@ -1,5 +1,5 @@
--- nuvrec.c.orig Wed Jul 4 23:59:58 2001
+++ nuvrec.c Sun Feb 1 17:31:10 2004
--- nuvrec.c.orig Wed Jul 4 23:59:36 2001
+++ nuvrec.c Thu Oct 28 12:02:27 2004
@@ -27,14 +27,28 @@
#include <sys/stat.h>
#include <sys/time.h>
@ -31,12 +31,22 @@
// #define TESTINPUT 1
// #define TESTSPLIT 1
#define KEYFRAMEDIST 30
@@ -47,11 +61,28 @@
@@ -42,16 +56,38 @@
#ifdef TESTSPLIT
#define MAXBYTES 20000000
#define MAXBYTESFORCE 21000000
+#define SPLIT 1
#else
#define MAXBYTES 2000000000
#define MAXBYTESFORCE 2100000000
#endif
-// we need the BTTV_FIELDNR, so we really know how many frames we lose
-#define BTTV_FIELDNR _IOR('v' , BASE_VIDIOCPRIVATE+2, unsigned int)
+#ifndef SPLIT
+#define SPLIT 0
+#endif
+
+#define PAL 1
+#define NTSC 2
+#define SECAM 3
@ -62,7 +72,7 @@
int fd; // output file haendle
int ostr=0;
__s8 *strm;
@@ -71,10 +102,10 @@
@@ -71,10 +107,10 @@
unsigned long long audiobytes;
int effectivedsp;
int ntsc=0; // default to PAL, this info is only for the video header
@ -75,7 +85,7 @@
//#define DP(DSTRING) fprintf(stderr, "%s\n", DSTRING);
#define DP(DSTRING)
@@ -173,9 +204,6 @@
@@ -173,9 +209,6 @@
kill(pid, 9);
if (recordaudio) kill(pid2, 9);
@ -85,7 +95,7 @@
if (!quiet) fprintf(stderr, "\n"); // preserve status line
exit(i);
}
@@ -201,24 +229,25 @@
@@ -201,24 +234,25 @@
unsigned char *startaudio;
if (init_shm) {
@ -116,7 +126,25 @@
videobuffer = (struct vidbuffertype *)sharedbuffer;
startaudiodesc = (char *)(sharedbuffer + video_buffer_count*sizeof(vidbuffertyp));
@@ -899,24 +928,6 @@
@@ -792,7 +826,7 @@
// we have no frames in our cycle buffer
//fprintf(stderr,"*");
- if (byteswritten > MAXBYTES) {
+ if (SPLIT && byteswritten > MAXBYTES) {
actfile++;
if (0 != create_nuppelfile(fname, actfile, w, h)) {
fprintf(stderr, "cannot open %s-%d.nuv for writing\n", fname, actfile);
@@ -804,7 +838,7 @@
continue; // check for next frame
}
- if (byteswritten > MAXBYTESFORCE) {
+ if (SPLIT && byteswritten > MAXBYTESFORCE) {
actfile++;
if (0 != create_nuppelfile(fname, actfile, w, h)) {
fprintf(stderr, "cannot open %s-%d.nuv for writing\n", fname, actfile);
@@ -899,24 +933,6 @@
#ifdef TESTINPUT
tf+=2; // when reading from files we won't lose frames ;)
#else
@ -141,7 +169,7 @@
// here is the non preferable timecode - drop algorithm - fallback
if (!usebttv) {
@@ -1073,21 +1084,125 @@
@@ -1073,21 +1089,125 @@
exit(-1);
}
@ -275,7 +303,7 @@
double frequency=0.0;
long v4lfrequency=0;
int volume = -1;
@@ -1277,109 +1392,28 @@
@@ -1277,109 +1397,28 @@
testinput();
#else

View File

@ -1,21 +0,0 @@
diff -ur ../NuppelVideo-0.52a/rtjpeg_plugin.c ./rtjpeg_plugin.c
--- ../NuppelVideo-0.52a/rtjpeg_plugin.c Tue Jul 3 15:34:02 2001
+++ ./rtjpeg_plugin.c Mon Feb 10 18:42:01 2003
@@ -155,7 +155,7 @@
while (pos > startpos && !foundit) {
lseek(rtjpeg_file, pos, SEEK_SET);
read(rtjpeg_file, buffer, 32768);
- needlepos = (char *)memmem(buffer, 32768, "RTjjjjjjjjjjjjjjjjjjjjjjjj", FRAMEHEADERSIZE);
+// needlepos = (char *)memmem(buffer, 32768, "RTjjjjjjjjjjjjjjjjjjjjjjjj", FRAMEHEADERSIZE);
if (needlepos != NULL) {
lseek(rtjpeg_file, pos+(needlepos - buffer) + FRAMEHEADERSIZE, SEEK_SET);
read(rtjpeg_file, &frameheader, FRAMEHEADERSIZE);
@@ -273,7 +273,7 @@
lseek(rtjpeg_file, pos, SEEK_SET);
read(rtjpeg_file, buffer, 32768);
//fprintf(stderr, "check for needle\n");
- needlepos = (char *)memmem(buffer, 32768, "RTjjjjjjjjjjjjjjjjjjjjjjjj", FRAMEHEADERSIZE);
+// needlepos = (char *)memmem(buffer, 32768, "RTjjjjjjjjjjjjjjjjjjjjjjjj", FRAMEHEADERSIZE);
if (needlepos != NULL) {
lseek(rtjpeg_file, pos+(needlepos - buffer) + FRAMEHEADERSIZE, SEEK_SET);
read(rtjpeg_file, &frameheader, FRAMEHEADERSIZE);

View File

@ -0,0 +1,9 @@
--- rtjpeg_plugin.h.orig Tue Jul 3 15:01:32 2001
+++ rtjpeg_plugin.h Thu Oct 28 02:28:45 2004
@@ -56,3 +56,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);