RZ-G/RZG GStreamer: Difference between revisions
No edit summary |
(Added RZV2L support scripts) |
||
Line 67: | Line 67: | ||
gst-launch-1.0 filesrc location=filename.mp4 ! qtdemux ! queue ! h264parse ! omxh264dec ! queue ! vspmfilter outbuf-alloc=true ! video/x-raw, format=BGRA ! waylandsink | gst-launch-1.0 filesrc location=filename.mp4 ! qtdemux ! queue ! h264parse ! omxh264dec ! queue ! vspmfilter outbuf-alloc=true ! video/x-raw, format=BGRA ! waylandsink | ||
</pre> | </pre> | ||
= Examples for RZV2L = | |||
== Camera Setup == | |||
This section describes how to setup the RZV2L Camera module OV5645. | |||
=== Camera Setup VGA === | |||
<code>media-ctl -d /dev/media0 -r ;</code> | |||
<code>media-ctl -d /dev/media0 -l "'rzg2l_csi2 10830400.csi2':1 -> 'CRU output':0 [1]" ;</code> | |||
<code>media-ctl -d /dev/media0 -V "'rzg2l_csi2 10830400.csi2':1 [fmt:UYVY8_2X8/640x480 field:none]" ;</code> | |||
<code>media-ctl -d /dev/media0 -V "'ov5645 0-003c':0 [fmt:UYVY8_2X8/640x480 field:none]" ;</code> | |||
<code>gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! waylandsink</code> | |||
=== Camera Setup 720p === | |||
<code>media-ctl -d /dev/media0 -r ;</code> | |||
<code>media-ctl -d /dev/media0 -l "'rzg2l_csi2 10830400.csi2':1 -> 'CRU output':0 [1]" ;</code> | |||
<code>media-ctl -d /dev/media0 -V "'rzg2l_csi2 10830400.csi2':1 [fmt:UYVY8_2X8/1280x720 field:none]" ;</code> | |||
<code>media-ctl -d /dev/media0 -V "'ov5645 0-003c':0 [fmt:UYVY8_2X8/1280x720 field:none]" ;</code> | |||
<code>gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! waylandsink</code> | |||
== Down Scaling using vspmfilter == | |||
=== Down Scale Camera 720p video === | |||
<code>gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! vspmfilter dmabuf-use=true ! video/x-raw, width=640, height=480 ! waylandsink</code> | |||
=== Down Scale H264 Video File === | |||
gst-launch-1.0 filesrc location=./in720p.mp4 ! qtdemux ! queue ! h264parse ! queue ! omxh264dec ! queue ! <code>! vspmfilter dmabuf-use=true ! video/x-raw, width=640, height=480 !</code>waylandsink | |||
=== Create H264 Video File === | |||
This script can be run on the RZV2L | |||
<code>gst-launch-1.0 videotestsrc ! omxh264enc ! filesink location=./testvideo.h264</code> | |||
== Stream H264 Video Over IP == | |||
=== RZV2L(Source)Β Device send h264 stream using RTP: === | |||
'''''Set the IP address to the PC or device that receives the video''''' | |||
<code>gst-launch-1.0 -v v4l2src device=/dev/video0 ! videoconvert ! vspmfilter dmabuf-use=true ! video/x-raw, width=640, height=480 ! queue ! omxh264enc ! queue ! rtph264pay ! queue ! udpsink host=<PC IP Address> port=5000</code> | |||
=== PC that receives h264 rtp stream: === | |||
<code>gst-launch-1.0 -v udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink</code> |
Revision as of 23:26, 1 April 2022
β RZ-G
<img height=100 style="float:right" src=>
Examples for RZ/G2L
Down Scaling using vspmfilter
- Below table show range of support:
Input resolution | Output scale down ratio | |
Min | 128x72 | 1 |
Max | 1920x1080 | 15 |
Following are sample commands for Up/Down Scaling with h264 Elementary Stream file.
Case of Down Scaling
gst-launch-1.0 filesrc location=./<FullHDsize_h264_file> ! h264parse ! queue ! omxh264dec ! queue ! vspmfilter outbuf-alloc=true ! video/x-raw, format=BGRA, width=1280, height=720 ! waylandsink
Case of Down Scaling (without color format conversion)
gst-launch-1.0 filesrc location=./<FullHDsize_h264_file> ! h264parse ! queue ! omxh264dec ! queue ! vspmfilter outbuf-alloc=true ! video/x-raw, width=1280, height=720 ! waylandsink
Case of Down Scaling (without color format conversion β use dmabuf)
gst-launch-1.0 filesrc location=./<FullHDsize_h264_file> ! h264parse ! queue ! omxh264dec ! queue ! vspmfilter dmabuf-use=true ! video/x-raw, width=1280, height=720 ! waylandsink
Color format conversion using vspmfilter
- Below table show color format conversion using vspmfilter:
No. | Supported color format |
1 | BGRA |
2 | BGRx |
3 | RGB16 |
4 | YUY2 |
5 | NV12 |
Following are sample commands for converting color format. Please set the output format which begin supported following βformat=β.
Case of BGRA output
gst-launch-1.0 filesrc location=filename.mp4 ! qtdemux ! queue ! h264parse ! omxh264dec ! queue ! vspmfilter outbuf-alloc=true ! video/x-raw, format=BGRA ! waylandsink
Examples for RZV2L
Camera Setup
This section describes how to setup the RZV2L Camera module OV5645.
Camera Setup VGA
media-ctl -d /dev/media0 -r ;
media-ctl -d /dev/media0 -l "'rzg2l_csi2 10830400.csi2':1 -> 'CRU output':0 [1]" ;
media-ctl -d /dev/media0 -V "'rzg2l_csi2 10830400.csi2':1 [fmt:UYVY8_2X8/640x480 field:none]" ;
media-ctl -d /dev/media0 -V "'ov5645 0-003c':0 [fmt:UYVY8_2X8/640x480 field:none]" ;
gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! waylandsink
Camera Setup 720p
media-ctl -d /dev/media0 -r ;
media-ctl -d /dev/media0 -l "'rzg2l_csi2 10830400.csi2':1 -> 'CRU output':0 [1]" ;
media-ctl -d /dev/media0 -V "'rzg2l_csi2 10830400.csi2':1 [fmt:UYVY8_2X8/1280x720 field:none]" ;
media-ctl -d /dev/media0 -V "'ov5645 0-003c':0 [fmt:UYVY8_2X8/1280x720 field:none]" ;
gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! waylandsink
Down Scaling using vspmfilter
Down Scale Camera 720p video
gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! vspmfilter dmabuf-use=true ! video/x-raw, width=640, height=480 ! waylandsink
Down Scale H264 Video File
gst-launch-1.0 filesrc location=./in720p.mp4 ! qtdemux ! queue ! h264parse ! queue ! omxh264dec ! queue ! ! vspmfilter dmabuf-use=true ! video/x-raw, width=640, height=480 !
waylandsink
Create H264 Video File
This script can be run on the RZV2L
gst-launch-1.0 videotestsrc ! omxh264enc ! filesink location=./testvideo.h264
Stream H264 Video Over IP
RZV2L(Source) Device send h264 stream using RTP:
Set the IP address to the PC or device that receives the video
gst-launch-1.0 -v v4l2src device=/dev/video0 ! videoconvert ! vspmfilter dmabuf-use=true ! video/x-raw, width=640, height=480 ! queue ! omxh264enc ! queue ! rtph264pay ! queue ! udpsink host=<PC IP Address> port=5000
PC that receives h264 rtp stream:
gst-launch-1.0 -v udpsrc port=5000 caps = "application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96" ! rtph264depay ! decodebin ! videoconvert ! autovideosink