[PATCH] Add option --realtime (-R) to rtmpdump to disable the BUFX hack
Hello Howard Chu, Steven Penny, Jindřich Makovička and others, The attached patch enables the user to seek/resume and easily get a fully valid output file from servers where the BUFX Pause/Unpause hack makes the server jump backwards in time. It is a third solution to the problem described in these two threads: [rtmpdump] RTMPDump failing to record stream from GeorgiaTech Server http://lists.mplayerhq.hu/pipermail/rtmpdump/2012-May/001985.html [rtmpdump] Crude fix rtmpdump repeats, "jumps" timestamps backwards http://lists.mplayerhq.hu/pipermail/rtmpdump/2012-May/001947.html Before getting deeper into my own patch, I'll comment on those two threads. In the former thread, Steven Penny offers this solution:
Use -v, brotha
Yes, the --live/-v option also avoided the jump-problem in my case, but then rtmpdump ignored my --start option: WARNING: Can't seek in a live stream, ignoring --start option The source and docs say all over the place that seek/resume in live streams is not allowed, so I won't argue against that. Keep it so. In the latter thread, Jindřich Makovička offers a patch that silently drops incoming packets with timestamps smaller than the last one saved (for audio and video separately). This solution doesn't sacrifice the ability to seek/resume. But when the jumps backward are large and frequent, it may increase the download time and consumed bandwidth quite a lot. In my case by a factor 3 to 4 on both parameters, compared with my own patch. Additionally, the packet-dropping solution might give small glitches in the final output. It's probably a good idea to add such a packet-dropping patch anyway, but I think it should at least once warn the user that a backwards jump has happened -- and if my patch is added too, it can suggest that the user retries the download with that new switch turned on instead. The essential change in my own patch is this in rtmpdump.c: /* 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; The rest of the patch is just setting and documenting the new option properly. "Realtime" is not a perfect name, better suggestions are welcome. In my case, it actually downloaded 100 seconds of video+audio in only 41.5 seconds, i.e. almost 2.5 times faster than realtime: $ date;\time rtmpdump ... --start 713 --stop 813 -R -o ...;date ons jul 25 14:46:52 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: 100.000 sec [...] INFO: displayWidth 1024.00 INFO: displayHeight 576.00 INFO: framerate 25.00 INFO: moovposition 321937506.00 INFO: duration 1860.03 17201.495 kB / 813.63 sec (43.7%) Download may be incomplete (downloaded about 43.70%), try resuming 0.16user 0.43system 0:41.50elapsed 1%CPU (0avgtext+0avgdata 4660maxresident)k 0inputs+34408outputs (0major+1921minor)pagefaults 0swaps ons jul 25 14:47:33 CEST 2012 (My patch doesn't change VERSION; I only did that in the make(1) command). Without the --realtime/-R switch, it still defaults to using the BUFX hack. Tested right before the above test with the same rtmpdump and command line, except for deleting '-R', it then made the first jump backwards already at timestamp 720.64, then proceeded until timestamp 776.34, where it jumped all the way back to close to ts 721 again. Soon after, I Ctrl-C'ed it. Five days earlier, using rtmpdump-2.4-0.1.20110811gitc58cfb3e.fc16.x86_64, it happened to jump in smaller steps, much more frequently, making the download from ts 704 to 822 (118 seconds) last 150 seconds and result in a huge and jumpy file. I tested my patch on Fedora 16 x86_64 Linux, adding only '-j8 VERSION=...' to the make(1) command line. Only tested initial seek (--start), not resuming a download. Finally I should mention that the post by KSV here was a great help, crucially mentioning the "RTMP_LF_BUFX hack": http://stream-recorder.com/forum/jumps-back-footage-t12927.html Regards, -- Ulrik Dickow
Jul 25, 2012 Ulrik Dickow wrote
Hello Howard Chu, Steven Penny, Jindřich Makovička and others,
The attached patch enables the user to seek/resume and easily get a fully valid output file from servers where the BUFX Pause/Unpause hack makes the server jump backwards in time.
2nd'd This is long overdue.
Ulrik Dickow wrote:
Hello Howard Chu, Steven Penny, Jindřich Makovička and others,
Thanks for the patch. Committed and pushed.
Finally I should mention that the post by KSV here was a great help, crucially mentioning the "RTMP_LF_BUFX hack":
http://stream-recorder.com/forum/jumps-back-footage-t12927.html
Just as an aside, KSV is no longer licensed to use the rtmpdump project's code in any of his work. More explicitly, as the copyright owner of the Project, I am changing the license terms to specifically exclude him. Anyone else may still freely use the code under the terms of the GPL. KSV is expressly excluded, and has no rights to use the code in any way, no matter in what form the code arrived in his hands.
Hi Howard, On 26/07/2012 13:04, Howard Chu wrote:
Just as an aside, KSV is no longer licensed to use the rtmpdump project's code in any of his work. More explicitly, as the copyright owner of the Project, I am changing the license terms to specifically exclude him. Anyone else may still freely use the code under the terms of the GPL. KSV is expressly excluded, and has no rights to use the code in any way, no matter in what form the code arrived in his hands.
I think you've misunderstood the consequences of applying an open source license to code you have authored. While you may be the copyright holder for any code you have authored, as soon as you apply the GPL license to that code, you waive certain rights, such as the ability to restrict who may or may not use the code. The GPL clearly states "You may not impose any further restrictions on the recipients' exercise of the rights granted herein." Therefore you can't revoke someones right to use, distribute or modify any source code you have released under the GPL. By way of an example, Oracle can't revoke peoples freedom to use OpenSolaris even though they decided to close the source and release Solaris 11 as commercial software after buying Sun Microsystems. As the new copyright holder of the code, they are entitled to re-license the software, which they do by stripping the CDDL header from all non-binary files they ship with Solaris 11. They have no obligation to publish new source code they write as the CDDL differs from the GPL in this regard, but they can't un-open-source previously open source software or add restrictions to previously released open source software. If you write new code, you are certainly entitled to place restrictions upon it, but only if you don't license that code under the terms GPL. KSV may have broken other laws by supplying patches which violate the copyright of other parties, or that violate the GPL, but that's a separate issue. You can't legally state that KSV may not use your software - by the terms of the GPL, he can. Regards, Alasdair
Alasdair Lumsden wrote:
Hi Howard,
On 26/07/2012 13:04, Howard Chu wrote:
Just as an aside, KSV is no longer licensed to use the rtmpdump project's code in any of his work. More explicitly, as the copyright owner of the Project, I am changing the license terms to specifically exclude him. Anyone else may still freely use the code under the terms of the GPL. KSV is expressly excluded, and has no rights to use the code in any way, no matter in what form the code arrived in his hands.
I think you've misunderstood the consequences of applying an open source license to code you have authored.
While you may be the copyright holder for any code you have authored, as soon as you apply the GPL license to that code, you waive certain rights, such as the ability to restrict who may or may not use the code.
Nonsense. As the author of the code I choose how it gets licensed. As the author of the code I can choose to dual-license or whatever else fits my purpose. When a user of the code receives it under a specific license, they are required to adhere to that specific license. When they break the terms of that license, as KSV has done, they no longer have any rights under that license.
The GPL clearly states "You may not impose any further restrictions on the recipients' exercise of the rights granted herein."
Therefore you can't revoke someones right to use, distribute or modify any source code you have released under the GPL.
KSV has already forfeited his rights by breaking the terms of the GPL. I don't actually need to do anything here, his rights have implicitly been revoekd due to his violation.
On Thu, Jul 26, 2012 at 05:04:38AM -0700, Howard Chu wrote:
Just as an aside, KSV is no longer licensed to use the rtmpdump project's code in any of his work. More explicitly, as the copyright owner of the Project, I am changing the license terms to specifically exclude him. Anyone else may still freely use the code under the terms of the GPL. KSV is expressly excluded, and has no rights to use the code in any way, no matter in what form the code arrived in his hands.
Can you explain why on-list? I would hate to see this become a trend where people that are willing to put work into bettering rtmpdump are prevented from doing so
Panashe Flack wrote:
On Thu, Jul 26, 2012 at 05:04:38AM -0700, Howard Chu wrote:
Just as an aside, KSV is no longer licensed to use the rtmpdump project's code in any of his work. More explicitly, as the copyright owner of the Project, I am changing the license terms to specifically exclude him. Anyone else may still freely use the code under the terms of the GPL. KSV is expressly excluded, and has no rights to use the code in any way, no matter in what form the code arrived in his hands.
Can you explain why on-list? I would hate to see this become a trend where people that are willing to put work into bettering rtmpdump are prevented from doing so
KSV has been distributing rtmpdump patches that contain actual Adobe binary code. This is a clear violation of Adobe's copyright, first, and invites legal trouble to the project that we have painstakingly avoided all these years. Additionally, this is in direct violation of the GPL, which requires that source code be provided for all modifications. Rather than admit his wrongdoing and trying to work something out with us, he has resorted to name calling. Nobody will prevent you from contributing to the project if you abide by the license and don't violate anyone's copyright. If you distribute my code combined with code stolen from others, you get trouble.
Jul 26, 2012 Howard Chu wrote
Nobody will prevent you from contributing to the project if you abide by the license and don't violate anyone's copyright. If you distribute my code combined with code stolen from others, you get trouble.
Howard, do you take issue with me hosting the patch, for historical reasons? I have no intention of distributing binaries. If so I will take it down. http://github.com/svnpenn/rtmpdump/commit/264f
participants (5)
-
Alasdair Lumsden -
Howard Chu -
Panashe Flack -
Steven Penny -
Ulrik Dickow