diff options
author | anders <anders@FreeBSD.org> | 2003-02-24 08:21:01 +0800 |
---|---|---|
committer | anders <anders@FreeBSD.org> | 2003-02-24 08:21:01 +0800 |
commit | e6c025efa2900686166baa47782a68b26fd41405 (patch) | |
tree | ebde4d1efb613d73b056fb2233eabc858fae7261 /multimedia | |
parent | e46bb7e63cc9a6715d444394365d60f680b23d4b (diff) | |
download | freebsd-ports-gnome-e6c025efa2900686166baa47782a68b26fd41405.tar.gz freebsd-ports-gnome-e6c025efa2900686166baa47782a68b26fd41405.tar.zst freebsd-ports-gnome-e6c025efa2900686166baa47782a68b26fd41405.zip |
Add dv2jpg, a tool to convert type-2 DV codec-encoded AVI streams to
mjpeg-encoded AVI.
Diffstat (limited to 'multimedia')
-rw-r--r-- | multimedia/Makefile | 1 | ||||
-rw-r--r-- | multimedia/dv2jpg/Makefile | 38 | ||||
-rw-r--r-- | multimedia/dv2jpg/distinfo | 1 | ||||
-rw-r--r-- | multimedia/dv2jpg/files/patch-avijoin.c | 9 | ||||
-rw-r--r-- | multimedia/dv2jpg/files/patch-dv2jpg.c | 134 | ||||
-rw-r--r-- | multimedia/dv2jpg/files/patch-makefile | 24 | ||||
-rw-r--r-- | multimedia/dv2jpg/pkg-descr | 8 | ||||
-rw-r--r-- | multimedia/dv2jpg/pkg-plist | 5 |
8 files changed, 220 insertions, 0 deletions
diff --git a/multimedia/Makefile b/multimedia/Makefile index 03b6d5eee487..cfb4f9088340 100644 --- a/multimedia/Makefile +++ b/multimedia/Makefile @@ -2,6 +2,7 @@ # SUBDIR += acme SUBDIR += avifile + SUBDIR += dv2jpg SUBDIR += dvdrip SUBDIR += ffmpeg SUBDIR += ffmpeg045 diff --git a/multimedia/dv2jpg/Makefile b/multimedia/dv2jpg/Makefile new file mode 100644 index 000000000000..832b9fd388b4 --- /dev/null +++ b/multimedia/dv2jpg/Makefile @@ -0,0 +1,38 @@ +# New ports collection makefile for: dv2jpg +# Date created: 24 February 2003 +# Whom: Anders Nordby <anders@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= dv2jpg +PORTVERSION= 1.1 +CATEGORIES= multimedia +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= ${PORTNAME} + +MAINTAINER= ports@FreeBSD.org +COMMENT= Convert Type-2 DV codec-encoded AVI streams to mjpeg-encoded AVI + +LIB_DEPENDS= dv.3:${PORTSDIR}/multimedia/libdv + +MAKEFILE= makefile +USE_GNOMENG= yes +USE_GNOME= glib12 gtk12 gdkpixbuf + +DOCS= README.avilib README.dv2jpg.html + +post-extract: + ${RM} ${WRKSRC}/avijoin ${WRKSRC}/dv2jpg ${WRKSRC}/*.o + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/avijoin ${PREFIX}/bin/ + ${INSTALL_PROGRAM} ${WRKSRC}/dv2jpg ${PREFIX}/bin/ +.if !defined(NOPORTDOCS) + ${INSTALL} -d -m 0755 ${DOCSDIR} +.for f in ${DOCS} + ${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}/ +.endfor +.endif + +.include <bsd.port.mk> diff --git a/multimedia/dv2jpg/distinfo b/multimedia/dv2jpg/distinfo new file mode 100644 index 000000000000..65678dff9bc5 --- /dev/null +++ b/multimedia/dv2jpg/distinfo @@ -0,0 +1 @@ +MD5 (dv2jpg-1.1.tar.gz) = e82b6623582b4bfe59b4adc5918b25e7 diff --git a/multimedia/dv2jpg/files/patch-avijoin.c b/multimedia/dv2jpg/files/patch-avijoin.c new file mode 100644 index 000000000000..9884379cc7c7 --- /dev/null +++ b/multimedia/dv2jpg/files/patch-avijoin.c @@ -0,0 +1,9 @@ +--- avijoin.c.orig Sun Jun 24 02:04:47 2001 ++++ avijoin.c Sun Feb 16 01:24:49 2003 +@@ -1,5 +1,5 @@ + #include <stdio.h> +-#include "/opt/vidpb/lib/avilib.h" ++#include "avilib.h" + + #define MAX_FILES 255 + #define OURBUFSIZ 4096000 diff --git a/multimedia/dv2jpg/files/patch-dv2jpg.c b/multimedia/dv2jpg/files/patch-dv2jpg.c new file mode 100644 index 000000000000..665ee23c8854 --- /dev/null +++ b/multimedia/dv2jpg/files/patch-dv2jpg.c @@ -0,0 +1,134 @@ +--- dv2jpg.c.orig Sun Jun 24 00:47:02 2001 ++++ dv2jpg.c Sun Feb 23 19:45:30 2003 +@@ -2,6 +2,7 @@ + #include <stdio.h> + #include <sys/types.h> + #include <fcntl.h> ++#include <string.h> + #include <jpeglib.h> + #include "avilib.h" + #include "dvavilib.h" +@@ -51,10 +52,56 @@ + } + + ++void print_usage(void) ++{ ++ printf ("Usage: dv2jpg [-w width] [-h height] <infile> <outfile>\n" ++ " By setting the width or height to 0, one can make dv2jpg output\n" ++ " video in either NTSC or PAL resoultions, whichever was set at compile\n" ++ " time.\n\n" ++ " If only one of width or height is given a positive value, and the other\n" ++ " left unspecified, the video will be scaled so as to keep its original aspect\n" ++ " ratio.\n"); ++ ++} ++ ++void parse_command_line (int argc, char **argv, char **infile, char **outfile, ++ long *width, long *height) ++{ ++ int cntr; ++ ++ for (cntr = 1; cntr < argc; cntr++) { ++ if (strcmp(argv[cntr], "-w") == 0) { ++ cntr++; ++ if (cntr == argc || (sscanf (argv[cntr], "%ld", width) != 1)) { ++ printf ("The -w option needs a valid argument!\n"); exit(1); ++ } ++ } ++ else if (strcmp(argv[cntr], "-h") == 0) { ++ cntr++; ++ if (cntr == argc || (sscanf (argv[cntr], "%ld", height) != 1)) { ++ printf ("The -h option needs a valid argument!\n"); exit(1); ++ } ++ } ++ else if (strcmp(argv[cntr], "--help") == 0) { ++ print_usage(); ++ exit(0); ++ } ++ else { ++ if (*infile == NULL) ++ *infile = argv[cntr]; ++ else if (*outfile == NULL) ++ *outfile = argv[cntr]; ++ else ++ printf ("Argument %s ignored.\n", argv[cntr]); ++ } ++ } ++} ++ + + int main(int ac,char **av) { +- char *infile=av[1],*outfile=av[2]; ++ char *infile = NULL,*outfile = NULL; + long frames,width,height,audiochannels; ++ long in_width = -1, in_height = -1; + long audiobits,audioformat,audiorate,audiobytes,audiosamps,audiobps; + double fps; + char *compressor; +@@ -65,14 +112,21 @@ + FILE *aufp; + long now,left; + ++ parse_command_line (ac, av, &infile, &outfile, &in_width, &in_height); ++ if (!infile || !outfile) { ++ print_usage(); ++ exit(1); ++ } + +- decoder = dv_decoder_new(); +- dv_init(); ++ decoder = dv_decoder_new(0, 0, 0); ++ dv_init(0, 0); + decoder->quality = DV_QUALITY_BEST; + + + printf("reading %s\n",infile); + ++ inh=DVAVI_open_input_file(infile,1); ++ + if ((inh=DVAVI_open_input_file(infile,1))==NULL) { + die("Can't read avi file"); + } +@@ -83,15 +137,27 @@ + width=DVAVI_video_width(inh); + height=DVAVI_video_height(inh); + ++ if (in_width == 0 || in_height == 0) { + #if defined(PAL) +- width=384; +- height=288; ++ width=384; ++ height=288; + #elif defined(NTSC) +- width=352; +- height=240; ++ width=352; ++ height=240; + #else +-#error Please define either NTSC or PAL ++ #error Please define either NTSC or PAL + #endif ++ } ++ else if (in_width * in_height < 0) { /* Only one is positive. */ ++ float ratio = (float)width/(float)height; ++ ++ if (in_width > 0) ++ in_height = (int)((float)in_width/ratio); ++ else ++ in_width = (int)((float)in_height*ratio); ++ ++ width = in_width; height = in_height; ++ } + + fps=DVAVI_frame_rate(inh); + compressor=DVAVI_video_compressor(inh); +@@ -136,7 +202,7 @@ + if (dv_parse_header(decoder, inbuf)<0) { + die("Failed to parse dv image header"); + } +- dv_decode_full_frame(decoder, inbuf, e_dv_color_rgb, pixels, pitches); ++ dv_decode_full_frame(decoder, inbuf, e_dv_color_rgb, pixels, (int *)pitches); + } + + diff --git a/multimedia/dv2jpg/files/patch-makefile b/multimedia/dv2jpg/files/patch-makefile new file mode 100644 index 000000000000..7f1443e03dc7 --- /dev/null +++ b/multimedia/dv2jpg/files/patch-makefile @@ -0,0 +1,24 @@ +--- makefile.orig Sun Jun 24 04:04:47 2001 ++++ makefile Sun Feb 16 02:39:38 2003 +@@ -1,6 +1,6 @@ + +-INC=-I/opt/gdk-pixbuf/lib -I/usr/include -I/usr/include/libdv +-LIBS=-ljpeg -lm -lgdk_pixbuf /usr/lib/libdv.a ++INC=`${GDK_PIXBUF_CONFIG} --cflags` -I${PREFIX}/include/libdv ++LIBS=-ljpeg -lm `${GDK_PIXBUF_CONFIG} --libs` -ldv + + # what type of video do you want? + VIDEO=NTSC +@@ -9,10 +9,10 @@ + all: dv2jpg avijoin + + dv2jpg: dv2jpg.o avilib.o dvavilib.o +- gcc -o dv2jpg dv2jpg.o avilib.o dvavilib.o $(LIBS) `glib-config --libs` `gtk-config --libs` ++ ${CC} -o dv2jpg dv2jpg.o avilib.o dvavilib.o $(LIBS) `${GLIB_CONFIG} --libs` `${GTK_CONFIG} --libs` + + dv2jpg.o: dv2jpg.c +- gcc -g $(INC) `glib-config --cflags` `gtk-config --cflags` -D$(VIDEO) -g -c dv2jpg.c ++ ${CC} -g $(INC) `${GLIB_CONFIG} --cflags` `${GTK_CONFIG} --cflags` -D$(VIDEO) -g -c dv2jpg.c + + avilib.o: avilib.c + gcc -g -c avilib.c diff --git a/multimedia/dv2jpg/pkg-descr b/multimedia/dv2jpg/pkg-descr new file mode 100644 index 000000000000..d7b0bc548960 --- /dev/null +++ b/multimedia/dv2jpg/pkg-descr @@ -0,0 +1,8 @@ +dv2jpg converts a Type-2 DV codec-encoded AVI stream (from dvgrab, for example) +to an mjpeg-encoded AVI stream that can be processed by the mjpeg tools +package. The mjpeg AVI can be converted to mpeg video/audio and burned onto a +VCD later. + +WWW: http://sourceforge.net/projects/dv2jpg/ + +- Anders Nordby <anders@FreeBSD.org> diff --git a/multimedia/dv2jpg/pkg-plist b/multimedia/dv2jpg/pkg-plist new file mode 100644 index 000000000000..d609aef0c7c1 --- /dev/null +++ b/multimedia/dv2jpg/pkg-plist @@ -0,0 +1,5 @@ +bin/avijoin +bin/dv2jpg +%%PORTDOCS%%share/doc/dv2jpg/README.avilib +%%PORTDOCS%%share/doc/dv2jpg/README.dv2jpg.html +%%PORTDOCS%%@dirrm share/doc/dv2jpg |