Skip to content
  • QMediaplayer performance

    Unsolved General and Desktop
    1
    0 Votes
    1 Posts
    56 Views
    No one has replied
  • 0 Votes
    9 Posts
    250 Views
    F

    The problem could be due to directx 12 and some drivers. Maybe a bug.
    I saw that VLC also has a similar problem, but it is solved by changing the hardware encoding from automatic to directx 11.
    It is likely and explains why 5, the integrated player of ffmpeg and other players work perfectly, with excellent performance with any video.
    Is there a way to force the use of directx 11 in mediaplayer via code or something else?
    How can you use the vlc library in a Qt project?

  • 0 Votes
    2 Posts
    224 Views
    SGaistS

    Hi and welcome to devnet,

    Which version of Qt are you using ?

    To the best of my knowledge, there's no option for reverse play.

    As for the resource issue, the native backends cannot access the files within the resources. You have to copy the file in a temporary location and play it from there.

  • 0 Votes
    3 Posts
    212 Views
    S

    @SGaist Hi,
    I am using Qt version 6.5.0,
    on Windows,
    and to open fullscreen I am using the following code:

    void VideoWidget::mouseDoubleClickEvent(QMouseEvent *event) { setFullScreen(!isFullScreen()); event->accept(); }

    VideoWidget is just a derived class from QVideoWidget

  • 0 Votes
    3 Posts
    239 Views
    SGaistS

    Hi,

    To add to @KH-219Design, since 6.5, the default backend has been set to ffmpeg.

  • 0 Votes
    5 Posts
    497 Views
    S

    @mzimmers Yes, I am sure that the url is pointing to the correct source. In fact what seems strange is that the first time I call setPosition it works, but any other time, regardless of the url being identical or changed to point to a different file, it ends up being in the StalledMedia state.

  • 0 Votes
    5 Posts
    540 Views
    C

    这是Qt6.5的一个Bug.
    在官方Bug列表中以QMediaPlayer为关键字查询到Bug(QTBUG-112707).
    Fix playing of video files with Chinese names
    https://github.com/qt/qtmultimedia/commit/f1b07b9ac
    问题出现在 <Qt>\6.5.0\Src\qtmultimedia\src\plugins\multimedia\ffmpeg\playbackengine\qffmpegmediadataholder.cpp

  • 0 Votes
    1 Posts
    241 Views
    No one has replied
  • 0 Votes
    4 Posts
    417 Views
    S

    @Christian-Ehrlicher
    in the same strange way, i have an void :

    void QtVsPlayer::FullScr() { if (QtVsPlayer::isFullScreen()) { QtVsPlayer::showNormal(); this->ui->menubar->setVisible(true); if (!Zoomed) this->ui->statusbar->setVisible(true); } else { QtVsPlayer::showFullScreen(); this->ui->menubar->setVisible(false); this->ui->statusbar->setVisible(false); } return; }

    this void work, i have fullscreen video.
    now in mousemove event i have

    if (!this->ui->actionMasquer_les_controles->isChecked() and WVideoCtrls->isHidden() and this->ui->actionAuto_hide_controls->isChecked()) { if(!Zoomed and QtVsPlayer::isFullScreen() == false) ui->statusbar->setVisible(true); WVideoCtrls->show(); WVideoCtrls->activateWindow(); WVideoCtrls->raise(); this->centralWidget()->lower(); this->centralWidget()->stackUnder(WVideoCtrls); } if (QtVsPlayer::cursor() == Qt::BlankCursor) { QtVsPlayer::unsetCursor(); } return;

    the goal is to display videocontrols, like play, pause and so on, but not the status bar in full screen, but it is shown, zoomed is false but isfullscreen is no such value

  • 0 Votes
    2 Posts
    480 Views
    Q

    I have the same issue. It's soo slow with rtsp and buggy.

  • 0 Votes
    9 Posts
    1k Views
    C

    Ok, I found a solution to my problem. This is the PlaySound method from my SoundEffect class. The area of interest is the code below the note.

    void SoundEffect::PlaySound() { mPlayer.setSource(soundUrl); // Note about QMediaPlayer::Loops // Using QMediaPlayer::Loops::Infinite does not work correctly on Linux and Windows. // It either plays once and then stops or plays multiple times, but stops unexpectedly. // Therefore, use QMediaPlayer::Loops::Once and connect to the playbackStateChanged signal. // The slot will reset the QMediaPlayer and play the sound again. mPlayer.setLoops(QMediaPlayer::Loops::Once); connect(&mPlayer, &QMediaPlayer::playbackStateChanged, this, [this, soundUrl](QMediaPlayer::PlaybackState aState) { if (aState == QMediaPlayer::PlaybackState::StoppedState) { // Clear the source mPlayer.setSource(QUrl()); // Restore the source mPlayer.setSource(soundUrl); mPlayer.play(); } }); mPlayer.play(); }
  • 0 Votes
    9 Posts
    1k Views
    T

    @jsulm In Qt Creator and in VS 2022 as well.

    Qt Creator:
    5353555d-9324-4191-893c-fecc5c693f47-image.png

    VS 2022:
    bb6a6442-08eb-47b0-8094-ebbe6633792b-image.png

    EDIT: I found the problem... QAbstractVideoSurface has been replaced by the QVideoSink class in Qt6:
    https://doc.qt.io/qt-6/qtmultimedia-changes-qt6.html

    EDIT2: I think i will open two different topic since I found different "bug?"

  • 0 Votes
    3 Posts
    474 Views
    A

    The problem was in the Windows firewall. I still don't understand why this was affecting the sound, but disabling the firewall did the trick.

  • 0 Votes
    9 Posts
    2k Views
    SGaistS

    Great !

    The please mark the thread as solved using the "Topic Tools" button or the three doted menu beside the answer you deem correct so that other forum users may know a solution has been found :-)

  • 1 Votes
    15 Posts
    7k Views
    V

    @SGaist I'll try to cross compile qt again and let you know the error .
    Meanwhile can you please share any link where i can get the procedure about how to cross compile qt for zynq mpsoc devices.
    Thanx.

  • 0 Votes
    10 Posts
    1k Views
    VagabondV

    @Pablo-J-Rogina thanks. Just looked into it. As the docs for QNetworkConfiguration state:

    QNetworkConfiguration encapsulates a single access point or service network. In most cases a single access point configuration can be mapped to one network interface.

    I deduce from that, that any call to QMediaPlayer::setNetworkConfigurations(QList<QNetworkConfiguration>) will not fix my problem. In fact, I gather from the information, that QNetworkConfiguration deals more with hardware-side networking & routing configurations than it does with specifics for transmission protocols.

    This notion is strengthened by the fact, that there is no accessible public members for QNetworkConfiguration and the only available constructors are copy and default. Therefore, the only way accessible way to provide valid values to setNetworkConfigurations is by filtering QNetworkConfigurationManager::allConfigurations()). Then again, this method produces a list dependent on the host system, which indicates hardware specific settings.

    Still, I got curious while reading the desciption for QNetworkConfiguration::ServiceSpecificPurpose, which states:

    The configuration can be used for operator specific services (e.g. receiving MMS messages or content **streaming**).

    For experimental purposes I filtered all available configurations of that type, which again didn't change anything for me.

    (Also, be sure to check out my latest edit up top, if you care for more info)

  • 0 Votes
    7 Posts
    2k Views
    W

    It seems remarkable to me that the QMediaPlayer can know whether I'm playing back audio with 1, 2, or more channels, but I cannot get that information from it, but I guess that's just the way it is? It seems like some people can get this to work, and others can't, so I wonder if this is another issue of platform differences? (For reference, this is playback either via a wired connection to an MFi device, or directly on an iPad/iPhone, so iOS under the hood.)

    Anyway, I've given up on displaying mono/stereo channel information in our implementation. (The player will fail to play back audio with three or more channels, so I can at least flag that. It'd be nice to label, but it's not required.) I'll report a bug if I get the time at some point.

  • 0 Votes
    12 Posts
    3k Views
    T

    Hey,
    Sorry for late answer. Yes everything seemed fine. No error report at least.
    But I'm guessing that this might not actually be linked with this topic anymore. So I'll just look into this issue on my own from there.

    Anyway, thanks a lot for the support !

    Best regards,

    TomHat

  • 0 Votes
    4 Posts
    892 Views
    M

    Hi @SGaist ,

    Thanks for your response. Just wanted to know for sure if there was a way to do it with Qt itself. Will start looking at other options.

    Thanks.