how to avoid green screen at beginning of rtsp streaming playback

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to avoid green screen at beginning of rtsp streaming playback

2,446 Views
tootzoe
Contributor III

hi all , 

i am playing rtsp streaming with gstream-0.1 on imx53, the rtsp server is non-stop sending rtp packages,  i play this stream  with this one:

gst-launch  rtspsrc location=rtsp://192.168.1.123:554/vga name=source ! queue  max-size-buffers=0 max-size-time=0 ! rtph264depay ! mfw_vpudecoder ! mfw_v4lsink source. ! queue max-size-buffers=0 max-size-time=0  !  rtpmpadepay ! mpegaudioparse ! mad ! alsasink 


this works very well except that there are some time green screen about 1~3 seconds at the beginning of the playback,  i searched about what problem of this, and some one said playback should wait for an i-frame (keyframe) before playing, 

i don't know where to set this parameter or (maybe ) adding extra element bin (caps) ? or any other solutions is welcome !

Thanks!

Best Regards!

toot_hzf

Labels (1)
0 Kudos
3 Replies

555 Views
VincasD
Contributor III

To avoid green screen at the beginning of rtsp we can set wait-for-keyframe=1 for h264depay element. Leard this from someone in #gstreamer IRC channel!

You  can add request-keyframe=1 to probably avoid green screens during temporary loss of the traffic during playback.

0 Kudos

1,633 Views
art
NXP Employee
NXP Employee

Most likely, it can be done somehow by checking the v4l buffer flags. For details, refer to the v4l API description:

https://linuxtv.org/downloads/v4l-dvb-apis/

https://linuxtv.org/downloads/v4l-dvb-apis/uapi/v4l/buffer.html#buffer-flags

Seems that you have to create your own gstreamer plugin for that:

https://gstreamer.freedesktop.org/

https://gstreamer.freedesktop.org/documentation/

Best Regards,

Artur

0 Kudos

1,633 Views
tootzoe
Contributor III

hi artur,

  thanks for replying, i will go to find buffer flags in source code and modify it and re-compile it.

 another question,  is there any way to avoid playing sound when waiting for the i-frame?  for some time the sound started when the screen is green or black.

Best regards!

toot_hzf

0 Kudos