VideoTexture 'cam' device number does not work and rate has weird effects 249rc1 #18634

Closed
opened 2009-04-27 22:50:31 +02:00 by Laurence Weedy · 5 comments

Category: Rendering

%%%using python of the form:
GameLogic.vidSrc = VideoTexture.VideoFFmpeg('cam', 0, 1, 640, 480)

I only seem to be able to get the first webcam (ie. 0) to work. This was a problem for me as I was using a Canon camcorder as a video source on my laptop which has a webcam already... Worked fine in Ashsid's plugin with cam value set to 1, but not on VideoTexture in RC1. Have also tried it with a second web cam and get the same result.

After a little more research I have found:
On my laptop (winXPpro, Intel Centrino Duo, Nvidia 8600m GT) only cam = 0 works. set to any other value you just get black (with later experiments I got grey).

On my desktop PC (WinXP, Intel E8400, Nvidia 8600GT), with 'cam' set to 1, a 'choose device' dialogue pops up with the available choices in it, and then only device 0 works anyway.

This was verified with the Videotexture demo file.%%%

**Category**: Rendering %%%using python of the form: GameLogic.vidSrc = VideoTexture.VideoFFmpeg('cam', 0, 1, 640, 480) I only seem to be able to get the first webcam (ie. 0) to work. This was a problem for me as I was using a Canon camcorder as a video source on my laptop which has a webcam already... Worked fine in Ashsid's plugin with cam value set to 1, but not on VideoTexture in RC1. Have also tried it with a second web cam and get the same result. After a little more research I have found: On my laptop (winXPpro, Intel Centrino Duo, Nvidia 8600m GT) only cam = 0 works. set to any other value you just get black (with later experiments I got grey). On my desktop PC (WinXP, Intel E8400, Nvidia 8600GT), with 'cam' set to 1, a 'choose device' dialogue pops up with the available choices in it, and then only device 0 works anyway. This was verified with the Videotexture demo file.%%%
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

%%%Great I spelt it wrong... I meant 'device' number in the title..sorry%%%

%%%Great I spelt it wrong... I meant 'device' number in the title..sorry%%%
Member

%%%The syntax for the camera is a follow:

Windows: VideoFFmpeg("",,,,)
cam is 0 for the first camera, 1 for the second, etc.
Unfortunately, it seems that the vfwcap driver does not handle correctly the camera number: opening with =1 never works, even if there are 2 cameras, at least on my machine; and =0 gives a pop-up windows where you can choose which camera you want to use. It could also be a bug in ffmpeg that it does not use vfwcap correctly.

Linux: same format as in Windows in which case the v4l driver is used with the name /dev/video0 for the first cam, /dev/video1 for the second, etc.
You can also specify the driver directly:

VideoFFmpeg("[:]",0,,,)
where should start with "/dev/" and optional format can be 'pal', 'secam' or 'ntsc'. Example of valid filename:
/dev/v4l/video0:pal
/dev/ieee1394/1:ntsc

I didn't try with 2 cameras in Linux but there is a good chance that it works better because the driver is named explicitely.

In any case these are problems in ffmpeg or in Windows driver. I can't fix them now. %%%

%%%The syntax for the camera is a follow: Windows: VideoFFmpeg("",<cam>,<fps>,<sizex>,<sizey>) cam is 0 for the first camera, 1 for the second, etc. Unfortunately, it seems that the vfwcap driver does not handle correctly the camera number: opening with <cam>=1 never works, even if there are 2 cameras, at least on my machine; and <cam>=0 gives a pop-up windows where you can choose which camera you want to use. It could also be a bug in ffmpeg that it does not use vfwcap correctly. Linux: same format as in Windows in which case the v4l driver is used with the name /dev/video0 for the first cam, /dev/video1 for the second, etc. You can also specify the driver directly: VideoFFmpeg("<driver>[:<format>]",0,<fps>,<sizex>,<sizey>) where <driver> should start with "/dev/" and optional format can be 'pal', 'secam' or 'ntsc'. Example of valid filename: /dev/v4l/video0:pal /dev/ieee1394/1:ntsc I didn't try with 2 cameras in Linux but there is a good chance that it works better because the driver is named explicitely. In any case these are problems in ffmpeg or in Windows driver. I can't fix them now. %%%
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Inês Almeida self-assigned this 2014-05-26 10:46:53 +02:00
Member

This seems to be working, despite the inconsistent API. The reported problem seems to be with ffmpeg or the windows driver.
I will close this and leave a better API as a ToDo.

This seems to be working, despite the inconsistent API. The reported problem seems to be with ffmpeg or the windows driver. I will close this and leave a better API as a ToDo.
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blender/blender#18634
No description provided.