paky888 / boblight

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

boblight-v4l can't read input #49

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I have my video grabber which uses v4l2 on /dev/video1.
I tested it with vlc which works flawless.
When i try to open the same source with:

boblight-v4l -c /dev/video1 -i 0

i get:

denis@utouch:~$ boblight-v4l -c /dev/video1 -i 0
Gamma not set, using 2.2 since this is default for video
Connecting to boblightd
Connection to boblightd opened
[video4linux2 @ 0x8c28d80] [4]Capabilities: 5020011
[video4linux2 @ 0x8c28d80] The V4L2 driver using the interlaced modeThe V4L2 
driver set input_id: 0, input: Composite1
[video4linux2 @ 0x8c28d80] Setting time per frame to 1/60
[video4linux2 @ 0x8c28d80] ioctl set time per frame(1/60) failed
[video4linux2 @ 0x8c28d80] ioctl(VIDIOC_DQBUF): Invalid argument
[video4linux2 @ 0x8c28d80] decoding for stream 0 failed
[video4linux2 @ 0x8c28d80] Estimating duration from bitrate, this may be 
inaccurate
ERROR: Unable to find stream info

I have a webcam in this notebook which works without a problem with:

denis@utouch:~$ boblight-v4l -c /dev/video0 -i 0
Gamma not set, using 2.2 since this is default for video
Connecting to boblightd
Connection to boblightd opened
[video4linux2 @ 0x931ad80] [4]Capabilities: 4000001
[video4linux2 @ 0x931ad80] The V4L2 driver changed the video from 64x64 to 
160x120
[video4linux2 @ 0x931ad80] The V4L2 driver set input_id: 0, input: Camera 1
[video4linux2 @ 0x931ad80] Setting time per frame to 1/60
[video4linux2 @ 0x931ad80] The driver changed the time per frame from 1/60 to 
1/30
[rawvideo @ 0x931b480] err{or,}_recognition separate: 1; 1
[rawvideo @ 0x931b480] err{or,}_recognition combined: 1; 1
[video4linux2 @ 0x931ad80] All info found
[video4linux2 @ 0x931ad80] Estimating duration from bitrate, this may be 
inaccurate
Input #0, video4linux2, from '/dev/video0':
  Duration: N/A, start: 1657.764477, bitrate: 9216 kb/s
    Stream #0.0, 1, 1/1000000: Video: rawvideo, yuyv422, 160x120, 1/30, 9216 kb/s, 30 tbr, 1000k tbn, 30 tbc
[rawvideo @ 0x931b480] err{or,}_recognition separate: 1; 1
[rawvideo @ 0x931b480] err{or,}_recognition combined: 1; 1
Got signal, setting priority to 128

I'm not sure if this is a problem with the libraries from ffmpeg while building 
boblight-v4l. Any ideas?

Original issue reported on code.google.com by denishamann on 29 Aug 2012 at 11:03

GoogleCodeExporter commented 8 years ago
Some further Information:

On vlc i get the following output:

