没有可用于类型“video/x-h264”的解码器

Ara*_*ras 8 video gstreamer h.264 qt5 qtmultimedia

我正在尝试在不进行任何修改的情况下运行 qt 示例应用程序之一。它被称为player,它是一个多媒体小部件演示。我的系统是 Ubuntu 16.04 64 位。当我尝试播放视频时,我在控制台中看到以下错误:

No decoder available for type 'video/x-h264

这是尝试两个不同视频后的完整错误:

Starting /home/aras/Qt5.7.0_Sept2016/Examples/Qt-5.7/multimediawidgets/build-player-Sept2016-Debug/player...
Warning: "No decoder available for type 'video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)3, profile=(string)constrained-baseline, codec_data=(buffer)0142e01eff0100192742e01ea9101405ff2e00d418041adb7a00f480f55ef7c04001000428de09c8, width=(int)640, height=(int)360, framerate=(fraction)2997/125, pixel-aspect-ratio=(fraction)1/1'."
Warning: "No decoder available for type 'video/x-h264, stream-format=(string)avc, alignment=(string)au, level=(string)3, profile=(string)constrained-baseline, codec_data=(buffer)0142e01eff0100192742e01ea9101405ff2e00d418041adb7a00f480f55ef7c04001000428de09c8, width=(int)640, height=(int)360, framerate=(fraction)2997/125, pixel-aspect-ratio=(fraction)1/1'."
Warning: "No decoder available for type 'video/x-h264, stream-format=(string)avc, pixel-aspect-ratio=(fraction)1/1, width=(int)1280, height=(int)720, framerate=(fraction)601600/10033'."
Run Code Online (Sandbox Code Playgroud)

我几乎安装了与 gstreamer 远程相关的所有软件包。当我运行时,gst-inspect-1.0我得到了很多输出,最后一行是:

Total count: 241 plugins (1 blacklist entry not shown), 1388 features

~$ gst-inspect-1.0 |grep x-h264
typefindfunctions: video/x-h264: h264, x264, 264

:~$ gst-inspect-1.0 avdec_h264
Factory Details:
  Rank                     primary (256)
  Long-name                libav H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 decoder
  Klass                    Codec/Decoder/Video
  Description              libav h264 decoder
Run Code Online (Sandbox Code Playgroud)

所以在我看来一切都安装正确。为什么 Qt 多媒体示例无法开箱即用?

Man*_*ger 8

我通过在我的构建系统上安装GStreamer 多媒体框架 ffmpeg插件来修复它:

sudo pacman -S gst-libav
Run Code Online (Sandbox Code Playgroud)

Debian :

sudo apt install gstreamer1.0-libav ubuntu-restricted-extras
Run Code Online (Sandbox Code Playgroud)


Ahr*_*sse 1

在命令行界面中,运行:

ldd /home/aras/Qt5.7.0_Sept2016/Examples/Qt-5.7/multimediawidgets/build-player-Sept2016-Debug/player
ldd echo $(which gst-inspect-1.0)
Run Code Online (Sandbox Code Playgroud)

查找引用 GStreamer 的行,例如:

libgstreamer-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0

如果两个命令结果中引用 GStreamer 的行不相同,则您可能安装了多个 GStreamer。然后尝试指定一个新的LD_LIBRARY_PATH环境变量(如果您运行 OS-X),该变量仅指向第二个 GStreamer结果(由 给出)所在的DYLD_LIBRARY_PATH目录。libgstreamer-1.0.so.0lddldd echo $(which gst-inspect-1.0)

例如,运行:

export LD_LIBRARY_PATH="/usr/local/lib:/usr/lib"
Run Code Online (Sandbox Code Playgroud)