How to play a video in Raspberry Pi
I want to embed a video window in my qml applacation in Rasp pi. I find that mediaplayer qml type can easily make it. But now I'm getting into a trouble.
1.Mediaplayer need to be supported by gstreamer in linux. And if I want to play a .mp4 video, I have to install gst-ffmpeg. I use the following terminal code and install successfully in linux.
sudo add-apt-repository ppa:mc3man/gstffmpeg-keep
sudo apt-get update
sudo apt-get install gstreamer0.10-ffmpeg
BUT, when I try to use the same way to install gst-ffmpeg in Rasp pi, it can not find the gstreamer-ffmpeg. So, how can I install the gst-ffmpeg in Rasp pi?
- As is known, gstreamer0.10 is very old vision of gstreamer. What should I do if I want to use gstreamer1.0 or higher vision with Qt qml applacation on Rasp pi?
- Any other way to embed a video window in qml applacation in Rasp pi?
After trying hundreds of add-repository, I finally get my Raspberry installed with gstreamer0.10-ffmpeg. BUT, unfortunately, it still cant work.
It still shows "defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.mediaplayer"" But I do make sure that I already install gsreamer0.10 and all its plugins in Raspberry, include gstreamer0.10-ffmpeg, cause I get them installed by
sudo apt-get install gstreamer0.10-*.
I'm really confused how can I use qml multimedia in Raspberry. What should I do to solve this problem.
Not sure this will work for you becaue my raspberry pi is running on arch linux. I'm still new on Raspberry Pi and Qt. But mine application requires to play the video on the raspberry pi as well but it needs to display the webpage at the same time. So i had some investigation and i learned that Raspberry Pi the best way to stream video is using omxplayer. You might want to have a look on it.
hope it helps.
@liewjls Thanks a lot! I will have a try on omxplayer. Do you know how to use omxplayer with Qt? I only have the way on vlc.
I think I find out the reason. I checked plugin mediaservice, and I find that there is only one .so file, which supposed to be 4 files. That means when I install plugins, I miss some files. So I try to rebuild and install the mediaservice. But when I try to qmake the plugins, it shows
Checking for openal... no
Checking for alsa... no
Checking for pulseaudio... no
Checking for gstreamer... no
Checking for resourcepolicy... no
Checking for gpu_vivante... no
How can I make these "no" to "yes"? Should I install gstreamer* first in Raspberry mount file?
@ascnp You need to install dev packages for all those missing things (at least for what you really need):
Not sure about other things.
@jsulm Thanks! I'm trying to do that.
@jsulm Do you mean that I have to install the .img file on SD card and then install all of the necessary package and then make a .img file again and mount to my system, so that I can get my .so file? Do you have any easier method?
@ascnp If you have a card reader then you can simply mount the SD card in your PC after installing the stuff.
@jsulm Sounds good idea！Thank you