如何使用 libvlc api 设置网络摄像头的流视频格式?
我正在开发一个应用程序,我应该在其中使用网络摄像头进行流媒体传输, 为此,我使用了 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须将参数“sout”传递给 libvlc_vlm_add_broadcast 函数。您可以在其中指定所需的格式。
例如:
在 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:
dshow:// is used on Windows, for Linux you use v4l2:///dev/videoX, where X is the cam ID.