如何使用 libvlc api 设置网络摄像头的流视频格式?

发布于 2024-11-19 22:11:53 字数 143 浏览 7 评论 0原文

我正在开发一个应用程序,我应该在其中使用网络摄像头进行流媒体传输, 为此,我使用了 libvlc api, 我可以从网络摄像头进行流式传输, 但我得到的是 YUYV 格式的流, 但我想要 MJPEG 格式的流媒体, 那么有人可以帮助我如何在 libvlc 中设置流格式吗?

I am developing an application in which I am supposed to get Streaming using webcam,
For this I have used the libvlc api,
I am able to stream from webcam,
But I am getting the stream in the YUYV format,
but I want the streaming in the MJPEG format,
so can anybody help me how to set streaming format in libvlc.?

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

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

发布评论

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

评论(1

苏璃陌 2024-11-26 22:11:54

您必须将参数“sout”传递给 libvlc_vlm_add_broadcast 函数。您可以在其中指定所需的格式。
例如:

const char *sout = "#transcode{vcodec=mjpg, vb=1600}:http{dst=127.0.0.1:8090/cam.mp4}";
libvlc_vlm_add_broadcast(mVLCInst, media_name, "dshow://", sout, 0, NULL, true, false);

在 Windows 上使用 dshow://,在 Linux 上使用 v4l2:///dev/videoX,其中 X 是摄像机 ID。

You have to pass the parameter "sout" to libvlc_vlm_add_broadcast function. In it, you can specify the desired format.
For instance:

const char *sout = "#transcode{vcodec=mjpg, vb=1600}:http{dst=127.0.0.1:8090/cam.mp4}";
libvlc_vlm_add_broadcast(mVLCInst, media_name, "dshow://", sout, 0, NULL, true, false);

dshow:// is used on Windows, for Linux you use v4l2:///dev/videoX, where X is the cam ID.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文