View Single Post
  #10  
Old 04-25-2012, 09:17 AM
Chris001 Chris001 is offline
Junior Member
 
Join Date: Nov 2011
Posts: 3
Chris001 is on a distinguished road
Default

Re: Cam4 - Automatic recording when user logs in?


The problem with Cam4 is that the direct RTMP url has a long code at the end that changes every time the user starts broadcasting. There is even a separate RTMP url for viewers who are logged in and for anonymous viewers.

If the RTMP url would be the same all the time, like "rtmp://cam4.com/some_user" then you could simply check that link once in a while, to see if the user is broadcasting.

Personally I don't have the kwowledge about decompiling the swf script, so the only way to download the streams, is to open the broadcasters page in a browser and use a HTTP sniffer to sniff out the RTMP url. I made two tools.

One tool checks once in a while if a certain broadcaster is online. If a broadcaster is online, then it starts Chrome (which I specifically use for Cam4) and navigates to the broadcasters page. After 20 seconds the browser is automatically closed.

At first I used Replay Media Catcher to detect and download the streams, but 90% of them are out of sync So, I made my own packet sniffer, which sniffs out the necessary data and constructs the RTMP url. It then extracts the page 'Title' from the Chrome browser, which is used as video name. Then it starts RTMPDump, which is able to download the stream with video/audio fully in sync.

It's far from a good solution, but it works alright I guess and I've downloaded hundreds of Cam4 videos this way, without interaction. I live in Europe and most broadcasters are from America. When it's 9pm in America, it's 3am-6am in Europe and this way I can see my favourite broadcasters without staying up at night.
Reply With Quote