i.MX 8 - RTSP Streaming Support

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX 8 - RTSP Streaming Support

i.MX 8 - RTSP Streaming Support

Recently I published this i.MX Dev Blog post about the Gateworks plugin gst-variable-rtsp-server support for i.MX 6.

Now, you can check how to use it on i.MX 8 SoCs as well.

1. Preparing the image

In order to use gst-variable-rtsp-server plugin, prepare your machine and distro:


Add the following line to conf/local.conf:

IMAGE_INSTALL_append += "gstreamer1.0-rtsp-server gst-variable-rtsp-server"

Download the attached patch and apply it by doing:

$ cd <yocto_path>/sources/meta-fsl-bsp-release/
$ git am ~/Download/0001-Add-RTSP-support-for-i.MX-8-L4.14.78_ga1.0.0-or-olde.patch

Note: This patch is not necessary for L4.14.98_ga2.0.0 BSP!

Then, build the image with bitbake and deploy it to the SD card.

2. Video Test Source Example

Server

$ gst-variable-rtsp-server -p 9001 -u "videotestsrc ! v4l2h264enc ! rtph264pay name=pay0 pt=96"

Client


2. Camera Example

Server

$ gst-variable-rtsp-server -p 9001 -u "v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480 ! v4l2h264enc ! rtph264pay name=pay0 pt=96"

Client


In order to use VLC or other application as the client, just enter the URL as shown in the image below:vlc_rtsp_example.png

Attachments
Comments
IMAGE_INSTALL_append += "gstreamer1.0-rtsp-server gst-variable-rtsp-server"

Correct me if I am wrong but one will also require adding gstreamer1.0-plugins-good and gstreamer1.0-plugins-bad plugins as you are using v4l2h264enc in your example.

So the above line should be changed to 

IMAGE_INSTALL_append += "gstreamer1.0-rtsp-server gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gst-variable-rtsp-server"

 

