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.?
Asked
Active
Viewed 2,372 times
1 Answers
1
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.

construKction
- 11
- 3