Clone WebCam stream in mediastreamer2

I'm using mediastreamer2 for a video stream from a Webcam, via a RTP connection to another System.

I want to have 2 (or more) outgoing video streams, the first one initialized works fine, but the second stream is complaining, that the WebCam is busy.

libv4l2: error setting pixformat: Device or resource busy

Do you have any hints, and/or ideas how to clone the webcam video stream or another way to implement 2 videostreams?

thanks in advance! Mediastreamer2 is written in c , I'm using Ubuntu and Qt to code.

regards


Ok I have a solution :

  • Loopback is a nice packet to make virtual Webcams.

    sudo apt-get install v4l2loopback-dkms //to install
    sudo modprobe v4l2loopback devices=X // X = number of virtual cams

  • Copy Videosource from Real Webcam to Virtual ( check this page )

    ffmpeg -f video4linux2 -s 352x288 -i /dev/video0 -codec copy -f v4l2 /dev/video1 -codec copy -f v4l2 /dev/video2 // this copys from video0 to the VirtualCams video1

  • Start Streams by selecting Virtual Cams

    MSWebCam *cam = ms_web_cam_manager_get_cam(m,"V4L2: /dev/video1");

  • 链接地址: http://www.djcxy.com/p/81096.html

    上一篇: 管理存储在github上的开放源代码rails 3应用程序的安全性

    下一篇: 在mediastreamer2中克隆WebCam流