Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can FFMPEG library send the live H264 iOS Camera stream to Wowza using RTSP

My requirement is to get iphone camera feed, encode it into H264 format and send it to server. In search, I found encoding part is possible with ffmpeg lib with x264 (libx264). But now the next task is to send the encoded data to Wowza server using rtsp.

Please share some code or useful document if anyone is aware about this.

There is one another library for encoding purpose live555. But I am not sure it can send the data to server using rtsp.

like image 731
Vishal Lohia Avatar asked Jul 27 '13 08:07

Vishal Lohia


2 Answers

Actualy I made an iOS streaming app (with wowza as streaming server)

I believe you can stream video only with FFmpeg with rtsp protocol although FFmpeg don't fully support it

However with ffmpeg you can get a valid SDP and pass it to wowza using RTCP protocol - ANNOUNCE OPTION SETUP RECORD -

I didn't use FFmpeg for encoding but if you can get the raw H264 data you can packetize it to make a valid RTP packet using rfc6184

edit : here is a sample to connect wowza :

    NSString* response = [NSString stringWithFormat:@"ANNOUNCE %@ RTSP/1.0\r\n",self->addr];
    response = [response stringByAppendingFormat:@"CSeq: %d\r\n",self->cseq];
    response = [response stringByAppendingFormat:@"Content-Type: application/sdp\r\nContent-Length: %d\r\n\r\n", [self->sdp length] ];
    response = [response stringByAppendingString:self->sdp];
    NSString* result = [self sendAndRecvData:response];

where sendAndRecvData is a tcp socket bound to wowza_ip:1935

you can use the same kind of code for SETUP, which will send back RTP (+RTCP) ports where you should send your datas

like image 185
HaneTV Avatar answered Oct 27 '22 16:10

HaneTV


Your using live555 , you can use a live 555 server living on the device to send both audio and video, this will give you rtsp+rtcp stream to wowza, for announce and record live 555 has an unsupported dss module.

like image 29
Michelle Cannon Avatar answered Oct 27 '22 17:10

Michelle Cannon