After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 542014 - sluggish video and out-of-sync audio
sluggish video and out-of-sync audio
Status: RESOLVED FIXED
Product: cheese
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Cheese Maintainer(s)
Cheese Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2008-07-08 08:30 UTC by Filippo Argiolas
Modified: 2008-07-28 09:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Filippo Argiolas 2008-07-08 08:30:01 UTC
Cheese video recording has still a lot to be improved.
When recording at maximum resolution (1280x1024@9fps here) the video output is really slow, with really low framerate (less than the displayed one), and the audio output is a couple of seconds out of sync.
The issue still stands when recording at lower resolutions at high framerates (like 640x480@30fps).
Sometimes, instead, video is faster than expected and audio still out-of-sync.
Note that I've got two cores at 1,67 GHz both with performance governor set.
I think this happens because the vorbis/theoraenc cannot manage to do the encoding in realtime with so high resolution or framerates.
A possible solution would be to not use resolutions higher than 640x480 when recording video and slow down framerate to 20/2 or 9/1 in the recorded video.
This can be achieved with the videorate element and can be done just in the recorded stream while still displaying the full framerate video source.
Here's an example pipeline that creates a good video with in-sync audio on my laptop:

gst-launch-0.10 oggmux name=mux ! filesink location=test.ogg v4l2src ! video/x-raw-yuv, width=640, height=480, framerate=\(fraction\)30/1 ! ffmpegcolorspace ! tee ! queue ! ffmpegcolorspace ! xvimagesink qos=false sync=false tee0. ! videorate ! video/x-raw-yuv,framerate=9/1 ! theoraenc quality=30 ! queue ! mux. alsasrc  ! queue ! audioconvert ! vorbisenc !  mux.

Another solution would be to record raw data and schedule encoding on idle, but I didn't investigate too much on its feasibility.
Ideas welcome!
Comment 1 André Klapper 2008-07-16 13:07:22 UTC
Get real, this is not a blocker bug AT ALL.
Comment 2 Filippo Argiolas 2008-07-16 13:31:40 UTC
I think Daniel marked it as blocker just to gain some quick attention over it
Comment 3 André Klapper 2008-07-16 14:18:16 UTC
eeks. damn, i should take a look at the bug activity first. sigh. sorry.
Comment 4 Filippo Argiolas 2008-07-18 09:17:32 UTC
;) no problem!
Comment 5 Filippo Argiolas 2008-07-28 08:19:51 UTC
I found that fixing this was simpler than I thought. We just needed to put a videorate element in the video_save_bin; quoting from videorate docs:
>This operation is useful to link to elements that require a perfect stream. >Typical examples are formats that do not store timestamps for video frames, but only store a framerate, like Ogg and AVI.
So a videorate element should be always needed because we're encoding to ogg.

I'm not quite sure to close this bug because video has still something to be improved, I think we should let the user chose video resolution, framerate and audio/video quality at least through gconf properties but I could file a new enhancement bug about this.
Comment 6 Filippo Argiolas 2008-07-28 09:01:08 UTC
Closing it. The out-of-sync bug is fixed in svn trunk.
Reopen if you wish to continue the Video Recording improvement discussion within this bug.