If we find any errata, we will post it here.
Additional CommandsWe maintain a list of GStreamer commands for the NXP i.MX 8M Plus on GitHub Gists: Flint's cheat-sheet for GStreamer on the NXP i.MX 8M Plus
IntroductionPlease rely on the training document in the download section of this project.
The text that follows is for a quick understanding of what we intend to accomplish during this training. It is a copy of sections 1 and 2 of the training document.
Purpose of this trainingHow to get started processing video is one of the more common topics that our customers ask of us. Back in June of 2021, we wrote a simple training on hackster.io on how to make an IP camera using the i.MX 8M Plus EVK. This has since become an important first training for many of our customers. We now aim to provide our customers with a training that will get them started on many additional aspects of GStreamer.
Difficulty levelThis is a beginner level training, but some basic proficiency in using Linux is expected. If you completed our first training from the spring of 2021, “Avnet MaaXBoard Training 2021 April-May”, then you have the technical skills required for the training provided in this docume
What is the style of this training?We will provide practical examples of GStreamer pipelines that we know to work, and where you can find online material for additional knowledge. We will start out with simple pipelines, and incrementally build on them. For your comprehensive understanding, we will provide nearly identical material for running a pipeline on a PC (your Linux workstation), and on an embedded board such as a MaaXBoard, but with the minor modifications that are needed to make the pipeline work on these different platforms.
Why are we using GStreamer?GStreamer is a framework for creating streaming media applications. The GStreamer framework is designed to make it easy to write applications that handle audio or video or both. The GStreamer core function is to provide a framework for plugins, data flow and media type handling/negotiation. It also provides an API to write applications using the various plugins. NXP provides GStreamer support in their i.MX BSPs (Board Support Packages) and offers plugins for NXP specific hardware support.
Further reading: What is GStreamer?
Why are we using the MaaXBoard?The MaaXBoard is an Avnet-designed embedded board in the profile of a Raspberry Pi.
We are using the original MaaXBoard (NXP i.MX 8M) for this training because we feel that of the three MaaXBoard variants available today, this is the most capable for general usage because it has a HDMI connector for easy connectivity to a computer monitor or television. The MaaXBoards are also more cost effective than a NXP i.MX EVK.
What processors does this training support?All the processors that are part of the i.MX 8 family can be used for this training.
The four main families of the i.MX 8 are:
- i.MX 8 (nothing) – Massively powerful with 6 Cores. Has encoding, decoding, and HDMI. Has hardware video encoding and decoding, and HDMI. An excellent choice for this training.
- i.MX 8X – Automotive focused. Has hardware encoding and decoding, but no HDMI.
- i.MX 8M – Multimedia and Mobile. Extremely popular family for Avnet customers. See individual descriptions in the next list.
- i.MX 8ULP – Ultra Low Power. Does not have hardware encoding or decoding, or HDMI. Not a good choice for this training.
In our experience, most of Avnet’s customers focus on the i.MX 8M family. The devices in the 8M family, in order of their suitability for this training, are:
- i.MX 8M Plus – The best, newest, and most capable. Has both video encoders and decoders. Has HDMI. This is the best choice for this training.
- i.MX 8M – The original 8M. Has hardware video decoders only. Also has HDMI. Not as good a choice as the 8M Plus but is decent.
- i.MX 8M Mini – Has both encoders and decoders. Does not have HDMI. If you have a MIPI-DSI display, then this would be a good choice.
- i.MX 8M Nano – Does not have encoders or decoders or HDMI. This platform is not a good choice for this training.
In summary, the i.MX 8M Plus is the best choice for learning how to use GStreamer because it has HDMI output as well as both video encoders and decoders.
What other hardware is compatible with this training?There are 3 MaaXBoard flavors available from Avnet at the time of this training. In order of their suitability for this training, they are:
- MaaXBoard (nothing) – NXP i.MX 8M – Has an HDMI connector.
- MaaXBoard Mini – NXP i.MX 8M Mini – Does not have an HDMI connector.
- MaaXBoard Nano – NXP i.MX 8M Nano – Does not have an HDMI connector.
Note: There is no MaaXBoard Plus (NXP i.MX 8M plus) which is unfortunate because this would have been the most ideal hardware platform for this training.
Note: The MaaXBoards do not have microphone or headphone jacks, so we will need to rely on USB for audio.
We also recommend using the NXP i.MX 8M family of EVKs (Evaluation Kits) for this training. All NXP EVKs have microphone and headphone jacks so relying on USB audio is not necessary. Here is a list of EVKs in order of their suitability:
- 8MPLUSLPD4-EVK - This is the EVK for the i.MX 8M Plus and is the best hardware to use for this training, and we recommend it far more than using the MaaXBoard.
- MCIMX8M-EVK - This kit uses the same processor (i.MX 8M) as the MaaXBoard we are recommending. This has HDMI.
- 8MMINILPD4-EVK – Although the processor (i.MX 8M Mini) has video encoders and decoders, this kit does not have HDMI, so you will need to rely on a MIPI-DSI display instead of a conventional HDMI monitor or television.
- 8MNANOLPD4-EVK – This processor (i.MX 8M Nano) does not have any video encoders, decoders, or HDMI. With a MIPI-DSI display you would still be able to run this training, but this is not a great choice.
In summary, the i.MX 8M Plus EVK is the best choice for learning how to use GStreamer because it has a HDMI output, microphone, and headphone jacks, and both hardware video encoders and decoders.
How do I learn more about what is provided in this training?In this training, whenever we introduce new elements for the pipeline, we will provide a list of these elements, a definition for them, and a URL to click on to find the GStreamer documentation for that element.
This is a list of online GStreamer content that we recommend you bookmark:
- GStreamer documentation
- GStreamer FAQ
- GStreamer basic tutorials
- i.MX Linux User's Guide, section 7 "Multimedia"
- IMXVPUAPI i.MX VPU Application Programming Interface Linux Reference Manual
- i.MX 8 GStreamer User Guide
- Using GStreamer by Jan Schmidt
This is a list of some digital video education that we recommend you read:
- H.264 AVC Advanced Video Coding (MPEG-4 AVC), MPEG-4 Part 10
- H.265 HEVC High Efficiency Video Coding (HEVC), MPEG-H Part 2
- YCbCr Color space
- Understanding Chroma And Luminance In Digital Imaging
- Chroma subsampling
- Real Time Transport Protocol
Read this section very carefully.
To prepare for this training, make sure that you have the needed documents, software, and other files, and that they are the most recent versions.
Go to the hackster.io project “Learning GStreamer on the MaaXBoard”. Under the “Schematics” section, download the following 4 files:
- MaaXBoard Training Document (this document)
- MaaXBoard Training Cheat Sheet
- MaaXBoard Training Multimedia Files
- MaaXBoard Training Debian SD Card Image
Sections 2, 3, and 4, of this document, are focused on preparing for the training. Any clarification needed in these 3 sections will be placed into the last section, section 9“Additional Information”.
Make sure you have the appropriate hardware needed for this training, and purchase anything you do not have: Section 2“Hardware prerequisites for this training”
Prepare your Linux workstation for the training: Section 3“Prepare your GNU/Linux Workstation”
Prepare the MaaXBoard for the training: Section 4“Prepare the MaaXBoard”
How are the trainings organized?There are 4 trainings in this document, and can be thought of as 2 groups of 2 trainings each:
- The first 2 trainings are performed in isolation, meaning that only the MaaXBoard or the Workstation are needed, but not both.
- The second set of 2 trainings are performed with both the MaaXBoard and the Workstation together and rely on work performed in the first two trainings.
Training 1: Section 5 “GStreamer on the Workstation only” Can be performed on the Workstation only. The MaaXBoard is not involved. This is a good training to take while you wait for newly-purchased hardware to arrive.
Training 2: Section 6 “GStreamer on the MaaXBoard only” This is a copy of Training 1 but is performed on the MaaXBoard instead of the Workstation.
Training 3: Section 7 “GStreamer with MaaXBoard as source and Workstation as sink” This eventually builds an IP camera with the MaaXBoard as the camera source and the Workstation as the display.
Training 4:Section 8 “GStreamer with Workstation as source and MaaXBoard as sink” This is a copy of Training 3, but the roles are reversed. This eventually builds an IP camera with the Workstation as the camera source and the MaaXBoard as the display.
What should I do if I have questions during the training?If you have questions, please visit the hackster.io project “Learning GStreamer on the MaaXBoard”, and under the “Comments” section, write your question to us. Please specify which document section number that issue happens, which command failed, what your result is, and what your setup is.
Hardware prerequisites for this trainingIn this section we will describe the hardware needed for this training.
If you attended our first training from the spring of 2021, “Avnet MaaXBoard Training 2021 April-May”, then you have most of the required hardware and only need to obtain a camera and a headset (speakers and a microphone).
List of required hardwareThis is a list of what we recommend for this training:
Embedded Board
- MaaXBoard or other kit
- We are using Avnet p/n AES-MC-SBC-IMX8M-G
Power for the Embedded Board
- USB Type-C power supply 3A @ 5V
- We are using Avnet p/n AES-ACC-MAAX-PWRUL
Console adapter (TTL to USB)
- We are using Avnet p/n MCU-LINK
- This is not needed if using a NXP EVK because it is already built in to EVKs
Video source
- Ideally a USB Webcam with integrated microphone
- We are using the Logitech C920S (1080p)
- Other webcams that we have tested are listed in section 9.8
Video sink
- Monitor or TV with HDMI input
Audio source
- Ideally integrated into the USB Webcam but you can also use a USB audio headset
- We are using the Logitech G533 wireless USB headset
- NXP EVKs can use the microphone jack and a standard audio headset.
Audio sink
- A USB Audio Headset
- We are using the Logitech G533 wireless USB headset
- NXP EVKs can use the microphone jack and a standard audio headset.
MicroSD card
- 16 GBytes or larger; and as fast as possible.
- Please see section 9.4 “MicroSD Card Selection” for details on microSD selection
- We are using the Samsung 32GB Evo Plus Class 10 Micro SDHC
Adapter for programming the MicroSD card
- Please see section 9.5 for details on the programming adapter
Ethernet cable CAT-5e or better
- Available Ethernet port on your network router or switch
HDMI cable
- We discuss what to look for in section 9.7
Computer workstation or laptop with Ubuntu 20.04 LTS
Search Engine TextThe following text is for search engines, it is a list of GStreamer pipelines created during the training. Do not use this list, instead use the CheatSheet.txt available for download.
$ gst-inspect-1.0 videotestsrc
$ gst-inspect-1.0 autovideosink
$ gst-launch-1.0 videotestsrc ! autovideosink
$ gst-launch-1.0 -h
$ gst-launch-1.0 -v videotestsrc ! autovideosink
$ gst-launch-1.0 -v videotestsrc pattern=ball ! video/x-raw,width=1280,height=720 ! autovideosink
$ ls ~/multimedia/video/*.raw
$ gst-launch-1.0 -v filesrc \
location=~/multimedia/video/sintel_trailer-vga-640x480_30fps.raw \
! rawvideoparse width=640 height=480 framerate=30/1 \
! videoconvert ! videoscale ! autovideosink
$ gst-inspect-1.0 filesrc
$ gst-inspect-1.0 decodebin
$ gst-inspect-1.0 videoconvert
$ gst-inspect-1.0 videoscale
$ ls ~/multimedia/video/*.mp4
$ gst-launch-1.0 -v filesrc
location=~/multimedia/video/sintel_trailer-fwvga-854x480_h264.mp4 \
! decodebin ! videoconvert ! videoscale ! autovideosink
$ gst-launch-1.0 -v filesrc
location=~/multimedia/video/sintel-uhd-3840x1744_h265.mp4 \
! decodebin ! videoconvert ! videoscale ! autovideosink
$ gst-launch-1.0 audiotestsrc ! autoaudiosink
$ pulseaudio start
$ gst-launch-1.0 audiotestsrc ! autoaudiosink
$ gst-device-monitor-1.0 Audio/Sink
$ gst-launch-1.0 audiotestsrc ! pulsesink device=alsa_output.usb-Logitech_G533_Gaming_Headset-00.iec958-stereo
$ export audioout="pulsesink device=alsa_output.usb-Logitech_G533_Gaming_Headset-00.iec958-stereo"
$ echo $audioout
$ gst-launch-1.0 audiotestsrc ! $audioout
$ pactl list sinks
$ pacmd list sinks
$ aplay -l
$ gst-launch-1.0 audiotestsrc ! alsasink device=hw:3
$ ls ~/multimedia/audio/*.wav
$ gst-inspect-1.0 rawaudioparse
$ gst-launch-1.0 -v filesrc \
location=~/multimedia/audio/WhatABeautifulSunset-Angelwing.wav \
! rawaudioparse ! audioconvert ! audioresample ! $audioout
$ ls ~/multimedia/audio/*.mp3
$ gst-launch-1.0 -v filesrc \
location=~/multimedia/audio/DoubleViolinConcerto1stMovement-JSBach.mp3 \
! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! $audioout
$ gst-launch-1.0 playbin uri=file:~/multimedia/video/sintel-uhd-3840x1744_h265.mp4
$ gst-play-1.0 ~/multimedia/video/sintel-uhd-3840x1744_h265.mp4
$ gst-play-1.0 help
$ gst-inspect-1.0 qtdemux
$ gst-inspect-1.0 queue
$ gst-inspect-1.0 audioconvert
$ gst-inspect-1.0 audioresample
$ gst-inspect-1.0 autoaudiosink
$ gst-launch-1.0 -v filesrc \
location= ~/multimedia/video/sintel-uhd-3840x1744_h265.mp4 \
! qtdemux name=demux demux.audio_0 ! queue ! decodebin \
! audioconvert ! audioresample ! $audioout demux.video_0 \
! queue ! decodebin ! videoconvert ! videoscale ! autovideosink
$ gst-launch-1.0 autoaudiosrc ! autoaudiosink
$ pulseaudio start
$ gst-launch-1.0 audiotestsrc ! autoaudiosink
$ gst-device-monitor-1.0 Audio/Source
$ gst-launch-1.0 pulsesrc \
device=alsa_input.usb-Logitech_G533_Gaming_Headset-00.mono-fallback \
! $audioout
$ export audioin="pulsesrc device=alsa_input.usb-Logitech_G533_Gaming_Headset-00.mono-fallback"
$ echo $audioin
$ gst-launch-1.0 $audioin ! $audioout
$ pactl list sources
$ pacmd list sources
$ arecord -l
$ gst-launch-1.0 alsasrc device=hw:3 ! autoaudiosink
$ gst-launch-1.0 alsasrc device=hw:4 ! autoaudiosink
$ dmesg
$ ls -ltrh /dev/video*
$ /usr/bin/ls -ltrh /dev/video*
$ v4l2-ctl help
$ v4l2-ctl help-all
$ v4l2-ctl list-devices
$ v4l2-ctl device=/dev/video2 all
$ v4l2-ctl device=/dev/video3 all
$ v4l2-ctl list-formats
$ gst-device-monitor-1.0 Video/Source
$ gst-launch-1.0 -v v4l2src device=/dev/video2 ! autovideosink
$ export videoin="v4l2src device=/dev/video2" ; echo $videoin
$ gst-launch-1.0 -v $videoin \
! video/x-raw,width=640,height=480 ! autovideosink
$ gst-launch-1.0 -v $videoin \
! video/x-raw,width=640,height=480,framerate=10/1 ! autovideosink
# gst-launch-1.0 -v videotestsrc pattern=ball \
! video/x-raw,width=640,height=480 ! autovideosink
# htop
# gst-launch-1.0 -v videotestsrc pattern=ball \
! video/x-raw,width=1920,height=1080 ! autovideosink
# ls ~/multimedia/video/*.raw
# gst-launch-1.0 -v filesrc \
location=~/multimedia/video/sintel_trailer-qvga-320x240_30fps.raw \
! rawvideoparse width=320 height=240 framerate=30/1 \
! videoconvert ! videoscale ! autovideosink
# gst-launch-1.0 -v filesrc \
location=~/multimedia/video/sintel_trailer-vga-640x480_30fps.raw \
! rawvideoparse width=640 height=480 framerate=30/1 \
! videoconvert ! videoscale ! autovideosink
# gst-launch-1.0 -v filesrc \
location=~/multimedia/video/sintel_trailer-fhd-1920x1080_30fps.raw \
! rawvideoparse width=1920 height=1080 framerate=30/1 \
! videoconvert ! videoscale ! autovideosink
# ls ~/multimedia/video/*.mp4
# gst-launch-1.0 -v filesrc \
location=~/multimedia/video/sintel_trailer-fwvga-854x480_h264.mp4 \
! decodebin ! videoconvert ! videoscale ! autovideosink
# htop
# gst-launch-1.0 -v filesrc \
location=~/multimedia/video/sintel-uhd-3840x1744_h265.mp4 \
! decodebin ! videoconvert ! videoscale ! autovideosink
# gst-launch-1.0 audiotestsrc ! autoaudiosink
# pulseaudio start
# gst-launch-1.0 audiotestsrc ! autoaudiosink
# gst-device-monitor-1.0 Audio/Sink
# gst-launch-1.0 audiotestsrc ! pulsesink device=alsa_output.usb-Logitech_G533_Gaming_Headset-00.analog-stereo
# export audioout="pulsesink device=alsa_output.usb-Logitech_G533_Gaming_Headset-00.analog-stereo"
# echo $audioout
# gst-launch-1.0 audiotestsrc ! $audioout
# ls ~/multimedia/audio/*.wav
# gst-launch-1.0 -v filesrc \
location=~/multimedia/audio/WhatABeautifulSunset-Angelwing.wav \
! rawaudioparse ! audioconvert ! audioresample ! autoaudiosink
# ls ~/multimedia/audio/*.mp3
# gst-launch-1.0 -v filesrc \
location=~/multimedia/audio/DoubleViolinConcerto1stMovement-JSBach.mp3 \
! mpegaudioparse ! mpg123audiodec ! audioconvert ! audioresample ! autoaudiosink
# gst-launch-1.0 playbin uri=file:~/multimedia/video/sintel-uhd-3840x1744_h265.mp4
# gst-launch-1.0 -v filesrc \
location= ~/multimedia/video/sintel-uhd-3840x1744_h265.mp4 \
! qtdemux name=demux demux.audio_0 ! queue ! decodebin \
! audioconvert ! audioresample ! autoaudiosink demux.video_0 \
! queue ! decodebin ! videoconvert ! videoscale ! autovideosink
# ls -ltrh /dev/video*
# v4l2-ctl list-devices
# v4l2-ctl device=/dev/video1 all
# v4l2-ctl list-formats
# gst-device-monitor-1.0 Video/Source
# export videoin="v4l2src device=/dev/video1" ; echo $videoin
# gst-launch-1.0 -v $videoin ! autovideosink
# gst-launch-1.0 -v $videoin io-mode=2 ! autovideosink
# gst-launch-1.0 -v $videoin io-mode=2 \
! video/x-raw,width=640,height=480 ! autovideosink
# gst-launch-1.0 -v $videoin io-mode=2 \
! video/x-raw,width=640,height=480,framerate=10/1 ! autovideosink
# v4l2-ctl list-devices
# v4l2-ctl device=/dev/video2 all
# gst-launch-1.0 $videoin ! autovideosink
# gst-launch-1.0 $videoin io-mode=2 ! autovideosink
# export videoin="v4l2src device=/dev/video1 io-mode=2"; echo $videoin
# arecord -l
# export audioin="alsasrc device=hw:1"; echo $audioin
$ gst-launch-1.0 videotestsrc ! autovideosink
$ aplay -l
$ export audioout="alsasink device=hw:3"; echo $audioout
$ gst-launch-1.0 audiotestsrc ! $audioout
# ifconfig
# ip a
$ ifconfig
$ ip a
# export workstation="192.168.1.61"; echo $workstation
# export maaxboard="192.168.1.80"; echo $maaxboard
# ping $workstation -c 1
$ export maaxboard="192.168.1.80"; echo $maaxboard
$ export workstation="192.168.1.61"; echo $workstation
$ ping $maaxboard -c 1
# export videoin="v4l2src device=/dev/video1 io-mode=2"; \
echo $videoin; \
export audioin="alsasrc device=hw:1"; echo $audioin; \
export workstation="192.168.1.61"; echo workstation=$workstation; \
export maaxboard="192.168.1.80"; echo maaxboard=$maaxboard; \
ping $workstation -c 1
$ export export audioout="alsasink device=hw:3"; echo $audioout; \
export maaxboard="192.168.1.80"; echo maaxboard=$maaxboard; \
export workstation="192.168.1.61"; echo workstation=$workstation; \
ping $maaxboard -c 1
# export caps="video/x-raw, width=320, height=240"; echo $caps
# gst-launch-1.0 -v videotestsrc ! $caps ! rtpvrawpay ! queue ! udpsink host=$workstation
$ export caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, sampling=(string)YCbCr-4:2:0, depth=(string)8, width=(string)320, height=(string)240, colorimetry=(string)BT601-5, payload=(int)96, a-framerate=(string)30"; echo $caps
$ gst-launch-1.0 -v udpsrc caps="$caps" \
! rtpjitterbuffer ! queue ! rtpvrawdepay ! autovideosink
$ wireshark
ip.src==<WORKSTATION> && ip.dst==<MAAXBOARD> && udp.port==<PORT>
ip.src==192.168.1.80 && ip.dst==192.168.1.61 && udp.port==5004
# export caps="video/x-raw, width=1024, height=768"; echo $caps
# gst-launch-1.0 -v videotestsrc ! $caps \
! rtpvrawpay ! queue ! udpsink host=$workstation
$ export caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, sampling=(string)YCbCr-4:2:0, depth=(string)8, width=(string)1024, height=(string)768, colorimetry=(string)BT709-2, payload=(int)96, a-framerate=(string)30"; echo $caps
$ gst-launch-1.0 -v udpsrc caps="$caps" \
! rtpjitterbuffer ! queue ! rtpvrawdepay ! autovideosink
# export caps="video/x-raw, width=1024, height=768"
# gst-launch-1.0 -v videotestsrc ! $caps \
! rtpvrawpay mtu=6000 ! queue ! udpsink host=$workstation
# export caps="video/x-raw, width=320, height=240"; echo $caps
# gst-launch-1.0 -v videotestsrc ! $caps \
! videoconvert ! x264enc ! video/x-h264,profile=main \
! h264parse ! rtph264pay ! queue ! udpsink host=$workstation
$ export caps="application/x-rtp, encoding-name=H264, payload=96"; echo $caps
$ gst-launch-1.0 -v udpsrc caps="$caps" ! rtpjitterbuffer \
! rtph264depay ! h264parse ! decodebin ! videoconvert ! autovideosink
# export caps="video/x-raw, width=1280, height=720"; echo $caps
# gst-launch-1.0 -v videotestsrc ! $caps ! videoconvert \
! x264enc ! video/x-h264,profile=main ! h264parse \
! rtph264pay ! queue ! udpsink host=$workstation
$ export caps="application/x-rtp, encoding-name=H264, payload=96"; echo $caps
$ gst-launch-1.0 -v udpsrc caps="$caps" \
! rtpjitterbuffer ! rtph264depay ! h264parse \
! decodebin ! videoconvert ! autovideosink
$ gst-launch-1.0 -v udpsrc caps="$caps" \
! rtpjitterbuffer ! rtph264depay ! h264parse \
! decodebin ! videoconvert ! fpsdisplaysink
# gst-launch-1.0 -v audiotestsrc ! audioconvert ! rtpL16pay ! udpsink host=$workstation
$ export caps="application/x-rtp, media=(string)audio, clock-rate=(int)44100, encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1, payload=(int)96"; echo $caps
$ gst-launch-1.0 -v udpsrc caps="$caps" ! rtpL16depay \
! queue ! audioconvert ! $audioout sync=false
# gst-launch-1.0 -ve $audioin ! audioconvert ! rtpL16pay ! udpsink host=$workstation
$ export caps="application/x-rtp, media=(string)audio, clock-rate=(int)32000, encoding-name=(string)L16, encoding-params=(string)2, channels=(int)2, payload=(int)96"; echo $caps
$ gst-launch-1.0 -v udpsrc caps="$caps" ! rtpL16depay \
! queue ! audioconvert ! $audioout sync=false
# gst-launch-1.0 -ve $audioin ! audioconvert ! avenc_ac3 \
! mpegtsmux ! rtpmp2tpay ! udpsink host=$workstation sync=false
$ export caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T, payload=(int)33"; echo $caps
$ gst-launch-1.0 -v udpsrc caps="$caps" ! rtpjitterbuffer \
! rtpmp2tdepay ! tsparse ! decodebin \
! audioconvert ! $audioout sync=false
# gst-launch-1.0 -v mpegtsmux name=mux alignment=7 ! rtpmp2tpay ! udpsink host=$workstation sync=false \
compositor name=videomix ! x264enc bitrate=10000 tune=zerolatency ! video/x-h264, profile=baseline ! queue ! mux. \
audiomixer name=audiomix ! audioconvert ! audioresample ! avenc_ac3 ! queue ! mux. \
videotestsrc is-live=true ! "video/x-raw, width=320, height=240" ! videomix. \
audiotestsrc is-live=true ! audiomix.
$ export caps="application/x-rtp"; echo $caps
$ gst-launch-1.0 -v udpsrc caps="$caps" ! \
rtpmp2tdepay ! tsparse ! tsdemux name=demux \
demux. ! queue ! decodebin ! videoconvert ! autovideosink sync=false \
demux. ! queue leaky=1 ! decodebin ! audioconvert ! $audioout sync=false
# export caps="video/x-raw, width=320, height=240, framerate=30/1"; echo $caps
# gst-launch-1.0 -v $videoin ! $caps ! videoconvert \
! $caps ! rtpvrawpay ! queue ! udpsink host=$workstation
$ export caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, sampling=(string)YCbCr-4:2:2, depth=(string)8, width=(string)320, height=(string)240, colorimetry=(string)BT601-5, payload=(int)96, a-framerate=(string)30"; echo $caps
$ gst-launch-1.0 -v udpsrc caps="$caps" ! rtpjitterbuffer \
! queue ! rtpvrawdepay ! videoconvert ! autovideosink
# export caps="video/x-raw, width=320, height=240, framerate=30/1"; echo $caps
# gst-launch-1.0 -v $videoin ! $caps ! videoconvert ! $caps \
! rtpvrawpay ! rtpstreampay ! queue \
! tcpserversink host=$maaxboard port=5000 sync=false async=false
$ export caps="application/x-rtp-stream, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, sampling=(string)YCbCr-4:2:2, depth=(string)8, width=(string)320, height=(string)240, colorimetry=(string)BT601-5, payload=(int)96, a-framerate=(string)30"; echo $caps
$ gst-launch-1.0 -v tcpclientsrc host=$maaxboard port=5000 \
! $caps ! queue ! rtpstreamdepay ! rtpvrawdepay \
! videoconvert ! autovideosink sync=false
# export caps="video/x-raw, width=320, height=240, framerate=30/1"; echo $caps
# gst-launch-1.0 -ve $videoin ! $caps ! videoconvert \
! x264enc bitrate=10000 tune=zerolatency \
! video/x-h264, profile=baseline ! mpegtsmux \
! rtpmp2tpay ! udpsink host=$workstation sync=false
$ export caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T, payload=(int)33"; echo $caps
$ gst-launch-1.0 -ve udpsrc caps="$caps" ! rtpjitterbuffer \
! rtpmp2tdepay ! tsparse ! tsdemux ! decodebin \
! videoconvert ! autovideosink sync=false
# export caps="video/x-raw, width=320, height=240, framerate=30/1"; echo $caps
# gst-launch-1.0 -ve mpegtsmux name=mux alignment=7 ! rtpmp2tpay ! udpsink host=$workstation sync=false \
$ export caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T, payload=(int)33"; echo $caps
$ gst-launch-1.0 -v udpsrc caps="$caps" ! \
rtpjitterbuffer ! rtpmp2tdepay ! tsparse ! tsdemux name=demux \
demux. ! queue ! decodebin ! videoconvert ! autovideosink sync=false \
demux. ! queue leaky=1 ! decodebin ! audioconvert ! $audioout sync=false
$ v4l2-ctl list-devices
$ v4l2-ctl device=/dev/video2 all
$ export videoin="v4l2src device=/dev/video2"; echo $videoin
$ gst-launch-1.0 $videoin ! autovideosink
$ arecord -l
$ export audioout="alsasrc device=hw:1"; echo $audioout
# gst-launch-1.0 videotestsrc ! autovideosink
# aplay -l
# export audioout="alsasink device=hw:1"; echo $audioout
# gst-launch-1.0 audiotestsrc ! $audioout
$ export videoin="v4l2src device=/dev/video2"; echo $videoin; \
export audioin="alsasrc device=hw:1"; echo $audioout; \
export maaxboard="192.168.1.80"; echo maaxboard=$maaxboard; \
export workstation="192.168.1.61"; echo workstation=$workstation; \
ping $maaxboard -c 1
# export audioout="alsasink device=hw:1"; echo $audioout; \
export workstation="192.168.1.61"; echo workstation=$workstation; \
export maaxboard="192.168.1.80"; echo maaxboard=$maaxboard; \
ping $workstation -c 1
$ export caps="video/x-raw, width=320, height=240"; echo $caps
$ gst-launch-1.0 -v videotestsrc ! $caps ! rtpvrawpay ! queue ! udpsink host=$maaxboard
# export caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, sampling=(string)YCbCr-4:2:0, depth=(string)8, width=(string)320, height=(string)240, colorimetry=(string)BT601-5, payload=(int)96, a-framerate=(string)30"; echo $caps
# gst-launch-1.0 -v udpsrc caps="$caps" ! rtpjitterbuffer \
! queue ! rtpvrawdepay ! autovideosink
$ export caps="video/x-raw, width=1024, height=768"; echo $caps
$ gst-launch-1.0 -v videotestsrc ! $caps ! rtpvrawpay ! queue ! udpsink host=$maaxboard
# export caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, sampling=(string)YCbCr-4:2:0, depth=(string)8, width=(string)1024, height=(string)768, colorimetry=(string)BT709-2, payload=(int)96, a-framerate=(string)30"; echo $caps
# gst-launch-1.0 -v udpsrc caps="$caps" ! rtpjitterbuffer \
! queue ! rtpvrawdepay ! autovideosink
$ export caps="video/x-raw, width=1024, height=768"
$ gst-launch-1.0 -v videotestsrc ! $caps ! rtpvrawpay mtu=6000 \
! queue ! udpsink host=$maaxboard
$ export caps="video/x-raw, width=320, height=240"; echo $caps
$ gst-launch-1.0 -v videotestsrc ! $caps ! videoconvert \
! x264enc ! video/x-h264,profile=main ! h264parse \
! rtph264pay ! queue ! udpsink
# export caps="application/x-rtp, encoding-name=H264, payload=96"; echo $caps
# gst-launch-1.0 -v udpsrc caps="$caps" ! rtpjitterbuffer \
! rtph264depay ! h264parse ! decodebin ! videoconvert ! autovideosink
$ export caps="video/x-raw, width=1920, height=1080"; echo $caps
$ gst-launch-1.0 -v videotestsrc ! $caps ! videoconvert \
! x264enc ! video/x-h264,profile=main ! h264parse ! rtph264pay \
! queue ! udpsink host=$maaxboard
# export caps="application/x-rtp, encoding-name=H264, payload=96"; echo $caps
# gst-launch-1.0 -v udpsrc caps="$caps" ! rtpjitterbuffer \
! rtph264depay ! h264parse ! decodebin ! videoconvert ! autovideosink
$ gst-launch-1.0 -v audiotestsrc ! audioconvert ! rtpL16pay ! udpsink host=$maaxboard
# export caps="application/x-rtp, media=(string)audio, clock-rate=(int)44100, encoding-name=(string)L16, encoding-params=(string)1, channels=(int)1, payload=(int)96"; echo $caps
# gst-launch-1.0 -v udpsrc caps="$caps" ! rtpL16depay \
! queue ! audioconvert ! $audioout sync=false
$ gst-launch-1.0 -ve $audioin ! audioconvert ! rtpL16pay ! udpsink host=$maaxboard
# export caps="application/x-rtp, media=(string)audio, clock-rate=(int)32000, encoding-name=(string)L16, encoding-params=(string)2, channels=(int)2, payload=(int)96"; echo $caps
# gst-launch-1.0 -v udpsrc caps="$caps" ! rtpL16depay \
! queue ! audioconvert ! $audioout sync=false
$ gst-launch-1.0 -ve $audioin ! audioconvert ! avenc_ac3 \
! mpegtsmux ! rtpmp2tpay ! udpsink host=$maaxboard sync=false
# export caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T, payload=(int)33"; echo $caps
# gst-launch-1.0 -v udpsrc caps="$caps" ! rtpjitterbuffer \
! rtpmp2tdepay ! tsparse ! decodebin ! audioconvert \
! $audioout sync=false
$ gst-launch-1.0 -v mpegtsmux name=mux alignment=7 ! rtpmp2tpay ! udpsink host=$maaxboard sync=false \
compositor name=videomix ! x264enc bitrate=10000 tune=zerolatency ! video/x-h264, profile=baseline ! queue ! mux. \
audiomixer name=audiomix ! audioconvert ! audioresample ! avenc_ac3 ! queue ! mux. \
videotestsrc is-live=true ! "video/x-raw, width=320, height=240" ! videomix. \
audiotestsrc is-live=true ! audiomix.
# export caps="application/x-rtp"; echo $caps
# gst-launch-1.0 -v udpsrc caps="$caps" ! \
rtpmp2tdepay ! tsparse ! tsdemux name=demux \
demux. ! queue ! decodebin ! videoconvert ! autovideosink sync=false \
demux. ! queue leaky=1 ! decodebin ! audioconvert ! $audioout sync=false
$ export caps="video/x-raw, width=320, height=240, framerate=30/1"; echo $caps
$ gst-launch-1.0 -v $videoin ! $caps ! videoconvert ! $caps \
! rtpvrawpay ! queue ! udpsink host=$maaxboard
# export caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, sampling=(string)YCbCr-4:2:2, depth=(string)8, width=(string)320, height=(string)240, colorimetry=(string)BT601-5, payload=(int)96, a-framerate=(string)30"; echo $caps
# gst-launch-1.0 -v udpsrc caps="$caps" ! rtpjitterbuffer ! queue \
! rtpvrawdepay ! videoconvert ! autovideosink
$ export caps="video/x-raw, width=320, height=240, framerate=30/1"; echo $caps
$ gst-launch-1.0 -v $videoin ! $caps ! videoconvert ! $caps \
! rtpvrawpay ! rtpstreampay ! queue \
! tcpserversink host=$workstation port=5000 sync=false async=false
# export caps="application/x-rtp-stream, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, sampling=(string)YCbCr-4:2:2, depth=(string)8, width=(string)320, height=(string)240, colorimetry=(string)BT601-5, payload=(int)96, a-framerate=(string)30"; echo $caps
# gst-launch-1.0 -v tcpclientsrc host=$workstation port=5000 \
! $caps ! queue ! rtpstreamdepay ! rtpvrawdepay \
! videoconvert ! autovideosink sync=false
$ export caps="video/x-raw, width=320, height=240, framerate=30/1"; echo $caps
$ gst-launch-1.0 -ve $videoin ! $caps ! videoconvert \
! x264enc bitrate=10000 tune=zerolatency \
! video/x-h264, profile=baseline ! mpegtsmux \
! rtpmp2tpay ! udpsink host=$maaxboard sync=false
# export caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T, payload=(int)33"; echo $caps
# gst-launch-1.0 -ve udpsrc caps="$caps" ! rtpjitterbuffer \
! rtpmp2tdepay ! tsparse ! tsdemux ! decodebin \
! videoconvert ! autovideosink sync=false
$ export caps="video/x-raw, width=320, height=240, framerate=30/1"; echo $caps
$ gst-launch-1.0 -ve mpegtsmux name=mux alignment=7 \
! rtpmp2tpay ! udpsink host=$maaxboard sync=false \
$videoin ! $caps ! videoconvert ! x264enc bitrate=10000 tune=zerolatency \
! video/x-h264, profile=baseline ! queue ! mux. \
$audioin ! audioconvert ! audioresample ! avenc_ac3 \
! queue ! mux.
# export caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)MP2T, payload=(int)33"; echo $caps
# gst-launch-1.0 -v udpsrc caps="$caps" ! \
rtpjitterbuffer ! rtpmp2tdepay ! tsparse ! tsdemux name=demux \
demux. ! queue ! decodebin ! videoconvert ! autovideosink sync=false \
demux. ! queue leaky=1 ! decodebin ! audioconvert ! $audioout sync=false
END
Comments
Please log in or sign up to comment.