Closed apavlenko closed 8 years ago
First of all you don't need VlcVideoSurface
and VideoOutput
at the same time, so you should remove one of them. Second - you didn't specify width
and height
for VlcVideoSurface
. What about placing it to RowLayout
- I'll check it, but I think you just use RowLayout
in wrong way.
when I comment one of player's mrl
- the other one works as expected, but both they try to use the same output element...
RowLayout {
id: row
anchors.fill: parent
//1
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: 320
Layout.minimumHeight: 240
Layout.preferredWidth: 640
Text {
anchors.centerIn: parent
text: parent.width + 'x' + parent.height
}
color: 'grey';
border.color: 'black'
VlcPlayer {
id: vlcPlayer;
mrl: "rtsp://192.168.10.190:1234";
}
VlcVideoSurface {
id: vlcSurface;
source: vlcPlayer;
width: 320;
height: 240;
}
/*VideoOutput {
id: vlcVideoOutput;
source: vlcPlayer;
width: 320;
height: 240;
}*/
}
//2
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: 320
Layout.minimumHeight: 240
Layout.preferredWidth: 640
Text {
anchors.centerIn: parent
text: parent.width + 'x' + parent.height
}
color: 'yellow';
border.color: 'black'
VlcPlayer {
id: vlcPlayer2;
mrl: "rtsp://192.168.10.218:1234";
}
VideoOutput {
id: vlcVideoOut2;
source: vlcPlayer2;
Layout.fillWidth: true
Layout.fillHeight: true
//width: 640;//parent.width;
//height: 480; //parent.height;
}
}
}
I really need help showing output of two players in the same app window - could you share any working example?
your example works for me.
a little bit simplified one, which works fine too:
RowLayout {
id: row
anchors.fill: parent
//1
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
color: 'grey';
border.color: 'black'
VlcPlayer {
id: vlcPlayer;
mrl: "http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_stereo.avi";
}
VlcVideoSurface {
id: vlcSurface;
source: vlcPlayer;
anchors.fill: parent;
}
}
//2
Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
color: 'yellow';
border.color: 'black'
VlcPlayer {
id: vlcPlayer2;
mrl: "http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_stereo.avi";
}
VlcVideoSurface {
id: vlcVideoOut2;
source: vlcPlayer2;
anchors.fill: parent;
}
}
}
Another working sample: https://github.com/RSATom/QmlVlcDemo/blob/master/skin/basic_2.qml
btw, what Qt version do you use, and what OS?
Windows 8.1 Qt 5.5 and 5.6
I'm on Win 10 with Qt 5.5
Could you try the same with something other than rtsp source? maybe it's related...
it works OK when player1 plays RTSP and player2 plays HTTP, but changing both to use RTSP URLs brings the problem!
Then it's libvlc level issue. Please enable debug mode and look log with https://technet.microsoft.com/en-us/sysinternals/debugview.aspx
https://github.com/RSATom/QmlVlcDemo/blob/master/main.cpp#L39 - it's how enable debug mode
you are right: I've run two VLC players to show two different RTSP streams - but they display both in the same window leaving the other black! :( thanks a lot for you help, anyway...
it's possible they just try to use the same port for incoming stream.
And maybe it could be fixed by some libvlc setting. Look to log, maybe you'll find something there.
you're right again: both connections used the same ports! thanks a lot for help - now I know where to go for getting this fixed!
You are welcome.
I think this issue can be closed.
When trying to play 2 videos one next to the other they are displayed one over the other instead... Is it possible to show them right way?