Arch Linux ofVideoGrabber only showing first frame, gstreamer error on exit

#1

Hi.

I am running the latest openframeworks (0.8.4) on Arch Linux with the latest gstreamer (1.4.3-1), but can’t use ofVideoGrabber. The videoGrabberExample compiles fine, and runs fine, but freezes a couple of frames in with no errors — regardless of whether it’s an internal of external webcam. On exit, however, I get this error:

GStreamer-CRITICAL **: gst_mini_object_unref: assertion 'mini_object->refcount > 0' failed

The camera, gstreamer and v4l works flawlessly in other applications.

Anyone has any tips on what causes this error and how I can fix it? I need it for an installation next week, so it’s quite urgent.

Issue with ofVideoGrabber in Ubuntu
ofVideoGrabber in Debian only shows first frame
#2

can you try with the the latest version from github or a nightly build? there’s several errors fixed in there in the gstreamer elements.

#3

Hi Arturo, and thank you for your swift reply.

I tried with the version from github, now I don’t get any error message, but the video nevertheless freezes (or rather doesn’t update). Here’s the ouput from my terminal:

└──> make run HOST_OS=Linux HOST_ARCH=x86_64 checking pkg-config libraries: cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gl glu glew gtk+-3.0 libmpg123 [notice ] ofGstVideoGrabber: Probing devices with udev... [notice ] ofGstVideoGrabber: Found device 05ac:8509, getting capabilities... [notice ] ofGstVideoGrabber: detected v4l2 device: FaceTime HD Camera (Built-in) [notice ] ofGstVideoGrabber: driver: uvcvideo, version: 200707 [notice ] ofGstVideoGrabber: Capabilities: 0x84000001 0: FaceTime HD Camera (Built-in) [notice ] ofGstVideoGrabber: initGrabber(): selected device: FaceTime HD Camera (Built-in) [notice ] ofGstVideoGrabber: initGrabber(): selected format: 320x240 video/x-raw RGB framerate: 2997/100 [notice ] ofGstUtils: setPipelineWithSink(): gstreamer pipeline: v4l2src name=video_source device=/dev/video0 ! video/x-raw,format=RGB,width=320,height=240,framerate=2997/100 ! appsink name=ofappsink caps="video/x-raw, format=RGB, width=320, height=240"

Only strange thing I see is the framerate, is it supposed to say “2997/100”? ofGetFramerate is happily reporting just under 60 as usual.

#4

can you try adding ofSetLogLevel(LOG_VERBOSE) at the beginning of setup and posting the output?

the framerate is normal, it’s the framerate of the camera not the application.

#5

└──> make run
HOST_OS=Linux
HOST_ARCH=x86_64
checking pkg-config libraries: cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal openssl libpulse-simple alsa gl glu glew gtk±3.0 libmpg123
[verbose] ofGstUtils: gstreamer inited
[notice ] ofGstVideoGrabber: Probing devices with udev…
[notice ] ofGstVideoGrabber: Found device 05ac:8509, getting capabilities…
[notice ] ofGstVideoGrabber: detected v4l2 device: FaceTime HD Camera (Built-in)
[notice ] ofGstVideoGrabber: driver: uvcvideo, version: 200707
[notice ] ofGstVideoGrabber: Capabilities: 0x84000001
[verbose] ofGstVideoGrabber: listDevices(): device 0: /dev/video0: FaceTime HD Camera (Built-in)
0: FaceTime HD Camera (Built-in)
[verbose] Device: FaceTime HD Camera (Built-in) (/dev/video0)

