Qt 6.5 MediaPlayer and tcp stream
-
wrote on 4 May 2023, 11:58 last edited by
I'm trying to display a simple tcp stream in a MediaPlayer object in Qt 6.5 (ffmpeg backend), but it doesn't seem to work. I tried to open it from my application, as well from the mediaplayer example.
Here is a minimal example: I create a stream myself using gstreamer (mjpeg encoding):
gst-launch-1.0 videotestsrc ! videoconvert ! video/x-raw,format=I420 ! jpegenc quality=70 ! multipartmux ! tcpserversink host=127.0.0.1 port=5000
I can open the stream using
vlc
(using url:tcp://127.0.0.1:5000
) and using ffmpeg:ffplay tcp://127.0.0.1:5000
. It can be decoded by gstreamer too:gst-launch-1.0 tcpclientsrc host=127.0.0.1 port=5000 ! multipartdemux ! jpegdec ! autovideosink
However opening
tcp://127.0.0.1:5000
as URL from the mediaplayer Qt example gives a "Could not open file" error.
Same when setting thesource
property of a mediaplayer object to this URL.Can you give some hints how to open this stream? Or how can I build a stream that can be decoded by mediaplayer?
-
I'm trying to display a simple tcp stream in a MediaPlayer object in Qt 6.5 (ffmpeg backend), but it doesn't seem to work. I tried to open it from my application, as well from the mediaplayer example.
Here is a minimal example: I create a stream myself using gstreamer (mjpeg encoding):
gst-launch-1.0 videotestsrc ! videoconvert ! video/x-raw,format=I420 ! jpegenc quality=70 ! multipartmux ! tcpserversink host=127.0.0.1 port=5000
I can open the stream using
vlc
(using url:tcp://127.0.0.1:5000
) and using ffmpeg:ffplay tcp://127.0.0.1:5000
. It can be decoded by gstreamer too:gst-launch-1.0 tcpclientsrc host=127.0.0.1 port=5000 ! multipartdemux ! jpegdec ! autovideosink
However opening
tcp://127.0.0.1:5000
as URL from the mediaplayer Qt example gives a "Could not open file" error.
Same when setting thesource
property of a mediaplayer object to this URL.Can you give some hints how to open this stream? Or how can I build a stream that can be decoded by mediaplayer?
wrote on 4 May 2023, 12:17 last edited by JonB 5 Apr 2023, 13:16@kbarni
I don't know, but since Qt6 removed support for FTP protocol (QNetworkAccessManager
) is this a non-starter trying to open atcp:...
Url schema whether forQMediaPlayer
or otherwise?Oh dear, sorry, I thought it said
ftp:
nottcp:
! :( -
@kbarni
I don't know, but since Qt6 removed support for FTP protocol (QNetworkAccessManager
) is this a non-starter trying to open atcp:...
Url schema whether forQMediaPlayer
or otherwise?Oh dear, sorry, I thought it said
ftp:
nottcp:
! :(wrote on 4 May 2023, 12:58 last edited by@JonB
Normally TCP is the most low-level protocol (almost every other protocol sends data over TCP), so I don't know how this can be a problem. It definitely is supported by QTcpSocket.
I tested without thetcp://
and it still doesn't work.
Anyway, I was thinking that the URL was being sent directly to ffmpeg.Unfortunately the ffmpeg backend for Qt multimedia is not documented and QML is not very verbose when there's an error.
-
@JonB
Normally TCP is the most low-level protocol (almost every other protocol sends data over TCP), so I don't know how this can be a problem. It definitely is supported by QTcpSocket.
I tested without thetcp://
and it still doesn't work.
Anyway, I was thinking that the URL was being sent directly to ffmpeg.Unfortunately the ffmpeg backend for Qt multimedia is not documented and QML is not very verbose when there's an error.
wrote on 4 May 2023, 13:15 last edited by JonB 5 Apr 2023, 13:17@kbarni said in Qt 6.5 MediaPlayer and tcp stream:
Normally TCP is the most low-level protocol
I had a complete mind-mess! I thought (for some reason) you were asking about
ftp:
protocol, which has indeed been removed at Qt6, not thetcp
you wrote and I quoted! Consequently ignore my previous!! -
Hi,
Since you mention 6.5, it's likely related to QTBUG-111910.
-
Hi,
Since you mention 6.5, it's likely related to QTBUG-111910.
-
2/6