I am trying to run one of qt sample apps without any modification. It is called player
and it is a multimedia widget demonstration. My system is Ubuntu 16.04 64bit. When I try to play a video, I see the following error in the console:
我正在尝试运行一个qt示例应用程序,没有任何修改。它被称为播放器,它是一个多媒体小部件演示。我的系统是Ubuntu 16.04 64位。当我尝试播放视频时,我在控制台看到以下错误:
No decoder available for type 'video/x-h264
类型'video/x-h264没有解码器
Here is the full error after trying two different videos:
这是在尝试了两个不同的视频后的完全错误:
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'."
I have pretty much every package remotely related to gstreamer installed. When I run gst-inspect-1.0
I get a lot of output and the last line is:
我已经安装了几乎所有与gstreamer相关的远程软件包。当我运行gst- inspection -1.0时,我得到了很多输出,最后一行是:
Total count: 241 plugins (1 blacklist entry not shown), 1388 features
总数:241个插件(1个黑名单条目未显示),1388个特性
~$ 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
So it looks like to me that everything is installed properly. How come the Qt multimedia example does not work out of the box?
在我看来,一切都安装得很好。为什么Qt多媒体的例子不能用在盒子里?
1 个解决方案
#1
1
In you command line interface, run:
在你的命令行界面中,运行:
ldd /home/aras/Qt5.7.0_Sept2016/Examples/Qt-5.7/multimediawidgets/build-player-Sept2016-Debug/player
ldd echo $(which gst-inspect-1.0)
Look for lines that are referring to GStreamer, for example:
寻找那些指向GStreamer的行,例如:
libgstreamer-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
libgstreamer-1.0.so。0 = > /usr/lib/x86_64-linux-gnu / libgstreamer-1.0.so.0
If the lines referring to GStreamer are not the same on both command results, you might have multiple GStreamer installations. Then try to specify a new LD_LIBRARY_PATH
environment variable (DYLD_LIBRARY_PATH
if you run OS-X) that only point to the directory where libgstreamer-1.0.so.0
is located thanks to the second GStreamer ldd
result (gave by ldd echo $(which gst-inspect-1.0)
).
如果在两个命令结果中引用GStreamer的行不相同,则可能有多个GStreamer安装。然后尝试指定一个新的LD_LIBRARY_PATH环境变量(如果运行OS-X,则是DYLD_LIBRARY_PATH),该变量只指向libgstreamer-1.0.so所在的目录。0的位置要感谢第二个GStreamer ldd结果(由ldd echo $(gst- inspection -1.0)提供)。
For example, run:
例如,运行:
export LD_LIBRARY_PATH="/usr/local/lib:/usr/lib"
#1
1
In you command line interface, run:
在你的命令行界面中,运行:
ldd /home/aras/Qt5.7.0_Sept2016/Examples/Qt-5.7/multimediawidgets/build-player-Sept2016-Debug/player
ldd echo $(which gst-inspect-1.0)
Look for lines that are referring to GStreamer, for example:
寻找那些指向GStreamer的行,例如:
libgstreamer-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libgstreamer-1.0.so.0
libgstreamer-1.0.so。0 = > /usr/lib/x86_64-linux-gnu / libgstreamer-1.0.so.0
If the lines referring to GStreamer are not the same on both command results, you might have multiple GStreamer installations. Then try to specify a new LD_LIBRARY_PATH
environment variable (DYLD_LIBRARY_PATH
if you run OS-X) that only point to the directory where libgstreamer-1.0.so.0
is located thanks to the second GStreamer ldd
result (gave by ldd echo $(which gst-inspect-1.0)
).
如果在两个命令结果中引用GStreamer的行不相同,则可能有多个GStreamer安装。然后尝试指定一个新的LD_LIBRARY_PATH环境变量(如果运行OS-X,则是DYLD_LIBRARY_PATH),该变量只指向libgstreamer-1.0.so所在的目录。0的位置要感谢第二个GStreamer ldd结果(由ldd echo $(gst- inspection -1.0)提供)。
For example, run:
例如,运行:
export LD_LIBRARY_PATH="/usr/local/lib:/usr/lib"