-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added encoded_frame docs
- Loading branch information
Showing
4 changed files
with
101 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
EncodedFrame | ||
============ | ||
|
||
The ``EncodedFrame`` message is an output of the :ref:`VideoEncoder` node. This message is used to represent a frame that has been encoded by the VideoEncoder. It provides various properties and methods for interacting with the encoded frame data. | ||
|
||
Structure | ||
######### | ||
|
||
The ``EncodedFrame`` class inherits from ``Buffer`` and includes several nested classes and methods for accessing and modifying frame properties. Here are the primary components of the ``EncodedFrame`` class: | ||
|
||
- ``FrameType``: Enumerates the types of frames that can be encoded (I, P, B, Unknown). | ||
- ``Profile``: Indicates the encoding profile used (AVC, HEVC, JPEG). | ||
|
||
FrameType | ||
--------- | ||
|
||
The ``FrameType`` class identifies the type of the encoded frame. The available types are: | ||
|
||
- **B**: Represents a bi-directional predicted frame. | ||
- **I**: Represents an intra-coded frame. | ||
- **P**: Represents a predicted frame. | ||
- **Unknown**: Used when the frame type cannot be determined. | ||
|
||
Profile | ||
------- | ||
|
||
The ``Profile`` class specifies the encoding profile used for the frame. The supported profiles are: | ||
|
||
- **AVC**: H.264/AVC encoding profile. | ||
- **HEVC**: H.265/HEVC encoding profile. | ||
- **JPEG**: JPEG encoding profile. | ||
|
||
|
||
Reference | ||
######### | ||
|
||
.. tabs:: | ||
|
||
.. tab:: Python | ||
|
||
.. autoclass:: depthai.EncodedFrame | ||
:members: | ||
:inherited-members: | ||
:noindex: | ||
|
||
.. tab:: C++ | ||
|
||
.. doxygenclass:: dai::EncodedFrame | ||
:project: depthai-core | ||
:members: | ||
:private-members: | ||
:undoc-members: | ||
|
||
.. include:: ../../includes/footer-short.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Video Encoded Frame Type | ||
======================== | ||
|
||
This example showcases how to compress and print the sequence of encoded frame types (I, P, B) encountered during the encoding process. | ||
|
||
|
||
Example script output | ||
##################### | ||
|
||
.. code-block:: | ||
~/depthai-python/examples$ python3 video_encoding.py | ||
Press Ctrl+C to stop encoding... | ||
To view the encoded data, convert the stream file (.h265) into a video file (.mp4) using a command below: | ||
ffmpeg -framerate 30 -i video.h265 -c copy video.mp4 | ||
1I,29P,1I,29P,1I,29P,1I,29P,1I,29P,1I,29P,1I,29P,1I,29P,1I,29P,1I,18P | ||
This output indicates the script's real-time video encoding process, and it compresses the sequence of frame types encountered. After stopping the script, it provides instructions to convert the raw H.265 stream into a playable MP4 video file. The final line shows a compressed representation of the frame types sequence, indicating the count of consecutive P, B, and I frames. | ||
|
||
Setup | ||
##### | ||
|
||
.. include:: /includes/install_from_pypi.rst | ||
|
||
Source code | ||
########### | ||
|
||
.. tabs:: | ||
|
||
.. tab:: Python | ||
|
||
Also `available on GitHub <https://github.com/luxonis/depthai-python/blob/main/examples/VideoEncoder/rgb_encoding_encodedframe.py>`__ | ||
|
||
.. literalinclude:: ../../../../examples/VideoEncoder/rgb_encoding_encodedframe.py | ||
:language: python | ||
:linenos: | ||
|
||
.. include:: /includes/footer-short.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters