Kodi Community Forum
Patch for rtmpdump/librtmp - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: Patch for rtmpdump/librtmp (/showthread.php?tid=70512)

Pages: 1 2 3 4 5 6


Patch for rtmpdump/librtmp - highlandsun - 2010-03-22

On the assumption that lightning doesn't strike twice in the same spot, reposting this thread that was lost last time 'round... (from google cache)

highlandsun 2010-03-10 22:05 Wrote:I've posted a patch to adapt DVDInputStreamRTMP to use rtmpdump's librtmp instead of the current libRTMP.

http://trac.xbmc.org/ticket/8971

This adds support for SWF Verification, encrypted streams, etc. etc...

exobuzz 2010-03-10 23:37 Wrote:Nice work.

I was looking at this last night - you saved me some work Smile. Now we just need to either associate a url of a player with a listitem from python or add a new python function to get the hash and then associate that with each item.

Or you have other ideas ?

highlandsun 2010-03-11 01:07 Wrote:librtmp will compute the hash automatically. You just have to tell it to do so by setting the SWFVerify boolean property in your stream item. Search for "SWFVerify" in the patch, you'll see it. (The player URL is already being provided in another item property, that's always been in there.)

exobuzz 2010-03-11 01:29 Wrote:aha i see. Thanks.

highlandsun 2010-03-11 02:00 Wrote:If you haven't already, you should grab the current code in rtmpdump svn HEAD. Read the rtmpdump(1) manpage, that will give you a better idea of what's going on. I've also posted a copy of the manpage here

http://rtmpdump.mplayerhq.hu/rtmpdump.1.html



ERROR: RTMP_ReadPacket, failed to read RTMP packet header - jackanddougal - 2010-03-25

I'm having the same issue exobuzz identified in Trac.

I have the following setup...

rtmpdump/trunk : rev 396
xbmc/trunk : rev 28256

Applied your patch and tested as follows...

1) tried IPlayer stream, with no modification to SWFVerification property - rtmpdump reports SWFVerification will not be used. Stream plays for around 1 minute then terminates as expected (although a crash due to 'double free' occurs.
2) Modified patch to ignore SWFVerification property (still using SWFPlayer : http://www.bbc.co.uk/emp/9player.swf?revision=10344_10753) - I get the RTMP_ReadPacket, failed to read RTMP packet header error.

Any thoughts on this?


- highlandsun - 2010-03-25

As I noted in the trac item, you need xbmc revision 28276, not 28256.

What do you mean by "modified patch to ignore swfverification property" ?

If you want this to work with iPlayer you have to set the SWFVerify property to "true".


- johoja - 2010-03-30

Would this patch make the justin.tv plugin viable again?


- highlandsun - 2010-03-30

Dunno anything about justin.tv or its plugin. Why did it stop working?

Possibly it will help; I revived the Hulu plugin (but that needed a lot of scraping/parsing fixes in addition to this patch).


- johoja - 2010-03-30

highlandsun Wrote:Dunno anything about justin.tv or its plugin. Why did it stop working?

Possibly it will help; I revived the Hulu plugin (but that needed a lot of scraping/parsing fixes in addition to this patch).



Some sort of DRM on the SWF now for justin.tv


- spicemuseum - 2010-03-30

highlandsun Wrote:As I noted in the trac item, you need xbmc revision 28276, not 28256.

What do you mean by "modified patch to ignore swfverification property" ?

If you want this to work with iPlayer you have to set the SWFVerify property to "true".
I suspect what Jackanddougal means is that a switchable SWFVerify property is largely redundant since it could be assumed to be always necessary...

If you assume swf verification is always a possibility in any stream, then if you receive a request for verification for the stream, you send the response, if you don't, you don't.

WRT the revisions, I don't see anything between those two revision numbers which would make any difference to this.


- highlandsun - 2010-03-31

spicemuseum Wrote:I suspect what Jackanddougal means is that a switchable SWFVerify property is largely redundant since it could be assumed to be always necessary...

If you assume swf verification is always a possibility in any stream, then if you receive a request for verification for the stream, you send the response, if you don't, you don't.

WRT the revisions, I don't see anything between those two revision numbers which would make any difference to this.

Certainly; even if you turn on the swfverify option, it will only be used upon request from the server. But the reason not to always generate the hash information by default is that sometimes this has a significant cost in execution time. I.e., you have to fetch the SWF using http, decompress it, and then calculate the hash. It's better not to go through all of that hassle if you know the server won't request it. (Even though all of this hassle is hidden inside librtmp, so it's no big deal to activate it, it still can mean a noticeable delay before a stream can actually be opened and processed.)


- highlandsun - 2010-04-02

Patch updated. Option handling is now delegated completely to librtmp, since we add new options frequently. Also, the ffmpeg team has now merged support for librtmp, and is using the new option mechanism as well. This approach will allow RTMP URLs and options to be specified uniformly across ffmpeg, mplayer, XBMC, and any other apps that use librtmp.

The old XBMC RTMP options are still supported, but new options can only be specified using the new mechanism. See the trac item for an example.


- highlandsun - 2010-04-04

Just to re-cap - this is what I do to build XBMC with this patch...

  1. start with XBMC svn r28276
  2. apply the patches from http://trac.xbmc.org/ticket/8971
  3. move the old xbmc/xbmc/libRTMP out of the way
  4. put rtmpdump librtmp into xbmc/xbmc/libRTMP
  5. configure and make as usual

You'll also need to apply this patch to ffmpeg to get RTMP seek working:
https://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/2010-April/028885.html

If you're building on Debian or Ubuntu, you should probably build librtmp first, with "make CRYPTO=GNUTLS", that will keep the process size smaller. (Since a lot of their system libraries are already built with GnuTLS, it's a waste of space to build librtmp using OpenSSL.)

Last I checked, the patches also work with current XBMC SVN trunk, but I'm not using that since I don't know how the new plugin/addon system is supposed to work yet...


- highlandsun - 2010-04-04

PS: use the rtmpdump SVN, not the tarballs. Currently at r416.


- andybz - 2010-04-04

Thanks for the instructions. I figured that was probably how it worked. I managed to get it working.. but it's barfing after 60 seconds.

Does the SWF Verification handling work right out of the box, or do I need to enable something?

I'm seeing this on the command line from launching XBMC and hitting up the BBC iPlayer:

ERROR: HandleCtrl: Ignoring SWFVerification request, use --swfVfy!


- andybz - 2010-04-04

Ok, I fiddled with it for a while but no luck.

I might have missed something, but when I try and force swfVfy on, it still doesn't want to handle the SWFVerification request. I think it might not be computing the hash, but not sure where to look.

I have a debug log, if you're interested.


- highlandsun - 2010-04-04

The current code doesn't behave the same way as it did at the beginning of this thread. To use swf verification you have to append " swfurl=http://the/url swfvfy=true" to the rtmp url.


- thebitjockey - 2010-04-08

I recall seeing some posts about Adobe using DMCA takedown requests to try and stop distribution of rtmpdump. Not sure if this is still the case but if so I suspect it could affect inclusion of rtmpdump.