GNOME Bugzilla – Bug 646211
[camerabin] state changes need to be made when recording a video
Last modified: 2011-05-07 13:44:28 UTC
Cheese had a problem (bug #645975): after recording a video or taking a screenshot, the next video recording made was black-only. After fiddling around a while I came up with this patch: g_object_set (priv->camerabin, "mode", MODE_VIDEO, NULL); + gst_element_set_state (priv->camerabin, GST_STATE_READY); g_object_set (priv->camerabin, "filename", filename, NULL); g_signal_emit_by_name (priv->camerabin, "capture-start", 0); + gst_element_set_state (priv->camerabin, GST_STATE_PLAYING); priv->is_recording = TRUE; It's not very clear from the documentation why this hack is needed - or if another better one should be proposed. I have gstreamer0.10-plugins-bad 0.10.21-1ubuntu7 from Ubuntu 11.04. I tried installing gstreamer + plugins from git but I just managed to make all applications fail to render video at all and reverted to the packaged version.
I suspect this started when we changed oggmux to use running time instead of timestamps. I added some additional logging to oggmux and it seems to confirm it. These are the running times of the first buffers arriving at oggmux. First 0x991d1d8 0:00:00.000000000 Secnd 0x977aff8 0:00:06.168875715 First 0x991d1d8 0:00:00.013061224 Secnd 0x977aff8 0:00:06.168875715 First 0x991d1d8 0:00:00.036281179 Secnd 0x977aff8 0:00:06.168875715
Created attachment 187178 [details] Test case This test case should reproduce the problem
Promoting this one to a blocker, as it is a regression due to muxers being fixed and camerabin not. I'm working on it.
Created attachment 187293 [details] [review] camerabin: Use running time for muxing This patch removes the audio source buffer probe that was used to re-timestamp buffers to make them start from 0. As muxers have been fixed to use running time instead of timestamps, this is not needed anymore. Fixes bug #646211
Thanks for working on that. I just tested this patch in cheese removing the workaround we had applied. Cheese with Camerabin is working definitely better with this patch, but I can't tell for sure if the initial problem was fixed because I didn't see black only videos, but only change in performance (less glitches in the videos). Raluca, can you check if this solves the problem for you?
Pushed the fix to -bad 72574962ef836fbf9f0837783b45a4800e4c9fb5 Raluca, if it still fails for your case, please reopen.
Hi, I tested it again. I got the repository for cheese and build it (without my patch) I got the latest gstreamer ppa because the gstreamer-plugins-bad wouldn't build with the version from ubuntu 11.04 I tested it with and without my patch. It has the same behavior: The camera recording is blocked in a frame for some time and after that continues to record. It does that several times and after.
Thanks for trying the patch. Are you absolutely sure the plugin with the patch applied was actually used? (if you compile from source the plugin will be installed into /usr/local/lib/gstreamer-0.10/ by default where it will not be found by the system gstreamer)
I am not sure. Could you tell me what to do to be sure?
Maybe apply the patch and edit the same file and add a g_print ("here\n"); somewhere in the code :)
I tried with "GST_PLUGIN_PATH=/usr/local/lib/gstreamer-0.10/ cheese" and this made cheese use git-compiled plugins-bad. I don't see any problems with or without my patch applied.
> I tried with "GST_PLUGIN_PATH=/usr/local/lib/gstreamer-0.10/ cheese" and this > made cheese use git-compiled plugins-bad. I don't see any problems with or > without my patch applied. So, just to confirm: Thiago's patch fixes the problem you saw before, and your patch on top of it doesn't make a difference - correct?
Yes.