openframeworks / openframeworks/openFrameworks

ofVideoGrabber on RaspberryPi: Gstreamer trouble. No video capture.

Open
#2,967 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug core linuxarm section-video
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

The videoGrabberExample and any other ofVideoGrabber in connection with a USB Webcam is non-functional. It shows only a black or white camera image if the Video is >160x120px.

With any other Webcam software the camera is working fine, even at Full HD.

As it seems to me, it uses a gstreamer pipe? Is this maybe the problem?

[notice ] ofGstUtils: setPipelineWithSink(): gstreamer pipeline: v4l2src name=video_source device=/dev/video0 ! video/x-raw,format=RGB,width=160,height=120,framerate=30/1 ! appsink name=ofappsink caps="video/x-raw, format=RGB, width=160, height=120" <-- works

but with anything above 160x120px, it doesnt.

I tried with "examples/video/videoGrabberExample" and my own code.

More debug info:

[notice ] ofAppEGLWindow: setupRPiNativeWindow(): screenRect: 1680x1050
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): windowRect: 1024x768
[notice ] ofAppEGLWindow: createSurface(): setting up EGL Display
[notice ] ofAppEGLWindow: createSurface(): EGL Display correctly set
[notice ] ofAppEGLWindow: createSurface(): current renderer type: GL
[notice ] ofAppEGLWindow: createSurface(): default renderer detected
[notice ] ofAppEGLWindow: createSurface(): surface created correctly
[notice ] ofAppEGLWindow: createSurface(): API bound correctly
[notice ] ofAppEGLWindow: createSurface(): -----EGL-----
[notice ] ofAppEGLWindow: createSurface(): EGL_VERSION_MAJOR = 1
[notice ] ofAppEGLWindow: createSurface(): EGL_VERSION_MINOR = 4
[notice ] ofAppEGLWindow: createSurface(): EGL_CLIENT_APIS = OpenGL_ES OpenVG
[notice ] ofAppEGLWindow: createSurface(): EGL_VENDOR = Broadcom
[notice ] ofAppEGLWindow: createSurface(): EGL_VERSION = 1.4
[notice ] ofAppEGLWindow: createSurface(): EGL_EXTENSIONS = EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_vg_parent_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_lock_surface 
[notice ] ofAppEGLWindow: createSurface(): GL_RENDERER = VideoCore IV HW
[notice ] ofAppEGLWindow: createSurface(): GL_VERSION  = OpenGL ES-CM 1.1
[notice ] ofAppEGLWindow: createSurface(): GL_VENDOR   = Broadcom
[notice ] ofAppEGLWindow: createSurface(): -------------
[notice ] ofAppEGLWindow: setupPeripherals(): peripheral setup complete
[notice ] ofAppEGLWindow: setupNativeUDev(): created udev object
[notice ] ofAppEGLWindow: setupMouse(): unabled to find mouse
[ error ] ofAppEGLWindow: setupMouse(): did not open mouse
[ error ] ofAppEGLWindow: setupMouse(): did not open mouse, mouse_fd < 0
[warning] ofAppEGLWindow: setupKeyboard(): unabled to find keyboard
[ error ] ofAppEGLWindow: setupKeyboard(): did not open keyboard
[ error ] ofAppEGLWindow: setupKeyboard(): did not open keyboard, keyboard_fd < 0
[notice ] ofAppEGLWindow: setupPeripherals(): native event setup complete
[notice ] ofAppEGLWindow: setupOpenGL(): peripheral setup complete
[notice ] ofAppEGLWindow: runAppViaInfiniteLoop(): entering infinite loop
[notice ] probing devices with udev...
[notice ] found device 046d:0821, getting capabilities...
[notice ] detected v4l2 device: UVC Camera (046d:0821)
[notice ] driver: uvcvideo, version: 199205
[notice ] capabilities: 0x84000001
[notice ] found device 046d:0821, getting capabilities...
[notice ] detected v4l2 device: UVC Camera (046d:0821)
[notice ] driver: uvcvideo, version: 199205
[notice ] capabilities: 0x84000001
0: UVC Camera (046d:0821)
1: UVC Camera (046d:0821)
[notice ] ofGstVideoGrabber: initGrabber(): selected device: UVC Camera (046d:0821)
[notice ] ofGstVideoGrabber: initGrabber(): selected format: 640x480 video/x-raw RGB framerate: 24/1
[notice ] ofGstUtils: setPipelineWithSink(): gstreamer pipeline: v4l2src name=video_source device=/dev/video0 ! video/x-raw,format=RGB,width=640,height=480,framerate=24/1    ! appsink name=ofappsink caps="video/x-raw, format=RGB, width=640, height=480"
[notice ] ofAppEGLWindow: runAppViaInfiniteLoop(): setting up notifications complete
^C[notice ] ofAppEGLWindow: destroyNativeKeyboard()
[notice ] ofAppEGLWindow: destroyNativeKeyboard(): unable to reset terminal
[notice ] ofAppEGLWindow: destroySurface(): destroying EGL surface
libv4l2: warning v4l2 mmap buffers still mapped on close()

(videoGrabberExample:8355): GStreamer-CRITICAL **: gst_mini_object_unref: assertion `mini_object->refcount > 0' failed

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with examples/video/videoGrabberExample on the Raspberry Pi and USB webcam, then inspect the pipeline logged by ofGstUtils for 160x120 versus 640x480 capture. Reproduce the black or white image at a resolution above 160x120 and verify that video capture works at the selected 640x480 format.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, raspberry-pi
Domain
audio-video-rtc, embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.