# EncodedFrame

Outputs EncodedFrame message that carries encoded (MJPEG, H264 or H265) frame data. Source of this message is
[VideoEncoder](https://docs.luxonis.com/software-v3/depthai/depthai-components/nodes/video_encoder.md) node.

## Reference

### dai::EncodedFrame

Kind: class

#### std::uint8_t Profile

Kind: enum

##### JPEG

Kind: enum_value

##### AVC

Kind: enum_value

##### HEVC

Kind: enum_value

#### std::uint8_t FrameType

Kind: enum

##### I

Kind: enum_value

##### P

Kind: enum_value

##### B

Kind: enum_value

##### Unknown

Kind: enum_value

#### ImgFrame::CameraSettings CameraSettings

Kind: enum

#### ImgFrame::Fsync Fsync

Kind: enum

#### CameraSettings cam

Kind: variable

#### uint32_t instanceNum

Kind: variable

#### unsigned int width

Kind: variable

#### unsigned int height

Kind: variable

#### uint32_t quality

Kind: variable

#### uint32_t bitrate

Kind: variable

#### Profile profile

Kind: variable

#### bool lossless

Kind: variable

#### FrameType type

Kind: variable

#### uint32_t frameOffset

Kind: variable

#### uint32_t frameSize

Kind: variable

#### ImgTransformation transformation

Kind: variable

#### ~EncodedFrame()

Kind: function

#### unsigned int getInstanceNum()

Kind: function

Retrieves instance number

#### unsigned int getWidth()

Kind: function

Retrieves image width in pixels

#### unsigned int getHeight()

Kind: function

Retrieves image height in pixels

#### std::chrono::microseconds getExposureTime()

Kind: function

Retrieves exposure time

#### int getSensitivity()

Kind: function

Retrieves sensitivity, as an ISO value

#### int getColorTemperature()

Kind: function

Retrieves white-balance color temperature of the light source, in kelvins

#### int getLensPosition()

Kind: function

Retrieves lens position, range 0..255. Returns -1 if not available

#### float getLensPositionRaw()

Kind: function

Retrieves lens position, range 0.0f..1.0f. Returns -1 if not available

#### Fsync getFsync()

Kind: function

Retrieves effective frame sync mode for this frame.

#### int getSensorMode()

Kind: function

Retrieves selected sensor mode index for this frame.

#### float getFps()

Kind: function

Retrieves sensor FPS for this frame.

#### unsigned int getQuality()

Kind: function

Retrieves the encoding quality

#### unsigned int getBitrate()

Kind: function

Retrieves the encoding bitrate

#### bool getLossless()

Kind: function

Returns true if encoding is lossless (JPEG only)

#### FrameType getFrameType()

Kind: function

Retrieves frame type (H26x only)

#### Profile getProfile()

Kind: function

Retrieves the encoding profile (JPEG, AVC or HEVC)

#### EncodedFrame & setInstanceNum(unsigned int instance)

Kind: function

Instance number relates to the origin of the frame (which camera) parameters: instance: Instance number

#### EncodedFrame & setWidth(unsigned int width)

Kind: function

Specifies frame width parameters: width: frame width

#### EncodedFrame & setHeight(unsigned int height)

Kind: function

Specifies frame height parameters: height: frame height

#### EncodedFrame & setSize(unsigned int width, unsigned int height)

Kind: function

Specifies frame size parameters: height: frame height; width: frame width

#### EncodedFrame & setSize(std::tuple< unsigned int, unsigned int > size)

Kind: function

Specifies frame size parameters: size: frame size

#### EncodedFrame & setQuality(unsigned int quality)

Kind: function

Specifies the encoding quality parameters: quality: Encoding quality

#### EncodedFrame & setBitrate(unsigned int bitrate)

Kind: function

Specifies the encoding quality parameters: quality: Encoding quality

#### EncodedFrame & setLossless(bool lossless)

Kind: function

Specifies if encoding is lossless (JPEG only) parameters: lossless: True if lossless

#### EncodedFrame & setFrameType(FrameType type)

Kind: function

Specifies the frame type (H26x only) parameters: type: Type of h26x frame (I, P, B)

#### EncodedFrame & setProfile(Profile profile)

Kind: function

Specifies the encoding profile parameters: profile: Encoding profile

#### ImgFrame getImgFrameMeta()

Kind: function

#### void serialize(std::vector< std::uint8_t > & metadata, DatatypeEnum & datatype)

Kind: function

#### DatatypeEnum getDatatype()

Kind: function

Get the datatype of this specific message.

return: DatatypeEnum

#### DEPTHAI_SERIALIZE(EncodedFrame, cam, instanceNum, width, height, quality, bitrate, profile, lossless, type, frameOffset,
frameSize, transformation, Buffer::sequenceNum, Buffer::ts, Buffer::tsDevice)

Kind: function

### Need assistance?

Head over to [Discussion Forum](https://discuss.luxonis.com/) for technical support or any other questions you might have.
