简体   繁体   English

FFMPEG库是否可以使用RTSP将实时H264 iOS摄像机流发送到Wowza

[英]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. 我的要求是获取iPhone摄像头提要,将其编码为H264格式,然后将其发送到服务器。 In search, I found encoding part is possible with ffmpeg lib with x264 (libx264). 在搜索中,我发现使用x264(libx264)的ffmpeg lib可以进行编码。 But now the next task is to send the encoded data to Wowza server using rtsp. 但是现在的下一个任务是使用rtsp将编码的数据发送到Wowza服务器。

Please share some code or useful document if anyone is aware about this. 如果有人知道,请分享一些代码或有用的文档。

There is one another library for encoding purpose live555. 还有一个用于编码目的的库live555。 But I am not sure it can send the data to server using rtsp. 但是我不确定它是否可以使用rtsp将数据发送到服务器。

Actualy I made an iOS streaming app (with wowza as streaming server) 实际上,我制作了一个iOS流媒体应用(使用wowza作为流媒体服务器)

I believe you can stream video only with FFmpeg with rtsp protocol although FFmpeg don't fully support it 我相信您只能使用带有rtsp协议的FFmpeg流视频,尽管FFmpeg并不完全支持它

However with ffmpeg you can get a valid SDP and pass it to wowza using RTCP protocol - ANNOUNCE OPTION SETUP RECORD - 但是,使用ffmpeg可以获取有效的SDP,并使用RTCP协议将其传递到wowza-通知选项设置记录-

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 我没有使用FFmpeg进行编码,但是如果您可以获取原始的H264数据,则可以使用rfc6184将其打包成一个有效的RTP数据包

edit : here is a sample to connect wowza : 编辑:这是连接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 其中sendAndRecvData是绑定到wowza_ip:1935的tcp套接字

you can use the same kind of code for SETUP, which will send back RTP (+RTCP) ports where you should send your datas 您可以将相同类型的代码用于SETUP,这将向后发送应发送数据的RTP(+ RTCP)端口

您使用live555时,可以使用设备上的live 555服务器发送音频和视频,这将为您提供rtsp + rtcp流到wowza,以便宣布和记录live 555具有不受支持的dss模块。

Wowza有一个名为GoCoder的iPhone应用程序,它将向Wowza服务器发送实时编码流。

You can stream directly to a Wowza server using RTMP instead of RTSP. 您可以使用RTMP(而不是RTSP)直接流式传输到Wowza服务器。 The ffmpeg command is something like: ffmpeg命令类似于:

ffmpeg -re -i localFile.mp4 -c copy -f flv rtmp://server/live/streamName

As long as you specify your output format as flv and the output destination as rtmp://xxx then you should be OK. 只要将输出格式指定为flv并将输出目标指定为rtmp:// xxx,那么您就可以了。

Source: ffmpeg streaming 来源: ffmpeg流

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM