[Interest] Qt Multimedia (Quick) with special character in MediaPlayer source

Gaurav Kalra gvkalra at gmail.com
Mon Sep 13 14:24:01 CEST 2021


Hi,

I am trying to use the MediaPlayer { } QML element to play a file from the
local filesystem using gst-pipeline scheme:

------ This pipeline works ------

MediaPlayer {

  id: mediaplayer

  autoPlay: true

  autoLoad: true

  source: 'gst-pipeline: playbin
uri=file:///data/screenshots/2021_Jul_27_15_14_05.avi
video-sink=qtvideosink audio-sink=alsasink'

}


However, when there is a special character in the source (e.g., space or
languages other than English), the pipeline fails:
------ This pipeline doesn't work *(I moved the file to sub-folder 'G g')*
------

MediaPlayer {

  id: mediaplayer

  autoPlay: true

  autoLoad: true

  source: 'gst-pipeline: playbin uri=file:///data/screenshots/G
g/2021_Jul_27_15_14_05.avi video-sink=qtvideosink audio-sink=alsasink'

}


The error message is:
--------
(media-player-test:6807): GStreamer-CRITICAL **: 11:44:21.461:
gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
Error: " playbin uri=file:///data/screenshots/G g/2021_Jul_27_15_14_05.avi
video-sink=qtvideosink audio-sink=alsasink" : "no element \"g\""
GStreamer; Unable to pause - "gst-pipeline: playbin
uri=file:///data/screenshots/G g/2021_Jul_27_15_14_05.avi
video-sink=qtvideosink audio-sink=alsasink"
GStreamer; Unable to play - "gst-pipeline: playbin
uri=file:///data/screenshots/G g/2021_Jul_27_15_14_05.avi
video-sink=qtvideosink audio-sink=alsasink"
Error: "Resource not found."
--------

And it seems that the problem is here: *"no element \"g\""*
because the space character was not escaped properly.

I have tried hardcoding the file paths for escaping space as:
1. file:///data/screenshots/*G\ g*/2021_Jul_27_15_14_05.avi
2. file:///data/screenshots/*G%20g*/2021_Jul_27_15_14_05.avi

But, no luck...

How can I use gst-pipeline scheme in MediaPlayer { } QML element
when the URI contains special characters (e.g., space or languages other
than English)?

Thanks



-- 
--
Gaurav Kalra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210913/83e03ec0/attachment.html>


More information about the Interest mailing list