Quantcast

shmsink/shmsrc adds colored band to output

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

shmsink/shmsrc adds colored band to output

Mandar Joshi
Hello,
I am using the following pipelines to decode video in one program and
display it in another

gst-launch-1.0 rtspsrc location=url ! rtph264depay ! vaapidecodebin !
shmsink socket-path=/tmp/x wait-for-connection=false

gst-launch-1.0 -v shmsrc  socket-path=/tmp/x is-live=true
do-timestamp=true !
video/x-raw,width=1920,height=1080,format=NV12,framerate=25/1  !
videoconvert !  xvimagesink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps =
video/x-raw, width=(int)1920, height=(int)1080, format=(string)NV12,
framerate=(fraction)25/1
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps
= video/x-raw, width=(int)1920, height=(int)1080,
framerate=(fraction)25/1, format=(string)YV12
/GstPipeline:pipeline0/GstXvImageSink:xvimagesink0.GstPad:sink: caps =
video/x-raw, width=(int)1920, height=(int)1080,
framerate=(fraction)25/1, format=(string)YV12
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps
= video/x-raw, width=(int)1920, height=(int)1080, format=(string)NV12,
framerate=(fraction)25/1
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:02.345800624
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

They work but there is a colored band in the out at the top of the
image. I've attached the image.
I am doing this on an Intel Haswell processor.
Doing video conversion to RGBA  before sending video to shmsink solves
the problem but that adds a lot to the CPU usage.
Can someone suggest a solution?

Regards
Mandar Joshi

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

hikvision1.jpeg (148K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: shmsink/shmsrc adds colored band to output

Nicolas Dufresne-5
Le mercredi 26 avril 2017 à 10:59 +0530, Mandar Joshi a écrit :
> gst-launch-1.0 rtspsrc location=url ! rtph264depay ! vaapidecodebin !
> shmsink socket-path=/tmp/x wait-for-connection=false
>
> gst-launch-1.0 -v shmsrc  socket-path=/tmp/x is-live=true
> do-timestamp=true !
> video/x-raw,width=1920,height=1080,format=NV12,framerate=25/1  !
> videoconvert !  xvimagesink

There is a problem here, since hardware decoder generally requires some
padding. For 1080p, I would expect the decoder to produce buffer of the
size 1920x1088 at the very minimum (H264 with 16x16 macroblock). I'm
surprise it's not more broken then that here, probably vaapidecodebin
makes a copy without padding. In any case, it's likely the problem is
not there for you. But read this as a warning, you are doing something
undefined.

> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Setting pipeline to PLAYING ...
> New clock: GstSystemClock
> /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps =
> video/x-raw, width=(int)1920, height=(int)1080, format=(string)NV12,
> framerate=(fraction)25/1
> /GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps
> = video/x-raw, width=(int)1920, height=(int)1080,
> framerate=(fraction)25/1, format=(string)YV12
> /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0.GstPad:sink: caps
> =
> video/x-raw, width=(int)1920, height=(int)1080,
> framerate=(fraction)25/1, format=(string)YV12
> /GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink:
> caps
> = video/x-raw, width=(int)1920, height=(int)1080,
> format=(string)NV12,
> framerate=(fraction)25/1
> ^Chandling interrupt.
> Interrupt: Stopping pipeline ...
> Execution ended after 0:00:02.345800624
> Setting pipeline to PAUSED ...
> Setting pipeline to READY ...
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> They work but there is a colored band in the out at the top of the
> image. I've attached the image.
> I am doing this on an Intel Haswell processor.
> Doing video conversion to RGBA  before sending video to shmsink
> solves
> the problem but that adds a lot to the CPU usage.
> Can someone suggest a solution?

You can narrow down a bit. Replaced xvimagesink to ximagesink, that
would indicate a bug in your XV driver. Solution would be to update
your X11 drivers, or file a bug if there is no newer version that fixes
it.

You could also test replacing vaapidecodebin with avdec_h264, that
would indicate an issue with usage of vaapidecodebin.

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

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: shmsink/shmsrc adds colored band to output

Mandar Joshi
> You can narrow down a bit. Replaced xvimagesink to ximagesink, that
> would indicate a bug in your XV driver. Solution would be to update
> your X11 drivers, or file a bug if there is no newer version that fixes
> it.
Using ximagesink doesn't solve the problem.

> You could also test replacing vaapidecodebin with avdec_h264, that
> would indicate an issue with usage of vaapidecodebin.
>
avdec_h264 produces a clean image.


The problem only occurs when I use shmsink/shmsrc. Directly decoding
the video stream coming from the camera and displaying it using
xvimagesink doesn't produce the colored band.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: shmsink/shmsrc adds colored band to output

Nicolas Dufresne-5
Le jeudi 27 avril 2017 à 01:47 +0530, Mandar Joshi a écrit :
> The problem only occurs when I use shmsink/shmsrc. Directly decoding
> the video stream coming from the camera and displaying it using
> xvimagesink doesn't produce the colored band.

That bring us closer to the issue I have mention earlier. One would
need to have a look at the GstBuffer produced by vaapidecode, and check
 if there is a GstVideoMeta being set (even though shmsrc/sink does not
support that). If that is the case, it means we need to add a buffer
copy in vaapidecode for that specific case. It will kill the
performance of course, but provide correct output.

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

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: shmsink/shmsrc adds colored band to output

Scott D Phillips
On Wed, Apr 26, 2017 at 08:13:45PM -0400, Nicolas Dufresne wrote:

> Le jeudi 27 avril 2017 à 01:47 +0530, Mandar Joshi a écrit :
> > The problem only occurs when I use shmsink/shmsrc. Directly decoding
> > the video stream coming from the camera and displaying it using
> > xvimagesink doesn't produce the colored band.
>
> That bring us closer to the issue I have mention earlier. One would
> need to have a look at the GstBuffer produced by vaapidecode, and check
>  if there is a GstVideoMeta being set (even though shmsrc/sink does not
> support that). If that is the case, it means we need to add a buffer
> copy in vaapidecode for that specific case. It will kill the
> performance of course, but provide correct output.

I haven't checked this case, but I have seen situations before
where vaapidecode does the errant behavior you describe.

> regards,
> Nicolas



> _______________________________________________
> 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
Loading...