Bug 78199 - h264 libva capture corrupted results in rgb565 format
Summary: h264 libva capture corrupted results in rgb565 format
Status: VERIFIED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: weston (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Ander Conselvan de Oliveira
QA Contact: Wayland bug list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-02 16:16 UTC by U. Artie Eoff
Modified: 2014-05-16 19:35 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Screenshot of captured playback (1.37 MB, image/jpeg)
2014-05-02 16:18 UTC, U. Artie Eoff
Details

Description U. Artie Eoff 2014-05-02 16:16:05 UTC
The libva h264 capture feature in weston generates corrupt results when output is using rgb565 gbm-format (16bpp).  Format xrgb8888 (32bpp) works fine.

::Steps::

1. In weston.ini, set the gbm-format for the output to rgb565, for example:
 [output]
 name=HDMI1
 gbm-format=rgb565
2. Launch weston
3. Start h264 capture with: <mod>+<shift>+<space> q
4. Do stuff (i.e. launch apps, move windows, etc.)
5. Stop h264 capture with: <mod>+<shift>+<space> q
6. Playback capture.h264
 $ gst-play-1.0 capture.h264
 or
 $ gst-launch-1.0 filesrc location=capture.h264 \
   ! h264parse ! vaapidecode ! vaapisink
7. Transcode capture.h264 to capture.mp4
 $ gst-launch-1.0 filesrc location=capture.h264 \
   ! h264parse ! mp4mux ! filesink location=capture.mp4

Kernel: 3.13.6-200.fc20
Systemd: 212 (rawhide)
wayland (master) 1.4.92-0-g4a4523f
drm (master) libdrm-2.4.52-0-g46d451c
mesa (master) heads/master-0-gd55e5a3
libva (master) libva-1.2.1-0-g88ed1eb
intel-driver (master) 1.2.2-0-g121e70d
cairo (1.12) heads/1.12-0-g59e2a93
libinput (master) heads/master-0-g97af5c3
weston (master) 1.4.92-0-gd7d71e8
gstreamer (1.2) heads/1.2-0-gf8c6552
gst-plugins-base (1.2) heads/1.2-0-gcf5f7cf
gst-plugins-good (1.2) heads/1.2-0-g28d65fb
gst-plugins-bad (1.2) heads/1.2-0-g4f01875
gst-ffmpeg (1.2) 1.2.4-0-g72f6cb6
gstreamer-vaapi (master) tags/0.5.8-0-gc9af9a8
Comment 1 U. Artie Eoff 2014-05-02 16:18:21 UTC
Created attachment 98344 [details]
Screenshot of captured playback
Comment 2 Ander Conselvan de Oliveira 2014-05-05 13:48:14 UTC
The problem is that we don't appropriately set the format when initializing the VA pipeline, so it just assumes the buffer is in 24 bit depth. However, at the moment libva doesn't even define a RGB565 format. I'm looking into implementing support for this format in libva.
Comment 3 Ander Conselvan de Oliveira 2014-05-06 13:51:17 UTC
(In reply to comment #2)
> The problem is that we don't appropriately set the format when initializing
> the VA pipeline, so it just assumes the buffer is in 24 bit depth. However,
> at the moment libva doesn't even define a RGB565 format. I'm looking into
> implementing support for this format in libva.

This doesn't seem like a trivial task, so for the moment I sent a patch to the mailing list so that we don't attempt to record from an output with an unsupported format.
Comment 4 Kristian Høgsberg 2014-05-06 22:35:48 UTC
commit 2ef1cd177e73173d8cd25325ce691a09187134cb
Author: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Date:   Tue May 6 16:49:06 2014 +0300

    compositor-drm: Don't use vaapi recorder with unsupported formats
    
    We only support recording with GBM_FORMAT_XRGB888 format, so don't try
    to record if the output has a differnt format.
    
    https://bugs.freedesktop.org/show_bug.cgi?id=78199


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.