steven-varga / chromakey

live green screen solution with ffmpeg and v4l2 pseudo device
10 stars 3 forks source link

Inappropriate ioctl for device #2

Closed curtisklarsen closed 3 years ago

curtisklarsen commented 3 years ago

I get the following error when I run the script:

/dev/video0: Inappropriate ioctl for device

Any ideas?

steven-varga commented 3 years ago

Thanks for reporting. I just tried the script on my new laptop (linux mint 20 based on Ubuntu 20.04) and got the error below. Is it what you see on your screen? Less fortunate I can't fix it right away -- but I am looking into it, and try to identify/fix the problem.

steven@io:~$ chromakey -i Pictures/background.png -k 0xffffff 
[png_pipe @ 0x55eca6ce2a00] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, png_pipe, from 'Pictures/background.png':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: png, rgb24(pc), 5503x3669 [SAR 2835:2835 DAR 5503:3669], 25 tbr, 25 tbn, 25 tbc
Input #1, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 205744.485080, bitrate: N/A
    Stream #1:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Stream mapping:
  Stream #0:0 (png) -> overlay:main
  Stream #1:0 (mjpeg) -> colorkey
  overlay -> Stream #0:0 (rawvideo)
Press [q] to stop, [?] for help
[swscaler @ 0x55eca6fffa40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x55eca6fffa40] No accelerated colorspace conversion found from yuv422p to argb.
[video4linux2,v4l2 @ 0x55eca6cf5740] ioctl(VIDIOC_G_FMT): Invalid argument
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 -- 
[video4linux2,v4l2 @ 0x55eca6ce7dc0] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
Conversion failed!
steven-varga commented 3 years ago

probably picked up the wrong devices. I just updated the script, and added live screen grab with xgrab. make sure you list the devices with v4l2-ctl --list-devices then pass the correct names.