Cant take an immediate screenshot image of static video from h264 rtp stream

Nicolas Dufresne nicolas.dufresne at collabora.com
Thu Sep 18 08:17:02 PDT 2014


Le 2014-09-18 11:07, anno domini a écrit :
> Bonjour Nicolas!
>
> Merci pour votre reponse!
> Thanks so much for taking the time to answer.
> I'm a little lost in that last part of your suggestion.
> To make things a little quicker to debug i am now running everything 
> on the command line and i have removed the valve and the intra-refresh 
> element.
>
> As suspected i still see the long delay, here is my setup:
>
> UDP STREAM SERVER (COMMAND LINE):
> 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 \
> videoTee. ! queue ! x264enc tune="zerolatency" threads=1 ! rtph264pay 
> config-interval=2 ! udpsink port=8554 \
> videoTee. ! queue ! x264enc tune="zerolatency" threads=1 ! rtph264pay 
> config-interval=2 ! udpsink port=8555

Ideally replacing the intra-refresh would be better. The options is 
key-int-max, if you want a key frame every 2 seconds (to match your 
config-interval), and a frame rate of 30 fps, then key-int-max=60 should do.

>
> MONITOR CLIENT (COMMAND LINE):
> gst-launch -v udpsrc port=8555 ! application/x-rtp, payload=96 ! 
> rtph264depay ! ffdec_h264 ! xvimagesink
>
> PNG CREATOR CLIENT PIPELINE (PYTHON):
> udpsrc port=8554 ! application/x-rtp, payload=96 ! rtph264depay ! 
> ffdec_h264 ! ffmpegcolorspace ! 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/blah2.png
What I mean with a seperate pipeline is:

appsrc ! videoconvert ! pngenc ! filesink ...

When you want to take a shot, just get the property "last-sample" from 
the xvimagsink from the monitor client, and pass the caps and buffer 
from the obtained GstSample to the appsrc. Then send EOS, a PNG shall be 
created. This way, you don't need so many key frames per second, and can 
get a shot on a non-keyframe. This obviously require some C writing.
>
> You are right that i am running on 0.10.
> I'm not familiar with appsrc or pushing the buffer. Could you 
> elaborate on what you mean?
appsrc is a element that comes with an API. It's made for application 
that want to insert or extra buffer into/from a pipeline and do their 
own processing.

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-appsrc.html

>
> Merci Beaucoup!!!!!
cordialement,
Nicolas


More information about the gstreamer-devel mailing list