|
1 |
| - |
| 1 | + |
2 | 2 |
|
3 | 3 |
|
4 | 4 |
|
5 | 5 | # **VCodec interface C++ library**
|
6 | 6 |
|
7 |
| -**v2.1.3** |
| 7 | +**v2.1.4** |
8 | 8 |
|
9 | 9 |
|
10 | 10 |
|
|
28 | 28 |
|
29 | 29 | # Overview
|
30 | 30 |
|
31 |
| -**VCodec** C++ library provides standard interface as well defines data structures and rules for different video codec classes (video encoding and decoding). **VCodec** interface class doesn't do anything, just provides interface. Different video codec classes inherit interface form **VCodec** C++ class. **VCodec.h** file contains **VCodecCommand** enum, **VCodecParam** enum and **VCodec** class declaration. **VCodecCommands** enum contains IDs of commands supported by **VCodec** class. **VCodecParam** enum contains IDs of params supported by **VCodec** class. All video codec should include params and commands listed in **VCodec.h** file. **VCodec** class depends on [Frame](https://github.com/ConstantRobotics-Ltd/Frame) class which determines video frame structure. Video codec interface supports only 8 bit depth input pixels. It uses C++17 standard. The library is licensed under the **Apache 2.0** license. |
| 31 | +**VCodec** C++ library provides standard interface as well defines data structures and rules for different video codec classes (video encoding and decoding). **VCodec** interface class doesn't do anything, just provides interface. Different video codec classes inherit interface form **VCodec** C++ class. **VCodec.h** file contains **VCodecCommand** enum, **VCodecParam** enum and **VCodec** class declaration. **VCodecCommands** enum contains IDs of commands supported by **VCodec** class. **VCodecParam** enum contains IDs of params supported by **VCodec** class. All video codec should include params and commands listed in **VCodec.h** file. **VCodec** class depends on [Frame](https://rapidpixel.constantrobotics.com/docs/service-libraries/frame.html) class which determines video frame structure. Video codec interface supports only 8 bit depth input pixels. It uses C++17 standard. The library is licensed under the **Apache 2.0** license. |
32 | 32 |
|
33 | 33 |
|
34 | 34 |
|
|
45 | 45 | | 2.1.1 | 14.12.2023 | - Virtual destructor added.<br />- Frame submodule updated. |
|
46 | 46 | | 2.1.2 | 14.12.2023 | - Frame submodule updated.<br />- Documentation updated. |
|
47 | 47 | | 2.1.3 | 25.04.2024 | - Documentation updated. |
|
| 48 | +| 2.1.4 | 16.05.2024 | - Documentation updated.<br />- Frame submodule updated. | |
48 | 49 |
|
49 | 50 |
|
50 | 51 |
|
|
53 | 54 | The library supplied by source code only. The user would be given a set of files in the form of a CMake project (repository). The repository structure is shown below:
|
54 | 55 |
|
55 | 56 | ```xml
|
56 |
| -CMakeLists.txt ---------------- Main CMake file of the library. |
57 |
| -3rdparty ---------------------- Folder with third-party libraries. |
58 |
| - CMakeLists.txt ------------ CMake file to include third-party libraries. |
59 |
| - Frame --------------------- Folder with Frame library files. |
60 |
| -src --------------------------- Folder with library source code. |
61 |
| - CMakeLists.txt ------------ CMake file of the library. |
62 |
| - VCodec.h ------------------ Main library header file. |
63 |
| - VCodecVersion.h ----------- Header file with library version. |
64 |
| - VCodecVersion.h.in -------- File for CMake to generate version header. |
65 |
| - VCodec.cpp ---------------- C++ implementation file. |
| 57 | +CMakeLists.txt ---------- Main CMake file of the library. |
| 58 | +3rdparty ---------------- Folder with third-party libraries. |
| 59 | + CMakeLists.txt ------ CMake file to include third-party libraries. |
| 60 | + Frame --------------- Folder with Frame library files. |
| 61 | +src --------------------- Folder with library source code. |
| 62 | + CMakeLists.txt ------ CMake file of the library. |
| 63 | + VCodec.h ------------ Main library header file. |
| 64 | + VCodecVersion.h ----- Header file with library version. |
| 65 | + VCodecVersion.h.in -- File for CMake to generate version header. |
| 66 | + VCodec.cpp ---------- C++ implementation file. |
66 | 67 | ```
|
67 | 68 |
|
68 | 69 |
|
@@ -119,23 +120,23 @@ std::cout << "VCodec class version: " << VCodec::getVersion() << std::endl;
|
119 | 120 | Console output:
|
120 | 121 |
|
121 | 122 | ```bash
|
122 |
| -VCodec class version: 2.1.3 |
| 123 | +VCodec class version: 2.1.4 |
123 | 124 | ```
|
124 | 125 |
|
125 | 126 |
|
126 | 127 |
|
127 | 128 | ## transcode method
|
128 | 129 |
|
129 |
| -The **transcode(...)** method intended to encode and decode video frame ([Frame](https://github.com/ConstantRobotics-Ltd/Frame) class). Video codec encode/decode video frames frame-by-frame. Method declaration: |
| 130 | +The **transcode(...)** method intended to encode and decode video frame ([Frame](https://rapidpixel.constantrobotics.com/docs/service-libraries/frame.html) class). Video codec encodes / decodes video frame-by-frame. Method declaration: |
130 | 131 |
|
131 | 132 | ```cpp
|
132 | 133 | virtual bool transcode(Frame& src, Frame& dst) = 0;
|
133 | 134 | ```
|
134 | 135 |
|
135 | 136 | | Parameter | Value |
|
136 | 137 | | --------- | ------------------------------------------------------------ |
|
137 |
| -| src | Source video frame (see [Frame](https://github.com/ConstantRobotics-Ltd/Frame) class description). To encode video data **src** frame must have RAW pixel data (field **fourcc** of **Frame** class): **RGB24**, **BGR24**, **YUYV**, **UYVY**, **GRAY**, **YUV24**, **NV12**, **NV21**, **YU12** or **YV12**. To decode video data **src** frame must have compressed pixel format (field **fourcc** of **Frame** class): **JPEG**, **H264** or **HEVC**. Particular video codec can support limited RAW input pixel format or only one. When it possible video codec should accept all supported RAW pixel formats and should do pixel format conversion inside if it necessary. Also, particular video codec can support all, few or just one compressed pixel format. When it possible video code should support all compressed pixel format to encode/decode. | |
138 |
| -| dst | Result video frame (see **Frame** class description). To decode video data **src** frame must have compressed pixel format (field **fourcc** of **Frame** class): **JPEG**, **H264** or **HEVC**. In case decoding particular video codec can set output pixel format automatically. To encode video frame user must set **fourcc** field of dst frame to necessary output compressed format: **JPEG**, **H264** or **HEVC**. The method will write decoded frame data (RAW pixel format) to **data** filed of **src** frame in case decoding or will write compressed data in case encoding. | |
| 138 | +| src | Source video frame (see [Frame](https://rapidpixel.constantrobotics.com/docs/service-libraries/frame.html) class description). To encode video data **src** frame must have RAW pixel data (field **fourcc** of **Frame** class): **RGB24**, **BGR24**, **YUYV**, **UYVY**, **GRAY**, **YUV24**, **NV12** (default format for codec), **NV21**, **YU12** or **YV12**. To decode video data **src** frame must have compressed pixel format (field **fourcc** of **Frame** class): **JPEG**, **H264** or **HEVC**. Particular video codec can support limited RAW input pixel format or only one (usually only **NV12**). When it possible video codec should accept all supported RAW pixel formats and should do pixel format conversion inside if it necessary. Also, particular video codec can support all, few or just one compressed pixel format. When it possible video code should support all compressed pixel format to encode / decode. | |
| 139 | +| dst | Result video frame (see [Frame](https://rapidpixel.constantrobotics.com/docs/service-libraries/frame.html) class description). To decode video data **src** frame must have compressed pixel format (field **fourcc** of **Frame** class): **JPEG**, **H264** or **HEVC**. In case decoding particular video codec can set output pixel format automatically. To encode video frame user must set **fourcc** field of dst frame to necessary output compressed format: **JPEG**, **H264** or **HEVC**. The method will write decoded frame data (RAW pixel format) to **data** filed of **src** frame in case decoding or will write compressed data in case encoding. | |
139 | 140 |
|
140 | 141 | **Returns:** TRUE if frame was encoded/decoded or FALSE if not.
|
141 | 142 |
|
|
0 commit comments