简体   繁体   English

H264视频流塞满0xff

[英]H264 video stream stuffed with 0xff

I am using recvfrom() to receive data over a socket. 我正在使用recvfrom()通过套接字接收数据。 I was expecting my buffer to contain a solid stream of data, but it seems to periodically be broken up by chucks of 0xFF bytes. 我原本希望缓冲区包含可靠的数据流,但是它似乎会定期被0xFF字节的中断破坏。 I am using VLC player for streaming the H264 video. 我正在使用VLC播放器流式传输H264视频。

My question is where are these 0xFF bytes coming from? 我的问题是这些0xFF字节从哪里来? Are they set by the VLC player? 它们由VLC播放器设置吗? I know they aren't packet separators because I am successfully parsing all of my sequence numbers. 我知道它们不是数据包分隔符,因为我已经成功解析了所有序列号。 If they are not part of the packet, how do I safely remove them? 如果它们不是包装的一部分,如何安全地将其删除? Some examples below: 以下是一些示例:

80 a1 12 63 
88 7f b9 32 
79 11 3 98 
47 40 44 31 
41 0 ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff 0 0 
1 c0 0 70 
80 80 5 21 
0 1d c f7 

and

1d a7 77 77 
47 40 44 32 
40 0 ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff ff ff ff 
ff 0 0 1 
c0 0 71 80 
80 5 21 0 
1d 1f 55 ff 

Update 更新资料

I am using RTP. 我正在使用RTP。 The segments above are only a chunk of a much larger packet. 上面的段只是更大的数据包的一部分。 Here is some info about my stream: 以下是有关我的信息流的一些信息:

:sout=#transcode{vcodec=h264,vb=56,venc=x264{profile=baseline},fps=12,width=176,height=144,acodec=mp3,ab=24,channels=1,samplerate=44100}:rtp{dst=192.168.0.96,port=9999,mux=ts} :sout-keep :sout =#transcode {vcodec = h264,vb = 56,venc = x264 {profile = baseline},fps = 12,width = 176,height = 144,acodec = mp3,ab = 24,channels = 1,samplerate = 44100 }:rtp {dst = 192.168.0.96,port = 9999,mux = ts}:sout-keep

One of the reasons I don't think 0xFF is supposed to be there is because my decoded output looks very corrupted. 我不认为应该存在0xFF的原因之一是因为我的解码输出看起来非常损坏。 You can also see that there is a RTP start code 0x000001 directly after the 0xFF segment. 您还可以看到在0xFF段之后直接有一个RTP起始代码0x000001。

Looking at the packets being transmitted over the network from the origin using wireshark, I have found that the 0xFF is actually part of the message. 查看使用wireshark从源头通过网络传输的数据包,我发现0xFF实际上是消息的一部分。 The packets are also of consistent length with 0xFF included. 数据包的长度也一致,包括0xFF。 I have determined that I am receiving the data correctly. 我确定我已正确接收数据。 My problem must be elsewhere. 我的问题一定在其他地方。

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

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