Hi,
From Change Log, Changes in rtmpdump v2.4 are:-
11 July 2011, v2.4
- add RTMPE type 9 handshake support
Attached is a patch for the ports tree, I have built rtmpdump v2.4 on
amd64/i386, tested rtmpdump on amd64 for downloads using get_iplayer 3
TV and 6 radio programmes, get_flash_videos from ITV, Channel 5, NBC sites.
No source tar ball is available yet, this update is for testing until
one becomes available. To download from git and create a source tar ball
use -
git clone git://git.ffmpeg.org/rtmpdump
cd rtmpdump
git archive --format=tar --prefix=rtmpdump-2.4/
c28f1bab7822de97353849e7787b59e50bbb1428
| gzip >/usr/ports/distfiles/rtmpdump-2.4.tgz
The distinfo may not match, and need updating.
Regards
Nigel Taylor
diff -rNu -x CVS /usr/ports/net/rtmpdump/Makefile rtmpdump/Makefile
--- /usr/ports/net/rtmpdump/Makefile Wed Mar 23 11:46:18 2011
+++ rtmpdump/Makefile Thu Jul 14 13:14:46 2011
@@ -4,8 +4,7 @@
COMMENT = dump RTMP media streams
-DISTNAME = rtmpdump-2.3
-REVISION = 0
+DISTNAME = rtmpdump-2.4
EXTRACT_SUFX = .tgz
CATEGORIES = net
@@ -22,14 +21,10 @@
MASTER_SITES = ${HOMEPAGE}download/
-MAKE_FLAGS = CC="${CC}" XCFLAGS="${CFLAGS}" OPT= THREADLIB=-pthread
+MAKE_FLAGS = CC="${CC}" XCFLAGS="${CFLAGS}" OPT= THREADLIB=-pthread
SO_VERSION=${LIBrtmp_VERSION}
USE_GROFF = Yes
NO_REGRESS = Yes
-
-do-configure:
- perl -pi -e 's,so\.0,so.${LIBrtmp_VERSION},g' \
- ${WRKSRC}/librtmp/Makefile
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/rtmpdump
diff -rNu -x CVS /usr/ports/net/rtmpdump/distinfo rtmpdump/distinfo
--- /usr/ports/net/rtmpdump/distinfo Sat Nov 13 12:37:33 2010
+++ rtmpdump/distinfo Thu Jul 14 12:18:45 2011
@@ -1,5 +1,5 @@
-MD5 (rtmpdump-2.3.tgz) = 65YfMc1V8Kz1qtGnuQDvWQ==
-RMD160 (rtmpdump-2.3.tgz) = HUiSXmVneDgG+miBnWppXNBhOLw=
-SHA1 (rtmpdump-2.3.tgz) = tlzncIrnmttR0fQ90LbZhwdtfEI=
-SHA256 (rtmpdump-2.3.tgz) = 7zi3qZ2CzmkSBj0hBjrq8oGFNBs99IbiS//OU1QiSyw=
-SIZE (rtmpdump-2.3.tgz) = 125103
+MD5 (rtmpdump-2.4.tgz) = OAJP8MMj4BsqtH+g9wh4Iw==
+RMD160 (rtmpdump-2.4.tgz) = CyUIpg8ghhNOBMWAjsYqGIEj03g=
+SHA1 (rtmpdump-2.4.tgz) = 89gKbM4D29xmxkqRpRbtCXrd/Yg=
+SHA256 (rtmpdump-2.4.tgz) = LhZyKUlSyU2hGZsQjDWnAAWkKBKc/jl5DLz4jxsOXi0=
+SIZE (rtmpdump-2.4.tgz) = 134313
diff -rNu -x CVS /usr/ports/net/rtmpdump/patches/patch-Makefile
rtmpdump/patches/patch-Makefile
--- /usr/ports/net/rtmpdump/patches/patch-Makefile Mon Mar 21 09:46:31 2011
+++ rtmpdump/patches/patch-Makefile Thu Jan 1 01:00:00 1970
@@ -1,81 +0,0 @@
-$OpenBSD: patch-Makefile,v 1.8 2011/03/21 09:46:31 sthen Exp $
---- Makefile.orig Wed Jun 30 20:58:35 2010
-+++ Makefile Sun Mar 20 19:11:50 2011
-@@ -11,9 +11,10 @@ SYS=posix
- CRYPTO=OPENSSL
- #CRYPTO=POLARSSL
- #CRYPTO=GNUTLS
--LIB_GNUTLS=-lgnutls -lgcrypt
--LIB_OPENSSL=-lssl -lcrypto
--LIB_POLARSSL=-lpolarssl
-+LIBZ=-lz
-+LIB_GNUTLS=-lgnutls -lgcrypt $(LIBZ)
-+LIB_OPENSSL=-lssl -lcrypto $(LIBZ)
-+LIB_POLARSSL=-lpolarssl $(LIBZ)
- CRYPTO_LIB=$(LIB_$(CRYPTO))
- DEF_=-DNO_CRYPTO
- CRYPTO_DEF=$(DEF_$(CRYPTO))
-@@ -32,10 +33,12 @@ SBINDIR=$(DESTDIR)$(sbindir)
- MANDIR=$(DESTDIR)$(mandir)
-
- LIBS_posix=
-+LIBS_darwin=
- LIBS_mingw=-lws2_32 -lwinmm -lgdi32
--LIBS=$(CRYPTO_LIB) -lz $(LIBS_$(SYS)) $(XLIBS)
-+LIBS=-Llibrtmp -lrtmp $(CRYPTO_LIB) $(LIBS_$(SYS)) $(XLIBS)
-
- THREADLIB_posix=-lpthread
-+THREADLIB_darwin=-lpthread
- THREADLIB_mingw=
- THREADLIB=$(THREADLIB_$(SYS))
- SLIBS=$(THREADLIB) $(LIBS)
-@@ -44,14 +47,17 @@ LIBRTMP=librtmp/librtmp.a
- INCRTMP=librtmp/rtmp_sys.h librtmp/rtmp.h librtmp/log.h librtmp/amf.h
-
- EXT_posix=
-+EXT_darwin=
- EXT_mingw=.exe
- EXT=$(EXT_$(SYS))
-
--all: $(LIBRTMP) progs
-+PROGS=rtmpdump rtmpgw rtmpsrv rtmpsuck
-
--progs: rtmpdump rtmpgw rtmpsrv rtmpsuck
-+all: $(LIBRTMP) $(PROGS)
-
--install: progs
-+$(PROGS): $(LIBRTMP)
-+
-+install: $(PROGS)
- -mkdir -p $(BINDIR) $(SBINDIR) $(MANDIR)/man1 $(MANDIR)/man8
- cp rtmpdump$(EXT) $(BINDIR)
- cp rtmpgw$(EXT) rtmpsrv$(EXT) rtmpsuck$(EXT) $(SBINDIR)
-@@ -68,20 +74,17 @@ FORCE:
- $(LIBRTMP): FORCE
- @cd librtmp; $(MAKE) all
-
--# note: $^ is GNU Make's equivalent to BSD $>
--# we use both since either make will ignore the one it doesn't recognize
-+rtmpdump: rtmpdump.o
-+ $(CC) $(LDFLAGS) -o $@$(EXT) $@.o $(LIBS)
-
--rtmpdump: rtmpdump.o $(LIBRTMP)
-- $(CC) $(LDFLAGS) $^ $> -o $@$(EXT) $(LIBS)
-+rtmpsrv: rtmpsrv.o thread.o
-+ $(CC) $(LDFLAGS) -o $@$(EXT) $@.o thread.o $(SLIBS)
-
--rtmpsrv: rtmpsrv.o thread.o $(LIBRTMP)
-- $(CC) $(LDFLAGS) $^ $> -o $@$(EXT) $(SLIBS)
-+rtmpsuck: rtmpsuck.o thread.o
-+ $(CC) $(LDFLAGS) -o $@$(EXT) $@.o thread.o $(SLIBS)
-
--rtmpsuck: rtmpsuck.o thread.o $(LIBRTMP)
-- $(CC) $(LDFLAGS) $^ $> -o $@$(EXT) $(SLIBS)
--
--rtmpgw: rtmpgw.o thread.o $(LIBRTMP)
-- $(CC) $(LDFLAGS) $^ $> -o $@$(EXT) $(SLIBS)
-+rtmpgw: rtmpgw.o thread.o
-+ $(CC) $(LDFLAGS) -o $@$(EXT) $@.o thread.o $(SLIBS)
-
- rtmpgw.o: rtmpgw.c $(INCRTMP) Makefile
- rtmpdump.o: rtmpdump.c $(INCRTMP) Makefile
diff -rNu -x CVS /usr/ports/net/rtmpdump/patches/patch-librtmp_Makefile
rtmpdump/patches/patch-librtmp_Makefile
--- /usr/ports/net/rtmpdump/patches/patch-librtmp_Makefile Thu Jan 1
01:00:00 1970
+++ rtmpdump/patches/patch-librtmp_Makefile Thu Jul 14 13:14:06 2011
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- librtmp/Makefile.orig Tue Jul 12 01:24:33 2011
++++ librtmp/Makefile Thu Jul 14 13:13:52 2011
+@@ -36,7 +36,7 @@ CRYPTO_LIB=$(LIB_$(CRYPTO)) $(PRIVATE_LIBS)
+ CRYPTO_REQ=$(REQ_$(CRYPTO))
+ CRYPTO_DEF=$(DEF_$(CRYPTO))
+
+-SO_VERSION=0
++SO_VERSION?=0
+ SOX_posix=so
+ SOX_darwin=dylib
+ SOX_mingw=so # useless
diff -rNu -x CVS /usr/ports/net/rtmpdump/patches/patch-librtmp_handshake_h
rtmpdump/patches/patch-librtmp_handshake_h
--- /usr/ports/net/rtmpdump/patches/patch-librtmp_handshake_h Mon Mar 21
09:46:31 2011
+++ rtmpdump/patches/patch-librtmp_handshake_h Thu Jan 1 01:00:00 1970
@@ -1,16 +0,0 @@
-$OpenBSD: patch-librtmp_handshake_h,v 1.1 2011/03/21 09:46:31 sthen Exp $
---- librtmp/handshake.h.orig Wed Jun 30 20:58:35 2010
-+++ librtmp/handshake.h Sun Mar 20 19:11:50 2011
-@@ -400,8 +400,10 @@ HandShake(RTMP * r, int FP9HandShake)
- /* set version to at least 9.0.115.0 */
- if (encrypted)
- {
-- clientsig[4] = 128;
-- clientsig[6] = 3;
-+/* clientsig[4] = 128;
-+ clientsig[6] = 3; */
-+ clientsig[4] = 0x7c;
-+ clientsig[6] = 0x2;
- }
- else
- {
diff -rNu -x CVS /usr/ports/net/rtmpdump/patches/patch-librtmp_librtmp_pc_in
rtmpdump/patches/patch-librtmp_librtmp_pc_in
--- /usr/ports/net/rtmpdump/patches/patch-librtmp_librtmp_pc_in Mon Mar 21
09:46:31 2011
+++ rtmpdump/patches/patch-librtmp_librtmp_pc_in Thu Jan 1 01:00:00 1970
@@ -1,17 +0,0 @@
-$OpenBSD: patch-librtmp_librtmp_pc_in,v 1.1 2011/03/21 09:46:31 sthen Exp $
---- librtmp/librtmp.pc.in.orig Wed Jun 30 20:58:34 2010
-+++ librtmp/librtmp.pc.in Sun Mar 20 19:11:50 2011
-@@ -1,6 +1,6 @@
- prefix=@prefix@
- exec_prefix=${prefix}
--libdir=${exec_prefix}/lib
-+libdir=@libdir@
- incdir=${prefix}/include
-
- Name: librtmp
-@@ -9,4 +9,5 @@ Version: @VERSION@
- Requires: @CRYPTO_REQ@
- URL: http://rtmpdump.mplayerhq.hu
- Libs: -L${libdir} -lrtmp -lz
-+Libs.private: @PRIVATE_LIBS@
- Cflags: -I${incdir}
diff -rNu -x CVS /usr/ports/net/rtmpdump/patches/patch-librtmp_rtmp_c
rtmpdump/patches/patch-librtmp_rtmp_c
--- /usr/ports/net/rtmpdump/patches/patch-librtmp_rtmp_c Mon Mar 21
09:46:31 2011
+++ rtmpdump/patches/patch-librtmp_rtmp_c Thu Jan 1 01:00:00 1970
@@ -1,105 +0,0 @@
-$OpenBSD: patch-librtmp_rtmp_c,v 1.1 2011/03/21 09:46:31 sthen Exp $
---- librtmp/rtmp.c.orig Wed Jun 30 20:58:35 2010
-+++ librtmp/rtmp.c Sun Mar 20 19:11:50 2011
-@@ -877,7 +877,13 @@ RTMP_Connect1(RTMP *r, RTMPPacket *cp)
- r->m_clientID.av_val = NULL;
- r->m_clientID.av_len = 0;
- HTTP_Post(r, RTMPT_OPEN, "", 1);
-- HTTP_read(r, 1);
-+ if (HTTP_read(r, 1) != 0)
-+ {
-+ r->m_msgCounter = 0;
-+ RTMP_Log(RTMP_LOGDEBUG, "%s, Could not connect for handshake",
__FUNCTION__);
-+ RTMP_Close(r);
-+ return 0;
-+ }
- r->m_msgCounter = 0;
- }
- RTMP_Log(RTMP_LOGDEBUG, "%s, ... connected, handshaking", __FUNCTION__);
-@@ -1019,6 +1025,9 @@ RTMP_ToggleStream(RTMP *r)
-
- if (!r->m_pausing)
- {
-+ if (RTMP_IsTimedout(r) && r->m_read.status == RTMP_READ_EOF)
-+ r->m_read.status = 0;
-+
- res = RTMP_SendPause(r, TRUE, r->m_pauseStamp);
- if (!res)
- return res;
-@@ -1281,7 +1290,12 @@ ReadN(RTMP *r, char *buffer, int n)
- return 0;
- }
- }
-- HTTP_read(r, 0);
-+ if (HTTP_read(r, 0) == -1)
-+ {
-+ RTMP_Log(RTMP_LOGDEBUG, "%s, No valid HTTP response found",
__FUNCTION__);
-+ RTMP_Close(r);
-+ return 0;
-+ }
- }
- if (r->m_resplen && !r->m_sb.sb_size)
- RTMPSockBuf_Fill(&r->m_sb);
-@@ -2789,11 +2803,17 @@ HandleCtrl(RTMP *r, const RTMPPacket *packet)
- if (nType == 0x1A)
- {
- RTMP_Log(RTMP_LOGDEBUG, "%s, SWFVerification ping received: ",
__FUNCTION__);
-+ if (packet->m_nBodySize > 2 && packet->m_body[2] > 0x01)
-+ {
-+ RTMP_Log(RTMP_LOGERROR,
-+ "%s: SWFVerification Type %d request not supported! Patches
welcome...",
-+ __FUNCTION__, packet->m_body[2]);
-+ }
- #ifdef CRYPTO
- /*RTMP_LogHex(packet.m_body, packet.m_nBodySize); */
-
- /* respond with HMAC SHA256 of decompressed SWF, key is the 30byte
player key, also the last 30 bytes of the server handshake are applied */
-- if (r->Link.SWFSize)
-+ else if (r->Link.SWFSize)
- {
- RTMP_SendCtrl(r, 0x1B, 0, 0);
- }
-@@ -3386,10 +3406,10 @@ RTMP_Close(RTMP *r)
- {
- if (r->m_stream_id > 0)
- {
-- if ((r->Link.protocol & RTMP_FEATURE_WRITE))
-- SendFCUnpublish(r);
- i = r->m_stream_id;
- r->m_stream_id = 0;
-+ if ((r->Link.protocol & RTMP_FEATURE_WRITE))
-+ SendFCUnpublish(r);
- SendDeleteStream(r, i);
- }
- if (r->m_clientID.av_val)
-@@ -3661,14 +3681,18 @@ HTTP_read(RTMP *r, int fill)
- if (fill)
- RTMPSockBuf_Fill(&r->m_sb);
- if (r->m_sb.sb_size < 144)
-- return -1;
-+ return -2;
- if (strncmp(r->m_sb.sb_start, "HTTP/1.1 200 ", 13))
- return -1;
-- ptr = strstr(r->m_sb.sb_start, "Content-Length:");
-+ ptr = r->m_sb.sb_start + sizeof("HTTP/1.1 200");
-+ while ((ptr = strstr(ptr, "Content-"))) {
-+ if (!strncasecmp(ptr+8, "length:", 7)) break;
-+ ptr += 8;
-+ }
- if (!ptr)
- return -1;
- hlen = atoi(ptr+16);
-- ptr = strstr(ptr, "\r\n\r\n");
-+ ptr = strstr(ptr+16, "\r\n\r\n");
- if (!ptr)
- return -1;
- ptr += 4;
-@@ -4070,7 +4094,7 @@ Read_1_Packet(RTMP *r, char *buf, unsigned int buflen)
- /* grab first timestamp and see if it needs fixing */
- nTimeStamp = AMF_DecodeInt24(packetBody + 4);
- nTimeStamp |= (packetBody[7] << 24);
-- delta = packet.m_nTimeStamp - nTimeStamp;
-+ delta = packet.m_nTimeStamp - nTimeStamp + r->m_read.nResumeTS;
-
- while (pos + 11 < nPacketLen)
- {
diff -rNu -x CVS /usr/ports/net/rtmpdump/patches/patch-librtmp_rtmp_sys_h
rtmpdump/patches/patch-librtmp_rtmp_sys_h
--- /usr/ports/net/rtmpdump/patches/patch-librtmp_rtmp_sys_h Mon Mar 21
09:46:31 2011
+++ rtmpdump/patches/patch-librtmp_rtmp_sys_h Thu Jul 14 12:28:14 2011
@@ -1,7 +1,7 @@
-$OpenBSD: patch-librtmp_rtmp_sys_h,v 1.1 2011/03/21 09:46:31 sthen Exp $
---- librtmp/rtmp_sys.h.orig Mon Mar 21 09:33:05 2011
-+++ librtmp/rtmp_sys.h Mon Mar 21 09:33:23 2011
-@@ -49,10 +49,10 @@
+$OpenBSD$
+--- librtmp/rtmp_sys.h.orig Tue Jul 12 01:24:33 2011
++++ librtmp/rtmp_sys.h Thu Jul 14 12:27:55 2011
+@@ -46,10 +46,10 @@
#include <sys/socket.h>
#include <sys/times.h>
#include <netdb.h>
diff -rNu -x CVS /usr/ports/net/rtmpdump/patches/patch-rtmpdump_c
rtmpdump/patches/patch-rtmpdump_c
--- /usr/ports/net/rtmpdump/patches/patch-rtmpdump_c Mon Mar 21 09:46:31 2011
+++ rtmpdump/patches/patch-rtmpdump_c Thu Jan 1 01:00:00 1970
@@ -1,12 +0,0 @@
-$OpenBSD: patch-rtmpdump_c,v 1.1 2011/03/21 09:46:31 sthen Exp $
---- rtmpdump.c.orig Wed Jun 30 20:58:35 2010
-+++ rtmpdump.c Sun Mar 20 19:11:50 2011
-@@ -583,7 +583,7 @@ Download(RTMP * rtmp, // connected RTMP object
- #endif
-
- }
-- while (!RTMP_ctrlC && nRead > -1 && RTMP_IsConnected(rtmp));
-+ while (!RTMP_ctrlC && nRead > -1 && RTMP_IsConnected(rtmp) &&
!RTMP_IsTimedout(rtmp));
- free(buffer);
- if (nRead < 0)
- nRead = rtmp->m_read.status;
diff -rNu -x CVS /usr/ports/net/rtmpdump/patches/patch-rtmpsrv_c
rtmpdump/patches/patch-rtmpsrv_c
--- /usr/ports/net/rtmpdump/patches/patch-rtmpsrv_c Mon Mar 21 09:46:31 2011
+++ rtmpdump/patches/patch-rtmpsrv_c Thu Jan 1 01:00:00 1970
@@ -1,21 +0,0 @@
-$OpenBSD: patch-rtmpsrv_c,v 1.1 2011/03/21 09:46:31 sthen Exp $
---- rtmpsrv.c.orig Wed Jun 30 20:58:35 2010
-+++ rtmpsrv.c Sun Mar 20 19:11:50 2011
-@@ -266,7 +266,7 @@ static int
- SendPlayStart(RTMP *r)
- {
- RTMPPacket packet;
-- char pbuf[384], *pend = pbuf+sizeof(pbuf);
-+ char pbuf[512], *pend = pbuf+sizeof(pbuf);
-
- packet.m_nChannel = 0x03; // control channel (invoke)
- packet.m_headerType = 1; /* RTMP_PACKET_SIZE_MEDIUM; */
-@@ -298,7 +298,7 @@ static int
- SendPlayStop(RTMP *r)
- {
- RTMPPacket packet;
-- char pbuf[384], *pend = pbuf+sizeof(pbuf);
-+ char pbuf[512], *pend = pbuf+sizeof(pbuf);
-
- packet.m_nChannel = 0x03; // control channel (invoke)
- packet.m_headerType = 1; /* RTMP_PACKET_SIZE_MEDIUM; */