Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么gstreamer与vaapih264enc一起展出;上下文键盘对等查询失败";?_Gstreamer_H.264_Vaapi - Fatal编程技术网

为什么gstreamer与vaapih264enc一起展出;上下文键盘对等查询失败";?

为什么gstreamer与vaapih264enc一起展出;上下文键盘对等查询失败";?,gstreamer,h.264,vaapi,Gstreamer,H.264,Vaapi,我想使用硬件编码来压缩原始视频文件,使用gstreamer和vaapi。我发现无法初始化支持库,这不允许编码器打开。可能的根本原因是上下文键盘对等查询失败。但我不确定。我使用以下管道: gst-launch-1.0 -v filesrc location=input.raw ! videoparse width=1280 height=1024 format=yuy2 framerate=20/1 ! vaapih264enc ! h264parse ! qtmux ! filesink loc

我想使用硬件编码来压缩原始视频文件,使用gstreamer和vaapi。我发现
无法初始化支持库
,这不允许编码器打开。可能的根本原因是
上下文键盘对等查询失败。但我不确定。我使用以下管道:

gst-launch-1.0 -v filesrc location=input.raw ! videoparse width=1280 height=1024 format=yuy2 framerate=20/1 ! vaapih264enc ! h264parse ! qtmux ! filesink location=compressed.mov
管道失败,消息为:

Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0: Could not initialize supporting library.
Additional debug info:
gstvideoencoder.c(1534): gst_video_encoder_change_state (): /GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0:
Failed to open encoder
Setting pipeline to NULL ...
Freeing pipeline ...
我做错了什么

使用
GST_DEBUG=3 GST-launch-1.0--GST DEBUG level=4
启动管道,我得到了以下结果:

