Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| raw [2020/03/29 17:12] – yair | raw [2024/06/30 17:30] (current) – yair | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====GRAY8 vs RTP==== | ====GRAY8 vs RTP==== | ||
| **problem**: | **problem**: | ||
| - | single plane raw formats are not part of [[https:// | + | single plane raw formats are not part of [[https:// |
| **solution**: | **solution**: | ||
| - | map the GRAY8 **one plane** source into a quarter width **four plane** RGBA output image\\ | + | an image format is **just a convention**, internally they are byte(octet) streams. |
| - | we will then remap it to Y8 on the receiving side. \\ | + | |
| - | the trick is to use gstreamer built in forma spec and let it optimize | + | view the image format as just a stream of octets. here is our stream in Y8 format |
| + | | ||
| + | | ||
| + | | ||
| + | and again, data quartered and represented in 8 bit depth and with stride of 4 | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | note the above represents two sequential pixels. | ||
| + | |||
| + | the trick is to use gstreamer built in [[https:// | ||
| the [[https:// | the [[https:// | ||
| Line 24: | Line 35: | ||
| 00000000 (0x7f369c00a8c0): | 00000000 (0x7f369c00a8c0): | ||
| 00000000 (0x556228700560): | 00000000 (0x556228700560): | ||
| - | ┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐ | ||
| - | │00000000│ eb eb eb eb eb eb eb eb ┊ eb eb eb eb eb eb eb eb │××××××××┊××××××××│ | ||
| - | └────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘ | ||
| </ | </ | ||
| **note**: why white pixel is not FF=(255)?\\ | **note**: why white pixel is not FF=(255)?\\ | ||
| - | gstreamer uses YUV colorimetry when generating a GRAY8 test image and YUV doesnt use the entire 0-255 space. [[https:// | + | gstreamer uses YUV colorimetry when generating a GRAY8 test image \\ |
| + | and YUV doesnt use the entire 0-255 space. [[https:// | ||
| + | |||
| + | **note2**: this example is running on linux/ | ||
| + | to adapt to windows using powershell replace '' | ||
| + | place quotes around | ||
| + | |||
| + | |||
| + | ====FakeRawPay==== | ||
| + | gray8 raw video transported as RTP payload via a " | ||
| + | conforming to [[https:// | ||
| + | pay | ||
| + | <code dot> | ||
| + | gst-launch-1.0 -v \ | ||
| + | videotestsrc pattern=white is-live=1 \ | ||
| + | ! video/ | ||
| + | ! rawvideoparse width=1 height=4 format=rgba \ | ||
| + | ! rtpvrawpay \ | ||
| + | ! queue \ | ||
| + | ! udpsink host=localhost port=5000 | ||
| + | </ | ||
| + | depay and back to gray8 | ||
| + | <code dot> | ||
| + | gst-launch-1.0 -v \ | ||
| + | udpsrc port=5000 \ | ||
| + | ! " | ||
| + | ! rtpvrawdepay \ | ||
| + | ! queue \ | ||
| + | ! rawvideoparse width=4 height=4 format=gray8 \ | ||
| + | ! videoconvert \ | ||
| + | ! fpsdisplaysink | ||
| + | </ | ||
| + | | ||
| ====strides and offsets==== | ====strides and offsets==== | ||
| - | note: we dont need to dig into this as we use the capabilities as listed in format_info. \\ | + | |
| - | but hopefully this section will advance your understanding. | + | there are caveats |
| Line 128: | Line 168: | ||
| </ | </ | ||
| - | |||
| - | See raw video format [[https:// | ||
| - | |||
| - | |||
| - | ====FakeRawPay==== | ||
| - | gray8 raw video transported as RTP payload via a " | ||
| - | conforming to [[https:// | ||
| - | pay | ||
| - | <code dot> | ||
| - | gst-launch-1.0 -v \ | ||
| - | videotestsrc pattern=white is-live=1 \ | ||
| - | ! video/ | ||
| - | ! rawvideoparse width=1 height=4 format=rgba \ | ||
| - | ! rtpvrawpay \ | ||
| - | ! queue \ | ||
| - | ! udpsink host=localhost port=5000 | ||
| - | </ | ||
| - | depay and back to gray8 | ||
| - | <code dot> | ||
| - | gst-launch-1.0 -v \ | ||
| - | udpsrc port=5000 \ | ||
| - | ! " | ||
| - | ! rtpvrawdepay \ | ||
| - | ! queue \ | ||
| - | ! rawvideoparse width=4 height=4 format=gray8 \ | ||
| - | ! videoconvert \ | ||
| - | ! fpsdisplaysink | ||
| - | </ | ||
| - | | ||
| - | |||
| - | ====raw parsing==== | ||
| - | <code c> | ||
| - | gst-launch-1.0 videotestsrc pattern=white num-buffers=1 \ | ||
| - | ! video/ | ||
| - | ! identity dump=1 \ | ||
| - | ! filesink location=white.gray8 -q | ||
| - | |||
| - | gst-launch-1.0 | ||
| - | ! rawvideoparse format=rgba width=1 height=4 \ | ||
| - | ! identity dump=1 \ | ||
| - | ! filesink location=white.rgba -q | ||
| - | </ | ||
| - | |||
| - | | ||
| <hidden more digging> | <hidden more digging> | ||
| Line 212: | Line 208: | ||
| </ | </ | ||
| - | [[https:// | + | [[https:// |
| + | [[https:// | ||