[desktop] Video recording is not working

Bug #1299073 reported by Ara Pulido on 2014-03-28
56
This bug affects 10 people
Affects Status Importance Assigned to Milestone
camera-app
Confirmed
Medium
Ugo Riboni
camera-app (Ubuntu)
Medium
Ugo Riboni
cheese (Ubuntu)
Undecided
Unassigned
guvcview (Ubuntu)
Undecided
Unassigned
qtmultimedia-opensource-src (Ubuntu)
Undecided
Unassigned

Bug Description

Video recording used to work fine on my trusty desktop, but now it freezes the application and video does not record.

Steps to reproduce:

1) Start camera-app in desktop mode ($ DESKTOP_MODE=1 camera-app)
2) Switch to video
3) Press the red button

Expected behaviour:

The app records video correctly

Actual behaviour:

The videocamera freezes (still image) and video is not recorded
The following error shows in the terminal:

libv4l2: error setting pixformat: Device or resource busy
CameraBin error: "Device '/dev/video0' is busy"
CameraBin error: "Could not negotiate format"

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: camera-app 2.9.1+14.04.20140307-0ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-18.38-generic 3.13.6
Uname: Linux 3.13.0-18-generic x86_64
ApportVersion: 2.13.3-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Fri Mar 28 16:32:32 2014
InstallationDate: Installed on 2013-06-17 (283 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
SourcePackage: camera-app
UpgradeStatus: Upgraded to trusty on 2014-01-20 (66 days ago)

Related branches

Ara Pulido (ara) wrote :
description: updated
Bill Filler (bfiller) on 2014-03-28
Changed in camera-app (Ubuntu):
importance: Undecided → Critical
assignee: nobody → Bill Filler (bfiller)
status: New → Triaged
Pat McGowan (pat-mcgowan) wrote :

This does not change if the ffmpeg codec is installed or not
I get the exact same symptoms as described

Bill Filler (bfiller) on 2014-04-22
Changed in camera-app (Ubuntu):
assignee: Bill Filler (bfiller) → Ugo Riboni (uriboni)
Bill Filler (bfiller) wrote :

It works as expected for me. Further investigation is needed to determine why it's failing. I see an .mkv file saved in ~/Videos

Bill Filler (bfiller) wrote :
Download full text (3.2 KiB)

This will require gstreamer0.10 installed. Here are the codecs I have on my system:
bfiller@ironhorse:~$ dpkg -l | grep gstreamer0.1
ii gstreamer0.10-alsa:amd64 0.10.36-1.1ubuntu2 amd64 GStreamer plugin for ALSA
ii gstreamer0.10-ffmpeg:amd64 0.10.13-5 amd64 FFmpeg plugin for GStreamer
ii gstreamer0.10-fluendo-mp3:amd64 0.10.23.debian-3 amd64 Fluendo mp3 decoder GStreamer 0.10 plugin
ii gstreamer0.10-gconf:amd64 0.10.31-3+nmu1ubuntu5 amd64 GStreamer plugin for getting the sink/source information from GConf
ii gstreamer0.10-gnonlin 0.10.17-2ubuntu1 amd64 non-linear editing module for GStreamer
ii gstreamer0.10-nice:amd64 0.1.4-1 amd64 ICE library (GStreamer 0.10 plugin)
ii gstreamer0.10-plugins-bad:amd64 0.10.23-7.2ubuntu1 amd64 GStreamer plugins from the "bad" set
ii gstreamer0.10-plugins-bad-multiverse 0.10.21-1ubuntu3 amd64 GStreamer plugins from the "bad" set (Multiverse Variant)
ii gstreamer0.10-plugins-base:amd64 0.10.36-1.1ubuntu2 amd64 GStreamer plugins from the "base" set
ii gstreamer0.10-plugins-base-apps 0.10.36-1.1ubuntu2 amd64 GStreamer helper programs from the "base" set
ii gstreamer0.10-plugins-good:amd64 0.10.31-3+nmu1ubuntu5 amd64 GStreamer plugins from the "good" set
rc gstreamer0.10-plugins-good:i386 0.10.31-3ubuntu1 i386 GStreamer plugins from the "good" set
ii gstreamer0.10-plugins-ugly:amd64 0.10.19-2ubuntu5 amd64 GStreamer plugins from the "ugly" set
ii gstreamer0.10-pulseaudio:amd64 0.10.31-3+nmu1ubuntu5 amd64 GStreamer plugin for PulseAudio
ii gstreamer0.10-tools 0.10.36-1.2ubuntu3 amd64 Tools for use with GStreamer
ii gstreamer0.10-x:amd64 0.10.36-1.1ubuntu2 amd64 GStreamer plugins for X11 and Pango
ii libgstreamer0.10-0:amd64 0.10.36-1.2ubuntu3 amd64 Core GStreamer libraries and elements
ii libgstreamer0.10-0:i386 0.10.36-1.2ubuntu3 i386 Core GStreamer libraries and elements
ii libgstreamer0.10-dev ...

Read more...

Ara Pulido (ara) wrote :

These are the ones that I have installed:

ii gstreamer0.10-alsa:amd64 0.10.36-1.1ubuntu2 amd64 GStreamer plugin for ALSA
ii gstreamer0.10-nice:amd64 0.1.4-1 amd64 ICE library (GStreamer 0.10 plugin)
ii gstreamer0.10-plugins-base:amd64 0.10.36-1.1ubuntu2 amd64 GStreamer plugins from the "base" set
ii gstreamer0.10-plugins-base-apps 0.10.36-1.1ubuntu2 amd64 GStreamer helper programs from the "base" set
ii gstreamer0.10-plugins-good:amd64 0.10.31-3+nmu1ubuntu5 amd64 GStreamer plugins from the "good" set
ii gstreamer0.10-pulseaudio:amd64 0.10.31-3+nmu1ubuntu5 amd64 GStreamer plugin for PulseAudio
ii gstreamer0.10-tools 0.10.36-1.2ubuntu3 amd64 Tools for use with GStreamer
ii gstreamer0.10-x:amd64 0.10.36-1.1ubuntu2 amd64 GStreamer plugins for X11 and Pango
ii libgstreamer0.10-0:amd64 0.10.36-1.2ubuntu3 amd64 Core GStreamer libraries and elements

Ara Pulido (ara) wrote :

Bill, what version of the camera-app are you running?

Jean-Baptiste Lallement (jibel) wrote :

I confirm the original report, same behavior and error message in the terminal.

$ apt-cache policy camera-app
camera-app:
  Installed: 2.9.1+14.04.20140331-0ubuntu2
  Candidate: 2.9.1+14.04.20140331-0ubuntu2

Gstreamer plugins:
gstreamer0.10-alsa:amd64 0.10.36-1.1ubuntu2
gstreamer0.10-ffmpeg:amd64 0.10.13-5ubuntu1~trusty2
gstreamer0.10-fluendo-mp3:amd64 0.10.23.debian-3
gstreamer0.10-nice:amd64 0.1.4-1
gstreamer0.10-plugins-bad:amd64 0.10.23-7.2ubuntu1
gstreamer0.10-plugins-base:amd64 0.10.36-1.1ubuntu2
gstreamer0.10-plugins-base-apps 0.10.36-1.1ubuntu2
gstreamer0.10-plugins-good:amd64 0.10.31-3+nmu1ubuntu5
gstreamer0.10-plugins-ugly:amd64 0.10.19-2ubuntu5
gstreamer0.10-pulseaudio:amd64 0.10.31-3+nmu1ubuntu5
gstreamer0.10-tools 0.10.36-1.2ubuntu3
gstreamer0.10-x:amd64 0.10.36-1.1ubuntu2

I tried ffmpeg from saucy and mc3man/trusty-media PPA to eliminate it from the the list of suspects and the issue is still there. Other plugins are from the official repository.

tags: added: qa-touch
Ugo Riboni (uriboni) on 2014-04-28
Changed in camera-app (Ubuntu):
status: Triaged → In Progress
Ugo Riboni (uriboni) wrote :

It works for me, an MKV video is recorded and saved in ~/Videos.
However I get an error message when stopping recording: CameraBin error: "Could not encode stream."
Upon playback the video has the last two or three seconds missing, however.

The error posted by the OP happens to me when running two instances of the app, since the video device gets locked. I suspect the OP has something else running that is using the camera exclusively.

Jean-Baptiste Lallement (jibel) wrote :

It doesn't work for me, camera-app is using /dev/video0 and there is only 1 instance of the app.
$ sudo fuser -v /dev/video0
[sudo] password for ubuntu:
                     USER PID ACCESS COMMAND
/dev/video0: ubuntu 2153 F.... camera-app
$ ps aux|grep came|grep -v grep
ubuntu 2153 29.4 1.9 1840568 74648 pts/0 Sl+ 15:53 0:35 camera-app
ubuntu@canonical-fx3dpy1:~$
[Exit camera-app]
ubuntu@canonical-fx3dpy1:~$ sudo fuser -v /dev/video0
ubuntu@canonical-fx3dpy1:~$

Ara Pulido (ara) wrote :

I am following this with Ugo on IRC, and the camera is not locked by any other application/service before running camera-app

Ugo Riboni (uriboni) wrote :

It seems that specifying explicitly what format to use (and making that format Ogg Theora for the time being) will solve the issue. Ara tested this proposed solution already and it's working ok in a small test application. I modified camera-app to use the same technique. The branch is attached to this bug.

Ugo Riboni (uriboni) on 2014-04-30
Changed in camera-app:
importance: Undecided → Critical
status: New → In Progress
assignee: nobody → Ugo Riboni (uriboni)
Bill Filler (bfiller) wrote :

The branch is not working for me (see comment there).

A good experiment is to run cheese and open the Preferences and look at video resolution. See if you can record a video in cheese at 640x480 or below. On Arthur's system his camera only seems to be able to support recording at 1280x720.

I think we need to force recording at a reasonable resoultion 640x480 or below and be able to lower the fps if needed. Not sure if all webcams support video recording at specified resolutions but ideally this should be dynamic in the code to query the camera and determine an appropriate resolution to record at and an approiate videoBitRate. These properties should then be set explicitly in the code. Currently we use the default settings for resolution and videoBitRate and I think this might be why some systems have problems and others don't.

We determined the error message ""Could not negotiate format" seems to occur when asking to record at a resolution that is not supported by the camera.

Pat McGowan (pat-mcgowan) wrote :

On laptop here with Intel graphics
Cheese records video at its highest resolution of 1280x1024, 25 fps in VP8 format
Setting any other resolution in preferences causing an error and connection to the camera is lost.
On a second older laptop, recording is at 800x600, and any higher or lower setting will cause an error.
The error is
(cheese:30245): cheese-WARNING **: Internal data flow error.: gstbasesrc.c(2865): gst_base_src_loop (): /GstCameraBin:camerabin/GstWrapperCameraBinSrc:camera_source/GstBin:bin17/GstV4l2Src:video_source:
streaming task paused, reason not-negotiated (-4)

Pat McGowan (pat-mcgowan) wrote :

the guvcview app which uses libav works fine in all resolutions.
wondering if there is a general issue in the gsrteamer stack, this is a regression in trusty
a number of similar bugs have been reported against cheese in 14.04

Pat McGowan (pat-mcgowan) wrote :

Testing on numerous desktop/laptop systems.
1 - the video is 0 bytes using the sample qml camera app
libv4l2: error setting pixformat: Device or resource busy
virtual bool QSGVideoItemSurface::present(const QVideoFrame&) I'm getting bad frames here...
CameraBin error: "Device '/dev/video0' is busy"
CameraBin error: "Could not negotiate format"

2 - specifying the default resolution size will work but most frames are dropped. Other resolution settings do not work at all.
(see attached test file)

The camera functioned properly prior to Feb, prior to move to qt5.2

Note that cheese is not working completely properly in Trusty, but does successfully record video using default resolution.

qt5 is still using gstreamer0.10

Pat McGowan (pat-mcgowan) wrote :
Pat McGowan (pat-mcgowan) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in qtmultimedia-opensource-src (Ubuntu):
status: New → Confirmed
Bill Filler (bfiller) wrote :

Ugo has determined that qtmultimedia is failing trying to get supported camera resolutions from gstreamer, which is part of the problem anyway. He's working on a fix for that, which would allow us to dynamically set the resolution to a supported resolution of 640x480 or below which we hope would partially fix the problem.

Other problem under investigation is not being able to set the frameRate property which we want to set. No fix has been identified for this yet.

He's patched qtmultimedia to attempt to correctly retrieve the resolutions. That is here:
~amanzi-team/+junk/qtmultimedia-opensource-src-caps-query/ and the package has been uploaded to ppa:amanzi-team/ppa.
This is not a complete fix but wip

Narcis Garcia (narcisgarcia) wrote :

Ubuntu-Gnome 14.04 (Trusty)
I've tested camera-app and works; but not cheese.

$ lsusb
Bus 002 Device 008: ID 8564:1000
Bus 002 Device 003: ID 046d:08b2 Logitech, Inc. QuickCam Pro 4000
Bus 002 Device 004: ID 0930:6545 Toshiba Corp. Kingston DataTraveler 102 Flash Drive / HEMA Flash Drive 2 GB / PNY Attache 4GB Stick
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 046d:c050 Logitech, Inc. RX 250 Optical Mouse
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

$ cheese
(cheese:718): cheese-WARNING **: S'ha produït un error intern de flux de dades.: gstbasesrc.c(2865): gst_base_src_loop (): /GstCameraBin:camerabin/GstWrapperCameraBinSrc:camera_source/GstBin:bin17/GstV4l2Src:video_source:
streaming task paused, reason not-negotiated (-4)

Changed in camera-app:
importance: Critical → High
Jim Hodapp (jhodapp) wrote :

Ugo, what's the latest status of this bug? Didn't you fix this already?

Changed in camera-app:
milestone: none → rtm-freeze
milestone: rtm-freeze → none
Alan Lord (theopensourcerer) wrote :

Any fix or alternative? Cheese didn't work at all and this camera-app is fine until I press the red button then get the same error as above.

libv4l2: error setting pixformat: Device or resource busy
virtual bool QSGVideoItemSurface::present(const QVideoFrame&) I'm getting bad frames here...
CameraBin error: "Device '/dev/video0' is busy"
CameraBin error: "Could not negotiate format"

Alan Lord (theopensourcerer) wrote :

Tried guvcview and that works fine at any resolution.

Bill Filler (bfiller) on 2014-08-28
Changed in camera-app (Ubuntu):
importance: Critical → Medium
Changed in camera-app:
importance: High → Medium
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cheese (Ubuntu):
status: New → Confirmed
Changed in guvcview (Ubuntu):
status: New → Confirmed
tuxmartin (tuxmartin) wrote :
Download full text (10.1 KiB)

I have the same problem:

martin@pc:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
martin@pc:~$ uname -a
Linux pc 3.13.0-45-generic #74-Ubuntu SMP Tue Jan 13 19:36:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
martin@pc:~$ lsusb | grep Cam
Bus 003 Device 011: ID 045e:0779 Microsoft Corp. LifeCam HD-3000
martin@pc:~$ cheese

** (cheese:4661): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-cLJXkkP1Fj: Spojení odmítnuto
libv4l2: error turning on stream: Nepřípustný argument

(cheese:4661): cheese-WARNING **: Interní chyba toku dat.: gstbasesrc.c(2865): gst_base_src_loop (): /GstCameraBin:camerabin/GstWrapperCameraBinSrc:camera_source/GstBin:bin17/GstV4l2Src:video_source:
streaming task paused, reason not-negotiated (-4)

martin@pc:~$ guvcview
guvcview 1.7.1
file guvcview_video.mkv has extension type 1
file guvcview_image.jpg has extension type 0

** (guvcview:4675): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-cLJXkkP1Fj: Spojení odmítnuto
file guvcview_image.jpg has extension type 0
Video file suffix detected: 0
Image file suffix detected: 0
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
bt_audio_service_open: connect() failed: Spojení odmítnuto (111)
bt_audio_service_open: connect() failed: Spojení odmítnuto (111)
bt_audio_service_open: connect() failed: Spojení odmítnuto (111)
bt_audio_service_open: connect() failed: Spojení odmítnuto (111)
Cannot connect to server socket err = Adresář nebo soubor neexistuje
Cannot connect to server request channel
jack server is not running or cannot be started
video device: /dev/video0
Init. Microsoft® LifeCam HD-3000 (location: usb-0000:00:14.0-11)
{ pixelformat = 'YUYV', description = 'YUV 4:2:2 (YUYV)' }
{ discrete: width = 640, height = 480 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 2/15,
{ discrete: width = 1280, height = 720 }
 Time interval between frame: 1/10, 2/15,
{ discrete: width = 960, height = 544 }
 Time interval between frame: 1/15, 1/10, 2/15,
{ discrete: width = 800, height = 448 }
 Time interval between frame: 1/20, 1/15, 1/10, 2/15,
{ discrete: width = 640, height = 360 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 2/15,
{ discrete: width = 424, height = 240 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 2/15,
{ discrete: width = 352, height = 288 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 2/15,
{ discrete: width = 320, height = 240 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 2/15,
{ discrete: width = 800, height = 600 }
 Time interval between frame: 1/15, 1/10, 2/15,
{ discrete: width = 176, height = 144 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 2/15,
{ discrete: width = 160, height = 120 }
 Time interval between frame: 1/30, 1/20, 1/15, 1/10, 2/15,
{ discrete: width = 1280, height = 800 }
 Time interval between frame: 1/10,
{ pixelformat = 'MJPG', description = 'MJ...

Changed in camera-app:
status: In Progress → Confirmed
Changed in camera-app (Ubuntu):
status: In Progress → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers