3-6 Performing Stream Tests on RZ/G2L
In this tutorial, we will perform streaming tests on RZ/G2L with hardware-specific encoder/decoder adjustments. Then we will try to stream videos from RZ/G2L to PC using GStreamer commands.
Basic Test
First, we can perform a basic test using a video test source. On the terminal of RZ/G2L (or serial monitor), run the following command:
gst-launch-1.0 videotestsrc ! autovideosink
Then, ensure the equirectangular filter is working properly by running:
gst-launch-1.0 videotestsrc ! video/x-raw,width=1920,height=1080 ! videoconvert ! equirectangular ! videoconvert ! autovideosink
The output should look like below:
Streaming Test
Now, we will stream from RZ/G2L to mini PC. On the terminal of Ubuntu 22.04, run the following command to wait for h.264 stream from RZ/G2L:
gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,media=video,clock-rate=90000,encoding-name=H264,payload=96 ! rtph264depay ! avdec_h264 ! autovideosink
Run the 3 scripts below, each with different sets of plugins:
gst-launch-1.0 -e filesrc location=./endo01.mp4 ! qtdemux ! queue ! h264parse ! video/x-h264, stream-format=avc,alignment=au ! rtph264pay pt=96 name=pay0 config-interval=3 mtu=6000 ! udpsink host=your-ip-address port=5000
gst-launch-1.0 -e filesrc location=./endo01.mp4 ! qtdemux ! queue ! h264parse ! omxh264dec ! omxh264enc ! rtph264pay config-interval=10 ! udpsink host=your-ip-address port=5000
gst-launch1.0 -e filesrc location=./endo01.mp4 ! h264parse ! omxh264dec ! videoconvert ! equirectangular ! videoconvert ! omxh264enc ! rtph264pay config-interval=10 ! udpsink host=your-ip-address port=5000
Note how different plugins may have an impact to the performance of the video streaming(eg. latency, frame rates, resolution).
Remember to change the IP address to the assigned IP on your RZ/G2L board!
Local Streaming Test
gst-launch-1.0 -e filesrc location=./endo01.mp4 ! qtdemux ! queue ! h264parse ! omxh264dec ! videoconvert ! equirectangular ! videoconvert ! autovideosink
Since the execution speed is slow, some frames could be dropped during the playback. A longer mp4 test file is recommended as it would be better for demonstration purposes.