### 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@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@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@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@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@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@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@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 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: +DEBUG: Property: +DEBUG: Property: +DEBUG: Property: +DEBUG: Property: +DEBUG: (object end) +DEBUG: (object end) +DEBUG: HandleInvoke, server invoking +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: +DEBUG: Property: [...] [...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@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@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@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@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@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@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: +DEBUG: Property: +DEBUG: Property: +DEBUG: Property: +DEBUG: Property: +DEBUG: (object end) +DEBUG: (object end) +DEBUG: HandleInvoke, server invoking +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: +DEBUG: Property: [...] [...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@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@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@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@quadtux bridge]$ sha256sum cspan-1800* 7d4cb6af4927149a2ed3d93c22a7e76040a5247a7610843b0309eaa4bf343a42 cspan-1800_2100_git2.flv 7d4cb6af4927149a2ed3d93c22a7e76040a5247a7610843b0309eaa4bf343a42 cspan-1800_2100_master_R.flv ### Again bit-identical, fine.