Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt qml mediaplayer not playing mp4

Qt qml mediaplayer not playing mp4

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dspelt
    wrote on last edited by
    #1

    I am trying to play a mp4 video in MediaPlayer

    MediaPlayer {
        id: mediaPlayer
        loops: Audio.Infinite
        source: "file:///c:/Users/Dan/Videos/Exercise Videos/Autumn Forest.mp4"
        onPlaying: console.log("Video playing", playbackState)
        muted: true
        onError: console.log("ScenarioView::MediaPlayer::onError() - error=" + error + ", errorString=" + errorString)
    }
    
    VideoOutput {
        fillMode: VideoOutput.PreserveAspectCrop
        source: mediaPlayer
        visible: hasVideo && settings.isVideoMode
        anchors.fill: parent
    }
    

    output:
    qml: Video playing 1
    libpng warning: iCCP: known incorrect sRGB profile
    libpng warning: iCCP: known incorrect sRGB profile
    libpng warning: iCCP: known incorrect sRGB profile
    DirectShowPlayerService::doRender: Unresolved error code 0x80040266 ()
    qml: ScenarioView::MediaPlayer::onError() - error=1, errorString=

    It seems to be going in the onPlaying I am getting
    PlayingState - the media is currently playing.
    but I can't see the video
    Does anybody have a idea why I can't see the video
    Also I have trying this on different versions of qt

    1 Reply Last reply
    0
    • YunusY Offline
      YunusY Offline
      Yunus
      wrote on last edited by
      #2

      @dspelt Hi. Actually you didnt start your mp4 video. Just trigger it with a button simply. It will work:

      Button{
              onClicked: {
                  mediaPlayer.play()
              }
          }
      
      1 Reply Last reply
      0
      • IntruderExcluderI Offline
        IntruderExcluderI Offline
        IntruderExcluder
        wrote on last edited by IntruderExcluder
        #3

        AFAIK on Windows DirectShow doesn't support mp4 out of box. Probably you need to install 3rd party codecs into your system. Usually installing k-lite codec pack solves the problem.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved