- After repo copy to ffmpeg045 port so that both older and faster

version 0.4.5 is preserved while the current version matures:
o Update to 0.4.6
o Remove ONLY_FOR_ARCHS, no longer i386 only
o Add PKGMESSAGE explaining the differences between this and ffmpeg045
  port

Reviewed by:	Steve O'Hara-Smith <steve@sohara.org>
Repo copied by:	cvs (joe)
Approved by:	portmgr (self)
This commit is contained in:
Mario Sergio Fujikawa Ferreira 2003-01-10 18:21:21 +00:00
parent 5a1004688f
commit 639ba969fc
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=72852
28 changed files with 394 additions and 252 deletions

View File

@ -6,21 +6,15 @@
#
PORTNAME= ffmpeg
PORTVERSION= 0.4.5
PORTREVISION= 5
PORTVERSION= 0.4.6
CATEGORIES= multimedia audio net
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= lioux
DISTNAME= ffmpeg-cvs-2002101400
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ffmpeg
MAINTAINER= lioux@FreeBSD.org
BUILD_DEPENDS= nasm:${PORTSDIR}/devel/nasm
LIB_DEPENDS= gnugetopt.1:${PORTSDIR}/devel/libgnugetopt
WRKSRC= ${WRKDIR}/${PORTNAME}
ONLY_FOR_ARCHS= i386
HAS_CONFIGURE= yes
USE_GMAKE= yes
USE_REINPLACE= yes
@ -34,18 +28,31 @@ SHLIB_VERSION= 0
#
DOC_FILES= COPYING Changelog README VERSION
# under subdir doc
DOC_DOCFILES= FAQ README.dev README.tech \
TODO bench.txt ffmpeg.txt \
HOWTO-STREAM README.beos \
ffserver.txt
DOC_DOCFILES= TODO \
faq.html faq.texi \
ffmpeg-doc.html ffmpeg-doc.texi \
ffserver-doc.html ffserver-doc.texi
HEADER_FILES= libavcodec/avcodec.h libavcodec/common.h \
libavcodec/dsputil.h
LIB_FILES= libavcodec/libavcodec.a libav/libavformat.a
LIB_FILES= libavcodec/libavcodec.a libavformat/libavformat.a
.include <bsd.port.pre.mk>
##
## arch detection
##
CONFIGURE_ARGS+= --cpu=${ARCH:L}
#
.if ${ARCH} != "i386"
WITHOUT_MMX= yes
.endif
## lib detection
##
##
.if exists(${X11BASE}/lib/libImlib2.so)
WITH_IMLIB2=yes
.endif
## lame mp3
.if exists(${LOCALBASE}/lib/libmp3lame.so.0)
WITH_MP3=yes
@ -67,6 +74,14 @@ CONFIGURE_ARGS+= --enable-a52 \
CONFIGURE_ARGS+= --enable-a52 \
--disable-a52bin
.endif
## enable imlib2
.if !defined(WITHOUT_VHOOK) && defined(WITH_IMLIB2)
LIB_DEPENDS+= Imlib2.1:${PORTSDIR}/graphics/imlib2
PLIST_SUB+= IMLIB2=""
.else
PLIST_SUB+= IMLIB2="@comment "
.endif
## disable mmx
.ifdef(WITHOUT_MMX)
CONFIGURE_ARGS+= --disable-mmx
@ -84,6 +99,14 @@ CONFIGURE_ARGS+= --extra-cflags="${CFLAGS} -I${LOCALBASE}/include \
.else
CONFIGURE_ARGS+= --extra-cflags="${CFLAGS} -I${LOCALBASE}/include"
.endif
## vhook
.ifndef(WITHOUT_VHOOK)
PLIST_SUB+= VHOOK=""
.else
CONFIGURE_ARGS+= -disable-vhook
PLIST_SUB+= VHOOK="@comment "
.endif
## vorbis
.ifdef(WITH_VORBIS)
LIB_DEPENDS+= vorbisenc.2:${PORTSDIR}/audio/libvorbis
@ -106,7 +129,12 @@ pre-everything::
@${ECHO_MSG} 'You can enable additional compilation optimizations'
@${ECHO_MSG} 'by defining WITH_OPTIMIZED_CFLAGS'
.endif
.ifndef(WITHOUT_VHOOK)
@${ECHO_MSG}
@${ECHO_MSG} 'You can disable vhook support by defining WITHOUT_VHOOK'
.endif
.ifndef(WITH_VORBIS)
@${ECHO_MSG}
@${ECHO_MSG} 'Define WITH_VORBIS to enable libvorbisenc VORBIS codec'
.endif
.if !(defined(WITH_BKTR_FORMAT) && defined(WITH_BKTR_DEV))
@ -123,7 +151,7 @@ pre-everything::
post-extract:
# install booktree extension
@${CP} ${FILESDIR}/grab_bsdbktr.c ${WRKSRC}/libav/
@${CP} ${FILESDIR}/grab_bsdbktr.c ${WRKSRC}/libavformat/
post-patch:
@${REINPLACE_CMD} -e "s!/etc/ffserver.conf!${PREFIX}/etc/ffserver.conf!g" \
@ -135,12 +163,12 @@ post-patch:
.ifdef(WITH_BKTR_FORMAT)
@${REINPLACE_CMD} -e \
"s!VIDEO_FORMAT NTSC!VIDEO_FORMAT ${WITH_BKTR_FORMAT}!" \
${WRKSRC}/libav/grab_bsdbktr.c
${WRKSRC}/libavformat/grab_bsdbktr.c
.endif
.ifdef(WITH_BKTR_DEV)
@${REINPLACE_CMD} -e \
"s!VIDEO_INPUT METEOR_INPUT_DEV0!VIDEO_INPUT METEOR_INPUT_DEV${WITH_BKTR_DEV}!" \
${WRKSRC}/libav/grab_bsdbktr.c
${WRKSRC}/libavformat/grab_bsdbktr.c
.endif
.ifndef(WITHOUT_LIBA52)
@${REINPLACE_CMD} -e 's|-ldl||' \

View File

@ -1 +1 @@
MD5 (ffmpeg-cvs-2002101400.tar.gz) = 13d04dcb31a09ff98a4caccbeed8dbc5
MD5 (ffmpeg-0.4.6.tar.gz) = bdd96d28327d3abe02e886c13e633878

View File

@ -1,14 +1,14 @@
--- ffmpeg.c.orig Thu Oct 10 20:13:52 2002
+++ ffmpeg.c Thu Oct 10 20:14:03 2002
@@ -36,6 +36,7 @@
#include <ctype.h>
--- ffmpeg.c.orig Wed Jan 1 20:56:06 2003
+++ ffmpeg.c Wed Jan 1 20:56:41 2003
@@ -35,6 +35,7 @@
#define INFINITY HUGE_VAL
#endif
+#define INT64_C(x) x##LL
#define MAXINT64 INT64_C(0x7fffffffffffffff)
typedef struct {
@@ -146,7 +147,7 @@
@@ -158,7 +159,7 @@
const char *audio_device = "none";
#endif
#ifndef CONFIG_VIDEO4LINUX
@ -17,7 +17,7 @@
#endif
typedef struct AVOutputStream {
@@ -1601,7 +1602,7 @@
@@ -1842,7 +1843,7 @@
void opt_video_device(const char *arg)
{
@ -26,7 +26,7 @@
}
void opt_audio_device(const char *arg)
@@ -2099,7 +2100,7 @@
@@ -2428,7 +2429,7 @@
/* by now video grab has one stream */
ic->streams[0]->r_frame_rate = ap->frame_rate;
input_files[nb_input_files] = ic;

View File

@ -1,20 +1,20 @@
--- libav/Makefile.orig Tue Oct 8 13:54:16 2002
+++ libav/Makefile Tue Oct 8 13:54:30 2002
--- libavformat/Makefile.orig Wed Jan 1 21:00:22 2003
+++ libavformat/Makefile Wed Jan 1 21:01:27 2003
@@ -6,7 +6,7 @@
VPATH=$(SRC_PATH)/libav
VPATH=$(SRC_PATH)/libavformat
-CFLAGS= $(OPTFLAGS) -Wall -g -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
+CFLAGS= $(OPTFLAGS) -Wall -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
OBJS= utils.o cutils.o allformats.o
@@ -17,7 +17,7 @@
OBJS+= avio.o aviobuf.o file.o
@@ -21,7 +21,7 @@
endif
ifeq ($(CONFIG_VIDEO4LINUX),yes)
-OBJS+= grab.o
+OBJS+= grab_bsdbktr.o
endif
ifeq ($(CONFIG_AUDIO_OSS),yes)

View File

@ -0,0 +1,11 @@
--- libavformat/avformat.h.orig Wed Jan 1 21:03:56 2003
+++ libavformat/avformat.h Wed Jan 1 21:04:02 2003
@@ -329,7 +329,7 @@
int video_grab_init(void);
int audio_init(void);
-extern const char *v4l_device;
+extern const char *video_device;
extern const char *audio_device;
#ifdef HAVE_AV_CONFIG_H

View File

@ -38,8 +38,7 @@ typedef struct {
int frame_format; /* see VIDEO_PALETTE_xxx */
int width, height;
int frame_rate;
INT64 per_frame;
INT64 last_frame_time;
int frame_size;
} VideoData;
const char *video_device = "/dev/bktr0";
@ -60,10 +59,14 @@ const char *video_device = "/dev/bktr0";
#endif
static UINT8 *video_buf;
static int nsignals = 0;
static int signal_expected = 0;
static int unexpected_signals = 0;
static void catchsignal(int signal)
{
nsignals++;
if (!signal_expected) unexpected_signals++;
signal_expected = 0;
return;
}
@ -85,7 +88,6 @@ static int bktr_init(AVFormatContext *s1, AVFormatParameters *ap)
width = s->width;
height = s->height;
s->last_frame_time = 0;
s->tuner_fd = open ("/dev/tuner0", O_RDWR);
if (s->tuner_fd < 0) {
@ -101,7 +103,7 @@ static int bktr_init(AVFormatContext *s1, AVFormatParameters *ap)
geo.rows = height;
geo.columns = width;
geo.frames = 1;
geo.oformat = METEOR_GEO_YUV_422 | METEOR_GEO_YUV_12;
geo.oformat = METEOR_GEO_YUV_PACKED;
if ((format == PAL) && (height <= (PAL_HEIGHT/2)))
geo.oformat |= METEOR_GEO_EVEN_ONLY;
@ -129,7 +131,7 @@ static int bktr_init(AVFormatContext *s1, AVFormatParameters *ap)
perror ("METEORSINPUT");
return -EIO;
}
video_buf = mmap((caddr_t)0, width*height*3, PROT_READ, MAP_SHARED,
video_buf = mmap((caddr_t)0, width*height*2, PROT_READ, MAP_SHARED,
video_fd, (off_t) 0);
if (video_buf == MAP_FAILED) {
perror ("mmap");
@ -138,45 +140,66 @@ static int bktr_init(AVFormatContext *s1, AVFormatParameters *ap)
c = METEOR_CAP_CONTINOUS;
ioctl(s->fd, METEORCAPTUR, &c);
c = SIGUSR1;
signal_expected = 1;
ioctl (s->fd, METEORSSIGNAL, &c);
return 0;
}
static void bf_yuv422_to_yuv420p(UINT8 *lum, UINT8 *cb, UINT8 *cr,
UINT8 *src, int width, int height)
{
int x, y;
UINT8 *p = src;
for(y=0;y<height;y+=2) {
for(x=0;x<width;x+=2) {
lum[0] = p[1];
cb[0] = p[0];
lum[1] = p[3];
cr[0] = p[2];
p += 4;
lum += 2;
cb++;
cr++;
}
for(x=0;x<width;x+=2) {
lum[0] = p[1];
lum[1] = p[3];
p += 4;
lum += 2;
}
}
}
/* note: we support only one picture read at a time */
static int grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
{
VideoData *s = s1->priv_data;
int size, halfsize;
sigset_t msig;
UINT64 curtime;
UINT8 *lum, *cb, *cr;
size = s->width * s->height;
halfsize = size << 1;
if (av_new_packet(pkt, size + halfsize) < 0)
return -EIO;
curtime = av_gettime();
if (!s->last_frame_time
|| ((s->last_frame_time + s->per_frame) > curtime)) {
if (!usleep (s->last_frame_time + s->per_frame + s->per_frame/8 - curtime)) {
if (!nsignals)
printf ("\nSLEPT NO signals - %d microseconds late\n",
av_gettime() - s->last_frame_time - s->per_frame);
}
} else if ((s->last_frame_time + s->per_frame*5 < curtime)) {
bzero (pkt->data, size + halfsize);
printf ("\nBlank %d signals - %d microseconds\n",
nsignals, curtime - s->last_frame_time - s->per_frame);
s->last_frame_time += s->per_frame;
return size + halfsize;
if (unexpected_signals > 0) {
unexpected_signals--;
} else {
signal_expected = 1;
sigemptyset (&msig);
sigsuspend (&msig);
}
nsignals = 0;
s->last_frame_time = s->last_frame_time
? s->last_frame_time + s->per_frame
: av_gettime();
if (unexpected_signals & 1) {
bzero (pkt->data, size + halfsize);
} else {
lum = pkt->data;
cb = lum + size;
cr = cb + size/4;
memcpy (pkt->data, video_buf, size + halfsize);
bf_yuv422_to_yuv420p (lum, cb, cr, video_buf, s->width, s->height);
}
return size + halfsize;
}
@ -203,7 +226,7 @@ static int grab_read_header (AVFormatContext *s1, AVFormatParameters *ap)
s->width = width;
s->height = height;
s->frame_rate = frame_rate;
s->per_frame = (INT64_C(1000000) * FRAME_RATE_BASE) / s->frame_rate;
s->frame_size = width*height*2;
st->codec.pix_fmt = PIX_FMT_YUV420P;
st->codec.codec_id = CODEC_ID_RAWVIDEO;
st->codec.width = width;

View File

@ -1,26 +1,12 @@
--- Makefile.orig Sun Sep 1 15:07:34 2002
+++ Makefile Tue Oct 8 13:51:49 2002
@@ -6,12 +6,12 @@
--- Makefile.orig Wed Jan 1 20:51:57 2003
+++ Makefile Wed Jan 1 20:52:27 2003
@@ -6,8 +6,7 @@
VPATH=$(SRC_PATH)
-CFLAGS= $(OPTFLAGS) -Wall -g -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libav -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
+CFLAGS= $(OPTFLAGS) -Wall -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libav -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
ifeq ($(CONFIG_DARWIN),yes)
LDFLAGS+= -g -d
FFSLDFLAGS= -Wl,-bind_at_load
else
-LDFLAGS+= -g -Wl,--warn-common
+LDFLAGS+= -Wl,--warn-common
FFSLDFLAGS= -Wl,-E
endif
@@ -60,7 +60,7 @@
ffserver$(EXE): ffserver.o $(DEP_LIBS)
$(CC) $(LDFLAGS) $(FFSLDFLAGS) \
-o $@ ffserver.o -L./libavcodec -L./libav \
- -lavformat -lavcodec -ldl $(EXTRALIBS)
+ -lavformat -lavcodec $(EXTRALIBS)
-CFLAGS= $(OPTFLAGS) -Wall -g -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
-LDFLAGS+= -g
+CFLAGS= $(OPTFLAGS) -Wall -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
ffplay: ffmpeg$(EXE)
ln -sf $< $@
ifeq ($(TARGET_GPROF),yes)
CFLAGS+=-p

View File

@ -1,14 +1,14 @@
--- ffmpeg.c.orig Thu Oct 10 20:13:52 2002
+++ ffmpeg.c Thu Oct 10 20:14:03 2002
@@ -36,6 +36,7 @@
#include <ctype.h>
--- ffmpeg.c.orig Wed Jan 1 20:56:06 2003
+++ ffmpeg.c Wed Jan 1 20:56:41 2003
@@ -35,6 +35,7 @@
#define INFINITY HUGE_VAL
#endif
+#define INT64_C(x) x##LL
#define MAXINT64 INT64_C(0x7fffffffffffffff)
typedef struct {
@@ -146,7 +147,7 @@
@@ -158,7 +159,7 @@
const char *audio_device = "none";
#endif
#ifndef CONFIG_VIDEO4LINUX
@ -17,7 +17,7 @@
#endif
typedef struct AVOutputStream {
@@ -1601,7 +1602,7 @@
@@ -1842,7 +1843,7 @@
void opt_video_device(const char *arg)
{
@ -26,7 +26,7 @@
}
void opt_audio_device(const char *arg)
@@ -2099,7 +2100,7 @@
@@ -2428,7 +2429,7 @@
/* by now video grab has one stream */
ic->streams[0]->r_frame_rate = ap->frame_rate;
input_files[nb_input_files] = ic;

View File

@ -1,18 +0,0 @@
--- ffserver.c.orig Tue Oct 8 13:45:36 2002
+++ ffserver.c Tue Oct 8 13:46:10 2002
@@ -20,7 +20,6 @@
#include "avformat.h"
#include <stdarg.h>
-#include <netinet/in.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
@@ -30,6 +29,7 @@
#include <time.h>
#include <sys/types.h>
#include <sys/socket.h>
+#include <netinet/in.h>
#include <sys/wait.h>
#include <arpa/inet.h>
#include <netdb.h>

View File

@ -1,9 +0,0 @@
--- libav/avformat.h Mon Jul 8 04:38:40 2002
+++ libav/avformat.h Sun Jul 14 15:22:58 2002
@@ -284,5 +284,5 @@
int video_grab_init(void);
int audio_init(void);
-extern const char *v4l_device;
+extern const char *video_device;
extern const char *audio_device;

View File

@ -1,20 +1,20 @@
--- libav/Makefile.orig Tue Oct 8 13:54:16 2002
+++ libav/Makefile Tue Oct 8 13:54:30 2002
--- libavformat/Makefile.orig Wed Jan 1 21:00:22 2003
+++ libavformat/Makefile Wed Jan 1 21:01:27 2003
@@ -6,7 +6,7 @@
VPATH=$(SRC_PATH)/libav
VPATH=$(SRC_PATH)/libavformat
-CFLAGS= $(OPTFLAGS) -Wall -g -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
+CFLAGS= $(OPTFLAGS) -Wall -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
OBJS= utils.o cutils.o allformats.o
@@ -17,7 +17,7 @@
OBJS+= avio.o aviobuf.o file.o
@@ -21,7 +21,7 @@
endif
ifeq ($(CONFIG_VIDEO4LINUX),yes)
-OBJS+= grab.o
+OBJS+= grab_bsdbktr.o
endif
ifeq ($(CONFIG_AUDIO_OSS),yes)

View File

@ -0,0 +1,11 @@
--- libavformat/avformat.h.orig Wed Jan 1 21:03:56 2003
+++ libavformat/avformat.h Wed Jan 1 21:04:02 2003
@@ -329,7 +329,7 @@
int video_grab_init(void);
int audio_init(void);
-extern const char *v4l_device;
+extern const char *video_device;
extern const char *audio_device;
#ifdef HAVE_AV_CONFIG_H

View File

@ -0,0 +1,17 @@
ATTENTIONATTENTION:
ffmpeg users have reported that older version 0.4.5 encodes faster
than later ffmpeg versions. Therefore, it might prove better for
capturing purposes with Brooktree bktr(4) devices. So, if you want
the additional speed, you might want to try using the ffmpeg045
port. The current ffmpeg port should be used for all other purposes
unless you really need the additional speed.
Do not install both ports at the same time. They install conflicting
files.
- ffmpeg 0.4.5
ports/multimedia/ffmpeg045
- ffmpeg current
ports/multimedia/ffmpeg

View File

@ -9,18 +9,20 @@ lib/libavcodec.a
lib/libavcodec.so
lib/libavcodec.so.%%SHLIB_VERSION%%
lib/libavformat.a
%%VHOOK%%lib/vhook/fish.so
%%VHOOK%%%%IMLIB2%%lib/vhook/imlib2.so
%%VHOOK%%lib/vhook/null.so
%%PORTDOCS%%share/doc/ffmpeg/COPYING
%%PORTDOCS%%share/doc/ffmpeg/Changelog
%%PORTDOCS%%share/doc/ffmpeg/FAQ
%%PORTDOCS%%share/doc/ffmpeg/HOWTO-STREAM
%%PORTDOCS%%share/doc/ffmpeg/README
%%PORTDOCS%%share/doc/ffmpeg/README.beos
%%PORTDOCS%%share/doc/ffmpeg/README.dev
%%PORTDOCS%%share/doc/ffmpeg/README.tech
%%PORTDOCS%%share/doc/ffmpeg/TODO
%%PORTDOCS%%share/doc/ffmpeg/VERSION
%%PORTDOCS%%share/doc/ffmpeg/bench.txt
%%PORTDOCS%%share/doc/ffmpeg/ffmpeg.txt
%%PORTDOCS%%share/doc/ffmpeg/ffserver.txt
%%PORTDOCS%%share/doc/ffmpeg/faq.html
%%PORTDOCS%%share/doc/ffmpeg/faq.texi
%%PORTDOCS%%share/doc/ffmpeg/ffmpeg-doc.html
%%PORTDOCS%%share/doc/ffmpeg/ffmpeg-doc.texi
%%PORTDOCS%%share/doc/ffmpeg/ffserver-doc.html
%%PORTDOCS%%share/doc/ffmpeg/ffserver-doc.texi
%%PORTDOCS%%@dirrm share/doc/ffmpeg
%%VHOOK%%@dirrm lib/vhook
@dirrm include/ffmpeg

View File

@ -6,21 +6,15 @@
#
PORTNAME= ffmpeg
PORTVERSION= 0.4.5
PORTREVISION= 5
PORTVERSION= 0.4.6
CATEGORIES= multimedia audio net
MASTER_SITES= ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= lioux
DISTNAME= ffmpeg-cvs-2002101400
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ffmpeg
MAINTAINER= lioux@FreeBSD.org
BUILD_DEPENDS= nasm:${PORTSDIR}/devel/nasm
LIB_DEPENDS= gnugetopt.1:${PORTSDIR}/devel/libgnugetopt
WRKSRC= ${WRKDIR}/${PORTNAME}
ONLY_FOR_ARCHS= i386
HAS_CONFIGURE= yes
USE_GMAKE= yes
USE_REINPLACE= yes
@ -34,18 +28,31 @@ SHLIB_VERSION= 0
#
DOC_FILES= COPYING Changelog README VERSION
# under subdir doc
DOC_DOCFILES= FAQ README.dev README.tech \
TODO bench.txt ffmpeg.txt \
HOWTO-STREAM README.beos \
ffserver.txt
DOC_DOCFILES= TODO \
faq.html faq.texi \
ffmpeg-doc.html ffmpeg-doc.texi \
ffserver-doc.html ffserver-doc.texi
HEADER_FILES= libavcodec/avcodec.h libavcodec/common.h \
libavcodec/dsputil.h
LIB_FILES= libavcodec/libavcodec.a libav/libavformat.a
LIB_FILES= libavcodec/libavcodec.a libavformat/libavformat.a
.include <bsd.port.pre.mk>
##
## arch detection
##
CONFIGURE_ARGS+= --cpu=${ARCH:L}
#
.if ${ARCH} != "i386"
WITHOUT_MMX= yes
.endif
## lib detection
##
##
.if exists(${X11BASE}/lib/libImlib2.so)
WITH_IMLIB2=yes
.endif
## lame mp3
.if exists(${LOCALBASE}/lib/libmp3lame.so.0)
WITH_MP3=yes
@ -67,6 +74,14 @@ CONFIGURE_ARGS+= --enable-a52 \
CONFIGURE_ARGS+= --enable-a52 \
--disable-a52bin
.endif
## enable imlib2
.if !defined(WITHOUT_VHOOK) && defined(WITH_IMLIB2)
LIB_DEPENDS+= Imlib2.1:${PORTSDIR}/graphics/imlib2
PLIST_SUB+= IMLIB2=""
.else
PLIST_SUB+= IMLIB2="@comment "
.endif
## disable mmx
.ifdef(WITHOUT_MMX)
CONFIGURE_ARGS+= --disable-mmx
@ -84,6 +99,14 @@ CONFIGURE_ARGS+= --extra-cflags="${CFLAGS} -I${LOCALBASE}/include \
.else
CONFIGURE_ARGS+= --extra-cflags="${CFLAGS} -I${LOCALBASE}/include"
.endif
## vhook
.ifndef(WITHOUT_VHOOK)
PLIST_SUB+= VHOOK=""
.else
CONFIGURE_ARGS+= -disable-vhook
PLIST_SUB+= VHOOK="@comment "
.endif
## vorbis
.ifdef(WITH_VORBIS)
LIB_DEPENDS+= vorbisenc.2:${PORTSDIR}/audio/libvorbis
@ -106,7 +129,12 @@ pre-everything::
@${ECHO_MSG} 'You can enable additional compilation optimizations'
@${ECHO_MSG} 'by defining WITH_OPTIMIZED_CFLAGS'
.endif
.ifndef(WITHOUT_VHOOK)
@${ECHO_MSG}
@${ECHO_MSG} 'You can disable vhook support by defining WITHOUT_VHOOK'
.endif
.ifndef(WITH_VORBIS)
@${ECHO_MSG}
@${ECHO_MSG} 'Define WITH_VORBIS to enable libvorbisenc VORBIS codec'
.endif
.if !(defined(WITH_BKTR_FORMAT) && defined(WITH_BKTR_DEV))
@ -123,7 +151,7 @@ pre-everything::
post-extract:
# install booktree extension
@${CP} ${FILESDIR}/grab_bsdbktr.c ${WRKSRC}/libav/
@${CP} ${FILESDIR}/grab_bsdbktr.c ${WRKSRC}/libavformat/
post-patch:
@${REINPLACE_CMD} -e "s!/etc/ffserver.conf!${PREFIX}/etc/ffserver.conf!g" \
@ -135,12 +163,12 @@ post-patch:
.ifdef(WITH_BKTR_FORMAT)
@${REINPLACE_CMD} -e \
"s!VIDEO_FORMAT NTSC!VIDEO_FORMAT ${WITH_BKTR_FORMAT}!" \
${WRKSRC}/libav/grab_bsdbktr.c
${WRKSRC}/libavformat/grab_bsdbktr.c
.endif
.ifdef(WITH_BKTR_DEV)
@${REINPLACE_CMD} -e \
"s!VIDEO_INPUT METEOR_INPUT_DEV0!VIDEO_INPUT METEOR_INPUT_DEV${WITH_BKTR_DEV}!" \
${WRKSRC}/libav/grab_bsdbktr.c
${WRKSRC}/libavformat/grab_bsdbktr.c
.endif
.ifndef(WITHOUT_LIBA52)
@${REINPLACE_CMD} -e 's|-ldl||' \

View File

@ -1 +1 @@
MD5 (ffmpeg-cvs-2002101400.tar.gz) = 13d04dcb31a09ff98a4caccbeed8dbc5
MD5 (ffmpeg-0.4.6.tar.gz) = bdd96d28327d3abe02e886c13e633878

View File

@ -1,14 +1,14 @@
--- ffmpeg.c.orig Thu Oct 10 20:13:52 2002
+++ ffmpeg.c Thu Oct 10 20:14:03 2002
@@ -36,6 +36,7 @@
#include <ctype.h>
--- ffmpeg.c.orig Wed Jan 1 20:56:06 2003
+++ ffmpeg.c Wed Jan 1 20:56:41 2003
@@ -35,6 +35,7 @@
#define INFINITY HUGE_VAL
#endif
+#define INT64_C(x) x##LL
#define MAXINT64 INT64_C(0x7fffffffffffffff)
typedef struct {
@@ -146,7 +147,7 @@
@@ -158,7 +159,7 @@
const char *audio_device = "none";
#endif
#ifndef CONFIG_VIDEO4LINUX
@ -17,7 +17,7 @@
#endif
typedef struct AVOutputStream {
@@ -1601,7 +1602,7 @@
@@ -1842,7 +1843,7 @@
void opt_video_device(const char *arg)
{
@ -26,7 +26,7 @@
}
void opt_audio_device(const char *arg)
@@ -2099,7 +2100,7 @@
@@ -2428,7 +2429,7 @@
/* by now video grab has one stream */
ic->streams[0]->r_frame_rate = ap->frame_rate;
input_files[nb_input_files] = ic;

View File

@ -0,0 +1,20 @@
--- libavformat/Makefile.orig Wed Jan 1 21:00:22 2003
+++ libavformat/Makefile Wed Jan 1 21:01:27 2003
@@ -6,7 +6,7 @@
VPATH=$(SRC_PATH)/libavformat
-CFLAGS= $(OPTFLAGS) -Wall -g -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
+CFLAGS= $(OPTFLAGS) -Wall -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
OBJS= utils.o cutils.o allformats.o
@@ -21,7 +21,7 @@
endif
ifeq ($(CONFIG_VIDEO4LINUX),yes)
-OBJS+= grab.o
+OBJS+= grab_bsdbktr.o
endif
ifeq ($(CONFIG_AUDIO_OSS),yes)

View File

@ -0,0 +1,11 @@
--- libavformat/avformat.h.orig Wed Jan 1 21:03:56 2003
+++ libavformat/avformat.h Wed Jan 1 21:04:02 2003
@@ -329,7 +329,7 @@
int video_grab_init(void);
int audio_init(void);
-extern const char *v4l_device;
+extern const char *video_device;
extern const char *audio_device;
#ifdef HAVE_AV_CONFIG_H

View File

@ -38,8 +38,7 @@ typedef struct {
int frame_format; /* see VIDEO_PALETTE_xxx */
int width, height;
int frame_rate;
INT64 per_frame;
INT64 last_frame_time;
int frame_size;
} VideoData;
const char *video_device = "/dev/bktr0";
@ -60,10 +59,14 @@ const char *video_device = "/dev/bktr0";
#endif
static UINT8 *video_buf;
static int nsignals = 0;
static int signal_expected = 0;
static int unexpected_signals = 0;
static void catchsignal(int signal)
{
nsignals++;
if (!signal_expected) unexpected_signals++;
signal_expected = 0;
return;
}
@ -85,7 +88,6 @@ static int bktr_init(AVFormatContext *s1, AVFormatParameters *ap)
width = s->width;
height = s->height;
s->last_frame_time = 0;
s->tuner_fd = open ("/dev/tuner0", O_RDWR);
if (s->tuner_fd < 0) {
@ -101,7 +103,7 @@ static int bktr_init(AVFormatContext *s1, AVFormatParameters *ap)
geo.rows = height;
geo.columns = width;
geo.frames = 1;
geo.oformat = METEOR_GEO_YUV_422 | METEOR_GEO_YUV_12;
geo.oformat = METEOR_GEO_YUV_PACKED;
if ((format == PAL) && (height <= (PAL_HEIGHT/2)))
geo.oformat |= METEOR_GEO_EVEN_ONLY;
@ -129,7 +131,7 @@ static int bktr_init(AVFormatContext *s1, AVFormatParameters *ap)
perror ("METEORSINPUT");
return -EIO;
}
video_buf = mmap((caddr_t)0, width*height*3, PROT_READ, MAP_SHARED,
video_buf = mmap((caddr_t)0, width*height*2, PROT_READ, MAP_SHARED,
video_fd, (off_t) 0);
if (video_buf == MAP_FAILED) {
perror ("mmap");
@ -138,45 +140,66 @@ static int bktr_init(AVFormatContext *s1, AVFormatParameters *ap)
c = METEOR_CAP_CONTINOUS;
ioctl(s->fd, METEORCAPTUR, &c);
c = SIGUSR1;
signal_expected = 1;
ioctl (s->fd, METEORSSIGNAL, &c);
return 0;
}
static void bf_yuv422_to_yuv420p(UINT8 *lum, UINT8 *cb, UINT8 *cr,
UINT8 *src, int width, int height)
{
int x, y;
UINT8 *p = src;
for(y=0;y<height;y+=2) {
for(x=0;x<width;x+=2) {
lum[0] = p[1];
cb[0] = p[0];
lum[1] = p[3];
cr[0] = p[2];
p += 4;
lum += 2;
cb++;
cr++;
}
for(x=0;x<width;x+=2) {
lum[0] = p[1];
lum[1] = p[3];
p += 4;
lum += 2;
}
}
}
/* note: we support only one picture read at a time */
static int grab_read_packet(AVFormatContext *s1, AVPacket *pkt)
{
VideoData *s = s1->priv_data;
int size, halfsize;
sigset_t msig;
UINT64 curtime;
UINT8 *lum, *cb, *cr;
size = s->width * s->height;
halfsize = size << 1;
if (av_new_packet(pkt, size + halfsize) < 0)
return -EIO;
curtime = av_gettime();
if (!s->last_frame_time
|| ((s->last_frame_time + s->per_frame) > curtime)) {
if (!usleep (s->last_frame_time + s->per_frame + s->per_frame/8 - curtime)) {
if (!nsignals)
printf ("\nSLEPT NO signals - %d microseconds late\n",
av_gettime() - s->last_frame_time - s->per_frame);
}
} else if ((s->last_frame_time + s->per_frame*5 < curtime)) {
bzero (pkt->data, size + halfsize);
printf ("\nBlank %d signals - %d microseconds\n",
nsignals, curtime - s->last_frame_time - s->per_frame);
s->last_frame_time += s->per_frame;
return size + halfsize;
if (unexpected_signals > 0) {
unexpected_signals--;
} else {
signal_expected = 1;
sigemptyset (&msig);
sigsuspend (&msig);
}
nsignals = 0;
s->last_frame_time = s->last_frame_time
? s->last_frame_time + s->per_frame
: av_gettime();
if (unexpected_signals & 1) {
bzero (pkt->data, size + halfsize);
} else {
lum = pkt->data;
cb = lum + size;
cr = cb + size/4;
memcpy (pkt->data, video_buf, size + halfsize);
bf_yuv422_to_yuv420p (lum, cb, cr, video_buf, s->width, s->height);
}
return size + halfsize;
}
@ -203,7 +226,7 @@ static int grab_read_header (AVFormatContext *s1, AVFormatParameters *ap)
s->width = width;
s->height = height;
s->frame_rate = frame_rate;
s->per_frame = (INT64_C(1000000) * FRAME_RATE_BASE) / s->frame_rate;
s->frame_size = width*height*2;
st->codec.pix_fmt = PIX_FMT_YUV420P;
st->codec.codec_id = CODEC_ID_RAWVIDEO;
st->codec.width = width;

View File

@ -1,26 +1,12 @@
--- Makefile.orig Sun Sep 1 15:07:34 2002
+++ Makefile Tue Oct 8 13:51:49 2002
@@ -6,12 +6,12 @@
--- Makefile.orig Wed Jan 1 20:51:57 2003
+++ Makefile Wed Jan 1 20:52:27 2003
@@ -6,8 +6,7 @@
VPATH=$(SRC_PATH)
-CFLAGS= $(OPTFLAGS) -Wall -g -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libav -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
+CFLAGS= $(OPTFLAGS) -Wall -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libav -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
ifeq ($(CONFIG_DARWIN),yes)
LDFLAGS+= -g -d
FFSLDFLAGS= -Wl,-bind_at_load
else
-LDFLAGS+= -g -Wl,--warn-common
+LDFLAGS+= -Wl,--warn-common
FFSLDFLAGS= -Wl,-E
endif
@@ -60,7 +60,7 @@
ffserver$(EXE): ffserver.o $(DEP_LIBS)
$(CC) $(LDFLAGS) $(FFSLDFLAGS) \
-o $@ ffserver.o -L./libavcodec -L./libav \
- -lavformat -lavcodec -ldl $(EXTRALIBS)
+ -lavformat -lavcodec $(EXTRALIBS)
-CFLAGS= $(OPTFLAGS) -Wall -g -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
-LDFLAGS+= -g
+CFLAGS= $(OPTFLAGS) -Wall -I. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -I$(SRC_PATH)/libavformat -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
ffplay: ffmpeg$(EXE)
ln -sf $< $@
ifeq ($(TARGET_GPROF),yes)
CFLAGS+=-p

View File

@ -1,14 +1,14 @@
--- ffmpeg.c.orig Thu Oct 10 20:13:52 2002
+++ ffmpeg.c Thu Oct 10 20:14:03 2002
@@ -36,6 +36,7 @@
#include <ctype.h>
--- ffmpeg.c.orig Wed Jan 1 20:56:06 2003
+++ ffmpeg.c Wed Jan 1 20:56:41 2003
@@ -35,6 +35,7 @@
#define INFINITY HUGE_VAL
#endif
+#define INT64_C(x) x##LL
#define MAXINT64 INT64_C(0x7fffffffffffffff)
typedef struct {
@@ -146,7 +147,7 @@
@@ -158,7 +159,7 @@
const char *audio_device = "none";
#endif
#ifndef CONFIG_VIDEO4LINUX
@ -17,7 +17,7 @@
#endif
typedef struct AVOutputStream {
@@ -1601,7 +1602,7 @@
@@ -1842,7 +1843,7 @@
void opt_video_device(const char *arg)
{
@ -26,7 +26,7 @@
}
void opt_audio_device(const char *arg)
@@ -2099,7 +2100,7 @@
@@ -2428,7 +2429,7 @@
/* by now video grab has one stream */
ic->streams[0]->r_frame_rate = ap->frame_rate;
input_files[nb_input_files] = ic;

View File

@ -1,18 +0,0 @@
--- ffserver.c.orig Tue Oct 8 13:45:36 2002
+++ ffserver.c Tue Oct 8 13:46:10 2002
@@ -20,7 +20,6 @@
#include "avformat.h"
#include <stdarg.h>
-#include <netinet/in.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
@@ -30,6 +29,7 @@
#include <time.h>
#include <sys/types.h>
#include <sys/socket.h>
+#include <netinet/in.h>
#include <sys/wait.h>
#include <arpa/inet.h>
#include <netdb.h>

View File

@ -1,9 +0,0 @@
--- libav/avformat.h Mon Jul 8 04:38:40 2002
+++ libav/avformat.h Sun Jul 14 15:22:58 2002
@@ -284,5 +284,5 @@
int video_grab_init(void);
int audio_init(void);
-extern const char *v4l_device;
+extern const char *video_device;
extern const char *audio_device;

View File

@ -0,0 +1,20 @@
--- libavformat/Makefile.orig Wed Jan 1 21:00:22 2003
+++ libavformat/Makefile Wed Jan 1 21:01:27 2003
@@ -6,7 +6,7 @@
VPATH=$(SRC_PATH)/libavformat
-CFLAGS= $(OPTFLAGS) -Wall -g -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
+CFLAGS= $(OPTFLAGS) -Wall -I.. -I$(SRC_PATH) -I$(SRC_PATH)/libavcodec -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
OBJS= utils.o cutils.o allformats.o
@@ -21,7 +21,7 @@
endif
ifeq ($(CONFIG_VIDEO4LINUX),yes)
-OBJS+= grab.o
+OBJS+= grab_bsdbktr.o
endif
ifeq ($(CONFIG_AUDIO_OSS),yes)

View File

@ -0,0 +1,11 @@
--- libavformat/avformat.h.orig Wed Jan 1 21:03:56 2003
+++ libavformat/avformat.h Wed Jan 1 21:04:02 2003
@@ -329,7 +329,7 @@
int video_grab_init(void);
int audio_init(void);
-extern const char *v4l_device;
+extern const char *video_device;
extern const char *audio_device;
#ifdef HAVE_AV_CONFIG_H

View File

@ -0,0 +1,17 @@
ATTENTIONATTENTION:
ffmpeg users have reported that older version 0.4.5 encodes faster
than later ffmpeg versions. Therefore, it might prove better for
capturing purposes with Brooktree bktr(4) devices. So, if you want
the additional speed, you might want to try using the ffmpeg045
port. The current ffmpeg port should be used for all other purposes
unless you really need the additional speed.
Do not install both ports at the same time. They install conflicting
files.
- ffmpeg 0.4.5
ports/multimedia/ffmpeg045
- ffmpeg current
ports/multimedia/ffmpeg

View File

@ -9,18 +9,20 @@ lib/libavcodec.a
lib/libavcodec.so
lib/libavcodec.so.%%SHLIB_VERSION%%
lib/libavformat.a
%%VHOOK%%lib/vhook/fish.so
%%VHOOK%%%%IMLIB2%%lib/vhook/imlib2.so
%%VHOOK%%lib/vhook/null.so
%%PORTDOCS%%share/doc/ffmpeg/COPYING
%%PORTDOCS%%share/doc/ffmpeg/Changelog
%%PORTDOCS%%share/doc/ffmpeg/FAQ
%%PORTDOCS%%share/doc/ffmpeg/HOWTO-STREAM
%%PORTDOCS%%share/doc/ffmpeg/README
%%PORTDOCS%%share/doc/ffmpeg/README.beos
%%PORTDOCS%%share/doc/ffmpeg/README.dev
%%PORTDOCS%%share/doc/ffmpeg/README.tech
%%PORTDOCS%%share/doc/ffmpeg/TODO
%%PORTDOCS%%share/doc/ffmpeg/VERSION
%%PORTDOCS%%share/doc/ffmpeg/bench.txt
%%PORTDOCS%%share/doc/ffmpeg/ffmpeg.txt
%%PORTDOCS%%share/doc/ffmpeg/ffserver.txt
%%PORTDOCS%%share/doc/ffmpeg/faq.html
%%PORTDOCS%%share/doc/ffmpeg/faq.texi
%%PORTDOCS%%share/doc/ffmpeg/ffmpeg-doc.html
%%PORTDOCS%%share/doc/ffmpeg/ffmpeg-doc.texi
%%PORTDOCS%%share/doc/ffmpeg/ffserver-doc.html
%%PORTDOCS%%share/doc/ffmpeg/ffserver-doc.texi
%%PORTDOCS%%@dirrm share/doc/ffmpeg
%%VHOOK%%@dirrm lib/vhook
@dirrm include/ffmpeg