我試圖運行qt示例應用程序之一沒有任何修改。它被稱爲player
,它是一個多媒體小部件演示。我的系統是Ubuntu 16.04 64bit。當我嘗試播放視頻,我在控制檯看到以下錯誤:沒有解碼器可用於類型'video/x-h264
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'."
我幾乎每包與安裝的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
所以看起來對我來說,一切都正確安裝。 Qt多媒體示例如何不起作用?
您使用QT的GStreamer這裏提到:https://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/? –
可能您的系統上安裝了多個gstreamer安裝程序?你的qt應用程序可能會鏈接到另一個。 – soupybionics
或者您在GST_PLUGIN_PATH中設置了錯誤路徑(在項目設置或.pro中將其設置在QtCreator env變量中)。check [this](https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html /gst-running.html) – nayana