View Single Post
  #278  
Old 05-26-2013, 08:46 PM
Edge Edge is offline
Smashing FMS
 
Join Date: Apr 2013
Posts: 18
Edge is on a distinguished road
Default

Re: www.myfreecams.com: How can I record free sex web-cam chat (rtmp:// .flv)


Right, Elegro, to clarify: What I did was hack the RTMPDump source to sort of shorthand the MFC-specific parameters so I wouldn't have to type the -C S:blablabla -C S:morestuff -C SOWNLOAD.... bits over and over.

RTMP_SetupURL is only called if fullUrl is filled in, which it will only be if you use -r rtmp://host.com/app, which I never do, I set the variables "hostname" and "app" manually to videoNN.mfc and NxServer, respecfively.

What you probably want to do if you're using LibRTMP is something like this:

Code:
AVal mfcapp;
AVal mfcsockshost={0,0};
AVal mfchost;
AVal mfcsession;
AVal mfcauth;
AVal mfcroom;
AVal mfcmode;
AVal mfcmodel;

STR2AVAL(mfcapp,"NxServer");
STR2AVAL(mfchost,"video100.myfreecams.com");

STR2AVAL(mfcsession,"S:12345678");
STR2AVAL(mfcauth,"S:");
STR2AVAL(mfcroom,"S:101234567");
STR2AVAL(mfcmode,"S:DOWNLOAD");
STR2AVAL(mfcmodel,"S:1234567");

RTMP_SetOpt(&rtmp,&av_conn,&mfcsession);
RTMP_SetOpt(&rtmp,&av_conn,&mfcauth);
RTMP_SetOpt(&rtmp,&av_conn,&mfcroom);
RTMP_SetOpt(&rtmp,&av_conn,&mfcmode);
RTMP_SetOpt(&rtmp,&av_conn,&mfcmodel);

RTMP_SetupStream(&rtmp,
                RTMP_PROTOCOL_RTMP,
                &mfchost,
                1935,
                &mfcsockshost,
                &mfcplaypath,
                &tcUrl,
                &swfUrl,
                &pageUrl,
                &mfcapp,
                &auth, /* unused */
                &swfHash, /* unused */
                swfSize,
                &flashVer,
                &subscribepath,
                &usherToken, /* unused */
                dSeek, /* unused */
                dStopOffset, /* unused */
                1, /* we are live */
                timeout);
MFC doesn't care about tcUrl, swfUrl or pageUrl and you can probably reuse an empty AVal for all the unused parameters but you get the general idea. The most important thing is to call RTMP_SetOpt *before* you create the stream, LibRTMP will pass it into the connect string. Remember to use an AVal type from amf.h, it's just a struct:

Code:
typedef struct AVal {
  char *av_val;
  int av_len;
} AVal;
Everything in LibRTMP expects AVals for the parameters because it's what AMF uses internally so it just passes it on.

On a side note, a thing I've been tinkering with is to rewrite the timestamping code in LibRTMP to start at zero and tick up accordingly so the saved streams don't get all annoying, do you have any insight here? Aside from using FFMpeg which doesn't do a very good job with this in my experience.

E.
Reply With Quote