[rtmpdump] branch master updated. e0056c5 Add option --realtime (-R) to rtmpdump to disable the BUFX hack

gitolite gil at avcodec.org
Thu Jul 26 13:59:36 CEST 2012


The branch, master has been updated
       via  e0056c51cc1710c9a44d2a2c4e2f344fa9cabcf4 (commit)
       via  603ff20e9e717a70b5b0c011f3413cf376d0c2f6 (commit)
      from  7340f6dbc6b3c8e552baab2e5a891c2de75cddcc (commit)


- Log -----------------------------------------------------------------
commit e0056c51cc1710c9a44d2a2c4e2f344fa9cabcf4
Author:     Ulrik Dickow <u.dickow at gmail.com>
AuthorDate: Tue Jul 24 17:17:26 2012 +0200
Commit:     Howard Chu <hyc at highlandsun.com>
CommitDate: Thu Jul 26 04:59:16 2012 -0700

    Add option --realtime (-R) to rtmpdump to disable the BUFX hack

diff --git a/rtmpdump.1 b/rtmpdump.1
index 0d9de8d..7bb5328 100644
--- a/rtmpdump.1
+++ b/rtmpdump.1
@@ -1,4 +1,4 @@
-.TH RTMPDUMP 1 "2011-07-20" "RTMPDump v2.4"
+.TH RTMPDUMP 1 "2012-07-24" "RTMPDump v2.4"
 .\" Copyright 2011 Howard Chu.
 .\" Copying permitted according to the GNU General Public License V2.
 .SH NAME
@@ -177,6 +177,12 @@ live streams is possible.
 Name of live stream to subscribe to. Defaults to
 .IR playpath .
 .TP
+.B \-\-realtime	\-R
+Download approximately in realtime, without attempting to speed up via
+Pause/Unpause commands ("the BUFX hack").
+Useful for servers that jump backwards in time at the Unpause command.
+Resuming and seeking in realtime streams is still possible.
+.TP
 .B \-\-resume		\-e
 Resume an incomplete RTMP download.
 .TP
diff --git a/rtmpdump.1.html b/rtmpdump.1.html
index 826f722..4c39b35 100644
--- a/rtmpdump.1.html
+++ b/rtmpdump.1.html
@@ -6,7 +6,7 @@
 <tr><td>RTMPDUMP(1)<td align="center"><td align="right">RTMPDUMP(1)
 </thead>
 <tfoot>
-<tr><td>RTMPDump v2.4<td align="center">2011-07-20<td align="right">RTMPDUMP(1)
+<tr><td>RTMPDump v2.4<td align="center">2012-07-24<td align="right">RTMPDUMP(1)
 </tfoot>
 <tbody><tr><td colspan="3"><br><br><ul>
 <!-- Copyright 2011 Howard Chu.
@@ -34,6 +34,7 @@ rtmpdump − RTMP streaming media client
 [<b>−y</b><i> playpath</i>]
 [<b>−Y</b>]
 [<b>−v</b>]
+[<b>−R</b>]
 [<b>−d</b><i> subscription</i>]
 [<b>−e</b>]
 [<b>−k</b><i> skip</i>]
@@ -218,6 +219,15 @@ Name of live stream to subscribe to. Defaults to
 </dl>
 <p>
 <dl compact><dt>
+<b>−−realtime −R</b>
+<dd>
+Download approximately in realtime, without attempting to speed up via
+Pause/Unpause commands ("the BUFX hack").
+Useful for servers that jump backwards in time at the Unpause command.
+Resuming and seeking in realtime streams is still possible.
+</dl>
+<p>
+<dl compact><dt>
 <b>−−resume −e</b>
 <dd>
 Resume an incomplete RTMP download.
diff --git a/rtmpdump.c b/rtmpdump.c
index 34bfdba..e52f7d4 100644
--- a/rtmpdump.c
+++ b/rtmpdump.c
@@ -441,7 +441,7 @@ GetLastKeyframe(FILE * file,	// output file [in]
 
 int
 Download(RTMP * rtmp,		// connected RTMP object
-	 FILE * file, uint32_t dSeek, uint32_t dStopOffset, double duration, int bResume, char *metaHeader, uint32_t nMetaHeaderSize, char *initialFrame, int initialFrameType, uint32_t nInitialFrameSize, int nSkipKeyFrames, int bStdoutMode, int bLiveStream, int bHashes, int bOverrideBufferTime, uint32_t bufferTime, double *percent)	// percentage downloaded [out]
+	 FILE * file, uint32_t dSeek, uint32_t dStopOffset, double duration, int bResume, char *metaHeader, uint32_t nMetaHeaderSize, char *initialFrame, int initialFrameType, uint32_t nInitialFrameSize, int nSkipKeyFrames, int bStdoutMode, int bLiveStream, int bRealtimeStream, int bHashes, int bOverrideBufferTime, uint32_t bufferTime, double *percent)	// percentage downloaded [out]
 {
   int32_t now, lastUpdate;
   int bufferSize = 64 * 1024;
@@ -492,6 +492,8 @@ Download(RTMP * rtmp,		// connected RTMP object
 		    bResume ? "Resuming" : "Starting",
 		    (double) size / 1024.0);
 	}
