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.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#18634
No description provided.