I want to send a flv to rtmp server,but there is an error?

131 views Asked by At

Here is my code

long start = 0;
long perframetime = 0;
RTMP_LogLevel lvl = RTMP_LOGINFO;
FILE*fp = NULL;
if (!ZINIT()) {
    printf("Init Socket Err\n");
    return -1;
}
//  RTMP_debuglevel=RTMP_LOGINFO;
RTMP_LogSetLevel(lvl);

// RTMP_LogSetOutput(FILE*fp);

rtmp = RTMP_Alloc();
RTMP_Init(rtmp);
rtmp->Link.timeout = 5;
packet = (RTMPPacket*)malloc(sizeof(RTMPPacket));
memset(packet, 0, sizeof(RTMPPacket));
RTMPPacket_Alloc(packet, 1024 * 64);
RTMPPacket_Reset(packet);

RTMP_SetupURL(rtmp, rtmpurl);
RTMP_EnableWrite(rtmp);

printf("Connecting...\n");

if (!RTMP_Connect(rtmp, NULL)) {
    printf("Connect Err\n");
    ZCLEAR();
    return -1;
}
Sleep(10000000);
printf("ConnectStream...\n");
if (!RTMP_ConnectStream(rtmp, 0)) {
    printf("ConnectStream Err\n");
    ZCLEAR();
    return -1;
}
packet->m_hasAbsTimestamp = 0;
packet->m_nChannel = 0x04; 
packet->m_nInfoField2 = rtmp->m_stream_id;

printf("OpenFile:%s\n", flvfilename);

but when I run it ,there is an error says RTMP_SwfHash connot cantact swf url How to do with it ?

and I mind that each rtmp server has a rtmp url and a code ,what is the code using for? thank you

0

There are 0 answers