RTSP/RTP 中可以进行下采样吗?
我有一个媒体服务器,为多个摄像机提供服务。 我希望服务器将数据采样率从 20 fps 降低到 1 fps。 显然,我可以通过解码和重新编码视频帧来做到这一点 - 但是,服务器资源有限。我注意到,如果我只是丢弃 RTP UDP 数据包,输出效果不太好 - 我在图像中看到撕裂和垃圾(至少使用 opencv/ffmpeg 客户端)。
是否可以通过丢弃更仔细选择的帧/数据包来在 RTP 流中进行下采样,以避免输出中出现垃圾和撕裂? (目前我可以在服务器上提取 RTP|H264 原始数据块,但无法通过完整的编解码器运行它们)。
I have a media server serving several cameras.
I'd like for the server to downsample the data from, say, 20 fps to 1 fps.
Obviously I could do this by decoding and recoding the video frames - however, the server is a little resource constrained. I notice that if I simply drop RTP UDP packets, the output is not so good - I see both tearing and junk in the images (at least with a opencv/ffmpeg client).
Is it possible to downsample within an RTP stream by dropping more carefully chosen frames/packets, to avoid junk and tearing in the output? (Currently I'm able to extract RTP|H264 raw data chunks on the server, but am not running them through a full codec).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
H.264 流由不同的帧类型组成:I(或 IDR)、P 和 B。I
(或 IDR)帧是完整图片,无需任何其他帧即可解码。
因此,您可以过滤掉 P 和 B 帧,只传递 I 帧。
生成的帧速率取决于原始流的 I(或 IDR)帧频率。我猜你的速度在 0.1 到 2 fps 之间。
An H.264 stream consists of different frame types: I (or IDR), P and B.
I (or IDR) frames are a full pictures and can be decoded without any other frames.
So you could filter out P and B frames and only pass on I frames.
Your resulting frame rates depends on the I (or IDR) frame frequency of the original stream. I am guessing you get somewhere between 0.1 to 2 fps.