[Spice-devel] How to use vaapi to accelerate video coding?

Sea木木 linlin.q at foxmail.com
Tue Dec 24 09:13:11 UTC 2019


I want to hard-code the video by gstreamer-vaapi but failed. Here is my system environment and modify:
1. ubuntu 16.04 desktop


2. apt install gstreamer1.0-vaapi  libgstreamer1.0-dev gstreamer1.0-tools gstreamer1.0-plugins-base libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad  gstreamer1.0-libav


3.Modify server/reds.c   
    default_video_codecs[] = "gstreamer:h264;"    
  Modify server/gstreamer-encoder.c
    case SPICE_VIDEO_CODEC_TYPE_H264: return "vaapih264enc";
    case SPICE_VIDEO_CODEC_TYPE_H264: gstenc_opts = g_strdup("");


When I play the video, the /var/log/libvirt/qemu/win7.log output:
   gstreamer-encoder.c:831:handle_pipline_message: GStreamer error from element encoder: Could not initialize supporting library.
   gstreamer-encoder.c:1122:configure_pipline: Gstreamer error: unable to set the pipeline to the playing state.


when I set GST_DEBUG=2 , it will output videoencoder gstvideoencoder.c:1534:gst_video_encoder_change_state:<encoder> error: Failed to open encoder.


In addition,When I build spice and kvm in the same way as Ubuntu18.04
The log report "gstreamer-encoder.c:985:create_pipeline: GStreamer error: no element "vaapih264enc" "   ,  but I check "gst-inspect-1.0 , vaapih264enc", it exists.


What did I do wrong or what else do I need to set?
Looking forward to your reply.
Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20191224/2f50a2b7/attachment-0001.htm>


More information about the Spice-devel mailing list