2010-06-28 165 views
7

如果您可以帮我解决H264流式传输问题,并且我一直在努力解决数周,我将非常感激。通过从Live555到VLC的RTP流式传输H.264视频

我需要从Live555(在Linux机器上)将H264视频流传输到VLC媒体播放器(在Windows机器上)。 使用RTSP它可以很好地工作,但我需要使用RTP而不使用RTSP,而使用RTP我不会看到视频。 VLC甚至不认识到该流是H264。

这是通过RTSP(配置的作品)传送的SDP文件:

v=0 
o=- 1277647151953158 1 IN IP4 190.40.14.100 
s=Session streamed by "testH264VideoAudioStreamer" 
i=test-h264-mux.mpg 
t=0 0 
a=tool:LIVE555 Streaming Media v2007.05.24 
a=type:broadcast 
a=control:* 
a=source-filter: incl IN IP4 * 190.40.14.100 
a=rtcp-unicast: reflection 
a=range:npt=0- 
a=x-qt-text-nam:Session streamed by "testH264VideoAudioStreamer" 
a=x-qt-test-inf:test-h264=mux.mpg 
m=video 8554 RTP/AVP 96 
c=IN IP4 190.40.15.63/7 
a=rtpmap:96 H264/90000 
a=fmtp:96 packetization-mode=1;profile-level-id=000042;sprop-parameter-sets=H264 
a=control:track1 

但是,如果我从RTSP切换到RTP,这是行不通的。我已经尝试在VLC播放器中加载上述SDP文件,但它没有帮助。

下面是一些VLC播放器0.8.6d的调试输出:

main input debug: thread 4016 (input) created at priority 1 (input/input.c:265) 
main input debug: `rtp://@190.40.15.63:8554' gives access `rtp demux' `' path `@190.40.15.63:8554' 
main input debug: creating demux: access='rtp' demux='' path='@190.40.15.63:8554' 
main demuxer debug: looking for access_demux module: 0 candidates 
main demuxer warning: no access_demux module matched "rtp" 
main input debug: creating access 'rtp' path='@190.40.15.63:8554' 
main access debug: looking for access2 module: 6 candidates 
access_udp access debug: opening server=:0 local=190.40.15.63:8554 
main access debug: net: connecting to '[]:[email protected][190.40.15.63]:8554 
main access debug: looking for netrowk module: 1 candidate 
ipv6 access debug: 190.40.15.63: Host or service not found 
main access debug: using network module "ipv6" 
main access debug: removing network module "ipv6" 
main access debug: looking for netrowk module: 1 candidate 
ipv4 access debug: resolving 190.40.15.63:8554... 
ipv4 access debug: resolving :0... 
main access debug: using network module "ipv4" 
main access debug: removing network module "ipv4" 
main access debug: using access2 module "access_udp" 
main private debug: pre buffering 
access_udp access debug: no RTP header detected 
main input debug: creating demux: access='rtp' demux='' path='@190.40.15.63:8554' 
main demuxer debug: looking for demux2 module: 45 candidates 
ts demuxer warning: TS module discarded (lost sync) 
ffmpeg demuxer debug: detected format: mp3 

(可能有错别字,因为我不得不手动将它复制 - 不要问:))

在VLC 1.0.5我得到一个未知有效负载类型错误,并且由于未知的网络堆栈错误,SDP无法加载。显示的其他错误是不支持SDP连接信息液体分离器警告:无效的SDP

任何帮助将不胜感激!

谢谢

伊利亚

+1

一个快速评论:您的SDP文件在技术上是无效的。您应该使用base-64编码SPS和PPS信息,用逗号分隔它,并将其附加到sprop参数集。你将它设置为字符串“H264”,这肯定是错误的(尽管很常见,不幸的是)。 – kidjan 2010-11-19 15:33:05

回答

8

我不得不做的是使用,而不是直接打开流SDP文件。结果是只有在使用RTSP时才传输SDP数据。在传输RTP时,我必须自己提供SDP文件。

所以我所做的就是:

  1. 流与RTSP(其工作方式方法),
  2. 使用Wireshark来
  3. 保存SDP记录超过RTSP传输的SDP文件为文本文件扩展名为.sdp,
  4. 在VLC中,打开SDP文件而不是直接打开网络流。

它做到了神奇!