[rtmpdump] Experimental patch to automatically disable BUFX [was: Re: another verifiable "video jumps-backwards" case]

Ulrik Dickow udickow at gmail.com
Mon Aug 13 16:57:45 CEST 2012


On 07-08-2012 22:26, Gunnar wrote:
> OK, disabling the BUFX-hack, --R is now implemented, great!

You're welcome :) (-R).

> Before I start trying more tricks on my own, what about, and has-or-is
> anyone else working on something like this

Yes, a little bit.

> -- it seems possible to detect this  jmp-backwards from the  EOF
> received ctrl packet

Didn't look at that, but...

> (better than comparing time stamps,etc "on the fly"?)

Perhaps.  A first good shot at comparing time stamps on the fly was
published to the mailing list on May 4 2012 by Jindřich Makovička:

   http://lists.mplayerhq.hu/pipermail/rtmpdump/2012-May/001947.html

It still applies cleanly to master.  I repost his patch here as my first
attachment (PATCH 1/2), because my extended patch in the second
attachment (PATCH 2/2) elaborates on the idea.  See the long log comment
in patch 2.

> -- minimum "fix", at least exit rtmpdump with error-bells screaming,
> user can then manually add the -R switch

As you can see in attachment 3, the combined patches 1+2 (= git2) fixes
the problem perfectly with the CSPAN server, giving bit-identical results of

    current master with -R

versus

    git2 version without -R (automatically disabling BUFX as needed)

This experimental version also gives perfect, bit-identical result with
the server that I originally implemented -R for (with -A 713 -B 813, no
longer needing -R).

Thus we shouldn't need to scream at all until we find a server where the
output is not perfect -- or if the time wasted on BUFX auto-disabling is
more than the handful of seconds presently observed (at most).

I _do_ scream a bit more than needed, perhaps, in the current patch,
emitting a single WARNING line that often gets buried among INFO-lines.

If you want to warn users more loudly that the download was not 100%
safe/optimal, you could add a few lines in rtmpdump.c to detect that the
library disabled the BUFX flag during download, and then as a final
output line recommend that -R is used explicitly for future downloads
from this server.

> -- automatic restart after detection with BUFXHack disabled

Sort of.  Patch 1+2 just let the packets flow by by themselves, dropping
the ones that are "too old" for the output, hoping that we hit exactly
the right frame again later on (and INFO-logging the successful hits for
these audio+video packets).

> (demands lots of re-inits of variables, pointers,flags,etc?)
> (changed one old non-lib rtmpdump to be able to loop through many
> downloads, got messy, always something "wrong' in specific situations)

Probably much easier now with the present rtmpdump master to try that
again if you think the timestamp-skipping method is too risky or ugly.

> But it seems that at that point this "jump-back-problem" can be "totally
> fixed"

Right.  Full fix requires that librtmpdump safely detects and corrects
the problem.  The attached patches are not 100% safe, but as mentioned
earlier, at least I've seen the combined patch work 100% correctly at
two different servers.

Since the attached test session is somewhat large, I'll point to the
last test as the most interesting one, essentially this:

	$ .../rtmpdump -r rtmp://video.c-spanarchives.org/bwcheck -y
mp4:downloads/305/305813-2/305813-2-MP4-STD/305813-2-MP4-STD_01.mp4 -A
1800 -B 2100 -o cspan-1800_2100_git2.flv
	RTMPDump v2.4-37-g6664a87
	[...]
	INFO:   duration              3467.61
	INFO: Timestamp jumped from 1807985 ms to 1800006 ms.  Disabling BUFX
hack and catching up.
	WARNING: Timestamp jumped from 1807959 ms to 1800042 ms (BUFX hack no
longer enabled).
	INFO: Successfully hit ts = 1807959 ms again (skipped, prev = 1807917 ms)
	INFO: Successfully hit ts = 1807985 ms again (skipped, prev = 1807963 ms)
	15871.687 kB / 2101.51 sec (60.6%)

resulting in a flv file with same sha256sum as with current master with
-R, and only spending 2-3 seconds more on the download due to the
backwards jump.

Regards,

Ulrik Dickow
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-check-for-decoding-timestamp-monotonicity.patch
Type: text/x-patch
Size: 1740 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/rtmpdump/attachments/20120813/e27d5de9/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Massively-improved-and-corrected-automatic-backwards.patch
Type: text/x-patch
Size: 5424 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/rtmpdump/attachments/20120813/e27d5de9/attachment-0003.bin>
-------------- next part --------------
### First test getting 60 seconds from the beginning of the video using an
### rtmpdump equal source-wise to current official master (v2.4-35-ge0056c5),
### saving verbose output to a logfile.

[ukd at quadtux bridge]$ date;\time rtmpdump -V -r rtmp://video.c-spanarchives.org/bwcheck -y mp4:downloads/305/305813-2/305813-2-MP4-STD/305813-2-MP4-STD_01.mp4 -B 60 -R -o cspan-60_master_R.flv 2> cspan-60_master_R.err;date
man aug 13 14:43:47 CEST 2012
man aug 13 14:43:58 CEST 2012

### Now the same with experimental version with automatic BUFX disabling and packet skipping:

[ukd at quadtux bridge]$ date;\time /opt/rtmpdump-2.4-git2/bin/rtmpdump -V -r rtmp://video.c-spanarchives.org/bwcheck -y mp4:downloads/305/305813-2/305813-2-MP4-STD/305813-2-MP4-STD_01.mp4 -B 60 -R -o cspan-60_git2_R.flv 2> cspan-60_git2_R.err;date
man aug 13 14:45:58 CEST 2012
man aug 13 14:46:08 CEST 2012

### And then new version but without -R, i.e. really use its new functionality
### (old version would make very jumpy output and take a long time here):

[ukd at quadtux bridge]$ date;\time /opt/rtmpdump-2.4-git2/bin/rtmpdump -V -r rtmp://video.c-spanarchives.org/bwcheck -y mp4:downloads/305/305813-2/305813-2-MP4-STD/305813-2-MP4-STD_01.mp4 -B 60 -o cspan-60_git2.flv 2> cspan-60_git2.err;date
man aug 13 14:47:34 CEST 2012
man aug 13 14:47:48 CEST 2012

### Compare results:

[ukd at quadtux bridge]$ ll cspan*
-rw-rw-r--. 1 ukd ukd   18885 13 aug 14:47 cspan-60_git2.err
-rw-rw-r--. 1 ukd ukd 3669952 13 aug 14:47 cspan-60_git2.flv
-rw-rw-r--. 1 ukd ukd   12430 13 aug 14:46 cspan-60_git2_R.err
-rw-rw-r--. 1 ukd ukd 3669952 13 aug 14:46 cspan-60_git2_R.flv
-rw-rw-r--. 1 ukd ukd   12407 13 aug 14:43 cspan-60_master_R.err
-rw-rw-r--. 1 ukd ukd 3669952 13 aug 14:43 cspan-60_master_R.flv

[ukd at quadtux bridge]$ sha256sum cspan*flv
621689f5b2d5c02514f1177f0adc4640a05151c23da05e97b686d249d68c632d  cspan-60_git2.flv
621689f5b2d5c02514f1177f0adc4640a05151c23da05e97b686d249d68c632d  cspan-60_git2_R.flv
621689f5b2d5c02514f1177f0adc4640a05151c23da05e97b686d249d68c632d  cspan-60_master_R.flv

### Perfectly identical, i.e. new version preserves correctness of -R, but now
### also handles automatic disabling of BUFX correctly.  Compare verbose outputs, ignoring
### differences in clientid or progress line.  No significant diff with -R, naturally:

[ukd at quadtux bridge]$ diff -u -I 'clientid\|^.[0-9][0-9]*.*%' cspan-60_master_R.err cspan-60_git2_R.err
--- cspan-60_master_R.err	2012-08-13 14:43:58.081534504 +0200
+++ cspan-60_git2_R.err	2012-08-13 14:46:08.891260193 +0200
@@ -1,4 +1,4 @@
-RTMPDump 2.4.git20120724.g7689787
+RTMPDump v2.4-37-g6664a87
 (c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
 DEBUG: Parsing...
 DEBUG: Parsed protocol: 0
@@ -264,5 +264,5 @@
 Download may be incomplete (downloaded about 1.70%), try resuming
 DEBUG: Closing connection.

-0.05user 0.14system 0:10.32elapsed 1%CPU (0avgtext+0avgdata 4676maxresident)k
-0inputs+7192outputs (0major+1959minor)pagefaults 0swaps
+0.07user 0.13system 0:10.09elapsed 1%CPU (0avgtext+0avgdata 4688maxresident)k
+0inputs+7200outputs (0major+1955minor)pagefaults 0swaps

### But more logging now without -R, in case a jump happens:

[ukd at quadtux bridge]$ diff -u -I 'clientid\|^.[0-9][0-9]*.*%' cspan-60_master_R.err cspan-60_git2.err
--- cspan-60_master_R.err	2012-08-13 14:43:58.081534504 +0200
+++ cspan-60_git2.err	2012-08-13 14:47:48.413247418 +0200
@@ -1,4 +1,4 @@
-RTMPDump 2.4.git20120724.g7689787
+RTMPDump v2.4-37-g6664a87
 (c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
 DEBUG: Parsing...
 DEBUG: Parsed protocol: 0
@@ -96,7 +96,6 @@
 DEBUG: HandleInvoke, server invoking <onStatus>
 DEBUG: HandleInvoke, onStatus: NetStream.Play.Start
 Starting download at: 0.000 kB
-  in approximately realtime (disabled BUFX speedup hack)
 For duration: 60.000 sec
 DEBUG: RTMP_ClientPacket, received: notify 24 bytes
 DEBUG: (object begin)
@@ -186,12 +185,157 @@
 INFO:   duration              3467.61
 DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
 DEBUG: HandleCtrl, Stream BufferReady 1
84.085 kB / 1.21 sec (0.0%)
78.680 kB / 1.17 sec (0.0%)
 DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
 DEBUG: HandleCtrl, Stream BufferEmpty 1
+DEBUG: RTMP_SendPause, 1, pauseTime=1984
+DEBUG: Invoking pause
 DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
 DEBUG: HandleCtrl, Stream BufferReady 1
431.392 kB / 6.36 sec (0.1%)
440.043 kB / 6.50 sec (0.1%)
+DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
+DEBUG: HandleCtrl, Stream BufferEmpty 1
+DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
+DEBUG: HandleCtrl, Stream BufferReady 1
977.736 kB / 16.50 sec (0.4%)
+DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
+DEBUG: HandleCtrl, Stream BufferEmpty 1
+DEBUG: HandleCtrl, received ctrl. type: 1, len: 6
+DEBUG: HandleCtrl, Stream EOF 1
+DEBUG: RTMP_ClientPacket, received: invoke 254 bytes
+DEBUG: (object begin)
+DEBUG: Property: NULL
+DEBUG: (object begin)
+DEBUG: Property: <Name:              level, STRING:	status>
+DEBUG: Property: <Name:               code, STRING:	NetStream.Pause.Notify>
+DEBUG: Property: <Name:        description, STRING:	Pausing downloads/305/305813-2/305813-2-MP4-STD/305813-2-MP4-STD_01.mp4.>
+DEBUG: Property: <Name:            details, STRING:	downloads/305/305813-2/305813-2-MP4-STD/305813-2-MP4-STD_01.mp4>
+DEBUG: Property: <Name:           clientid, NUMBER:	543776591.00>
+DEBUG: (object end)
+DEBUG: (object end)
+DEBUG: HandleInvoke, server invoking <onStatus>
+DEBUG: HandleInvoke, onStatus: NetStream.Pause.Notify
+DEBUG: RTMP_SendPause, 0, pauseTime=1984
+DEBUG: Invoking pause
+DEBUG: HandleCtrl, received ctrl. type: 4, len: 6
+DEBUG: HandleCtrl, Stream IsRecorded 1
+DEBUG: HandleCtrl, received ctrl. type: 0, len: 6
+DEBUG: HandleCtrl, Stream Begin 1
+DEBUG: RTMP_ClientPacket, received: invoke 258 bytes
+DEBUG: (object begin)
+DEBUG: Property: NULL
+DEBUG: (object begin)
+DEBUG: Property: <Name:              level, STRING:	status>
+DEBUG: Property: <Name:               code, STRING:	NetStream.Unpause.Notify>
[...]
[...a section of less interesting lines cut out by hand here...]
[...]
+INFO:   framerate             24.00
+INFO:   moovposition          197159324.00
+INFO:   duration              3467.61
+DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
+DEBUG: HandleCtrl, Stream BufferReady 1
+INFO: Timestamp jumped from 17958 ms to 2000 ms.  Disabling BUFX hack and catching up.
+WARNING: Timestamp jumped from 17941 ms to 2005 ms (BUFX hack no longer enabled).
 DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
 DEBUG: HandleCtrl, Stream BufferEmpty 1
 DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
@@ -201,7 +344,9 @@
 DEBUG: HandleCtrl, Stream BufferEmpty 1
 DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
 DEBUG: HandleCtrl, Stream BufferReady 1
1531.820 kB / 25.33 sec (0.7%)
+INFO: Successfully hit ts = 17941 ms again (skipped, prev = 17920 ms)
+INFO: Successfully hit ts = 17958 ms again (skipped, prev = 17917 ms)
1351.516 kB / 22.71 sec (0.6%)
 DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
 DEBUG: HandleCtrl, Stream BufferEmpty 1
 DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
@@ -264,5 +409,5 @@
 Download may be incomplete (downloaded about 1.70%), try resuming
 DEBUG: Closing connection.

-0.05user 0.14system 0:10.32elapsed 1%CPU (0avgtext+0avgdata 4676maxresident)k
-0inputs+7192outputs (0major+1959minor)pagefaults 0swaps
+0.06user 0.14system 0:13.86elapsed 1%CPU (0avgtext+0avgdata 4832maxresident)k
+0inputs+7208outputs (0major+1991minor)pagefaults 0swaps

### So far so good.  Now compare output if we ask for initial seek two minutes into the video.
### Test same 3 cases.

[ukd at quadtux bridge]$ date;\time /opt/rtmpdump-2.4-git2/bin/rtmpdump -V -r rtmp://video.c-spanarchives.org/bwcheck -y mp4:downloads/305/305813-2/305813-2-MP4-STD/305813-2-MP4-STD_01.mp4 -A 120 -B 180 -R -o cspan-120_180_git2_R.flv 2> cspan-120_180_git2_R.err;date
man aug 13 15:10:05 CEST 2012
man aug 13 15:10:14 CEST 2012

[ukd at quadtux bridge]$ date;\time /opt/rtmpdump-2.4-git2/bin/rtmpdump -V -r rtmp://video.c-spanarchives.org/bwcheck -y mp4:downloads/305/305813-2/305813-2-MP4-STD/305813-2-MP4-STD_01.mp4 -A 120 -B 180 -o cspan-120_180_git2.flv 2> cspan-120_180_git2.err;date
man aug 13 15:10:31 CEST 2012
man aug 13 15:10:41 CEST 2012

[ukd at quadtux bridge]$ ls -ltr cspan-120*
-rw-rw-r--. 1 ukd ukd 3259860 13 aug 15:07 cspan-120_180_master_R.flv
-rw-rw-r--. 1 ukd ukd   12371 13 aug 15:07 cspan-120_180_master_R.err
-rw-rw-r--. 1 ukd ukd 3259860 13 aug 15:10 cspan-120_180_git2_R.flv
-rw-rw-r--. 1 ukd ukd   12448 13 aug 15:10 cspan-120_180_git2_R.err
-rw-rw-r--. 1 ukd ukd 3259860 13 aug 15:10 cspan-120_180_git2.flv
-rw-rw-r--. 1 ukd ukd   18941 13 aug 15:10 cspan-120_180_git2.err

[ukd at quadtux bridge]$ sha256sum cspan-120*flv
b8930422bd476b0adae7cf8c1dc3a060cd9054735f4adc0d20ca46e3a59a47c3  cspan-120_180_git2.flv
b8930422bd476b0adae7cf8c1dc3a060cd9054735f4adc0d20ca46e3a59a47c3  cspan-120_180_git2_R.flv
b8930422bd476b0adae7cf8c1dc3a060cd9054735f4adc0d20ca46e3a59a47c3  cspan-120_180_master_R.flv

### Fortunately again bitwise 100% identical.

[ukd at quadtux bridge]$ diff -u -I 'clientid\|^.[0-9][0-9]*.*%' cspan-120_180_master_R.err cspan-120_180_git2_R.err
--- cspan-120_180_master_R.err	2012-08-13 15:07:45.473440137 +0200
+++ cspan-120_180_git2_R.err	2012-08-13 15:10:14.848595722 +0200
@@ -1,4 +1,4 @@
-RTMPDump 2.4.git20120724.g7689787
+RTMPDump v2.4-37-g6664a87
 (c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
 DEBUG: Parsing...
 DEBUG: Parsed protocol: 0
@@ -193,7 +193,10 @@
 DEBUG: HandleCtrl, Stream BufferEmpty 1
 DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
 DEBUG: HandleCtrl, Stream BufferReady 1
406.417 kB / 127.88 sec (3.6%)
+DEBUG: Keeping ts = last = prev = 120000 ms
25.553 kB / 120.00 sec (3.4%)
+DEBUG: Keeping ts = last = prev = 120003 ms
396.392 kB / 127.71 sec (3.6%)
 DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
 DEBUG: HandleCtrl, Stream BufferEmpty 1
 DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
@@ -266,5 +269,5 @@
 Download may be incomplete (downloaded about 5.20%), try resuming
 DEBUG: Closing connection.

-0.07user 0.11system 0:09.09elapsed 2%CPU (0avgtext+0avgdata 4688maxresident)k
-0inputs+6392outputs (0major+1963minor)pagefaults 0swaps
+0.05user 0.12system 0:08.88elapsed 2%CPU (0avgtext+0avgdata 4696maxresident)k
+0inputs+6400outputs (0major+1956minor)pagefaults 0swaps

### Only diff with -R is that I now debug-log the initial two video and audio
### keyframe packets that the simple monotonicity patch accidentally dropped
### due to the timestamp already having appeared before (don't know exactly
### why).

### More interesting is the diff of 'master -R' vs. git2 without -R:

[ukd at quadtux bridge]$ diff -u -I 'clientid\|^.[0-9][0-9]*.*%' cspan-120_180_master_R.err cspan-120_180_git2.err
--- cspan-120_180_master_R.err	2012-08-13 15:07:45.473440137 +0200
+++ cspan-120_180_git2.err	2012-08-13 15:10:41.575523443 +0200
@@ -1,4 +1,4 @@
-RTMPDump 2.4.git20120724.g7689787
+RTMPDump v2.4-37-g6664a87
 (c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
 DEBUG: Parsing...
 DEBUG: Parsed protocol: 0
@@ -98,7 +98,6 @@
 DEBUG: Continuing at TS: 120000 ms

 Starting download at: 0.000 kB
-  in approximately realtime (disabled BUFX speedup hack)
 For duration: 60.000 sec
 DEBUG: RTMP_ClientPacket, received: notify 24 bytes
 DEBUG: (object begin)
@@ -191,9 +190,158 @@
 DEBUG: HandleCtrl, Stream BufferReady 1
 DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
 DEBUG: HandleCtrl, Stream BufferEmpty 1
+DEBUG: RTMP_SendPause, 1, pauseTime=0
+DEBUG: Invoking pause
 DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
 DEBUG: HandleCtrl, Stream BufferReady 1
406.417 kB / 127.88 sec (3.6%)
+DEBUG: Keeping ts = last = prev = 120000 ms
25.553 kB / 120.00 sec (3.4%)
+DEBUG: Keeping ts = last = prev = 120003 ms
406.417 kB / 127.88 sec (3.6%)
+DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
+DEBUG: HandleCtrl, Stream BufferEmpty 1
+DEBUG: HandleCtrl, received ctrl. type: 1, len: 6
+DEBUG: HandleCtrl, Stream EOF 1
+DEBUG: RTMP_ClientPacket, received: invoke 254 bytes
+DEBUG: (object begin)
+DEBUG: Property: NULL
+DEBUG: (object begin)
+DEBUG: Property: <Name:              level, STRING:	status>
+DEBUG: Property: <Name:               code, STRING:	NetStream.Pause.Notify>
+DEBUG: Property: <Name:        description, STRING:	Pausing downloads/305/305813-2/305813-2-MP4-STD/305813-2-MP4-STD_01.mp4.>
+DEBUG: Property: <Name:            details, STRING:	downloads/305/305813-2/305813-2-MP4-STD/305813-2-MP4-STD_01.mp4>
+DEBUG: Property: <Name:           clientid, NUMBER:	154164387.00>
+DEBUG: (object end)
+DEBUG: (object end)
+DEBUG: HandleInvoke, server invoking <onStatus>
+DEBUG: HandleInvoke, onStatus: NetStream.Pause.Notify
+DEBUG: RTMP_SendPause, 0, pauseTime=0
+DEBUG: Invoking pause
+DEBUG: HandleCtrl, received ctrl. type: 4, len: 6
+DEBUG: HandleCtrl, Stream IsRecorded 1
+DEBUG: HandleCtrl, received ctrl. type: 0, len: 6
+DEBUG: HandleCtrl, Stream Begin 1
+DEBUG: RTMP_ClientPacket, received: invoke 258 bytes
+DEBUG: (object begin)
+DEBUG: Property: NULL
+DEBUG: (object begin)
+DEBUG: Property: <Name:              level, STRING:	status>
+DEBUG: Property: <Name:               code, STRING:	NetStream.Unpause.Notify>
[...]
[...again skipping less interesing lines...]
[...]
+INFO:   framerate             24.00
+INFO:   moovposition          197159324.00
+INFO:   duration              3467.61
+DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
+DEBUG: HandleCtrl, Stream BufferReady 1
+DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
+DEBUG: HandleCtrl, Stream BufferEmpty 1
+DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
+DEBUG: HandleCtrl, Stream BufferReady 1
+INFO: Timestamp jumped from 127982 ms to 120003 ms.  Disabling BUFX hack and catching up.
+WARNING: Timestamp jumped from 127958 ms to 120042 ms (BUFX hack no longer enabled).
+INFO: Successfully hit ts = 127958 ms again (skipped, prev = 127917 ms)
+INFO: Successfully hit ts = 127982 ms again (skipped, prev = 127961 ms)
 DEBUG: HandleCtrl, received ctrl. type: 31, len: 6
 DEBUG: HandleCtrl, Stream BufferEmpty 1
 DEBUG: HandleCtrl, received ctrl. type: 32, len: 6
@@ -266,5 +414,5 @@
 Download may be incomplete (downloaded about 5.20%), try resuming
 DEBUG: Closing connection.

-0.07user 0.11system 0:09.09elapsed 2%CPU (0avgtext+0avgdata 4688maxresident)k
-0inputs+6392outputs (0major+1963minor)pagefaults 0swaps
+0.08user 0.11system 0:10.13elapsed 1%CPU (0avgtext+0avgdata 4748maxresident)k
+0inputs+6408outputs (0major+1971minor)pagefaults 0swaps

### Finally let's test with somewhat larger numbers: 5 minutes of video,
### starting 30 minutes into the stream.  Here only compare 'master -R'
### vs. git2 without -R, and only at default log level (INFO) to stdout.

[ukd at quadtux bridge]$ date;\time rtmpdump -r rtmp://video.c-spanarchives.org/bwcheck -y mp4:downloads/305/305813-2/305813-2-MP4-STD/305813-2-MP4-STD_01.mp4 -A 1800 -B 2100 -R -o cspan-1800_2100_master_R.flv;date
man aug 13 15:28:15 CEST 2012
RTMPDump 2.4.git20120724.g7689787
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
INFO: Connected...
Starting download at: 0.000 kB
  in approximately realtime (disabled BUFX speedup hack)
For duration: 300.000 sec
INFO: Metadata:
INFO: trackinfo:
INFO:   timescale             24.00
INFO:   length                83221.00
INFO:   language              eng
INFO: sampledescription:
INFO:   sampletype            avc1
INFO:   timescale             48000.00
INFO:   length                166445056.00
INFO:   language              eng
INFO: sampledescription:
INFO:   sampletype            mp4a
INFO:   audiochannels         2.00
INFO:   audiosamplerate       48000.00
INFO:   videoframerate        24.00
INFO:   aacaot                2.00
INFO:   avclevel              30.00
INFO:   avcprofile            77.00
INFO:   audiocodecid          mp4a
INFO:   videocodecid          avc1
INFO:   width                 853.00
INFO:   height                480.00
INFO:   frameWidth            640.00
INFO:   frameHeight           480.00
INFO:   displayWidth          853.00
INFO:   displayHeight         480.00
INFO:   framerate             24.00
INFO:   moovposition          197159324.00
INFO:   duration              3467.61
15871.687 kB / 2101.51 sec (60.6%)
Download may be incomplete (downloaded about 60.60%), try resuming
0.24user 0.56system 4:01.31elapsed 0%CPU (0avgtext+0avgdata 4688maxresident)k
0inputs+31744outputs (0major+1963minor)pagefaults 0swaps
man aug 13 15:32:16 CEST 2012

### Yup, now we're indeed much closer to realtime.  That was master.  Now test
### git2-version without -R (automatic disabling of BUFX as needed):

[ukd at quadtux bridge]$ date;\time /opt/rtmpdump-2.4-git2/bin/rtmpdump -r rtmp://video.c-spanarchives.org/bwcheck -y mp4:downloads/305/305813-2/305813-2-MP4-STD/305813-2-MP4-STD_01.mp4 -A 1800 -B 2100 -o cspan-1800_2100_git2.flv;date
man aug 13 15:35:29 CEST 2012
RTMPDump v2.4-37-g6664a87
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
INFO: Connected...
Starting download at: 0.000 kB
For duration: 300.000 sec
INFO: Metadata:
INFO: trackinfo:
INFO:   timescale             24.00
INFO:   length                83221.00
INFO:   language              eng
INFO: sampledescription:
INFO:   sampletype            avc1
INFO:   timescale             48000.00
INFO:   length                166445056.00
INFO:   language              eng
INFO: sampledescription:
INFO:   sampletype            mp4a
INFO:   audiochannels         2.00
INFO:   audiosamplerate       48000.00
INFO:   videoframerate        24.00
INFO:   aacaot                2.00
INFO:   avclevel              30.00
INFO:   avcprofile            77.00
INFO:   audiocodecid          mp4a
INFO:   videocodecid          avc1
INFO:   width                 853.00
INFO:   height                480.00
INFO:   frameWidth            640.00
INFO:   frameHeight           480.00
INFO:   displayWidth          853.00
INFO:   displayHeight         480.00
INFO:   framerate             24.00
INFO:   moovposition          197159324.00
INFO:   duration              3467.61
320.502 kB / 1805.75 sec (52.0%)
INFO: Metadata:
INFO: trackinfo:
INFO:   timescale             24.00
INFO:   length                83221.00
INFO:   language              eng
INFO: sampledescription:
INFO:   sampletype            avc1
INFO:   timescale             48000.00
INFO:   length                166445056.00
INFO:   language              eng
INFO: sampledescription:
INFO:   sampletype            mp4a
INFO:   audiochannels         2.00
INFO:   audiosamplerate       48000.00
INFO:   videoframerate        24.00
INFO:   aacaot                2.00
INFO:   avclevel              30.00
INFO:   avcprofile            77.00
INFO:   audiocodecid          mp4a
INFO:   videocodecid          avc1
INFO:   width                 853.00
INFO:   height                480.00
INFO:   frameWidth            640.00
INFO:   frameHeight           480.00
INFO:   displayWidth          853.00
INFO:   displayHeight         480.00
INFO:   framerate             24.00
INFO:   moovposition          197159324.00
INFO:   duration              3467.61
INFO: Timestamp jumped from 1807985 ms to 1800006 ms.  Disabling BUFX hack and catching up.
WARNING: Timestamp jumped from 1807959 ms to 1800042 ms (BUFX hack no longer enabled).
INFO: Successfully hit ts = 1807959 ms again (skipped, prev = 1807917 ms)
INFO: Successfully hit ts = 1807985 ms again (skipped, prev = 1807963 ms)
15871.687 kB / 2101.51 sec (60.6%)
Download may be incomplete (downloaded about 60.60%), try resuming
0.28user 0.57system 4:03.53elapsed 0%CPU (0avgtext+0avgdata 4752maxresident)k
0inputs+31744outputs (0major+1971minor)pagefaults 0swaps
man aug 13 15:39:32 CEST 2012

[ukd at quadtux bridge]$ ll cspan-1800*
-rw-rw-r--. 1 ukd ukd 16252607 13 aug 15:39 cspan-1800_2100_git2.flv
-rw-rw-r--. 1 ukd ukd 16252607 13 aug 15:32 cspan-1800_2100_master_R.flv

[ukd at quadtux bridge]$ sha256sum cspan-1800*
7d4cb6af4927149a2ed3d93c22a7e76040a5247a7610843b0309eaa4bf343a42  cspan-1800_2100_git2.flv
7d4cb6af4927149a2ed3d93c22a7e76040a5247a7610843b0309eaa4bf343a42  cspan-1800_2100_master_R.flv

### Again bit-identical, fine.


More information about the rtmpdump mailing list