Detailed Description
A JPEGFrame is designed for transforming YCbCr colour space frames into an in memory JPEG frame buffer.
Frames in this format may be useful for saving as .jpg formatted files, for displaying on screen or for image processing. This class is required to convert the default output format of the video decompression process from YCbCr to JPEG. We create an instance of this object and then call the Convert() method with a YCbCr frame as a parameter. We can then access the JPEG version of the image after conversion.
The JPEGFrame is intended to be a reusable object. Convert can be called multiple times and the JPEGFrame will be updated should there be a change in the size of the image.
Availability
Available in version 6.0 of Decoder SDK. Requires a server version greater than 6.0
#include <JPEGFrame.h>
Public Member Functions | |
| DB_EDGEVIS_SDK int64_t | GetTimeStamp () const |
| Will return the timestamp of the JPEG. More... | |
| DB_EDGEVIS_SDK int32_t | GetBufferSize () const |
| Will return the length of the byte array representing the JPEG frame. More... | |
| DB_EDGEVIS_SDK byte_array | GetJPEG () const |
| Will return the byte_array containing the JPEG data. More... | |
| DB_EDGEVIS_SDK bool | Convert (int32_t width, int32_t height, uint8_t *y_plane, uint8_t *cb_plane, uint8_t *cr_plane, EdgeVisSDKCore::AspectRatio aspect, int64_t ts, int64_t dts, int32_t quality) |
| Convert a YCbCr frame to a JPEGFrame. More... | |
| DB_EDGEVIS_SDK bool | Convert (YCbCrFrame &yCbCrFrame, int32_t quality, bool correctAspect) |
| Convert a YCbCr frame to a JPEGFrame. More... | |
| DB_EDGEVIS_SDK std::wstring | ToBase64String () |
| Will return a base64 encoded string containting the JPEG frame. More... | |
Public Member Functions inherited from EdgeVisDecoderSDK::VideoData | |
| DB_EDGEVIS_SDK int32_t | GetWidth () const |
| Return the width of the image. More... | |
| DB_EDGEVIS_SDK int32_t | GetHeight () const |
| Return the height of the image. More... | |
| DB_EDGEVIS_SDK int64_t | GetEncodeTimeStamp () const |
| Return the timestamp of the image. More... | |
| DB_EDGEVIS_SDK int64_t | GetDisplayTimeStamp () const |
| Return the timestamp of the image. More... | |
| DB_EDGEVIS_SDK StreamTimestampContext | GetTimeStampContext () const |
| Return context of the image timestamp. More... | |
| DB_EDGEVIS_SDK int64_t | GetViewerTimeoutTimeStamp () const |
| Return the timestamp at which the stream will timeout. More... | |
| DB_EDGEVIS_SDK int32_t | GetInput () const |
| Returns what video input this image is coming from. More... | |
| DB_EDGEVIS_SDK EdgeVisSDKCore::AspectRatio | GetAspectRatio () const |
| Returns the aspect ratio of this image. More... | |
| DB_EDGEVIS_SDK bool | IsCached () const |
| This flag determines if the image has been cached at the remote encoder end for the Full Resolution. More... | |
| DB_EDGEVIS_SDK ArchivePlaybackSpeed | GetArchivePlaybackSpeed () const |
| Get the playback speed of the stream. More... | |
| DB_EDGEVIS_SDK int32_t | GetArchivePlaybackSpeedMultiplier () const |
| Get the playback speed multiplier of the stream. More... | |
| DB_EDGEVIS_SDK VideoFrameLayout | GetVideoFrameLayout () const |
| Returns the VideoFrameLayout describing the sources used to construct the received YCbCrFrame for the specified input. More... | |
Public Member Functions inherited from EdgeVisDecoderSDK::StreamData | |
| DB_EDGEVIS_SDK std::wstring | TypeName () const |
| Returns the type a StreamData this it. More... | |
Member Function Documentation
| DB_EDGEVIS_SDK int64_t EdgeVisDecoderSDK::JPEGFrame::GetTimeStamp | ( | ) | const |
Will return the timestamp of the JPEG.
This is the time the frames was encoded at the encoder.
- See also
- GetDisplayTimeStamp()
Timestamps are in miliseconds and UTC from unix epoch.
- Returns
- The timestamp
| DB_EDGEVIS_SDK int32_t EdgeVisDecoderSDK::JPEGFrame::GetBufferSize | ( | ) | const |
Will return the length of the byte array representing the JPEG frame.
- Returns
- The length of the JPEG frame
| DB_EDGEVIS_SDK byte_array EdgeVisDecoderSDK::JPEGFrame::GetJPEG | ( | ) | const |
Will return the byte_array containing the JPEG data.
- Returns
- The byte_array containing the JPEG frame
| DB_EDGEVIS_SDK bool EdgeVisDecoderSDK::JPEGFrame::Convert | ( | int32_t | width, |
| int32_t | height, | ||
| uint8_t * | y_plane, | ||
| uint8_t * | cb_plane, | ||
| uint8_t * | cr_plane, | ||
| EdgeVisSDKCore::AspectRatio | aspect, | ||
| int64_t | ts, | ||
| int64_t | dts, | ||
| int32_t | quality | ||
| ) |
Convert a YCbCr frame to a JPEGFrame.
Note that this method does not perform aspect ratio correction; the caller should ensure that the aspect ratio is correct before converting to JPEG.
- Parameters
-
width The width in pixels of the frame. height The height in pixels of the frame y_plane The y luminance plane cb_plane The cb chroma plane cr_plane The cr chroma plane quality The required JPEG quality. Valid values range from 10 to 100. aspect The aspect ratio of the frame. ts The UTC frame encode timestamp in milliseconds since 1970 dts The UTC frame display timestamp in milliseconds since 1970
- Returns
- Returns true for success, false for failure
| DB_EDGEVIS_SDK bool EdgeVisDecoderSDK::JPEGFrame::Convert | ( | YCbCrFrame & | yCbCrFrame, |
| int32_t | quality, | ||
| bool | correctAspect | ||
| ) |
Convert a YCbCr frame to a JPEGFrame.
Note that this method does not perform aspect ratio correction; the caller should ensure that the aspect ratio is correct before converting to JPEG.
- Parameters
-
yCbCrFrame The YCbCrFrame to convert to JPEG. quality The required JPEG quality. Valid values range from 10 to 100.
- Returns
- Returns true for success, false for failure
| DB_EDGEVIS_SDK std::wstring EdgeVisDecoderSDK::JPEGFrame::ToBase64String | ( | ) |
Will return a base64 encoded string containting the JPEG frame.
- Returns
- A base64 encoded string containing the JPEG frame data
The documentation for this class was generated from the following file:
- SDKs/EdgeVisDecoderSDK/JPEGFrame.h

Public Member Functions inherited from