02_gstreamer-vaapi--支持VA-API的GStreamer

1. 什么是 gstreamer-vaapi

VA-API support to GStreamer
* vaapi<_CODEC_>dec is used to decode JPEG, MPEG-2, MPEG-4:2, H.264, AVC, H.264 MVC, VP8, VP9, VC-1, WMV3, HEVC videos to VA surfaces,
depending on the actual value of <CODEC> and the underlying hardware capabilities. This plugin is also able to implicitly download the decoded surface to raw YUV buffers.

2. Features

3. Requirements

3.1. Hardware requirements

4. Usage

VA elements are automatically plugged into GStreamer pipelines. So using playbin should work as is.

However, here are a few alternate pipelines that could be manually constructed.

  $ gst-launch-1.0 -v filesrc location=/path/to/video.mp4 ! \
      qtdemux ! vaapidecodebin ! vaapisink fullscreen=true
  $ gst-launch-1.0 -v filesrc location=/path/to/mpeg2.bits ! \
      mpegvideoparse ! vaapimpeg2dec ! vaapipostproc ! vaapisink
$ gst-launch-1.0 -v filesrc location=/path/to/raw_video.yuv ! \
    videoparse format=yuy2 width=1280 height=720 ! \
    vaapipostproc format=nv12 height=480 ! vaapisink
$ gst-launch-1.0 -v filesrc location=/path/to/raw_video.yuv ! \
    videoparse format=i420 width=1920 height=1080 framerate=30/1 ! \
    vaapih264enc rate-control=cbr tune=high-compression ! \
    qtmux ! filesink location=/path/to/encoded_video.mp4

如果你觉得这篇文章对你有帮助,不妨请我喝杯咖啡,鼓励我创造更多!