Blog Entry

Gstreamer pipeline to make an snapshot of an MJPEG stream

martes, diciembre 09, 2008 by , under , , ,

GStreamer is just amazing, really.
In 10 minutes I was able to cook a pipeline to make an snapshot of an MJPEG stream. COOL.

Here you have:


#!/bin/bash
URL="http://your_url"
gst-launch-0.10 gnomevfssrc name="camsrc" location=$URL ! multipartdemux ! \
jpegdec ! ffmpegcolorspace !pngenc snapshot="true" ! \
filesink location="test.png"


What a nice software.

Edit!

Now I managed to make the pipeline to scale down the image and add borders :)


#!/bin/bash
URL="http://your_url"
gst-launch-0.10 -vvv gnomevfssrc name="camsrc" location=$URL ! multipartdemux ! \
jpegdec ! videobox left="-10" right="-10" top="-10" bottom="-10" fill="0" border-alpha="0.5" !\
ffmpegcolorspace ! videoscale ! \
"video/x-raw-rgb, width=(int)160, height=(int)120" !\
pngenc snapshot="true" ! \
filesink location="test.png"

0 Responses to 'Gstreamer pipeline to make an snapshot of an MJPEG stream'