正确安装 gstreamer1.0-vaapi

正确安装 gstreamer1.0-vaapi

好的伙计们,这是我过去几周遇到的问题,我一直在尝试使用 vaapi。我有支持 vaapi 的英特尔 i5 处理器(Wayland),但由于某种奇怪的原因,我无法让它工作,而且我运行的是 14.10 64 位版本。

已安装软件包列表dpkg --get-selections | grep va

gstreamer1.0-vaapi:amd64            install
i965-va-driver:amd64                install
i965-va-driver-dbg:amd64            install
libva-dev:amd64                     install
libva-drm1:amd64                    install
libva-egl1:amd64                    install
libva-glx1:amd64                    install
libva-intel-vaapi-driver            install
libva-tpi1:amd64                    install
libva-wayland1:amd64                install
libva-x11-1:amd64                   install
libva1:amd64                        install
libvdpau-va-gl1:amd64               install
libgstreamer-vaapi1.0-0:amd64       install
libgstreamer-vaapi1.0-dev           install
libavahi-client3:amd64              install
libavahi-client3:i386               install
libavahi-common-data:amd64          install
libavahi-common-data:i386           install
libavahi-common3:amd64              install
libavahi-common3:i386               install
libavahi-core7:amd64                install
libavahi-glib1:amd64                install
libavahi-gobject0:amd64             install

vainfo 的输出:

libva info: VA-API version 0.36.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.36 (libva 1.4.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Desktop - 1.3.2
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD

使用 gstreamer 简单管道如下:

gst-launch-1.0 playbin video-sink=vaapisink uri=rtsp://ip_of_my_camera/

我得到这个作为输出:

New clock: GstSystemClock
Progress: (request) Sending PLAY request
Progress: (request) Sending PLAY request
Progress: (request) Sent PLAY request
Got context from element 'vaapidecode0': gst.vaapi.Display=context, display=(GstVaapiDisplay)NULL;
0:00:03.405005415 27214 0x7f2560023370 ERROR                  vaapi ../../../../gst-libs/gst/vaapi/gstvaapidecoder_h264.c:1351:ensure_context: unsupported profile_idc 66
0:00:03.405029986 27214 0x7f2560023370 ERROR            vaapidecode ../../../gst/vaapi/gstvaapidecode.c:284:gst_vaapidecode_decode_frame: decode error 9
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source/GstUDPSrc:udpsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2943): gst_base_src_loop (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source/GstUDPSrc:udpsrc0:
streaming task paused, reason not-supported (-6)
Execution ended after 0:00:02.567426400
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

此后我尝试播放简单的 mp4:

gst-launch-1.0 playbin video-sink=vaapisink uri=file:///home/user/test.mp4

我得到这个作为输出:

Setting pipeline to PAUSED ...
libva info: VA-API version 0.36.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
Pipeline is PREROLLING ...
Got context from element 'vaapidecode0': gst.vaapi.Display=context, display=(GstVaapiDisplay)NULL;
0:00:00.082428099 27226 0x7fb268008c00 ERROR                  vaapi ../../../../gst-libs/gst/vaapi/gstvaapidecoder_h264.c:1351:ensure_context: unsupported profile_idc 66
0:00:00.082457191 27226 0x7fb268008c00 ERROR            vaapidecode ../../../gst/vaapi/gstvaapidecode.c:284:gst_vaapidecode_decode_frame: decode error 9
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0: GStreamer encountered a general stream error.
Additional debug info:
qtdemux.c(4432): gst_qtdemux_loop (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0:
streaming stopped, reason not-supported
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

答案1

我通过选择正确的版本解决了这个问题gstreamer1.0-vaapi。您可以在以下位置获取文件https://www.freedesktop.org/software/vaapi/releases/gstreamer-vaapi/

下载并解压其中一个文件后,您可以通过运行以下命令进行安装:

./configure
make
make install

当版本不正确(仍然出现错误)时,请使用make uninstall 卸载并继续尝试下一个版本。

apt(您还必须完全卸载使用/安装的版本apt-get。)

相关内容