cychiang / webcamstudio

Automatically exported from code.google.com/p/webcamstudio
GNU General Public License v3.0
1 stars 0 forks source link

Video Stream Not Being Rendered Properly v4l2loopback #116

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Setup an Image/webcamfeed/video
2.v4l2loopback option
3.try streaming it

What is the expected output?

The Image/video/webcam feed

What do you see instead?

Don't know the fix

The Operating system you are using (Linux, Windows etc)?

LinuxMint 17

What version of WebcamStudio are you using?

0.70

What version of Java are you using?

java version "1.7.0_55"
OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1ubuntu1)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)

What is your Webcamera vendor, model and version?
Webcam isn't the problem

For *nix users please enter the output from "sudo lsusb"?
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 008 Device 004: ID 0930:0200 Toshiba Corp. 
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 003: ID 046d:c066 Logitech, Inc. 
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 04f2:b008 Chicony Electronics Co., Ltd USB 2.0 Camera
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Either the problem is with mplayer or v4l2loopback. The video preview is fine 
but when I try streaming it, there is a problem rendering it. Images shown 
below describes it best"-

http://i.imgur.com/RzGiPUn.png
http://i.imgur.com/g7fV8lY.png

Original issue reported on code.google.com by sir...@gmail.com on 19 Sep 2014 at 5:21

Attachments:

GoogleCodeExporter commented 9 years ago
I'll handle this one.

Original comment by soylent...@gmail.com on 22 Sep 2014 at 11:58

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I'm available if you need any type of outputs or anything. Would like to 
contribute as much as I can to get this fixed. Also, my machine is this "Linux 
Linux-Mint 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 
x86_64 x86_64 GNU/Linux" Regards

Original comment by sir...@gmail.com on 22 Sep 2014 at 12:20

GoogleCodeExporter commented 9 years ago
Hi sir508,
 To use the Virtual Webcam in webcamstudio you have two choices:

1) Use the WebcamStudio Video Device shipped in the PPA with the 
webcamstudio-dkms package.
2) Install the original v4l2loopback from 
https://github.com/umlaeute/v4l2loopback

If you want to use another fork of the v4l2loopback such as DroidCam you must 
pay attention to the pixel-format settings.

DroidCam is originally build with this settings:

Format Video Capture:
    Width/Height  : 320/240
    Pixel Format  : 'YU12'
    Field         : None
    Bytes per Line: 320
    Size Image    : 115200
    Colorspace    : SRGB

WebcamStudio Virtual Device has this settings:

Format Video Output:
    Width/Height  : 320/240
    Pixel Format  : 'RGB3'
    Field         : None
    Bytes per Line: 960
    Size Image    : 230400
    Colorspace    : SRGB

The only way i found to let DroidCam correctly accept WebcamStudio data is to 
change the pixelformat in the sources file of DroidCam.
WebcamStudio use RGB24 pixelformat to stream to the Virtual-Webcam an so if you 
want to use DroidCam as the virtual device you have to uninstall it, change the 
source code and then reinstall it.

First of all uninstall the DroidCam with the uninstaller from the source folder:

$ sudo ./uninstall
$ rm -rf /home/HOME_FOLDER/.droidcam/

1) Download DroidCam from http://www.dev47apps.com/droidcam/linuxx/
2) Extract the archive and navigate to (In my case) 
/droidcam-v4l2-x86/v4l2loopback/
3) GEdit the file "v4l2loopback-dc.c"
4) Find the line "vid_format.fmt.pix.pixelformat = V4L2_PIX_FMT_YUV420;" and 
change it to "vid_format.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24;"
5) Save the file.
6) Return to /droidcam-v4l2-x86 folder and reinstall DroidCam as normal with:
$ sudo ./install
7) open WebcamStudio and retry to use the DroidCam Virtual Device.

Let me know.
karl.

Original comment by soylent...@gmail.com on 22 Sep 2014 at 12:43

GoogleCodeExporter commented 9 years ago
Another thing, when you install DroidCam be sure to pass the correct width and 
height that you will use in WebcamStudio.
karl.

Original comment by soylent...@gmail.com on 22 Sep 2014 at 12:46

GoogleCodeExporter commented 9 years ago
Hey, is there a way to not use Droidcam? I no longer use it. I just had it 
install in the past for testing purposes. Can't webcamstudio have its own 
v4l2loopback?
sir508

Original comment by sir...@gmail.com on 22 Sep 2014 at 1:44

GoogleCodeExporter commented 9 years ago
Hey.. It's fixed thanks. But I wish it had it own custom v4l2loopback driver 
like /video/2 so that droid cam component stayed seperate. I had to manually 
enter the resolution for it work. Thanks Karl

-/sir508

Original comment by sir...@gmail.com on 22 Sep 2014 at 2:20

Attachments:

GoogleCodeExporter commented 9 years ago
Yes sir508,
 you can add webcamstudio ppa to Mint 17:

$ sudo add-apt-repository ppa:webcamstudio/webcamstudio-dailybuilds

You will find two packages:
1) webcamstudio (The main Program)
2) webcamstudio-dkms (The v4l2loopback WS Device).

I think is better to uninstall DroidCam first ...

Install webcamstudio-dkms package and it will build the V4l2loopback fork 
module for you.
Notice that the first time you have to do a modprobe after the installation:

$ apt-get install webcamstudio-dkms
$ sudo modprobe webcamstudio

Let me know.
karl

Original comment by soylent...@gmail.com on 22 Sep 2014 at 2:58

GoogleCodeExporter commented 9 years ago
Hey Karl,

yes I have install webcamstudio through PPA and I do have DKMS installed. I 
just noticed that video playback only seems to work on Cheese and not on Skype. 
On Skype, it just shows a blank screen. Also, the video feed is not shown in 
Flash in a web browser. 

Do you know what might be happening?

Also thanks a lot for maintaining this program.

Regards
sir508

Original comment by sir...@gmail.com on 22 Sep 2014 at 4:33

GoogleCodeExporter commented 9 years ago
Hi sir508,
 thanks :)
The strange thing is that I can't see the v4l2loopback in Cheese or in Skype in 
no way ... can only see it from VLC, other players, gstreamer, avconv ...
I implemented a work around to let Flash and Skype (Unfortunately in my case 
not Cheese ...) see the WSVideoDevice.
You have to push the SkyCam button in the Ouputs to activate a new instance of 
the Virtual Device. The new device will be /dev/video21 and it will work with 
skype or flash. 
Have a look here:

https://www.youtube.com/watch?v=BzHp6K_7wR4&list=PLXUBx6_jVxXvPKykQKZULzUgt_frRT
YV6&index=29

https://www.youtube.com/watch?v=BzHp6K_7wR4&list=PLXUBx6_jVxXvPKykQKZULzUgt_frRT
YV6&index=28

https://www.youtube.com/watch?v=BzHp6K_7wR4&list=PLXUBx6_jVxXvPKykQKZULzUgt_frRT
YV6&index=27

karl

Original comment by soylent...@gmail.com on 22 Sep 2014 at 4:59

GoogleCodeExporter commented 9 years ago
Hey Karl.

When I use the Skycam option, /dev/video21 shows up on Skype video setting. But 
again, it blank. On cheese, there is no option for /dev/video21, only the 
option from Droidcam. 

v4l2loopback only seems to be working normal on Cheese. 

Original comment by sir...@gmail.com on 23 Sep 2014 at 9:51

Attachments:

GoogleCodeExporter commented 9 years ago
Hi try to start Skype After you activate WSVideoDevice on WS.
From my Tests it is better to have Skype completely closed before activating 
the WSVideoDevice on WS.
Let me know.
karl.

Original comment by soylent...@gmail.com on 23 Sep 2014 at 12:14

GoogleCodeExporter commented 9 years ago
I just tested that, not working :(
/sir508

Original comment by sir...@gmail.com on 23 Sep 2014 at 1:19

GoogleCodeExporter commented 9 years ago
Hi sir508,
 just tested on Ubuntu 14.04 x64:

Be sure Skype is completely closed (... not minimized but quitted).

1) Start WebcamStudio
2) Load a stream and play it.
3) Activate SkyCam device (... needs sudo password)
4) Activate WSVideoDevice
5) Start Skype and login
6) go to options->video and check the WSVideoDevice /dev/video21

The only thing that i don't understand is why in the preview video of Skype the 
v4l2loopback video is horizontal flipped.
Other peoples in the call told me they revived correct picture, not flipped.

If the above steps doesn't work for you let me know.
Maybe something in Mint 17 builds?
I will try to set up a VM for testing ...

karl

Original comment by soylent...@gmail.com on 23 Sep 2014 at 3:49

Attachments:

GoogleCodeExporter commented 9 years ago
Working! I missed the step
4) Activate WSVideoDevice

Thanks Karl. Bug closed no? 

sir508.

Original comment by sir...@gmail.com on 23 Sep 2014 at 4:23

GoogleCodeExporter commented 9 years ago
Hi sir508,
 I'm happy that WS works for you too :)
No bug closed, because there was no bug in WS code ;) ... no need to modify a 
line of the code ... :)
Thanks for sharing your tests with WS in Mint 17, this is very useful.
I will close this issue.
Have a good day.
karl.

Original comment by soylent...@gmail.com on 23 Sep 2014 at 5:31

GoogleCodeExporter commented 9 years ago
Explanation on how WS features works due to a missing WebcamStudio good 
Documentation ...

Original comment by soylent...@gmail.com on 23 Sep 2014 at 5:33