Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-61117

Video won't play if there are curly braces '{}' in the path on Windows 10

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.8.0
    • None
    • Windows 10,
      Qt Creator 4.2.1,
      QT 5.8

       
      Hello,
      I understand that this might be a trivial issue, but I wasn't able to find a solution online.

      I have a 'Video' component that plays videos from the local file system. It works fine but when the path to the video contains curly brackets it fails with the following error:

      DirectShowPlayerService::doSetUrlSource: Unresolved error code 0x80004005 (Unspecified error)

      and the 'status' of Video is MediaPlayer.InvalidMedia

      I tried to escape them using \ like so:

      popupVideo.source = source.replace(/\{/g,'\\{').replace(/\}/g,'\\}');
      

      I also tried:

      popupVideo.source = encodeURI(source);
      

      but it didn't work, and I get the same error.

      I must reiterate, files without curly brackets in their path play completely fine.

      I've tied different video files (.mp4,.flv,.m4v,.mkv,.avi) and with all the tests I've made files without braces play fine.

      Here is an example code that uses the same video file (copy pasted and renamed) once with braces and once without. In my test the file without braces plays fine and the file with braces gets the `DirectShowPlayerService::doSetUrlSource: Unresolved error code 0x80004005` error.

      // 
      import QtQuick 2.8
      import QtQuick.Controls 2.1
      import QtMultimedia 5.5
      
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      
      
          Rectangle{
              id:mainRect
              anchors.fill: parent
              color:"grey"
      
              Video{
                  id:noBraces
                  property bool isPlaying: false
                  anchors.top: rowLayout.bottom
                  width: 100
                  height: 100
                  fillMode: VideoOutput.PreserveAspectFit
                  source: "D:/kodi/movies/test/fluffy no braces.mkv"
      
      
                  onStatusChanged: {
                      console.log("noBraces status changed: Status is " + status)
                  }
              }
      
      
              Button{
                  id:noBracesPlay
                  anchors.top: noBraces.bottom
                  anchors.horizontalCenter: noBraces.horizontalCenter
                  text:"Play No Braces"
                  onClicked: {
                      if (!noBraces.isPlaying){
                          noBraces.play()
                          noBraces.isPlaying = true;
                      }else{
                          noBraces.stop()
                          noBraces.isPlaying = false;
                      }
      
      
      
      
                  }
              }
      
      
      
      
              Video{
                  id:braces
                  property bool isPlaying: false
                  anchors.left: noBraces.right
                  anchors.verticalCenter: noBraces.verticalCenter
                  width: 100
                  height: 100
                  fillMode: VideoOutput.PreserveAspectFit
                  source: "D:/kodi/movies/test/{fluffy braces}.mkv"
      
      
                  onStatusChanged: {
                      console.log("braces status changed: Status is " + status)
                  }
              }
      
      
              Button{
                  id:bracesPlay
                  anchors.top: braces.bottom
                  anchors.horizontalCenter: braces.horizontalCenter
                  text:"Play Braces"
                  onClicked: {
                      if (!braces.isPlaying){
                          braces.play()
                          braces.isPlaying = true;
                      }else{
                          braces.stop()
                          braces.isPlaying = false;
                      }
      
      
      
      
                  }
              }
          }
      }
      
      
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            valentyn.doroshchuk Valentyn Doroshchuk
            curtwagner1984 Curt Wagner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes