UDP Switch Demo

From RidgeRun Developer Wiki

Introduction

This demo serves as a proof of concept on how to receive two TS MPEG-2 encoded streams over two different UDP ports. The main idea is that when the current receiving port stops receiving data, a timeout is produced switching to the other port.

The demo consists of two parts

  • udp-timeout-demo-rXXX.img: A SD card image to be booted on a DM8148 TIEVM containing the demo to be executed.
  • Host PC pipelines: A couple of GStreamer pipelines to run on the host computer to serve as the stream source.

Setup

Target Board

Follow these steps to setup the test on the DM8148 TIEVM

  • Download the SD card image. Contact support@ridgerun.com to get the demo image.
  • Uncompress the image
~# tar -xvvf udp-timeout-demo-rXXX.img.tar
  • Flash the image to an sdcard
~# sudo dd if=udp-timeout-demo-rXXX.img of=/dev/sdX bs=1M count=512
  • Insert the SD card in the target board and boot the board. The application will start automatically.

Host PC

You will need these two pipelines as stream sources. Here, IPADDR is the IP address of the target board.

  • pipeline1: Bouncing ball pattern
IPADDR=10.251.101.76
gst-launch videotestsrc pattern=18 ! video/x-raw-yuv, width=640, height=480 ! ffenc_mpeg2video ! queue ! mpegtsmux ! queue ! udpsink host=$IPADDR port=5000
  • pipeline2: Color bars pattern
IPADDR=10.251.101.76
gst-launch videotestsrc pattern=0 ! video/x-raw-yuv, width=640, height=480 ! ffenc_mpeg2video ! queue ! mpegtsmux ! queue ! udpsink host=$IPADDR port=5001

Tests

Fallback ports

This test demonstrates how if the listening port stops receiving data, the demo immediately will switch to the other port to receive data.

# Step Expected outcome
1 Boot the board with the demo
2 Start pipeline1 . You should see a bouncing ball pattern on the board HDMI output.
3 Start pipeline2.
4 Stop pipeline1. You should see how the video output changes to a color bar pattern.
5 Start pipeline1.
6 Stop pipeline2. You should see how the video output changes back to the bouncing ball pattern.

Connect to first port with data

This test demonstrates how the demo will reconnect to the first port with data in the case of a temporal lack of data from both ports.

# Step Expected outcome
1 Boot the board with the demo
2 Start pipeline1. You should see a bouncing ball pattern on the board HDMI output.
3 Stop pipeline1. You should see the pattern freezing.
4 Start pipeline2. You should see a color bar pattern.
5 Stop pipeline2. You should see the pattern freezing
6 Start pipeline1. You should see how the video output changes back to the bouncing ball pattern.