2016-09-21 69 views
1

我試圖運行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多媒體示例如何不起作用?

+0

您使用QT的GStreamer這裏提到:https://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/? –

+0

可能您的系統上安裝了多個gstreamer安裝程序?你的qt應用程序可能會鏈接到另一個。 – soupybionics

+0

或者您在GST_PLUGIN_PATH中設置了錯誤路徑(在項目設置或.pro中將其設置在QtCreator env變量中)。check [this](https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html /gst-running.html) – nayana

回答

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) 

查找被參照的GStreamer線,例如:

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

如果在兩個命令結果中引用GStreamer的行不相同,則可能有多個GStre阿默爾裝置。然後嘗試通過第二個GStreamer ldd結果(由ldd echo $(which gst-inspect-1.0)給出)嘗試指定僅指向libgstreamer-1.0.so.0所在的目錄的新環境變量LD_LIBRARY_PATH環境變量(如果運行OS-X,則爲DYLD_LIBRARY_PATH)。

例如,運行:

export LD_LIBRARY_PATH="/usr/local/lib:/usr/lib" 
相關問題