[0x7f1880000b28] main input debug: `v4l2:///dev/video0' gives access `v4l2' 
demux `' path `/dev/video0'
[0x7f1880000b28] main input debug: creating demux: access='v4l2' demux='' 
location='/dev/video0' file='/dev/video0'
[0x7f18780012d8] main demux debug: looking for access_demux module: 1 candidate
[0x7f18780012d8] v4l2 demux debug: opening device '/dev/video0'
[0x7f187c005718] lua art finder debug: Trying Lua playlist script 
/usr/lib/vlc/lua/meta/art/02_frenchtv.luac
[0x7f187c005718] lua art finder debug: Trying Lua playlist script 
/usr/lib/vlc/lua/meta/art/03_lastfm.luac
[0x7f187c005718] lua art finder debug: Trying Lua scripts in 
/usr/share/vlc/lua/meta/art
[0x7f187c005718] main art finder debug: no art finder module matching "any" 
could be loaded
[0x7f187c005718] main art finder debug: TIMER module_need() : 2.388 ms - Total 
2.388 ms / 1 intvls (Avg 2.388 ms)
[0x208fab8] main playlist debug: art not found for v4l2:///dev/video0
[0x7f18780012d8] v4l2 demux debug: trying kernel V4L2
[0x7f18780012d8] v4l2 demux debug: device EasyCAP DC60 using driver easycap 
(version 0.9.1) on usb-0000:00:1d.7-4.4
[0x7f18780012d8] v4l2 demux debug: the device has the capabilities: 0x05020001
[0x7f18780012d8] v4l2 demux debug:  (X) Video Capture, (X) Audio, ( ) Tuner, ( 
) Radio
[0x7f18780012d8] v4l2 demux debug:  (X) Read/Write, (X) Streaming, ( ) 
Asynchronous
[0x7f18780012d8] v4l2 demux debug: video input 0 (CVBS0) has type: External 
analog input *
[0x7f18780012d8] v4l2 demux debug: video input 1 (CVBS1) has type: External 
analog input  
[0x7f18780012d8] v4l2 demux debug: video input 2 (CVBS2) has type: External 
analog input  
[0x7f18780012d8] v4l2 demux debug: video input 3 (CVBS3) has type: External 
analog input  
[0x7f18780012d8] v4l2 demux debug: video input 4 (CVBS4) has type: External 
analog input  
[0x7f18780012d8] v4l2 demux debug: video input 5 (S-VIDEO) has type: External 
analog input  
[0x7f18780012d8] v4l2 demux debug: input set to 0
[0x7f18780012d8] v4l2 demux debug: device supports chroma UYVY [uyvy, UYVY]
[0x7f18780012d8] v4l2 demux debug: device supports chroma YUY2 [yuy2, YUYV]
[0x7f18780012d8] v4l2 demux debug: device supports chroma RV24 [rgb24, RGB3]
[0x7f18780012d8] v4l2 demux debug: device supports chroma RV32 [rgb32, RGB4]
[0x7f18780012d8] v4l2 demux debug: device supports chroma RV24 [bgr24, BGR3]
[0x7f18780012d8] v4l2 demux debug: device supports chroma RV32 [bgr32, BGR4]
[0x7f18780012d8] v4l2 demux debug: found default width and height of 320x240
[0x7f18780012d8] v4l2 demux debug: will try to find optimal width and height
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/25 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/5 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/25 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/5 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/25 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/5 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/25 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/5 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/25 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/5 supported
[0x7f18780012d8] v4l2 demux debug: Found maximum framerate of 25.000000
[0x7f18780012d8] v4l2 demux debug:  discrete size 640x480 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/25 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/5 supported
[0x7f18780012d8] v4l2 demux debug:  discrete size 320x240 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/25 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/5 supported
[0x7f18780012d8] v4l2 demux debug:  discrete size 704x576 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/25 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/5 supported
[0x7f18780012d8] v4l2 demux debug:  discrete size 720x576 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/25 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/5 supported
[0x7f18780012d8] v4l2 demux debug:  discrete size 360x288 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/25 supported
[0x7f18780012d8] v4l2 demux debug:   discrete frame interval 1/5 supported
[0x7f18780012d8] v4l2 demux debug: Found optimal dimensions for framerate 
25.000000 of 720x576
[0x7f18780012d8] v4l2 demux debug: Driver requires at most 829440 bytes to 
store a complete image
[0x7f18780012d8] v4l2 demux debug: Interlacing setting: progressive
[0x7f18780012d8] v4l2 demux debug: added new video es YUY2 720x576
[0x7f18780012d8] v4l2 demux debug:  frame rate: 25.000000
[0x7f1880000b28] main input debug: selecting program id=0
[0x7f18780012d8] main demux debug: using access_demux module "v4l2"
[0x7f18780012d8] main demux debug: TIMER module_need() : 1711.276 ms - Total 
1711.276 ms / 1 intvls (Avg 1711.276 ms)
[0x7f1878009958] main decoder debug: looking for decoder module: 30 candidates
[0x7f1878009958] main decoder debug: using decoder module "rawvideo"
[0x7f1878009958] main decoder debug: TIMER module_need() : 5.703 ms - Total 
5.703 ms / 1 intvls (Avg 5.703 ms)
[0x7f1878005cc8] main demux meta debug: looking for meta reader module: 2 
candidates
[0x7f1878005cc8] lua demux meta debug: Trying Lua scripts in 
/home/denis/.local/share/vlc/lua/meta/reader
[0x7f1878005cc8] lua demux meta debug: Trying Lua scripts in 
/usr/lib/vlc/lua/meta/reader
[0x7f1878005cc8] lua demux meta debug: Trying Lua playlist script 
/usr/lib/vlc/lua/meta/reader/filename.luac
[0x7f1878005cc8] lua demux meta debug: Trying Lua scripts in 
/usr/share/vlc/lua/meta/reader
[0x7f1878005cc8] main demux meta debug: no meta reader module matching "any" 
could be loaded
[0x7f1878005cc8] main demux meta debug: TIMER module_need() : 0.614 ms - Total 
0.614 ms / 1 intvls (Avg 0.614 ms)
[0x7f1880000b28] main input debug: `v4l2:///dev/video0' successfully opened

with boblight-v4l i get the following:

[video4linux2 @ 0x1402100] [4]Capabilities: 5020001
[video4linux2 @ 0x1402100] The V4L2 driver changed the video from 64x64 to 
320x240
[video4linux2 @ 0x1402100] The V4L2 driver set input_id: 0, input: CVBS0
[video4linux2 @ 0x1402100] Setting time per frame to 1/60
[video4linux2 @ 0x1402100] ioctl set time per frame(1/60) failed
[video4linux2 @ 0x1402100] ioctl(VIDIOC_DQBUF): Input/output error
[video4linux2 @ 0x1402100] decoding for stream 0 failed
[video4linux2 @ 0x1402100] Estimating duration from bitrate, this may be 
inaccurate
ERROR: Unable to find stream info

I think theres a problem with setting the correct video setting (the framerate 
etc.)

Original comment by denishamann on 31 Aug 2012 at 10:38

GoogleCodeExporter commented 8 years ago
[video4linux2 @ 0x8c28d80] ioctl(VIDIOC_DQBUF): Invalid argument

I think that's the main problem.

Original comment by bob.loo...@gmail.com on 2 Sep 2012 at 11:23

GoogleCodeExporter commented 8 years ago
ok, i did some testings on the weekend.
I found the bug. Its the fixed framerate for the /dev/videoX device in 
videograbber.cpp on line 71: m_formatparams.time_base.den = 60;

The Hardcoded fps of 60 of course doesn't work with every device as some 
devices only have 50i or 25p (for example when using something in a PAL 
environment instead of NTSC).
As soon as i removed the corresponding 2 lines (70+71) the v4l driver 
automatically detected the framerate and worked flawless. So i coded new flag 
for manually setting the framerate and detecting if a framerate was set and 
then use the corresponding one. If no framerate was set it'll try to auto 
detect it, which is basically what vlc does.

Original comment by denishamann on 3 Sep 2012 at 9:36

Attachments:

GoogleCodeExporter commented 8 years ago
is there a way to include this into the main sourcecode?

Original comment by denishamann on 12 Nov 2012 at 7:46

GoogleCodeExporter commented 8 years ago
any update on this?

Original comment by denishamann on 8 Feb 2013 at 7:18

GoogleCodeExporter commented 8 years ago
thanks for your patch file, now my leds working good with usb grabber

Original comment by kayishigh on 15 Oct 2013 at 7:41