Questions tagged [qmediaplayer]

The QMediaPlayer class is a part of the Qt framework. It allows playing of media sources.

The QMediaPlayer class is a high level media playback class. It can be used to playback such content as songs, movies and internet radio. The content to playback is specified as a QMediaContent object, which can be thought of as a main or canonical URL with additional information attached. When provided with a QMediaContent playback may be able to commence.

211 questions
12
votes
0 answers

DirectShowPlayerService::doRender: Unresolved error code 0x80040266 ()

Helllo I was trying to play music on qt where I'm going to click on a button "jouer" to play the music and that was my code : #include "jouer.h" #include "ui_jouer.h" Jouer::Jouer(QWidget *parent) : QDialog(parent), ui(new…
Louay GOURRIDA
  • 190
  • 1
  • 3
  • 14
12
votes
1 answer

play background music in a loop Qt

I want to play background music continually in a loop until the game ends. in the header file: QMediaPlayer * music = new QMediaPlayer(); in the cpp file: startGame(){ music->setMedia(QUrl("qrc:/sounds/backgroundmusic.mp3")); …
Life4ants
  • 683
  • 2
  • 8
  • 24
11
votes
1 answer

QMediaPlayer negative playbackRate doesn't rewind video

I am trying to use QMediaPlayer to create a.. media player. I want to have an ability to rewind videos on press of a button. But setting a negative playbackRate via QMediaPlayer.setPlaybackRate doesn't seem to put video on rewind. It just keeps…
Božo Stojković
  • 2,893
  • 1
  • 27
  • 52
9
votes
1 answer

Is there a way in Qt to force QMediaPlayer to buffer a file without playing it?

When you load a file into a QMediaPlayer instance, it does not automatically buffer the file. The MediaStatus remains NoMedia until you play the file using play(), only after which it will end up as BufferedMedia. I can't find any way in the…
Thomas
  • 392
  • 5
  • 14
8
votes
2 answers

How to Play Audio and remove file in QMediaPlayer?

I'm using qt5.0. I created dll and put all my audio files inside dll. now i am creating file from resource and playing. it's working fine. But the problem is after playing the file I'm not able to delete that file and recreate new file. if I try to…
Saravanan
  • 131
  • 2
  • 13
7
votes
1 answer

Using a resource file in QMediaPlayer

How do I load a .mp3 file to use in a QMediaPlayer from a .qrc resource file? This is what I have so far QMediaPlayer *player = new QMediaPlayer; player->setMedia(QUrl::fromLocalFile(":/audio/theme.mp3")); player->play(); resources.qrc:
Oskar Persson
  • 6,605
  • 15
  • 63
  • 124
5
votes
0 answers

How to get total number of frames in a video.mp4 using Qt Multimedia

Scenario I am using QMediaPlayer to a display a video on a VideoOutput. Works well. I do a MyQMediaPlayerPtr->setMedia(sample_video.mp4) & I have full control on that video playback. I am using QMediaPlayer's setPostion to seek a random frame from…
TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159
5
votes
2 answers

QT: get video dimensions in QVideoWidget

This should be something simple but I cannot figure this out. How can I get the video dimensions for a file that is loaded into QVideoWidget/QMediaPlayer. So, my code is as follows: QMediaPlayer m_MediaPLayer(0,…
Luca
  • 10,458
  • 24
  • 107
  • 234
5
votes
1 answer

Force QMediaPlayer to update position accurately for video scrubbing application?

I am writing an application which will allow the user to scrub through an open video. Developing on Windows 7/8 with Qt 5.3, I have been using QMediaPlayer and QVideoWidget following the qvideowidget example project. The result has been pretty good,…
Michael Cooper
  • 2,255
  • 2
  • 18
  • 21
5
votes
1 answer

Input video data from C++ to QML Video Player

I am looking for a best way to implement a video player application in QML. Almost all QML examples are reading files from filesystem or web: MediaPlayer { id: mediaplayer source: "groovy_video.mp4" } VideoOutput { anchors: parent.fill …
psyched
  • 1,859
  • 1
  • 21
  • 28
4
votes
1 answer

How to play a numpy array in Qt without saving it to a file?

QMediaPlayer can be used to play a music file i.e., *.wav, *.mp3, etc. But can I use it to play a wave recorded in an array? From the official documentation, I found QMediaPlayer::setMedia has a parameter stream. I guess this API can be used to play…
Scientific.RAT
  • 134
  • 1
  • 1
  • 9
4
votes
1 answer

How to play multiple clips of a video one after another

I have a video, from which I am getting some clips by time interval, and I want to do the following: Make the clips play one after another - so first clip plays, then after it is done, then second plays, and so on... But currently, it's good, but…
U13-Forward
  • 69,221
  • 14
  • 89
  • 114
4
votes
3 answers

How to save a frame using QMediaPlayer?

I want to save an image of a frame from a QMediaPlayer. After reading the documentation, I understood that I should use QVideoProbe. I am using the following code : QMediaPlayer *player = new QMediaPlayer(); QVideoProbe *probe = new…
user3627553
  • 61
  • 1
  • 6
4
votes
0 answers

Qt5 Multimedia Backends specifying

On Windows, I saw that there are at least two media services in the Qt's plugins: dsengine (DirectShow) and wmfengine (Media Foundation) for playing videos (https://wiki.qt.io/Qt_5.5.0_Multimedia_Backends). How can we know which media services…
aviit
  • 1,957
  • 1
  • 27
  • 50
4
votes
0 answers

Qt - Using QAudioProbe with QMediaPlayer

I am trying to use the QAudioProbe class with QMediaPlayer but I can't seem to get it working. As suggested here, I'm using it to create an audio visualizer. I had the following: QMediaPlayer* player = new QMediaPlayer; QAudioProbe* probe = new…
aanrv
  • 2,159
  • 5
  • 25
  • 37
1
2 3
14 15