%3CLINGO-SUB%20id%3D%22lingo-sub-1121720%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3Ei.MX%208%20-%20RTSP%20Streaming%20Support%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1121720%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ERecently%26nbsp%3BI%20published%20this%20%3CA%20href%3D%22https%3A%2F%2Fimxdev.gitlab.io%2Ftutorial%2FGatework_RTSP_variable_is_supported_by_Yocto_Community_now%2F%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3Ei.MX%20Dev%20Blog%20post%3C%2FA%3E%20about%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FGateworks%2Fgst-gateworks-apps%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3EGateworks%20plugin%3C%2FA%3E%26nbsp%3B%3CSTRONG%3Egst-variable-rtsp-server%3C%2FSTRONG%3E%20support%20for%20i.MX%206.%3C%2FP%3E%3CP%3ENow%2C%20you%20can%20check%20how%20to%20use%20it%20on%20i.MX%208%20SoCs%20as%20well.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22border%3A%200px%3B%20font-weight%3A%20bold%3B%22%3E%3CSTRONG%3E1.%20Preparing%20the%20image%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIn%20order%20to%20use%20%3CSTRONG%3Egst-variable-rtsp-server%3C%2FSTRONG%3E%20plugin%2C%20prepare%20your%20machine%20and%20distro%3A%3C%2FP%3E%3CPRE%20style%3D%22color%3A%20%23000000%3B%20background-color%3A%20%23f9f9f9%3B%20border%3A%201px%20dashed%20%232f6fab%3B%20font-size%3A%2012.7px%3B%20padding%3A%201em%3B%22%3E%3CCODE%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%20font-size%3A%2012.7px%3B%22%3E%0A%3C%2FCODE%3E%3C%2FPRE%3E%3CP%20style%3D%22color%3A%20%2351626f%3B%20background-color%3A%20%23ffffff%3B%20border%3A%200px%3B%22%3EAdd%20the%20following%20line%20to%20%3CEM%3Econf%2Flocal.conf%3A%3C%2FEM%3E%3C%2FP%3E%3CPRE%20style%3D%22color%3A%20%23000000%3B%20background-color%3A%20%23f9f9f9%3B%20border%3A%201px%20dashed%20%232f6fab%3B%20font-size%3A%2012.7px%3B%20padding%3A%201em%3B%22%3E%3CCODE%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%20font-size%3A%2012.7px%3B%22%3EIMAGE_INSTALL_append%20%2B%3D%20%22%3CSPAN%20style%3D%22color%3A%20%2351626f%3B%20background-color%3A%20%23f6f6f6%3B%22%3Egstreamer1.0-rtsp-server%20gst-variable-rtsp-server%3C%2FSPAN%3E%22%3C%2FCODE%3E%3C%2FPRE%3E%3CP%20style%3D%22border%3A%200px%3B%22%3EDownload%20the%20attached%20patch%20and%20apply%20it%20by%20doing%3A%3C%2FP%3E%3CPRE%20style%3D%22color%3A%20%23000000%3B%20background-color%3A%20%23f9f9f9%3B%20border%3A%201px%20dashed%20%232f6fab%3B%20font-size%3A%2012.7px%3B%20padding%3A%201em%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%22%3E%24%20cd%20%3CYOCTO_PATH%3E%2Fsources%2Fmeta-fsl-bsp-release%2F%3C%2FYOCTO_PATH%3E%3C%2FSPAN%3E%0A%3CSPAN%20style%3D%22color%3A%20%233d3d3d%3B%22%3E%24%20git%20am%20~%2FDownload%2F0001-Add-RTSP-support-for-i.MX-8-L4.14.78_ga1.0.0-or-olde.patch%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%20style%3D%22border%3A%200px%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22border%3A%200px%3B%22%3E%3CSPAN%20style%3D%22border%3A%200px%3B%20font-weight%3A%20bold%3B%20font-size%3A%2012px%3B%22%3E%3CEM%3E%3CSTRONG%3ENote%3A%20This%20patch%20is%20not%20necessary%20for%20L4.14.98_ga2.0.0%20BSP!%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22color%3A%20%2351626f%3B%20background-color%3A%20%23ffffff%3B%20border%3A%200px%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22color%3A%20%2351626f%3B%20background-color%3A%20%23ffffff%3B%20border%3A%200px%3B%22%3EThen%2C%20build%20the%20image%20with%20%3CEM%3Ebitbake%3C%2FEM%3E%20and%20deploy%20it%20to%20the%20SD%20card.%3C%2FP%3E%3CP%20style%3D%22color%3A%20%2351626f%3B%20background-color%3A%20%23ffffff%3B%20border%3A%200px%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22color%3A%20%2351626f%3B%20background-color%3A%20%23ffffff%3B%20border%3A%200px%3B%22%3E%3CSPAN%20style%3D%22border%3A%200px%3B%20font-weight%3A%20bold%3B%22%3E%3CSTRONG%3E2.%20Video%20Test%20Source%20Example%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22color%3A%20%2351626f%3B%20background-color%3A%20%23ffffff%3B%20border%3A%200px%3B%22%3E%3CEM%3EServer%3C%2FEM%3E%3C%2FP%3E%3CPRE%20style%3D%22color%3A%20%23000000%3B%20background-color%3A%20%23f9f9f9%3B%20border%3A%201px%20dashed%20%232f6fab%3B%20font-size%3A%2012.7px%3B%20padding%3A%201em%3B%22%3E%24%20gst-variable-rtsp-server%20-p%209001%20-u%20%22videotestsrc%20!%20v4l2h264enc%20!%20rtph264pay%20name%3Dpay0%20pt%3D96%22%3CCODE%3E%0A%3C%2FCODE%3E%3C%2FPRE%3E%3CP%20style%3D%22color%3A%20%2351626f%3B%20background-color%3A%20%23ffffff%3B%20border%3A%200px%3B%22%3E%3CEM%3EClient%3C%2FEM%3E%3C%2FP%3E%3CPRE%20style%3D%22color%3A%20%23000000%3B%20background-color%3A%20%23f9f9f9%3B%20border%3A%201px%20dashed%20%232f6fab%3B%20font-size%3A%2012.7px%3B%20padding%3A%201em%3B%22%3E%3CCODE%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%20font-size%3A%2012.7px%3B%22%3E%0A%3C%2FCODE%3E%3C%2FPRE%3E%3CP%20style%3D%22color%3A%20%233d3d3d%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22color%3A%20%2351626f%3B%20background-color%3A%20%23ffffff%3B%20border%3A%200px%3B%22%3E%3CSPAN%20style%3D%22border%3A%200px%3B%20font-weight%3A%20bold%3B%22%3E%3CSTRONG%3E2.%20Camera%20Example%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22color%3A%20%2351626f%3B%20background-color%3A%20%23ffffff%3B%20border%3A%200px%3B%22%3E%3CEM%3EServer%3C%2FEM%3E%3C%2FP%3E%3CPRE%20style%3D%22color%3A%20%23000000%3B%20background-color%3A%20%23f9f9f9%3B%20border%3A%201px%20dashed%20%232f6fab%3B%20font-size%3A%2012.7px%3B%20padding%3A%201em%3B%22%3E%24%20gst-variable-rtsp-server%20-p%209001%20-u%20%22v4l2src%20device%3D%2Fdev%2Fvideo0%20!%20video%2Fx-raw%2Cwidth%3D640%2Cheight%3D480%20!%20v4l2h264enc%20!%20rtph264pay%20name%3Dpay0%20pt%3D96%22%3CCODE%3E%0A%3C%2FCODE%3E%3C%2FPRE%3E%3CP%20style%3D%22color%3A%20%2351626f%3B%20background-color%3A%20%23ffffff%3B%20border%3A%200px%3B%22%3E%3CEM%3EClient%3C%2FEM%3E%3C%2FP%3E%3CPRE%20style%3D%22color%3A%20%23000000%3B%20background-color%3A%20%23f9f9f9%3B%20border%3A%201px%20dashed%20%232f6fab%3B%20font-size%3A%2012.7px%3B%20padding%3A%201em%3B%22%3E%3CCODE%20style%3D%22border%3A%200px%3B%20font-weight%3A%20inherit%3B%20font-size%3A%2012.7px%3B%22%3E%0A%3C%2FCODE%3E%3C%2FPRE%3E%3CP%20style%3D%22color%3A%20%233d3d3d%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22color%3A%20%233d3d3d%3B%22%3EIn%20order%20to%20use%20VLC%20or%20other%20application%26nbsp%3Bas%20the%20%3CEM%3Eclient%3C%2FEM%3E%2C%20just%20enter%20the%20URL%20as%20shown%20in%20the%20image%20below%3A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22vlc_rtsp_example.png%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22vlc_rtsp_example.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108137i3067952120097F7A%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22vlc_rtsp_example.png%22%20alt%3D%22vlc_rtsp_example.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1121720%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Ei.MX%208%20Family%20%7C%20i.MX%208QuadMax%20(8QM)%20%7C%208QuadPlus%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ei.MX%208M%20%7C%20i.MX%208M%20Mini%20%7C%20i.MX%208M%20Nano%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMultimedia%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1940930%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20i.MX%208%20-%20RTSP%20Streaming%20Support%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1940930%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CPRE%3EIMAGE_INSTALL_append%20%2B%3D%20%22%3CSPAN%3Egstreamer1.0-rtsp-server%20gst-variable-rtsp-server%3C%2FSPAN%3E%22%3C%2FPRE%3E%3CP%3ECorrect%20me%20if%20I%20am%20wrong%20but%20one%20will%20also%20require%20adding%26nbsp%3B%3CSTRONG%3Egstreamer1.0-plugins-good%3C%2FSTRONG%3E%26nbsp%3Band%20%3CSTRONG%3Egstreamer1.0-plugins-bad%26nbsp%3B%3C%2FSTRONG%3Eplugins%20as%20you%20are%20using%26nbsp%3B%3CSTRONG%3Ev4l2h264enc%26nbsp%3B%3C%2FSTRONG%3Ein%20your%20example.%3C%2FP%3E%3CP%3ESo%20the%20above%20line%20should%20be%20changed%20to%26nbsp%3B%3C%2FP%3E%3CPRE%3EIMAGE_INSTALL_append%20%2B%3D%20%22%3CSPAN%3Egstreamer1.0-rtsp-server%20gstreamer1.0-plugins-good%20gstreamer1.0-plugins-bad%20gst-variable-rtsp-server%3C%2FSPAN%3E%22%3C%2FPRE%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎09-10-2020 02:52 AM
Updated by: