Playbin + kmssink + aspect ratio black borders

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Playbin + kmssink + aspect ratio black borders

Daniel Rossi
I am using kmssink to output video to HDMI on RPI. However, the video is overlaying the console text, with the text showing underneath it depending on the video scale.

In 16:9 on a TV it still shows text top and bottom but not on my monitor. In 4:3 it's apparantly forcing aspect ratio, and the console text is displaying underneath it . 

Is there a way to force a black border using playbin ?

Example command

gst-launch-1.0 playbin -v video-sink="kmssink" uri=srt://:8888
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Playbin + kmssink + aspect ratio black borders

Nicolas Dufresne-5


Le jeu. 10 oct. 2019 04 h 56, Daniel Rossi <[hidden email]> a écrit :
I am using kmssink to output video to HDMI on RPI. However, the video is overlaying the console text, with the text showing underneath it depending on the video scale.

In 16:9 on a TV it still shows text top and bottom but not on my monitor. In 4:3 it's apparantly forcing aspect ratio, and the console text is displaying underneath it . 

Is there a way to force a black border using playbin ?

By default, kmsink will render on an overlay, leaving fbcon frame buffer in place. To add black border without loosing the speed of zero copy, kmssink would need to learn to render on multiple planes, and for that it would need to use the new atomic kernel API. We basically need to implement a small compositor to go further with that.

Meanwhile, you could disable fbcon, or try to set force-modesetting property (that does not always work though). I've heard of a patch adding a "fullscreen-overlay" property, but it was a bit of a hack.

Final way, you could use modetest to replace fbcon framebuffer, but I don't know exactly how.


Example command

gst-launch-1.0 playbin -v video-sink="kmssink" uri=srt://:8888
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re[2]: Playbin + kmssink + aspect ratio black borders

Daniel Rossi
Thanks mate. Some of it went over my head regards to fbcon. How do I disable that ? I don't know what modetest is. Is this something I should take up with RPI forum ?

This setting force-modesetting seems to use the original underlying layer for display, or tries to. I'll test it and report back. 

I tried "add-borders" with videoscale and didn't seem to work ?

https://gstreamer.freedesktop.org/documentation/videoscale/index.html?gi-language=c



------ Original Message ------
From: "Nicolas Dufresne" <[hidden email]>
To: "Daniel Rossi" <[hidden email]>
Cc: "Discussion of the development of and with GStreamer" <[hidden email]>
Sent: 10/10/2019 9:45:31 PM
Subject: Re: Playbin + kmssink + aspect ratio black borders



Le jeu. 10 oct. 2019 04 h 56, Daniel Rossi <[hidden email]> a écrit :
I am using kmssink to output video to HDMI on RPI. However, the video is overlaying the console text, with the text showing underneath it depending on the video scale.

In 16:9 on a TV it still shows text top and bottom but not on my monitor. In 4:3 it's apparantly forcing aspect ratio, and the console text is displaying underneath it . 

Is there a way to force a black border using playbin ?

By default, kmsink will render on an overlay, leaving fbcon frame buffer in place. To add black border without loosing the speed of zero copy, kmssink would need to learn to render on multiple planes, and for that it would need to use the new atomic kernel API. We basically need to implement a small compositor to go further with that.

Meanwhile, you could disable fbcon, or try to set force-modesetting property (that does not always work though). I've heard of a patch adding a "fullscreen-overlay" property, but it was a bit of a hack.

Final way, you could use modetest to replace fbcon framebuffer, but I don't know exactly how.


Example command

gst-launch-1.0 playbin -v video-sink="kmssink" uri=srt://:8888
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: Playbin + kmssink + aspect ratio black borders

Nicolas Dufresne-5
Le jeudi 10 octobre 2019 à 11:47 +0000, Daniel Rossi a écrit :
> Thanks mate. Some of it went over my head regards to fbcon. How do I disable that ? I don't know what modetest is. Is this something I should take up with RPI forum ?

modetest is missing on raspbian (drm-utils is missing), sorry didn't
catch you are on RPi. One way I found is to unbind all consoles:

  for i in  /sys/class/vtconsole/*; do echo 0 > $i/bind; done

For me it turns the VT blank, no blinking or anything. And then kmssink
seems to do the right thing.

>
> This setting force-modesetting seems to use the original underlying layer for display, or tries to. I'll test it and report back.
>
> I tried "add-borders" with videoscale and didn't seem to work ?
>
> https://gstreamer.freedesktop.org/documentation/videoscale/index.html?gi-language=c
>
>
>
> ------ Original Message ------
> From: "Nicolas Dufresne" <[hidden email]>
> To: "Daniel Rossi" <[hidden email]>
> Cc: "Discussion of the development of and with GStreamer" <[hidden email]>
> Sent: 10/10/2019 9:45:31 PM
> Subject: Re: Playbin + kmssink + aspect ratio black borders
>
> >
> > Le jeu. 10 oct. 2019 04 h 56, Daniel Rossi <[hidden email]> a écrit :
> > > I am using kmssink to output video to HDMI on RPI. However, the video is overlaying the console text, with the text showing underneath it depending on the video scale.
> > >
> > > In 16:9 on a TV it still shows text top and bottom but not on my monitor. In 4:3 it's apparantly forcing aspect ratio, and the console text is displaying underneath it .
> > >
> > > Is there a way to force a black border using playbin ?
> >
> > By default, kmsink will render on an overlay, leaving fbcon frame buffer in place. To add black border without loosing the speed of zero copy, kmssink would need to learn to render on multiple planes, and for that it would need to use the new atomic kernel API. We basically need to implement a small compositor to go further with that.
> >
> > Meanwhile, you could disable fbcon, or try to set force-modesetting property (that does not always work though). I've heard of a patch adding a "fullscreen-overlay" property, but it was a bit of a hack.
> >
> > Final way, you could use modetest to replace fbcon framebuffer, but I don't know exactly how.
> >
> > > Example command
> > >
> > > gst-launch-1.0 playbin -v video-sink="kmssink" uri=srt://:8888
> > > _______________________________________________
> > > gstreamer-devel mailing list
> > > [hidden email]
> > > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (201 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re[4]: Playbin + kmssink + aspect ratio black borders

Daniel Rossi
RPI3B. I forgot to include that in the subject. I'm trying to make test 4:3 video sources but having a hard time not showing it fullscreen scaled.
kmssink force-modesetting=true
Causes frame dropping and these errors. Its using video4linux h264 decoder though
WARNING: from element /GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:vbin/GstKMSSink:kmssink0: A lot of buffers are being dropped.
I'll try that hack thanks. I would need a way to get console display back when streaming stops though.

------ Original Message ------
From: "Nicolas Dufresne" <[hidden email]>
To: "Daniel Rossi" <[hidden email]>
Cc: "Discussion of the development of and with GStreamer" <[hidden email]>
Sent: 10/11/2019 1:35:51 AM
Subject: Re: Re[2]: Playbin + kmssink + aspect ratio black borders

Le jeudi 10 octobre 2019 à 11:47 +0000, Daniel Rossi a écrit :
Thanks mate. Some of it went over my head regards to fbcon. How do I disable that ? I don't know what modetest is. Is this something I should take up with RPI forum ?
 
modetest is missing on raspbian (drm-utils is missing), sorry didn't
catch you are on RPi. One way I found is to unbind all consoles:
 
for i in /sys/class/vtconsole/*; do echo 0 > $i/bind; done
 
For me it turns the VT blank, no blinking or anything. And then kmssink
seems to do the right thing.
 
 
This setting force-modesetting seems to use the original underlying layer for display, or tries to. I'll test it and report back.
 
I tried "add-borders" with videoscale and didn't seem to work ?
 
 
 
 
------ Original Message ------
From: "Nicolas Dufresne" <[hidden email]>
To: "Daniel Rossi" <[hidden email]>
Cc: "Discussion of the development of and with GStreamer" <[hidden email]>
Sent: 10/10/2019 9:45:31 PM
Subject: Re: Playbin + kmssink + aspect ratio black borders
 
>
> Le jeu. 10 oct. 2019 04 h 56, Daniel Rossi <[hidden email]> a écrit :
> > I am using kmssink to output video to HDMI on RPI. However, the video is overlaying the console text, with the text showing underneath it depending on the video scale.
> >
> > In 16:9 on a TV it still shows text top and bottom but not on my monitor. In 4:3 it's apparantly forcing aspect ratio, and the console text is displaying underneath it .
> >
> > Is there a way to force a black border using playbin ?
>
> By default, kmsink will render on an overlay, leaving fbcon frame buffer in place. To add black border without loosing the speed of zero copy, kmssink would need to learn to render on multiple planes, and for that it would need to use the new atomic kernel API. We basically need to implement a small compositor to go further with that.
>
> Meanwhile, you could disable fbcon, or try to set force-modesetting property (that does not always work though). I've heard of a patch adding a "fullscreen-overlay" property, but it was a bit of a hack.
>
> Final way, you could use modetest to replace fbcon framebuffer, but I don't know exactly how.
>
> > Example command
> >
> > gst-launch-1.0 playbin -v video-sink="kmssink" uri=srt://:8888
> > _______________________________________________
> > gstreamer-devel mailing list

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re[4]: Playbin + kmssink + aspect ratio black borders

Daniel Rossi
In reply to this post by Nicolas Dufresne-5
I get permission issues trying to do that. If this is the only way to turn off the  console output while streaming I might have a problem because it's run as a system user on a startup. I'll consult RPI.  I tried to find a way to overlay a black border  in gstreamer but nothing seemed to work.

So something as simple as this

echo 0 > /sys/class/vtconsole/vtcon1/bind

echo 1 > /sys/class/vtconsole/vtcon1/bind

------ Original Message ------
From: "Nicolas Dufresne" <[hidden email]>
To: "Daniel Rossi" <[hidden email]>
Cc: "Discussion of the development of and with GStreamer" <[hidden email]>
Sent: 10/11/2019 1:35:51 AM
Subject: Re: Re[2]: Playbin + kmssink + aspect ratio black borders

Le jeudi 10 octobre 2019 à 11:47 +0000, Daniel Rossi a écrit :
Thanks mate. Some of it went over my head regards to fbcon. How do I disable that ? I don't know what modetest is. Is this something I should take up with RPI forum ?
 
modetest is missing on raspbian (drm-utils is missing), sorry didn't
catch you are on RPi. One way I found is to unbind all consoles:
 
for i in /sys/class/vtconsole/*; do echo 0 > $i/bind; done
 
For me it turns the VT blank, no blinking or anything. And then kmssink
seems to do the right thing.
 
 
This setting force-modesetting seems to use the original underlying layer for display, or tries to. I'll test it and report back.
 
I tried "add-borders" with videoscale and didn't seem to work ?
 
 
 
 
------ Original Message ------
From: "Nicolas Dufresne" <[hidden email]>
To: "Daniel Rossi" <[hidden email]>
Cc: "Discussion of the development of and with GStreamer" <[hidden email]>
Sent: 10/10/2019 9:45:31 PM
Subject: Re: Playbin + kmssink + aspect ratio black borders
 
>
> Le jeu. 10 oct. 2019 04 h 56, Daniel Rossi <[hidden email]> a écrit :
> > I am using kmssink to output video to HDMI on RPI. However, the video is overlaying the console text, with the text showing underneath it depending on the video scale.
> >
> > In 16:9 on a TV it still shows text top and bottom but not on my monitor. In 4:3 it's apparantly forcing aspect ratio, and the console text is displaying underneath it .
> >
> > Is there a way to force a black border using playbin ?
>
> By default, kmsink will render on an overlay, leaving fbcon frame buffer in place. To add black border without loosing the speed of zero copy, kmssink would need to learn to render on multiple planes, and for that it would need to use the new atomic kernel API. We basically need to implement a small compositor to go further with that.
>
> Meanwhile, you could disable fbcon, or try to set force-modesetting property (that does not always work though). I've heard of a patch adding a "fullscreen-overlay" property, but it was a bit of a hack.
>
> Final way, you could use modetest to replace fbcon framebuffer, but I don't know exactly how.
>
> > Example command
> >
> > gst-launch-1.0 playbin -v video-sink="kmssink" uri=srt://:8888
> > _______________________________________________
> > gstreamer-devel mailing list

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re[4]: Playbin + kmssink + aspect ratio black borders

Daniel Rossi
In reply to this post by Nicolas Dufresne-5
It seems to have an effect, but not blanking just no keyboard input
works

------ Original Message ------
From: "Nicolas Dufresne" <[hidden email]>
To: "Daniel Rossi" <[hidden email]>
Cc: "Discussion of the development of and with GStreamer"
<[hidden email]>
Sent: 10/11/2019 1:35:51 AM
Subject: Re: Re[2]: Playbin + kmssink + aspect ratio black borders

>Le jeudi 10 octobre 2019 à 11:47 +0000, Daniel Rossi a écrit :
>>  Thanks mate. Some of it went over my head regards to fbcon. How do I disable that ? I don't know what modetest is. Is this something I should take up with RPI forum ?
>
>modetest is missing on raspbian (drm-utils is missing), sorry didn't
>catch you are on RPi. One way I found is to unbind all consoles:
>
>   for i in  /sys/class/vtconsole/*; do echo 0 > $i/bind; done
>
>For me it turns the VT blank, no blinking or anything. And then kmssink
>seems to do the right thing.
>
>>
>>  This setting force-modesetting seems to use the original underlying layer for display, or tries to. I'll test it and report back.
>>
>>  I tried "add-borders" with videoscale and didn't seem to work ?
>>
>>https://gstreamer.freedesktop.org/documentation/videoscale/index.html?gi-language=c
>>
>>
>>
>>  ------ Original Message ------
>>  From: "Nicolas Dufresne" <[hidden email]>
>>  To: "Daniel Rossi" <[hidden email]>
>>  Cc: "Discussion of the development of and with GStreamer" <[hidden email]>
>>  Sent: 10/10/2019 9:45:31 PM
>>  Subject: Re: Playbin + kmssink + aspect ratio black borders
>>
>>  >
>>  > Le jeu. 10 oct. 2019 04 h 56, Daniel Rossi <[hidden email]> a écrit :
>>  > > I am using kmssink to output video to HDMI on RPI. However, the video is overlaying the console text, with the text showing underneath it depending on the video scale.
>>  > >
>>  > > In 16:9 on a TV it still shows text top and bottom but not on my monitor. In 4:3 it's apparantly forcing aspect ratio, and the console text is displaying underneath it .
>>  > >
>>  > > Is there a way to force a black border using playbin ?
>>  >
>>  > By default, kmsink will render on an overlay, leaving fbcon frame buffer in place. To add black border without loosing the speed of zero copy, kmssink would need to learn to render on multiple planes, and for that it would need to use the new atomic kernel API. We basically need to implement a small compositor to go further with that.
>>  >
>>  > Meanwhile, you could disable fbcon, or try to set force-modesetting property (that does not always work though). I've heard of a patch adding a "fullscreen-overlay" property, but it was a bit of a hack.
>>  >
>>  > Final way, you could use modetest to replace fbcon framebuffer, but I don't know exactly how.
>>  >
>>  > > Example command
>>  > >
>>  > > gst-launch-1.0 playbin -v video-sink="kmssink" uri=srt://:8888
>>  > > _______________________________________________
>>  > > gstreamer-devel mailing list
>>  > > [hidden email]
>>  > > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re[4]: Playbin + kmssink + aspect ratio black borders

Daniel Rossi
In reply to this post by Nicolas Dufresne-5
This is the only thing I've found  that would work as a system user, cursor is the only issue now. It's a blank screen, and keying enter shows the login again.

dd if=/dev/zero of=/dev/fb0

------ Original Message ------
From: "Nicolas Dufresne" <[hidden email]>
To: "Daniel Rossi" <[hidden email]>
Cc: "Discussion of the development of and with GStreamer" <[hidden email]>
Sent: 10/11/2019 1:35:51 AM
Subject: Re: Re[2]: Playbin + kmssink + aspect ratio black borders
T
Le jeudi 10 octobre 2019 à 11:47 +0000, Daniel Rossi a écrit :
Thanks mate. Some of it went over my head regards to fbcon. How do I disable that ? I don't know what modetest is. Is this something I should take up with RPI forum ?
 
modetest is missing on raspbian (drm-utils is missing), sorry didn't
catch you are on RPi. One way I found is to unbind all consoles:
 
for i in /sys/class/vtconsole/*; do echo 0 > $i/bind; done
 
For me it turns the VT blank, no blinking or anything. And then kmssink
seems to do the right thing.
 
 
This setting force-modesetting seems to use the original underlying layer for display, or tries to. I'll test it and report back.
 
I tried "add-borders" with videoscale and didn't seem to work ?
 
 
 
 
------ Original Message ------
From: "Nicolas Dufresne" <[hidden email]>
To: "Daniel Rossi" <[hidden email]>
Cc: "Discussion of the development of and with GStreamer" <[hidden email]>
Sent: 10/10/2019 9:45:31 PM
Subject: Re: Playbin + kmssink + aspect ratio black borders
 
>
> Le jeu. 10 oct. 2019 04 h 56, Daniel Rossi <[hidden email]> a écrit :
> > I am using kmssink to output video to HDMI on RPI. However, the video is overlaying the console text, with the text showing underneath it depending on the video scale.
> >
> > In 16:9 on a TV it still shows text top and bottom but not on my monitor. In 4:3 it's apparantly forcing aspect ratio, and the console text is displaying underneath it .
> >
> > Is there a way to force a black border using playbin ?
>
> By default, kmsink will render on an overlay, leaving fbcon frame buffer in place. To add black border without loosing the speed of zero copy, kmssink would need to learn to render on multiple planes, and for that it would need to use the new atomic kernel API. We basically need to implement a small compositor to go further with that.
>
> Meanwhile, you could disable fbcon, or try to set force-modesetting property (that does not always work though). I've heard of a patch adding a "fullscreen-overlay" property, but it was a bit of a hack.
>
> Final way, you could use modetest to replace fbcon framebuffer, but I don't know exactly how.
>
> > Example command
> >
> > gst-launch-1.0 playbin -v video-sink="kmssink" uri=srt://:8888
> > _______________________________________________
> > gstreamer-devel mailing list

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re[4]: Playbin + kmssink + aspect ratio black borders

Daniel Rossi
In reply to this post by Nicolas Dufresne-5
This in my gst python startup service seems to do the job. No issue with video overlay then. I just need to toggle the cursor also.

os.system("cat /dev/zero > /dev/fb0")



------ Original Message ------
From: "Nicolas Dufresne" <[hidden email]>
To: "Daniel Rossi" <[hidden email]>
Cc: "Discussion of the development of and with GStreamer" <[hidden email]>
Sent: 10/11/2019 1:35:51 AM
Subject: Re: Re[2]: Playbin + kmssink + aspect ratio black borders

Le jeudi 10 octobre 2019 à 11:47 +0000, Daniel Rossi a écrit :
Thanks mate. Some of it went over my head regards to fbcon. How do I disable that ? I don't know what modetest is. Is this something I should take up with RPI forum ?
 
modetest is missing on raspbian (drm-utils is missing), sorry didn't
catch you are on RPi. One way I found is to unbind all consoles:
 
for i in /sys/class/vtconsole/*; do echo 0 > $i/bind; done
 
For me it turns the VT blank, no blinking or anything. And then kmssink
seems to do the right thing.
 
 
This setting force-modesetting seems to use the original underlying layer for display, or tries to. I'll test it and report back.
 
I tried "add-borders" with videoscale and didn't seem to work ?
 
 
 
 
------ Original Message ------
From: "Nicolas Dufresne" <[hidden email]>
To: "Daniel Rossi" <[hidden email]>
Cc: "Discussion of the development of and with GStreamer" <[hidden email]>
Sent: 10/10/2019 9:45:31 PM
Subject: Re: Playbin + kmssink + aspect ratio black borders
 
>
> Le jeu. 10 oct. 2019 04 h 56, Daniel Rossi <[hidden email]> a écrit :
> > I am using kmssink to output video to HDMI on RPI. However, the video is overlaying the console text, with the text showing underneath it depending on the video scale.
> >
> > In 16:9 on a TV it still shows text top and bottom but not on my monitor. In 4:3 it's apparantly forcing aspect ratio, and the console text is displaying underneath it .
> >
> > Is there a way to force a black border using playbin ?
>
> By default, kmsink will render on an overlay, leaving fbcon frame buffer in place. To add black border without loosing the speed of zero copy, kmssink would need to learn to render on multiple planes, and for that it would need to use the new atomic kernel API. We basically need to implement a small compositor to go further with that.
>
> Meanwhile, you could disable fbcon, or try to set force-modesetting property (that does not always work though). I've heard of a patch adding a "fullscreen-overlay" property, but it was a bit of a hack.
>
> Final way, you could use modetest to replace fbcon framebuffer, but I don't know exactly how.
>
> > Example command
> >
> > gst-launch-1.0 playbin -v video-sink="kmssink" uri=srt://:8888
> > _______________________________________________
> > gstreamer-devel mailing list

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel