Sunday, May 5, 2024
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 3947  / 3 Years ago, thu, may 20, 2021, 2:09:33

I have qt 5.2(ubuntu sdk) installed on Ubuntu 14.04



When I try to run QML code:



MediaPlayer {
id: mediaPlayer
source: "../path/test.mp4"
autoPlay: true
}

VideoOutput {
id: video
width: screen.width
height: screen.height
source: mediaPlayer
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}


I get:
Error: "Your GStreamer installation is missing a plug-in."



Note:



1) I can play test.mp4 in Totem



2) I can play ogv files with above code



What am I missing?
Any help will be very appreciated.


More From » application-development

 Answers
5

Installing ubuntu-restricted-extras won't help you because the QML QtMultimedia component still uses the (old) gstreamer 0.10 plugins, check the Qt Multimedia (Qt 5) planning to see:




Port the GStreamer backend to GStreamer 1.0 (currently 0.10).




And since MP4 support in 0.10 is provided by the ffmpeg plugin you need to set up the following PPA to enable MP4 support for 14.04:



sudo apt-add-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install gstreamer0.10-ffmpeg


Note: you can play mp4 files in Totem because it uses the 1.0 gstreamer plugins.


[#24787] Thursday, May 20, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ardtry

Total Points: 254
Total Questions: 99
Total Answers: 114

Location: Finland
Member since Fri, Oct 21, 2022
2 Years ago
;