尝试流式传输Virtualy创建的Camera Video0设备,以24位RGB格式使用GSTREAMER制作VLC的RTSP流

发布于 2025-01-20 10:42:15 字数 889 浏览 3 评论 0原文

我使用 V4l2loopback 创建了 Video0 设备,并使用以下示例 Git 代码 V4l2Loopback_cpp 作为流式处理 jpg 图像的应用程序通过更改代码中的某些条件,从顺序文件夹中读取图像。但是代码将图像读取为 24 位 RGB 图像并将其发送给 Video0 设备,这很好,因为图像在 VLC 视频设备捕获上像正常视频一样运行。正如我之前提到的,如果我检查了视频的 VLC 属性,它会显示以下内容 在此处输入图像描述

我需要此 video0 设备使用 gstreamer lib 在 vlc 中流式传输 rtsp h264 视频。 我已使用以下命令检查命令行进行测试,但它显示一些内部进程错误,

gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,width=590,height=332,framerate=30/1 ! x264enc ! rtph264pay name=pay0 pt=96

我不知道这里有什么问题。它是 24 位 jpeg 格式还是我使用的 gstreamer 命令。我需要一个合适的 gstreamer 命令行来处理 video0 设备以流式传输 h264 rtsp 视频任何帮助,谢谢。

图像格式 - jpg(传递的序列图像) Video0 接收 - 24 位 RGB 图像 输出需要 - 来自 video0 的 h264 rtsp 流

I have created Video0 device using V4l2loopback and used the following sample Git code V4l2Loopback_cpp as a application to stream jpg images from a folder sequential by altering some conditions in the code.But the code read images as 24Bit RGB image and send it Video0 device which is fine ,because the image run like a proper video on VLC video device capture. As i mentioned earlier thet if i checked the VLC properties of the video its Shows the following content enter image description here

i need this video0 device to stream rtsp h264 video in vlc using the gstreamer lib .
i have used the following command to check in commandline for testing but its show some internal process error

gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,width=590,height=332,framerate=30/1 ! x264enc ! rtph264pay name=pay0 pt=96

i dont know whats the problem here .is it 24bit jpeg format or the gstreamer command i use. I need a proper gstreamer command line to process the video0 devide to stream h264 rtsp video any help is appreciated thank u.

image Format - jpg (sequence image passed)
Video0 recives - 24-bit RGB image
output need - h264 rtsp stream from video0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遗弃M 2025-01-27 10:42:16

不确定这是一个解决方案,但是以下方面可能会有所帮助:

  1. 您可以根据V4L报告(width = 584)尝试调整分辨率:
v4l2src device=/dev/video0 ! video/x-raw,format=RGB,width=584,height=332,framerate=30/1 ! videoconvert ! x264enc insert-vui=1 ! h264parse ! rtph264pay name=pay0 pt=96
  1. 请注意,在V4L2Loopback接收器侧可能会发生此错误,而可能是发送者错误。如果您将v4l2loopback添加到vstreamer管道上到v4l2sink,则将尝试添加诸如:
... ! video/x-raw,format=RGB,width=584,height=332,framerate=30/1 ! identity drop-allocation=1 ! v4l2sink

Not sure this is a solution, but the following may help:

  1. You may try adjusting resolution according to what V4L reports (width=584) :
v4l2src device=/dev/video0 ! video/x-raw,format=RGB,width=584,height=332,framerate=30/1 ! videoconvert ! x264enc insert-vui=1 ! h264parse ! rtph264pay name=pay0 pt=96
  1. Note that this error may happen on v4l2loopback receiver side while it may be a sender error. If you're feeding v4l2loopback with a gstreamer pipeline to v4l2sink, you would try adding identity such as:
... ! video/x-raw,format=RGB,width=584,height=332,framerate=30/1 ! identity drop-allocation=1 ! v4l2sink
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文