INFO       GST_STATES gstbin.c:2316:gst_bin_element_set_state:<vaapiencodeh264-0> current NULL pending VOID_PENDING, desired next READY
INFO      GST_CONTEXT gstvaapivideocontext.c:106:context_pad_query:<vaapiencodeh264-0:src> context pad peer query failed
INFO      GST_CONTEXT gstvaapivideocontext.c:106:context_pad_query:<vaapiencodeh264-0:sink> context pad peer query failed
INFO      GST_CONTEXT gstvaapivideocontext.c:180:_gst_context_query:<vaapiencodeh264-0> posting `need-context' message
INFO            vaapi gstvaapidisplay.c:119:libgstvaapi_init_once: gstreamer-vaapi version
WARN     videoencoder gstvideoencoder.c:1534:gst_video_encoder_change_state:<vaapiencodeh264-0> error: Failed to open encoder
INFO GST_ERROR_SYSTEM gstelement.c:1879:gst_element_message_full:<vaapiencodeh264-0> posting message: Could not initialize supporting library.
INFO GST_ERROR_SYSTEM gstelement.c:1902:gst_element_message_full:<vaapiencodeh264-0> posted error message: Could not initialize supporting library.
INFO       GST_STATES gstelement.c:2657:gst_element_change_state:<vaapiencodeh264-0> have FAILURE change_state return
INFO       GST_STATES gstelement.c:2247:gst_element_abort_state:<vaapiencodeh264-0> aborting state from NULL to READY
INFO       GST_STATES gstbin.c:2780:gst_bin_change_state_func:<pipeline0> child 'vaapiencodeh264-0' failed to go to state 2(READY)
vaapi插件似乎也已正确安装:

gst-inspect-1.0 vaapih264enc
Factory Details:
  Rank                     primary (256)
  Long-name                VA-API H.264 encoder
  Klass                    Codec/Encoder/Video
  Description              A VA-API based H.264 video encoder
  Author                   Wind Yuan <feng.yuan@intel.com>

Plugin Details:
  Name                     vaapi
  Description              VA-API based elements
  Filename                 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so
  Version                  1.8.3
  License                  LGPL
  Source module            gstreamer-vaapi
  Source release date      2016-06-09
  Binary package           gstreamer-vaapi
  Origin URL               http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer
...
gst-inspect-1.0 vaapih264enc
工厂详情:
小学排名(256)
长名称VA-API H.264编码器
Klass编解码器/编码器/视频
描述一种基于VA-API的H.264视频编码器
作者风元
插件详细信息:
名称瓦皮
基于VA-API的元素描述
Filename/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so
版本1.8.3
许可证LGPL
源模块gstreamer vaapi
来源发布日期2016-06-09
二进制包gstreamervaapi
源URLhttp://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer
...

谢谢您的建议。

我认为不正确的用户配置/权限是编码器库无法初始化的原因。如果知道如何在我的系统中的某个地方找到一些日志消息来为我指明方向,那就太好了(这对我来说是个幸运的意外)

在更改了两件事之后,我使硬件编码工作正常:1)运行这些命令的用户没有正确的权限或配置。我还没有调查到底是什么。2) 使用正确的用户帐户后,我收到一条错误消息,建议我在
vaapih264enc
之前使用
vaapippostroc
来解析en不理解的色度类型


我使用的最后一个管道命令是:
sudo-u property\u user gst-launch-1.0 filesrc location=input.raw!视频解析宽度=1280高度=1024格式=yuy2帧速率=20/1!视频转换!瓦皮布洛克!万岁!qtmux!filesink location=hardware.compressed.mov

我认为不正确的用户配置/权限是编码器库无法初始化的原因。如果知道如何在我的系统中的某个地方找到一些日志消息来为我指明方向,那就太好了(这对我来说是个幸运的意外)

在更改了两件事之后,我使硬件编码工作正常:1)运行这些命令的用户没有正确的权限或配置。我还没有调查到底是什么。2) 使用正确的用户帐户后,我收到一条错误消息,建议我在
vaapih264enc
之前使用
vaapippostroc
来解析en不理解的色度类型


我使用的最后一个管道命令是:
sudo-u property\u user gst-launch-1.0 filesrc location=input.raw!视频解析宽度=1280高度=1024格式=yuy2帧速率=20/1!视频转换!瓦皮布洛克!万岁!qtmux!filesink location=hardware.compressed.mov

我认为不需要包含
h264parse
。将
vaapih264enc
直接连接到
qtmux
。我同意。我可以使用软件编码器而无需
h264parse
gst-launch-1.0-v filesrc location=input.row!rawvideoparse使用接收器上限=假宽度=1280高度=1024格式=yuy2帧速率=20/1!视频转换!x264enc!qtmux!filesink location=compressed.mov
当我使用hardware encoder.Ok时,它不会改变结果。我不确定是什么问题。通过使用不同的文件进行测试,看看问题是否出在特定的分辨率/帧速率/颜色格式上。感谢您的建议,我在处理您的建议时偶然发现了解决方案。我认为您不需要包含
h264parse
。将
vaapih264enc
直接连接到
qtmux
。我同意。我可以使用软件编码器而无需
h264parse
gst-launch-1.0-v filesrc location=input.row!rawvideoparse使用接收器上限=假宽度=1280高度=1024格式=yuy2帧速率=20/1!视频转换!x264enc!qtmux!filesink location=compressed.mov
当我使用hardware encoder.Ok时,它不会改变结果。我不确定是什么问题。通过使用不同的文件进行测试,看看问题是否与特定的分辨率/帧速率/颜色格式有关。感谢您的建议,我在处理您的建议时偶然发现了解决方案。
gst-inspect-1.0 vaapih264enc
Factory Details:
  Rank                     primary (256)
  Long-name                VA-API H.264 encoder
  Klass                    Codec/Encoder/Video
  Description              A VA-API based H.264 video encoder
  Author                   Wind Yuan <feng.yuan@intel.com>

Plugin Details:
  Name                     vaapi
  Description              VA-API based elements
  Filename                 /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so
  Version                  1.8.3
  License                  LGPL
  Source module            gstreamer-vaapi
  Source release date      2016-06-09
  Binary package           gstreamer-vaapi
  Origin URL               http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer
...