<div dir="ltr"><div><div><div><div><div>HI All,<br><br></div>Would really appreciate any suggestions for an issue i am experiencing.<br></div>I had been happily taking screenshots from a regular v4l2src linux device using gstreamer using the following pipeline (i am using pythons gstreamer packages for this):<br><br>v4l2src device=/dev/video1 norm=PAL ! ffmpegcolorspace ! valve name=video_capture_valve drop=true ! videoscale ! video/x-raw-rgb, bpp=24, width=720, height=576, pixel-aspect-ratio=1/1 ! pngenc snapshot=true compression-level=1 ! filesink location=/tmp/blah.png<br><br></div><div>The valve is just so i can control exactly when to take the snapshot. When it is opened (i.e. drop=false) the png is generated almost immediately.<br></div><div>        <br></div>However, when I changed the src to be udpsrc receiving h264 RTP video it sometimes takes up to 40 seconds after opening the valve before the png is created.<br></div>A bit of investigation shows that this only happens when the video content is static (e.g. a video of pure black or just motionless content). I'm guessing this is because with h264 compression, static video produces very little bits and hence it takes longer before the buffers build up enough to empty down through the pipeline:<br><br>udpsrc port=8555 ! application/x-rtp, payload=96 ! rtph264depay ! ffdec_h264 ! ffmpegcolorspace ! valve 
name=video_capture_valve drop=true ! videoscale ! video/x-raw-rgb, 
bpp=24, width=720, height=576, pixel-aspect-ratio=1/1 ! pngenc 
snapshot=true compression-level=1 ! filesink location=/tmp/blah.png<br><br></div><div>So my question is does anyone have any suggestions as to how i could change things to ensure an immediate screenshot/image is taken?<br><br></div><div>Just for completion, here is the command line pipeline i use to generate the RTP source in the first place:<br><br>gst-launch -v -e v4l2src device=/dev/video1 norm=PAL ! videoscale ! video/x-raw-rgb, width=720, height=576, pixel-aspect-ratio=1/1 ! ffmpegcolorspace ! tee name=videoTee \<br>videoTee. ! queue ! x264enc tune="zerolatency" threads=1 intra-refresh=true ! rtph264pay config-interval=2 ! udpsink port=8554<br><br></div><div>Thanks!<br></div></div>