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:14] – [strides and offsets] 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 | ||
Line 58: | Line 70: | ||
</ | </ | ||
| | ||
- | |||
- | ====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 | ||
- | </ | ||
====strides and offsets==== | ====strides and offsets==== | ||
- | we dont need to dig into the following as we use the capabilities as listed in [[https:// | + | there are caveats |
- | but hopefully this section will advance your understanding. | + | |
Line 210: | Line 208: | ||
</ | </ | ||
- | [[https:// | + | [[https:// |
+ | [[https:// | ||