[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YUY21280x720 videoformat: 4 framerates:
[verbose] 10/1
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YUY2640x480 videoformat: 4 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YUY2352x288 videoformat: 4 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YUY2320x240 videoformat: 4 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YUY2176x144 videoformat: 4 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YUY2160x120 videoformat: 4 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): image/jpeg 1280x720 videoformat: 0 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): more similar framerate replacing existing format
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): image/jpeg 1024x576 videoformat: 0 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): image/jpeg 960x540 videoformat: 0 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw I4201280x720 videoformat: 2 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): non compressed format with same framerate, replacing existing format
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw I4201024x576 videoformat: 2 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): non compressed format with same framerate, replacing existing format
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw I420960x540 videoformat: 2 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): non compressed format with same framerate, replacing existing format
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw I420640x480 videoformat: 2 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw I420352x288 videoformat: 2 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw I420320x240 videoformat: 2 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw I420176x144 videoformat: 2 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw I420160x120 videoformat: 2 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YV121280x720 videoformat: 3 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YV121024x576 videoformat: 3 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YV12960x540 videoformat: 3 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YV12640x480 videoformat: 3 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YV12352x288 videoformat: 3 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YV12320x240 videoformat: 3 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YV12176x144 videoformat: 3 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw YV12160x120 videoformat: 3 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw BGR1280x720 videoformat: 16 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw BGR1024x576 videoformat: 16 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw BGR960x540 videoformat: 16 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw BGR640x480 videoformat: 16 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw BGR352x288 videoformat: 16 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw BGR320x240 videoformat: 16 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw BGR176x144 videoformat: 16 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw BGR160x120 videoformat: 16 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw RGB1280x720 videoformat: 15 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): I420 format with same framerate as other format, replacing existing format
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw RGB1024x576 videoformat: 15 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): I420 format with same framerate as other format, replacing existing format
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw RGB960x540 videoformat: 15 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): I420 format with same framerate as other format, replacing existing format
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw RGB640x480 videoformat: 15 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): YUY2 format with same framerate as other format, replacing existing format
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw RGB352x288 videoformat: 15 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): YUY2 format with same framerate as other format, replacing existing format
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw RGB320x240 videoformat: 15 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): YUY2 format with same framerate as other format, replacing existing format
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw RGB176x144 videoformat: 15 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): YUY2 format with same framerate as other format, replacing existing format
[verbose] ofGstVideoGrabber: add_video_format(): video/x-raw RGB160x120 videoformat: 15 framerates:
[verbose] 2997/100
[verbose] 25/1
[verbose] 24/1
[verbose] 15/1
[verbose] ofGstVideoGrabber: add_video_format(): already added, skipping
[verbose] ofGstVideoGrabber: add_video_format(): YUY2 format with same framerate as other format, replacing existing format
[notice ] ofGstVideoGrabber: initGrabber(): selected device: FaceTime HD Camera (Built-in)
[notice ] ofGstVideoGrabber: initGrabber(): selected format: 320x240 video/x-raw RGB framerate: 2997/100
[verbose] ofThread: - name: Thread 1 - Started Thread.
[notice ] ofGstUtils: setPipelineWithSink(): gstreamer pipeline: v4l2src name=video_source device=/dev/video0 ! video/x-raw,format=RGB,width=320,height=240,framerate=2997/100 ! appsink name=ofappsink caps=“video/x-raw, format=RGB, width=320, height=240”
[verbose] ofGstUtils: startPipeline(): attaching callbacks

#6

can you try a different resolution like 1280x720 for example? might be that the camera is reporting some supported combination of resolution and framerate when it doesn’t actually support it, perhaps try the same resolution that it’s working with other softwares

#7

I tried with a multitude of other resolutions, also one that is working in Cheese (the Gnome webcam application), but to no avail. I also tried the videGrabberExample on another Macbook (5,2, I believe) running Arch, but no difference. I guess I just have to install Debian on a machine to make the deadline, and then dvelwe into the videoGrabber-class in the source code when I have time later next week to see if I can make sense of anything (or are there any other place I should look? Maybe downgrade Gstreamer?). I will keep you updated.

Video signal (webcam ) freezes
#8

there might be some difference with gstreamer 1.4. i’ve only tested it on the raspberry with arch linux and as far as i remember everything was working fine there. i had to do a couple of changes for lazy initialization on videos but the camera was working fine i think.

#9

and yes probably downgrading gstreamer will solve it but installing debian or ubuntu would probably be the easiest

#10

switching kernel from 3.16 to 3.14 also solves the issue .