Transfer VP8 video stream over UDP using GStreamer


The UDP protocol does not guarantee that datagrams will be sent in the right order or even that they will arrive, hence the need for a protocol like RTP/RTCP. If you do want to use UDP then this post shows the commands required to move VP8 video.

Sending End

Execute

gst-launch -v videotestsrc horizontal-speed=1 ! vp8enc ! udpsink host=localhost port=9001

Receiving End

Execute

gst-launch udpsrc port=9001 reuse=true caps=video/x-vp8,width=320,height=240,framerate=30/1,pixel-aspect-ratio=1/1 ! vp8dec ! ffmpegcolorspace ! autovideosink

You can run several instances of the command above, but only the last instance plays, the previous instances stop playing. Once you kill the last instance the one before that resumes video playback. I haven’t figured out why, but I suspect it has go to do with how UDP messages are delivered.

You can do the same with an audio stream, using RTP. I am not aware of how that may be done using raw UDP.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s