GStreamer, RTP and live streaming
I wanted to stream a live video feed to the Internet, and have some Flash player available on the web that would make my live stream available.
I’ve searched services, or ways to do that. I’ve found ustream.tv and justin.tv.
After trying to use my Ubuntu machine to stream video out there (with a simple V4L2 camera), I’ve had much trouble (ustream.tv still doesn’t work) but worked out a way to effectively stream a 2 hours ceremony directly on the web, with 2 computers, a wireless router, a Mini-DV camera, a simple sound card, GStreamer and the justin.tv web service.
Here are the pieces I’ve used (and the references that helped me out):
- GStreamer 0.10
- dv1394src and plenty of other useful elements
- RTP support through GstRtpBin
- Python and the GStreamer python bindings
- WebCamStudio: for testing, finally I didn’t use it
- vloopback: to pipe some video content into a virtual V4L camera device (which Flash apps can read). You can take it from the WebCamStudio website.
- mjpegtools_yuv_to_v4l-0.2.tgz at http://panteltje.com/panteltje/mcamip/
- PulseAudio to stream audio to the Flash app
- http://www.justin.tv/ web service
Website references I’ve found useful to understand the whole GStreamer thing and especially the RTP parts:
- http://www.jejik.com/articles/2007/01/streaming_audio_over_tcp_with_python-gstreamer/
- http://blog.nicolargo.com/2009/02/jai-streame-avec-gstreamer.html
- Very useful (thanks wtay):
- Absolutely not useful (even though Google will make you think it’s the best result):
- http://www.jonobacon.org/2006/11/03/gstreamer-dynamic-pads-explained/
- http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-caps-api.html
- http://marlenehe.wordpress.com/2009/06/03/mercredi-3-juin-2009/
- And finally, especially for the PulseAudio part: http://ronnietucker.co.uk/blog/broadcasting-video-from-ubuntu-to-ustream-with-webcamstudio/
Here are the scripts I’ve used. First the video_streamer.py file:
