Using gstreamer

From ElphelWiki
Revision as of 17:17, 11 March 2009 by Fthiery (talk | contribs) (Command line)
Jump to: navigation, search

Gstreamer and live video processing over the network

Gstreamer is very suited to live video and audio processing, notably for live decoding/encoding, audio muxing.

Requirements

You will need

  • a fairly recent gstreamer distribution, with the rtpjpegdepay plugin
  • a relatively powerful computer to decode real time

Limitations

You will not (at this time) be able to decode the elphel 353 cameras on resolutions > 1920x1080 (which is the highest resolution you can reach with 25 fps anyway), because of the RTP payloading limits, with 25 fps anyway.

If you don't, you'll just have to build it yourself (see this guide from PiTiVi).

Tips

You won't get 25 fps if autoexposure is on and local brightness not high enough: the camera will automatically lower framerate for keeping clear picture. Either lighten up, or play with image settings (notably, gain).

Command line

Displaying

gst-launch -v rtspsrc location=rtsp://elphel:554 ! queue ! rtpjpegdepay ! queue ! jpegdec ! queue ! xvimagesink sync=false

Dumping

mjpeg dumping

gst-launch -v rtspsrc location=rtsp://elphel:554 ! queue ! rtpjpegdepay ! videorate ! capsfilter caps = "image/jpeg, framerate=(fraction)25/1, width=1024, height=768" ! queue ! matroskamux ! filesink location=/tmp/test.mkv

YUV Dumping

gst-launch -v rtspsrc location=rtsp://elphel:554 ! queue ! rtpjpegdepay ! queue ! jpegdec ! queue ! videorate ! capsfilter caps="video/x-raw-yuv, format=(fourcc)I420, width=(int)1024, height=(int)768, framerate=(fraction)25/1" ! queue ! avimux ! filesink location=/tmp/test.avi

Encoding

gst-launch -v rtspsrc location=rtsp://elphel:554 ! queue ! rtpjpegdepay ! queue ! jpegdec ! queue ! videorate ! capsfilter caps="video/x-raw-yuv, format=(fourcc)I420, width=(int)1024, height=(int)768, framerate=(fraction)25/1" ! queue ! theoraenc bitrate=4000 ! queue ! oggmux ! filesink location=/tmp/test1024.ogg

(Note: replace width and height accordingly to your camera setup and your computer's horsepower :p).