当前位置: 代码迷 >> 多媒体/流媒体开发 >> vlc接收RTP封装h264流出错解决办法
  详细解决方案

vlc接收RTP封装h264流出错解决办法

热度:3684   发布时间:2013-02-26 00:00:00.0
vlc接收RTP封装h264流出错
小弟最近做h264的打包发送,在windows下用vlc接收,只能解码播放第一帧图像(I帧),然后就卡那儿了,提示出错信息为:
avcodec error: more than 5 seconds of late video -> dropping frame (computer too slow ?) 
查看解码器信息,发现“已解码帧”和“已显示帧”数目也在不停的更新,但画面就是不动了,而且“已显示帧”要远大于“已解码帧”。让我很费解。

我又换到linux下接收,更是连第一帧都播不出来了,显示的信息为(我是在本地读sdp文件进行接收端的设置的,前面部分为读sdp的信息):

/////////////////////////////////////////////////////////////////////////////////////////
main debug: adding playlist item `/root/Desktop/h264test.sdp' ( /root/Desktop/h264test.sdp )
main debug: creating new input thread
main debug: waiting for thread completion
main debug: thread 2985520016 (input) created at priority 0 (input/input.c:265)
main debug: `/root/Desktop/h264test.sdp' gives access `' demux `' path `/root/Desktop/h264test.sdp'
main debug: creating demux: access='' demux='' path='/root/Desktop/h264test.sdp'
main debug: looking for access_demux module: 2 candidates
main debug: creating access '' path='/root/Desktop/h264test.sdp'
main debug: looking for access2 module: 8 candidates
[color=#FF0000]vcd debug: trying .cue file: /root/Desktop/h264test.cue
vcd debug: could not find .cue file
access_file debug: opening file `/root/Desktop/h264test.sdp'
main debug: using access2 module "access_file"
main debug: pre-buffering...
main debug: received first data for our buffer
main debug: creating demux: access='' demux='' path='/root/Desktop/h264test.sdp'
main debug: looking for demux2 module: 45 candidates
live555 debug: RTP subsession 'video/H264'
main debug: selecting program id=0
main debug: using demux2 module "live555"
main debug: looking for a subtitle file in /root/Desktop/
main debug: looking for decoder module: 26 candidates
ffmpeg debug: libavcodec already initialized
ffmpeg debug: postprocessing disabled
ffmpeg debug: ffmpeg codec (h264) started
main debug: using decoder module "ffmpeg"
main debug: looking for packetizer module: 17 candidates
main debug: using packetizer module "packetizer_h264"
main debug: thread 2962201488 (decoder) created at priority 0 (input/decoder.c:159)
main debug: `/root/Desktop/h264test.sdp' successfully opened packetizer_h264 

///////////////////////////////////////////////////////////////////////////////////////////////////


[#FF0000]warning: waiting for SPS/PPS
packetizer_h264 debug: found NAL_PPS
packetizer_h264 debug: found NAL_SPS


我打包是直接对一个h264文件提取出每个nal,然后加上RTP包头(依赖Jrtplib),PT设为98(与sdp中一致),时戳单元为1/90000,其它的都按jrtplib默认设置,每封装一个包就发送一个包。
哪位大侠给看看问题出在哪儿,看调试信息似乎是数据包的封装有问题导致vlc不认识,但为何又能发现pps和sps呢,windows下也能解码第一帧,难道他们的包设置不同。拜托各位了。
------解决方案--------------------------------------------------------
而且“已显示帧”要远大于“已解码帧”是自己程序的问题吧
你用wireshark截包工具分析下接收的包对不对,wireshark有trp协议的分析
------解决方案--------------------------------------------------------
  相关解决方案