The official LibYuv docker image.
Maintained by: openEuler CloudNative SIG.
Where to get help: openEuler CloudNative SIG, openEuler.
Current LibYuv docker images are built on the openEuler. This repository is free to use and exempted from per-user rate limits.
LibYuv is an open source project that includes YUV scaling and conversion functionality.
The tag of each libyuv docker image is consist of the version of libyuv and the version of basic image. The details are as follows
| Tag | Currently | Architectures |
|---|---|---|
| 1971-oe2403sp4 | libyuv 1971 on openEuler 24.03-LTS-SP4 | amd64, arm64 |
| 1948-oe2403sp4 | libyuv 1948 on openEuler 24.03-LTS-SP4 | amd64, arm64 |
| 1948-oe2403sp3 | libyuv 1948 on openEuler 24.03-LTS-SP3 | amd64, arm64 |
| 1934-oe2403sp3 | libyuv 1934 on openEuler 24.03-LTS-SP3 | amd64, arm64 |
| 1922-oe2403sp2 | libyuv 1922 on openEuler 24.03-LTS-SP2 | amd64, arm64 |
| 1920-oe2403sp2 | libyuv 1920 on openEuler 24.03-LTS-SP2 | amd64, arm64 |
| 1918-oe2403sp2 | libyuv 1918 on openEuler 24.03-LTS-SP2 | amd64, arm64 |
| 1917-oe2403sp2 | libyuv 1917 on openEuler 24.03-LTS-SP2 | amd64, arm64 |
| 1915-oe2403sp1 | LibYuv 1915 on openEuler 24.03-LTS-SP1 | amd64, arm64 |
In this usage, users can select the corresponding {Tag} based on their requirements.
Pull the openeuler/libyuv image from docker
docker pull openeuler/libyuv:{Tag}
To run and enter the libyuv container with an interactive shell:
docker run -it --rm openeuler/libyuv:{Tag} bash
Example Code (example.cpp)
This example demonstrates how to use LibYUV to convert an NV12(YUV420SP) image to RGB24 format and save it as a PPM file.
#include <libyuv.h>
#include <iostream>
#include <fstream>
#include <cstring>
int main() {
const int width = 640;
const int height = 480;
const int y_size = width * height;
const int uv_size = y_size / 2;
uint8_t* src_y = new uint8_t[y_size];
uint8_t* src_uv = new uint8_t[uv_size];
uint8_t* dst_rgb = new uint8_t[width * height * 3]; // RGB24
memset(src_y, 0x80, y_size);
memset(src_uv, 0x80, uv_size);
// NV12 转 RGB24
libyuv::NV12ToRGB24(
src_y, width,
src_uv, width,
dst_rgb, width * 3,
width, height
);
std::ofstream out("output.ppm", std::ios::binary);
out << "P6\n" << width << " " << height << "\n255\n";
out.write(reinterpret_cast<char*>(dst_rgb), width * height * 3);
out.close();
delete[] src_y;
delete[] src_uv;
delete[] dst_rgb;
std::cout << "YUV to RGB conversion completed!" << std::endl;
return 0;
}
Compilation Command
g++ example.cpp -o example -lyuv
Running the Program
./example
After execution, the program will:
output.ppm in the current directoryIf you have any questions or want to use some special features, please submit an issue or a pull request on openeuler-docker-images.
Content type
Image
Digest
sha256:e758c8650…
Size
316.9 MB
Last updated
3 days ago
docker pull openeuler/libyuvPulls:
2
Last week