+      if (bRealtimeStream)
+	RTMP_LogPrintf("  in approximately realtime (disabled BUFX speedup hack)\n");
     }
 
   if (dStopOffset > 0)
@@ -682,6 +684,8 @@ void usage(char *prog)
 	  RTMP_LogPrintf
 	    ("--subscribe|-d string   Stream name to subscribe to (otherwise defaults to playpath if live is specifed)\n");
 	  RTMP_LogPrintf
+	    ("--realtime|-R           Don't attempt to speed up download via the Pause/Unpause BUFX hack\n");
+	  RTMP_LogPrintf
 	    ("--flv|-o string         FLV output file name, if the file name is - print stream to stdout\n");
 	  RTMP_LogPrintf
 	    ("--resume|-e             Resume a partial RTMP download\n");
@@ -748,6 +752,7 @@ main(int argc, char **argv)
   int protocol = RTMP_PROTOCOL_UNDEFINED;
   int retries = 0;
   int bLiveStream = FALSE;	// is it a live stream? then we can't seek/resume
+  int bRealtimeStream = FALSE;  // If true, disable the BUFX hack (be patient)
   int bHashes = FALSE;		// display byte counters not hashes by default
 
   long int timeout = DEF_TIMEOUT;	// timeout connection after 120 seconds
@@ -832,6 +837,7 @@ main(int argc, char **argv)
 #endif
     {"flashVer", 1, NULL, 'f'},
     {"live", 0, NULL, 'v'},
+    {"realtime", 0, NULL, 'R'},
     {"flv", 1, NULL, 'o'},
     {"resume", 0, NULL, 'e'},
     {"timeout", 1, NULL, 'm'},
@@ -851,7 +857,7 @@ main(int argc, char **argv)
 
   while ((opt =
 	  getopt_long(argc, argv,
-		      "hVveqzr:s:t:p:a:b:f:o:u:C:n:c:l:y:Ym:k:d:A:B:T:w:x:W:X:S:#j:",
+		      "hVveqzRr:s:t:p:a:b:f:o:u:C:n:c:l:y:Ym:k:d:A:B:T:w:x:W:X:S:#j:",
 		      longopts, NULL)) != -1)
     {
       switch (opt)
@@ -936,6 +942,9 @@ main(int argc, char **argv)
 	case 'v':
 	  bLiveStream = TRUE;	// no seeking or resuming possible!
 	  break;
+	case 'R':
+	  bRealtimeStream = TRUE; // seeking and resuming is still possible
+	  break;
 	case 'd':
 	  STR2AVAL(subscribepath, optarg);
 	  break;
@@ -1181,7 +1190,7 @@ main(int argc, char **argv)
 		   &flashVer, &subscribepath, &usherToken, dSeek, dStopOffset, bLiveStream, timeout);
 
   /* Try to keep the stream moving if it pauses on us */
-  if (!bLiveStream && !(protocol & RTMP_FEATURE_HTTP))
+  if (!bLiveStream && !bRealtimeStream && !(protocol & RTMP_FEATURE_HTTP))
     rtmp.Link.lFlags |= RTMP_LF_BUFX;
 
   off_t size = 0;
@@ -1348,8 +1357,8 @@ main(int argc, char **argv)
 
       nStatus = Download(&rtmp, file, dSeek, dStopOffset, duration, bResume,
 			 metaHeader, nMetaHeaderSize, initialFrame,
-			 initialFrameType, nInitialFrameSize,
-			 nSkipKeyFrames, bStdoutMode, bLiveStream, bHashes,
+			 initialFrameType, nInitialFrameSize, nSkipKeyFrames,
+			 bStdoutMode, bLiveStream, bRealtimeStream, bHashes,
 			 bOverrideBufferTime, bufferTime, &percent);
       free(initialFrame);
       initialFrame = NULL;

commit 603ff20e9e717a70b5b0c011f3413cf376d0c2f6
Author:     Ulrik Dickow <u.dickow at gmail.com>
AuthorDate: Thu Jul 26 04:57:23 2012 -0700
Commit:     Howard Chu <hyc at highlandsun.com>
CommitDate: Thu Jul 26 04:58:17 2012 -0700

    Add .gitignore to ignore generated files

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c7ec44f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+*.[oa]
+*.exe
+*.so
+*.so.[0-9]
+*.dylib
+rtmpdump
+rtmpgw
+rtmpsrv
+rtmpsuck

-----------------------------------------------------------------------

Summary of changes:
 .gitignore      |    9 +++++++++
 rtmpdump.1      |    8 +++++++-
 rtmpdump.1.html |   12 +++++++++++-
 rtmpdump.c      |   19 ++++++++++++++-----
 4 files changed, 41 insertions(+), 7 deletions(-)
 create mode 100644 .gitignore


hooks/post-receive
-- 



More information about the rtmpdump mailing list