Skip to content

🎥 Make videos programmatically with React

add `pixelFormat` in `getVideoMetadata()`

jkcs4f71572e2169
diff --git a/packages/docs/docs/renderer/get-video-metadata.md b/packages/docs/docs/renderer/get-video-metadata.md
index e1e8653c62..34b6fe7a32 100644
--- a/packages/docs/docs/renderer/get-video-metadata.md
+++ b/packages/docs/docs/renderer/get-video-metadata.md
@@ -32,6 +32,7 @@ const {
colorSpace,
audioCodec,
audioFileExtension,
+ pixelFormat,
} = videoMetadata;
```
@@ -109,6 +110,10 @@ Otherwise, it is one of `"opus" | "aac" | "mp3" | "pcm-f16le" | "pcm-f24le" | "p
If the video has no audio track or is unknown to Remotion, it is `null`. Otherwise it is the appropriate file extension for the audio codec, e.g. `"mp3"`. The `.` is not included.
+### `pixelFormat`<AvailableFrom v="4.0.76"/>
+
+One of `unknown`, `yuv420p`, `yuyv422`, `rgb24`, `bgr24`, `yuv422p`, `yuv444p`, `yuv410p`, `yuv411p`, `gray8`, `monowhite`, `monoblack`, `pal8`, `yuvj420p`, `yuvj422p`, `yuvj444p`, `uyvy422`, `uyyvyy411`, `bgr8`, `bgr4`, `bgr4_byte`, `rgb8`, `rgb4`, `rgb4_byte`, `nv12`, `nv21`, `argb`, `rgba`, `abgr`, `bgra`, `gray16be`, `gray16le`, `yuv440p`, `yuvj440p`, `yuva420p`, `rgb48be`, `rgb48le`, `rgb565be`, `rgb565le`, `rgb555be`, `rgb555le`, `bgr565be`, `bgr565le`, `bgr555be`, `bgr555le`, `vaapi`, `yuv420p16le`, `yuv420p16be`, `yuv422p16le`, `yuv422p16be`, `yuv444p16le`, `yuv444p16be`, `dxva2_vld`, `rgb444le`, `rgb444be`, `bgr444le`, `bgr444be`, `ya8`, `bgr48be`, `bgr48le`, `yuv420p9be`, `yuv420p9le`, `yuv420p10be`, `yuv420p10le`, `yuv422p10be`, `yuv422p10le`, `yuv444p9be`, `yuv444p9le`, `yuv444p10be`, `yuv444p10le`, `yuv422p9be`, `yuv422p9le`, `gbrp`, `gbrp9be`, `gbrp9le`, `gbrp10be`, `gbrp10le`, `gbrp16be`, `gbrp16le`, `yuva420p9be`, `yuva420p9le`, `yuva422p9be`, `yuva422p9le`, `yuva444p9be`, `yuva444p9le`, `yuva420p10be`, `yuva420p10le`, `yuva422p10be`, `yuva422p10le`, `yuva444p10be`, `yuva444p10le`, `yuva420p16be`, `yuva420p16le`, `yuva422p16be`, `yuva422p16le`, `yuva444p16be`, `yuva444p16le`, `vdpau`, `xyz12le`, `xyz12be`, `nv16`, `nv20le`, `nv20be`, `rgba64be`, `rgba64le`, `bgra64be`, `bgra64le`, `yvyu422`, `ya16be`, `ya16le`, `qsv`, `mmal`, `d3d11va_vld`, `cuda`, `zrgb`, `rgbz`, `zbgr`, `bgrz`, `yuva444p`, `yuva422p`, `yuv420p12be`, `yuv420p12le`, `yuv420p14be`, `yuv420p14le`, `yuv422p12be`, `yuv422p12le`, `yuv422p14be`, `yuv422p14le`, `yuv444p12be`, `yuv444p12le`, `yuv444p14be`, `yuv444p14le`, `gbrp12be`, `gbrp12le`, `gbrp14be`, `gbrp14le`, `gbrap`, `gbrap16be`, `gbrap16le`, `yuvj411p`, `bayer_bggr8`, `bayer_rggb8`, `bayer_gbrg8`, `bayer_grbg8`, `bayer_bggr16le`, `bayer_bggr16be`, `bayer_rggb16le`, `bayer_rggb16be`, `bayer_gbrg16le`, `bayer_gbrg16be`, `bayer_grbg16le`, `bayer_grbg16be`, `yuv440p10le`, `yuv440p10be`, `yuv440p12le`, `yuv440p12be`, `ayuv64le`, `ayuv64be`, `videotoolbox`, `xvmc`, `rgb32`, `rgb32_1`, `bgr32`, `bgr32_1`, `zrgb32`, `zbgr32`, `gray16`, `ya16`, `rgb48`, `rgb565`, `rgb555`, `rgb444`, `bgr48`, `bgr565`, `bgr555`, `bgr444`, `yuv420p9`, `yuv422p9`, `yuv444p9`, `yuv420p10`, `yuv422p10`, `yuv440p10`, `yuv444p10`, `yuv420p12`, `yuv422p12`, `yuv440p12`, `yuv444p12`, `yuv420p14`, `yuv422p14`, `yuv444p14`, `yuv420p16`, `yuv422p16`, `yuv444p16`, `gbrp9`, `gbrp10`, `gbrp12`, `gbrp14`, `gbrp16`, `gbrap16`, `bayer_bggr16`, `bayer_rggb16`, `bayer_gbrg16`, `bayer_grbg16`, `yuva420p9`, `yuva422p9`, `yuva444p9`, `yuva420p10`, `yuva422p10`, `yuva444p10`, `yuva420p16`, `yuva422p16`, `yuva444p16`, `xyz12`, `nv20`, `ayuv64`, `p010le`, `p010be`, `gbrap12be`, `gbrap12le`, `gbrap10le`, `gbrap10be`, `mediacodec`, `gray12be`, `gray12le`, `gray10be`, `gray10le`, `p016le`, `p016be`, `d3d11`, `gray9be`, `gray9le`, `gbrpf32be`, `gbrpf32le`, `gbrapf32be`, `gbrapf32le`, `drm_prime`, `opencl`, `gray14be`, `gray14le`, `grayf32be`, `grayf32le`, `yuva422p12be`, `yuva422p12le`, `yuva444p12be`, `yuva444p12le`, `nv24`, `nv42`, `vulkan`, `y210be`, `y210le`, `x2rgb10le`, `x2rgb10be`, `x2bgr10le`, `x2bgr10be`, `p210be`, `p210le`, `p410be`, `p410le`, `p216be`, `p216le`, `p416be`, `p416le`, `vuya`, `rgbaf16be`, `rgbaf16le`, `vuyx`, `p012le`, `p012be`, `y212be`, `y212le`, `xv30be`, `xv30le`, `xv36be`, `xv36le`, `rgbf32be`, `rgbf32le`, `rgbaf32be`, `rgbaf32le`, `p212be`, `p212le`, `p412be`, `p412le`, `gbrap14be`, `gbrap14le`.
+
## See also
- [Source code for this function](https://github.com/remotion-dev/remotion/blob/main/packages/renderer/src/get-video-metadata.ts)
diff --git a/packages/it-tests/src/rendering/get-video-metadata.test.ts b/packages/it-tests/src/rendering/get-video-metadata.test.ts
index 8563fd81b6..30327926d3 100644
--- a/packages/it-tests/src/rendering/get-video-metadata.test.ts
+++ b/packages/it-tests/src/rendering/get-video-metadata.test.ts
@@ -21,6 +21,7 @@ test("Should return video metadata", async () => {
colorSpace: "bt601",
audioCodec: null,
audioFileExtension: null,
+ pixelFormat: "yuv420p",
};
expect(metadataResponse).toEqual(videoMetadata);
diff --git a/packages/renderer/rust/ffmpeg.rs b/packages/renderer/rust/ffmpeg.rs
index 8dadca3fba..7df6723492 100644
--- a/packages/renderer/rust/ffmpeg.rs
+++ b/packages/renderer/rust/ffmpeg.rs
@@ -358,6 +358,294 @@ pub fn get_video_metadata(file_path: &str) -> Result<VideoMetadata, ErrorWithBac
};
if let Ok(video) = codec.decoder().video() {
+ #[allow(non_snake_case)]
+ let pixelFormat: Option<String> = match video.format() {
+ remotionffmpeg::format::Pixel::None => Some("unknown".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P => Some("yuv420p".to_string()),
+ remotionffmpeg::format::Pixel::YUYV422 => Some("yuyv422".to_string()),
+ remotionffmpeg::format::Pixel::RGB24 => Some("rgb24".to_string()),
+ remotionffmpeg::format::Pixel::BGR24 => Some("bgr24".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P => Some("yuv422p".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P => Some("yuv444p".to_string()),
+ remotionffmpeg::format::Pixel::YUV410P => Some("yuv410p".to_string()),
+ remotionffmpeg::format::Pixel::YUV411P => Some("yuv411p".to_string()),
+ remotionffmpeg::format::Pixel::GRAY8 => Some("gray8".to_string()),
+ remotionffmpeg::format::Pixel::MonoWhite => Some("monowhite".to_string()),
+ remotionffmpeg::format::Pixel::MonoBlack => Some("monoblack".to_string()),
+ remotionffmpeg::format::Pixel::PAL8 => Some("pal8".to_string()),
+ remotionffmpeg::format::Pixel::YUVJ420P => Some("yuvj420p".to_string()),
+ remotionffmpeg::format::Pixel::YUVJ422P => Some("yuvj422p".to_string()),
+ remotionffmpeg::format::Pixel::YUVJ444P => Some("yuvj444p".to_string()),
+ remotionffmpeg::format::Pixel::UYVY422 => Some("uyvy422".to_string()),
+ remotionffmpeg::format::Pixel::UYYVYY411 => Some("uyyvyy411".to_string()),
+ remotionffmpeg::format::Pixel::BGR8 => Some("bgr8".to_string()),
+ remotionffmpeg::format::Pixel::BGR4 => Some("bgr4".to_string()),
+ remotionffmpeg::format::Pixel::BGR4_BYTE => Some("bgr4_byte".to_string()),
+ remotionffmpeg::format::Pixel::RGB8 => Some("rgb8".to_string()),
+ remotionffmpeg::format::Pixel::RGB4 => Some("rgb4".to_string()),
+ remotionffmpeg::format::Pixel::RGB4_BYTE => Some("rgb4_byte".to_string()),
+ remotionffmpeg::format::Pixel::NV12 => Some("nv12".to_string()),
+ remotionffmpeg::format::Pixel::NV21 => Some("nv21".to_string()),
+ remotionffmpeg::format::Pixel::ARGB => Some("argb".to_string()),
+ remotionffmpeg::format::Pixel::RGBA => Some("rgba".to_string()),
+ remotionffmpeg::format::Pixel::ABGR => Some("abgr".to_string()),
+ remotionffmpeg::format::Pixel::BGRA => Some("bgra".to_string()),
+ remotionffmpeg::format::Pixel::GRAY16BE => Some("gray16be".to_string()),
+ remotionffmpeg::format::Pixel::GRAY16LE => Some("gray16le".to_string()),
+ remotionffmpeg::format::Pixel::YUV440P => Some("yuv440p".to_string()),
+ remotionffmpeg::format::Pixel::YUVJ440P => Some("yuvj440p".to_string()),
+ remotionffmpeg::format::Pixel::YUVA420P => Some("yuva420p".to_string()),
+ remotionffmpeg::format::Pixel::RGB48BE => Some("rgb48be".to_string()),
+ remotionffmpeg::format::Pixel::RGB48LE => Some("rgb48le".to_string()),
+ remotionffmpeg::format::Pixel::RGB565BE => Some("rgb565be".to_string()),
+ remotionffmpeg::format::Pixel::RGB565LE => Some("rgb565le".to_string()),
+ remotionffmpeg::format::Pixel::RGB555BE => Some("rgb555be".to_string()),
+ remotionffmpeg::format::Pixel::RGB555LE => Some("rgb555le".to_string()),
+ remotionffmpeg::format::Pixel::BGR565BE => Some("bgr565be".to_string()),
+ remotionffmpeg::format::Pixel::BGR565LE => Some("bgr565le".to_string()),
+ remotionffmpeg::format::Pixel::BGR555BE => Some("bgr555be".to_string()),
+ remotionffmpeg::format::Pixel::BGR555LE => Some("bgr555le".to_string()),
+ remotionffmpeg::format::Pixel::VAAPI => Some("vaapi".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P16LE => Some("yuv420p16le".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P16BE => Some("yuv420p16be".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P16LE => Some("yuv422p16le".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P16BE => Some("yuv422p16be".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P16LE => Some("yuv444p16le".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P16BE => Some("yuv444p16be".to_string()),
+ remotionffmpeg::format::Pixel::DXVA2_VLD => Some("dxva2_vld".to_string()),
+ remotionffmpeg::format::Pixel::RGB444LE => Some("rgb444le".to_string()),
+ remotionffmpeg::format::Pixel::RGB444BE => Some("rgb444be".to_string()),
+ remotionffmpeg::format::Pixel::BGR444LE => Some("bgr444le".to_string()),
+ remotionffmpeg::format::Pixel::BGR444BE => Some("bgr444be".to_string()),
+ remotionffmpeg::format::Pixel::YA8 => Some("ya8".to_string()),
+ remotionffmpeg::format::Pixel::BGR48BE => Some("bgr48be".to_string()),
+ remotionffmpeg::format::Pixel::BGR48LE => Some("bgr48le".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P9BE => Some("yuv420p9be".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P9LE => Some("yuv420p9le".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P10BE => Some("yuv420p10be".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P10LE => Some("yuv420p10le".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P10BE => Some("yuv422p10be".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P10LE => Some("yuv422p10le".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P9BE => Some("yuv444p9be".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P9LE => Some("yuv444p9le".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P10BE => Some("yuv444p10be".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P10LE => Some("yuv444p10le".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P9BE => Some("yuv422p9be".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P9LE => Some("yuv422p9le".to_string()),
+ remotionffmpeg::format::Pixel::GBRP => Some("gbrp".to_string()),
+ remotionffmpeg::format::Pixel::GBRP9BE => Some("gbrp9be".to_string()),
+ remotionffmpeg::format::Pixel::GBRP9LE => Some("gbrp9le".to_string()),
+ remotionffmpeg::format::Pixel::GBRP10BE => Some("gbrp10be".to_string()),
+ remotionffmpeg::format::Pixel::GBRP10LE => Some("gbrp10le".to_string()),
+ remotionffmpeg::format::Pixel::GBRP16BE => Some("gbrp16be".to_string()),
+ remotionffmpeg::format::Pixel::GBRP16LE => Some("gbrp16le".to_string()),
+ remotionffmpeg::format::Pixel::YUVA420P9BE => Some("yuva420p9be".to_string()),
+ remotionffmpeg::format::Pixel::YUVA420P9LE => Some("yuva420p9le".to_string()),
+ remotionffmpeg::format::Pixel::YUVA422P9BE => Some("yuva422p9be".to_string()),
+ remotionffmpeg::format::Pixel::YUVA422P9LE => Some("yuva422p9le".to_string()),
+ remotionffmpeg::format::Pixel::YUVA444P9BE => Some("yuva444p9be".to_string()),
+ remotionffmpeg::format::Pixel::YUVA444P9LE => Some("yuva444p9le".to_string()),
+ remotionffmpeg::format::Pixel::YUVA420P10BE => Some("yuva420p10be".to_string()),
+ remotionffmpeg::format::Pixel::YUVA420P10LE => Some("yuva420p10le".to_string()),
+ remotionffmpeg::format::Pixel::YUVA422P10BE => Some("yuva422p10be".to_string()),
+ remotionffmpeg::format::Pixel::YUVA422P10LE => Some("yuva422p10le".to_string()),
+ remotionffmpeg::format::Pixel::YUVA444P10BE => Some("yuva444p10be".to_string()),
+ remotionffmpeg::format::Pixel::YUVA444P10LE => Some("yuva444p10le".to_string()),
+ remotionffmpeg::format::Pixel::YUVA420P16BE => Some("yuva420p16be".to_string()),
+ remotionffmpeg::format::Pixel::YUVA420P16LE => Some("yuva420p16le".to_string()),
+ remotionffmpeg::format::Pixel::YUVA422P16BE => Some("yuva422p16be".to_string()),
+ remotionffmpeg::format::Pixel::YUVA422P16LE => Some("yuva422p16le".to_string()),
+ remotionffmpeg::format::Pixel::YUVA444P16BE => Some("yuva444p16be".to_string()),
+ remotionffmpeg::format::Pixel::YUVA444P16LE => Some("yuva444p16le".to_string()),
+ remotionffmpeg::format::Pixel::VDPAU => Some("vdpau".to_string()),
+ remotionffmpeg::format::Pixel::XYZ12LE => Some("xyz12le".to_string()),
+ remotionffmpeg::format::Pixel::XYZ12BE => Some("xyz12be".to_string()),
+ remotionffmpeg::format::Pixel::NV16 => Some("nv16".to_string()),
+ remotionffmpeg::format::Pixel::NV20LE => Some("nv20le".to_string()),
+ remotionffmpeg::format::Pixel::NV20BE => Some("nv20be".to_string()),
+ remotionffmpeg::format::Pixel::RGBA64BE => Some("rgba64be".to_string()),
+ remotionffmpeg::format::Pixel::RGBA64LE => Some("rgba64le".to_string()),
+ remotionffmpeg::format::Pixel::BGRA64BE => Some("bgra64be".to_string()),
+ remotionffmpeg::format::Pixel::BGRA64LE => Some("bgra64le".to_string()),
+ remotionffmpeg::format::Pixel::YVYU422 => Some("yvyu422".to_string()),
+ remotionffmpeg::format::Pixel::YA16BE => Some("ya16be".to_string()),
+ remotionffmpeg::format::Pixel::YA16LE => Some("ya16le".to_string()),
+ remotionffmpeg::format::Pixel::QSV => Some("qsv".to_string()),
+ remotionffmpeg::format::Pixel::MMAL => Some("mmal".to_string()),
+ remotionffmpeg::format::Pixel::D3D11VA_VLD => Some("d3d11va_vld".to_string()),
+ remotionffmpeg::format::Pixel::CUDA => Some("cuda".to_string()),
+ remotionffmpeg::format::Pixel::ZRGB => Some("zrgb".to_string()),
+ remotionffmpeg::format::Pixel::RGBZ => Some("rgbz".to_string()),
+ remotionffmpeg::format::Pixel::ZBGR => Some("zbgr".to_string()),
+ remotionffmpeg::format::Pixel::BGRZ => Some("bgrz".to_string()),
+ remotionffmpeg::format::Pixel::YUVA444P => Some("yuva444p".to_string()),
+ remotionffmpeg::format::Pixel::YUVA422P => Some("yuva422p".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P12BE => Some("yuv420p12be".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P12LE => Some("yuv420p12le".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P14BE => Some("yuv420p14be".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P14LE => Some("yuv420p14le".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P12BE => Some("yuv422p12be".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P12LE => Some("yuv422p12le".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P14BE => Some("yuv422p14be".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P14LE => Some("yuv422p14le".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P12BE => Some("yuv444p12be".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P12LE => Some("yuv444p12le".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P14BE => Some("yuv444p14be".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P14LE => Some("yuv444p14le".to_string()),
+ remotionffmpeg::format::Pixel::GBRP12BE => Some("gbrp12be".to_string()),
+ remotionffmpeg::format::Pixel::GBRP12LE => Some("gbrp12le".to_string()),
+ remotionffmpeg::format::Pixel::GBRP14BE => Some("gbrp14be".to_string()),
+ remotionffmpeg::format::Pixel::GBRP14LE => Some("gbrp14le".to_string()),
+ remotionffmpeg::format::Pixel::GBRAP => Some("gbrap".to_string()),
+ remotionffmpeg::format::Pixel::GBRAP16BE => Some("gbrap16be".to_string()),
+ remotionffmpeg::format::Pixel::GBRAP16LE => Some("gbrap16le".to_string()),
+ remotionffmpeg::format::Pixel::YUVJ411P => Some("yuvj411p".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_BGGR8 => Some("bayer_bggr8".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_RGGB8 => Some("bayer_rggb8".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_GBRG8 => Some("bayer_gbrg8".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_GRBG8 => Some("bayer_grbg8".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_BGGR16LE => Some("bayer_bggr16le".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_BGGR16BE => Some("bayer_bggr16be".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_RGGB16LE => Some("bayer_rggb16le".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_RGGB16BE => Some("bayer_rggb16be".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_GBRG16LE => Some("bayer_gbrg16le".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_GBRG16BE => Some("bayer_gbrg16be".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_GRBG16LE => Some("bayer_grbg16le".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_GRBG16BE => Some("bayer_grbg16be".to_string()),
+ remotionffmpeg::format::Pixel::YUV440P10LE => Some("yuv440p10le".to_string()),
+ remotionffmpeg::format::Pixel::YUV440P10BE => Some("yuv440p10be".to_string()),
+ remotionffmpeg::format::Pixel::YUV440P12LE => Some("yuv440p12le".to_string()),
+ remotionffmpeg::format::Pixel::YUV440P12BE => Some("yuv440p12be".to_string()),
+ remotionffmpeg::format::Pixel::AYUV64LE => Some("ayuv64le".to_string()),
+ remotionffmpeg::format::Pixel::AYUV64BE => Some("ayuv64be".to_string()),
+ remotionffmpeg::format::Pixel::VIDEOTOOLBOX => Some("videotoolbox".to_string()),
+ remotionffmpeg::format::Pixel::XVMC => Some("xvmc".to_string()),
+ remotionffmpeg::format::Pixel::RGB32 => Some("rgb32".to_string()),
+ remotionffmpeg::format::Pixel::RGB32_1 => Some("rgb32_1".to_string()),
+ remotionffmpeg::format::Pixel::BGR32 => Some("bgr32".to_string()),
+ remotionffmpeg::format::Pixel::BGR32_1 => Some("bgr32_1".to_string()),
+ remotionffmpeg::format::Pixel::ZRGB32 => Some("zrgb32".to_string()),
+ remotionffmpeg::format::Pixel::ZBGR32 => Some("zbgr32".to_string()),
+ remotionffmpeg::format::Pixel::GRAY16 => Some("gray16".to_string()),
+ remotionffmpeg::format::Pixel::YA16 => Some("ya16".to_string()),
+ remotionffmpeg::format::Pixel::RGB48 => Some("rgb48".to_string()),
+ remotionffmpeg::format::Pixel::RGB565 => Some("rgb565".to_string()),
+ remotionffmpeg::format::Pixel::RGB555 => Some("rgb555".to_string()),
+ remotionffmpeg::format::Pixel::RGB444 => Some("rgb444".to_string()),
+ remotionffmpeg::format::Pixel::BGR48 => Some("bgr48".to_string()),
+ remotionffmpeg::format::Pixel::BGR565 => Some("bgr565".to_string()),
+ remotionffmpeg::format::Pixel::BGR555 => Some("bgr555".to_string()),
+ remotionffmpeg::format::Pixel::BGR444 => Some("bgr444".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P9 => Some("yuv420p9".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P9 => Some("yuv422p9".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P9 => Some("yuv444p9".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P10 => Some("yuv420p10".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P10 => Some("yuv422p10".to_string()),
+ remotionffmpeg::format::Pixel::YUV440P10 => Some("yuv440p10".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P10 => Some("yuv444p10".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P12 => Some("yuv420p12".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P12 => Some("yuv422p12".to_string()),
+ remotionffmpeg::format::Pixel::YUV440P12 => Some("yuv440p12".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P12 => Some("yuv444p12".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P14 => Some("yuv420p14".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P14 => Some("yuv422p14".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P14 => Some("yuv444p14".to_string()),
+ remotionffmpeg::format::Pixel::YUV420P16 => Some("yuv420p16".to_string()),
+ remotionffmpeg::format::Pixel::YUV422P16 => Some("yuv422p16".to_string()),
+ remotionffmpeg::format::Pixel::YUV444P16 => Some("yuv444p16".to_string()),
+ remotionffmpeg::format::Pixel::GBRP9 => Some("gbrp9".to_string()),
+ remotionffmpeg::format::Pixel::GBRP10 => Some("gbrp10".to_string()),
+ remotionffmpeg::format::Pixel::GBRP12 => Some("gbrp12".to_string()),
+ remotionffmpeg::format::Pixel::GBRP14 => Some("gbrp14".to_string()),
+ remotionffmpeg::format::Pixel::GBRP16 => Some("gbrp16".to_string()),
+ remotionffmpeg::format::Pixel::GBRAP16 => Some("gbrap16".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_BGGR16 => Some("bayer_bggr16".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_RGGB16 => Some("bayer_rggb16".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_GBRG16 => Some("bayer_gbrg16".to_string()),
+ remotionffmpeg::format::Pixel::BAYER_GRBG16 => Some("bayer_grbg16".to_string()),
+ remotionffmpeg::format::Pixel::YUVA420P9 => Some("yuva420p9".to_string()),
+ remotionffmpeg::format::Pixel::YUVA422P9 => Some("yuva422p9".to_string()),
+ remotionffmpeg::format::Pixel::YUVA444P9 => Some("yuva444p9".to_string()),
+ remotionffmpeg::format::Pixel::YUVA420P10 => Some("yuva420p10".to_string()),
+ remotionffmpeg::format::Pixel::YUVA422P10 => Some("yuva422p10".to_string()),
+ remotionffmpeg::format::Pixel::YUVA444P10 => Some("yuva444p10".to_string()),
+ remotionffmpeg::format::Pixel::YUVA420P16 => Some("yuva420p16".to_string()),
+ remotionffmpeg::format::Pixel::YUVA422P16 => Some("yuva422p16".to_string()),
+ remotionffmpeg::format::Pixel::YUVA444P16 => Some("yuva444p16".to_string()),
+ remotionffmpeg::format::Pixel::XYZ12 => Some("xyz12".to_string()),
+ remotionffmpeg::format::Pixel::NV20 => Some("nv20".to_string()),
+ remotionffmpeg::format::Pixel::AYUV64 => Some("ayuv64".to_string()),
+ remotionffmpeg::format::Pixel::P010LE => Some("p010le".to_string()),
+ remotionffmpeg::format::Pixel::P010BE => Some("p010be".to_string()),
+ remotionffmpeg::format::Pixel::GBRAP12BE => Some("gbrap12be".to_string()),
+ remotionffmpeg::format::Pixel::GBRAP12LE => Some("gbrap12le".to_string()),
+ remotionffmpeg::format::Pixel::GBRAP10LE => Some("gbrap10le".to_string()),
+ remotionffmpeg::format::Pixel::GBRAP10BE => Some("gbrap10be".to_string()),
+ remotionffmpeg::format::Pixel::MEDIACODEC => Some("mediacodec".to_string()),
+ remotionffmpeg::format::Pixel::GRAY12BE => Some("gray12be".to_string()),
+ remotionffmpeg::format::Pixel::GRAY12LE => Some("gray12le".to_string()),
+ remotionffmpeg::format::Pixel::GRAY10BE => Some("gray10be".to_string()),
+ remotionffmpeg::format::Pixel::GRAY10LE => Some("gray10le".to_string()),
+ remotionffmpeg::format::Pixel::P016LE => Some("p016le".to_string()),
+ remotionffmpeg::format::Pixel::P016BE => Some("p016be".to_string()),
+ remotionffmpeg::format::Pixel::D3D11 => Some("d3d11".to_string()),
+ remotionffmpeg::format::Pixel::GRAY9BE => Some("gray9be".to_string()),
+ remotionffmpeg::format::Pixel::GRAY9LE => Some("gray9le".to_string()),
+ remotionffmpeg::format::Pixel::GBRPF32BE => Some("gbrpf32be".to_string()),
+ remotionffmpeg::format::Pixel::GBRPF32LE => Some("gbrpf32le".to_string()),
+ remotionffmpeg::format::Pixel::GBRAPF32BE => Some("gbrapf32be".to_string()),
+ remotionffmpeg::format::Pixel::GBRAPF32LE => Some("gbrapf32le".to_string()),
+ remotionffmpeg::format::Pixel::DRM_PRIME => Some("drm_prime".to_string()),
+ remotionffmpeg::format::Pixel::OPENCL => Some("opencl".to_string()),
+ remotionffmpeg::format::Pixel::GRAY14BE => Some("gray14be".to_string()),
+ remotionffmpeg::format::Pixel::GRAY14LE => Some("gray14le".to_string()),
+ remotionffmpeg::format::Pixel::GRAYF32BE => Some("grayf32be".to_string()),
+ remotionffmpeg::format::Pixel::GRAYF32LE => Some("grayf32le".to_string()),
+ remotionffmpeg::format::Pixel::YUVA422P12BE => Some("yuva422p12be".to_string()),
+ remotionffmpeg::format::Pixel::YUVA422P12LE => Some("yuva422p12le".to_string()),
+ remotionffmpeg::format::Pixel::YUVA444P12BE => Some("yuva444p12be".to_string()),
+ remotionffmpeg::format::Pixel::YUVA444P12LE => Some("yuva444p12le".to_string()),
+ remotionffmpeg::format::Pixel::NV24 => Some("nv24".to_string()),
+ remotionffmpeg::format::Pixel::NV42 => Some("nv42".to_string()),
+ remotionffmpeg::format::Pixel::VULKAN => Some("vulkan".to_string()),
+ remotionffmpeg::format::Pixel::Y210BE => Some("y210be".to_string()),
+ remotionffmpeg::format::Pixel::Y210LE => Some("y210le".to_string()),
+ remotionffmpeg::format::Pixel::X2RGB10LE => Some("x2rgb10le".to_string()),
+ remotionffmpeg::format::Pixel::X2RGB10BE => Some("x2rgb10be".to_string()),
+ remotionffmpeg::format::Pixel::X2BGR10LE => Some("x2bgr10le".to_string()),
+ remotionffmpeg::format::Pixel::X2BGR10BE => Some("x2bgr10be".to_string()),
+ remotionffmpeg::format::Pixel::P210BE => Some("p210be".to_string()),
+ remotionffmpeg::format::Pixel::P210LE => Some("p210le".to_string()),
+ remotionffmpeg::format::Pixel::P410BE => Some("p410be".to_string()),
+ remotionffmpeg::format::Pixel::P410LE => Some("p410le".to_string()),
+ remotionffmpeg::format::Pixel::P216BE => Some("p216be".to_string()),
+ remotionffmpeg::format::Pixel::P216LE => Some("p216le".to_string()),
+ remotionffmpeg::format::Pixel::P416BE => Some("p416be".to_string()),
+ remotionffmpeg::format::Pixel::P416LE => Some("p416le".to_string()),
+ remotionffmpeg::format::Pixel::VUYA => Some("vuya".to_string()),
+ remotionffmpeg::format::Pixel::RGBAF16BE => Some("rgbaf16be".to_string()),
+ remotionffmpeg::format::Pixel::RGBAF16LE => Some("rgbaf16le".to_string()),
+ remotionffmpeg::format::Pixel::VUYX => Some("vuyx".to_string()),
+ remotionffmpeg::format::Pixel::P012LE => Some("p012le".to_string()),
+ remotionffmpeg::format::Pixel::P012BE => Some("p012be".to_string()),
+ remotionffmpeg::format::Pixel::Y212BE => Some("y212be".to_string()),
+ remotionffmpeg::format::Pixel::Y212LE => Some("y212le".to_string()),
+ remotionffmpeg::format::Pixel::XV30BE => Some("xv30be".to_string()),
+ remotionffmpeg::format::Pixel::XV30LE => Some("xv30le".to_string()),
+ remotionffmpeg::format::Pixel::XV36BE => Some("xv36be".to_string()),
+ remotionffmpeg::format::Pixel::XV36LE => Some("xv36le".to_string()),
+ remotionffmpeg::format::Pixel::RGBF32BE => Some("rgbf32be".to_string()),
+ remotionffmpeg::format::Pixel::RGBF32LE => Some("rgbf32le".to_string()),
+ remotionffmpeg::format::Pixel::RGBAF32BE => Some("rgbaf32be".to_string()),
+ remotionffmpeg::format::Pixel::RGBAF32LE => Some("rgbaf32le".to_string()),
+ remotionffmpeg::format::Pixel::P212BE => Some("p212be".to_string()),
+ remotionffmpeg::format::Pixel::P212LE => Some("p212le".to_string()),
+ remotionffmpeg::format::Pixel::P412BE => Some("p412be".to_string()),
+ remotionffmpeg::format::Pixel::P412LE => Some("p412le".to_string()),
+ remotionffmpeg::format::Pixel::GBRAP14BE => Some("gbrap14be".to_string()),
+ remotionffmpeg::format::Pixel::GBRAP14LE => Some("gbrap14le".to_string()),
+ };
+
// Return the video metadata
let metadata = VideoMetadata {
fps,
@@ -370,6 +658,7 @@ pub fn get_video_metadata(file_path: &str) -> Result<VideoMetadata, ErrorWithBac
colorSpace,
audioCodec: audio_codec_name,
audioFileExtension: audio_file_extension,
+ pixelFormat,
};
Ok(metadata)
} else {
diff --git a/packages/renderer/rust/payloads.rs b/packages/renderer/rust/payloads.rs
index 1a83c84d8f..16650dadd1 100644
--- a/packages/renderer/rust/payloads.rs
+++ b/packages/renderer/rust/payloads.rs
@@ -227,6 +227,7 @@ pub mod payloads {
pub colorSpace: KnownColorSpaces,
pub audioCodec: Option<KnownAudioCodecs>,
pub audioFileExtension: Option<String>,
+ pub pixelFormat: Option<String>,
}
#[derive(Serialize, Deserialize, Debug)]
diff --git a/packages/renderer/src/compositor/payloads.ts b/packages/renderer/src/compositor/payloads.ts
index c04e994023..e8a3d220e0 100644
--- a/packages/renderer/src/compositor/payloads.ts
+++ b/packages/renderer/src/compositor/payloads.ts
@@ -88,7 +88,293 @@ export type VideoMetadata = {
| 'pcm-s24le-planar'
| 'pcm-s32le-planar'
| 'unknown';
- audioFileExtension: string | null;
+ audioFileExtension: string | null,
+ pixelFormat:
+ | null
+ | 'unknown'
+ | 'yuv420p'
+ | 'yuyv422'
+ | 'rgb24'
+ | 'bgr24'
+ | 'yuv422p'
+ | 'yuv444p'
+ | 'yuv410p'
+ | 'yuv411p'
+ | 'gray8'
+ | 'monowhite'
+ | 'monoblack'
+ | 'pal8'
+ | 'yuvj420p'
+ | 'yuvj422p'
+ | 'yuvj444p'
+ | 'uyvy422'
+ | 'uyyvyy411'
+ | 'bgr8'
+ | 'bgr4'
+ | 'bgr4_byte'
+ | 'rgb8'
+ | 'rgb4'
+ | 'rgb4_byte'
+ | 'nv12'
+ | 'nv21'
+ | 'argb'
+ | 'rgba'
+ | 'abgr'
+ | 'bgra'
+ | 'gray16be'
+ | 'gray16le'
+ | 'yuv440p'
+ | 'yuvj440p'
+ | 'yuva420p'
+ | 'rgb48be'
+ | 'rgb48le'
+ | 'rgb565be'
+ | 'rgb565le'
+ | 'rgb555be'
+ | 'rgb555le'
+ | 'bgr565be'
+ | 'bgr565le'
+ | 'bgr555be'
+ | 'bgr555le'
+ | 'vaapi'
+ | 'yuv420p16le'
+ | 'yuv420p16be'
+ | 'yuv422p16le'
+ | 'yuv422p16be'
+ | 'yuv444p16le'
+ | 'yuv444p16be'
+ | 'dxva2_vld'
+ | 'rgb444le'
+ | 'rgb444be'
+ | 'bgr444le'
+ | 'bgr444be'
+ | 'ya8'
+ | 'bgr48be'
+ | 'bgr48le'
+ | 'yuv420p9be'
+ | 'yuv420p9le'
+ | 'yuv420p10be'
+ | 'yuv420p10le'
+ | 'yuv422p10be'
+ | 'yuv422p10le'
+ | 'yuv444p9be'
+ | 'yuv444p9le'
+ | 'yuv444p10be'
+ | 'yuv444p10le'
+ | 'yuv422p9be'
+ | 'yuv422p9le'
+ | 'gbrp'
+ | 'gbrp9be'
+ | 'gbrp9le'
+ | 'gbrp10be'
+ | 'gbrp10le'
+ | 'gbrp16be'
+ | 'gbrp16le'
+ | 'yuva420p9be'
+ | 'yuva420p9le'
+ | 'yuva422p9be'
+ | 'yuva422p9le'
+ | 'yuva444p9be'
+ | 'yuva444p9le'
+ | 'yuva420p10be'
+ | 'yuva420p10le'
+ | 'yuva422p10be'
+ | 'yuva422p10le'
+ | 'yuva444p10be'
+ | 'yuva444p10le'
+ | 'yuva420p16be'
+ | 'yuva420p16le'
+ | 'yuva422p16be'
+ | 'yuva422p16le'
+ | 'yuva444p16be'
+ | 'yuva444p16le'
+ | 'vdpau'
+ | 'xyz12le'
+ | 'xyz12be'
+ | 'nv16'
+ | 'nv20le'
+ | 'nv20be'
+ | 'rgba64be'
+ | 'rgba64le'
+ | 'bgra64be'
+ | 'bgra64le'
+ | 'yvyu422'
+ | 'ya16be'
+ | 'ya16le'
+ | 'qsv'
+ | 'mmal'
+ | 'd3d11va_vld'
+ | 'cuda'
+ | 'zrgb'
+ | 'rgbz'
+ | 'zbgr'
+ | 'bgrz'
+ | 'yuva444p'
+ | 'yuva422p'
+ | 'yuv420p12be'
+ | 'yuv420p12le'
+ | 'yuv420p14be'
+ | 'yuv420p14le'
+ | 'yuv422p12be'
+ | 'yuv422p12le'
+ | 'yuv422p14be'
+ | 'yuv422p14le'
+ | 'yuv444p12be'
+ | 'yuv444p12le'
+ | 'yuv444p14be'
+ | 'yuv444p14le'
+ | 'gbrp12be'
+ | 'gbrp12le'
+ | 'gbrp14be'
+ | 'gbrp14le'
+ | 'gbrap'
+ | 'gbrap16be'
+ | 'gbrap16le'
+ | 'yuvj411p'
+ | 'bayer_bggr8'
+ | 'bayer_rggb8'
+ | 'bayer_gbrg8'
+ | 'bayer_grbg8'
+ | 'bayer_bggr16le'
+ | 'bayer_bggr16be'
+ | 'bayer_rggb16le'
+ | 'bayer_rggb16be'
+ | 'bayer_gbrg16le'
+ | 'bayer_gbrg16be'
+ | 'bayer_grbg16le'
+ | 'bayer_grbg16be'
+ | 'yuv440p10le'
+ | 'yuv440p10be'
+ | 'yuv440p12le'
+ | 'yuv440p12be'
+ | 'ayuv64le'
+ | 'ayuv64be'
+ | 'videotoolbox'
+ | 'xvmc'
+ | 'rgb32'
+ | 'rgb32_1'
+ | 'bgr32'
+ | 'bgr32_1'
+ | 'zrgb32'
+ | 'zbgr32'
+ | 'gray16'
+ | 'ya16'
+ | 'rgb48'
+ | 'rgb565'
+ | 'rgb555'
+ | 'rgb444'
+ | 'bgr48'
+ | 'bgr565'
+ | 'bgr555'
+ | 'bgr444'
+ | 'yuv420p9'
+ | 'yuv422p9'
+ | 'yuv444p9'
+ | 'yuv420p10'
+ | 'yuv422p10'
+ | 'yuv440p10'
+ | 'yuv444p10'
+ | 'yuv420p12'
+ | 'yuv422p12'
+ | 'yuv440p12'
+ | 'yuv444p12'
+ | 'yuv420p14'
+ | 'yuv422p14'
+ | 'yuv444p14'
+ | 'yuv420p16'
+ | 'yuv422p16'
+ | 'yuv444p16'
+ | 'gbrp9'
+ | 'gbrp10'
+ | 'gbrp12'
+ | 'gbrp14'
+ | 'gbrp16'
+ | 'gbrap16'
+ | 'bayer_bggr16'
+ | 'bayer_rggb16'
+ | 'bayer_gbrg16'
+ | 'bayer_grbg16'
+ | 'yuva420p9'
+ | 'yuva422p9'
+ | 'yuva444p9'
+ | 'yuva420p10'
+ | 'yuva422p10'
+ | 'yuva444p10'
+ | 'yuva420p16'
+ | 'yuva422p16'
+ | 'yuva444p16'
+ | 'xyz12'
+ | 'nv20'
+ | 'ayuv64'
+ | 'p010le'
+ | 'p010be'
+ | 'gbrap12be'
+ | 'gbrap12le'
+ | 'gbrap10le'
+ | 'gbrap10be'
+ | 'mediacodec'
+ | 'gray12be'
+ | 'gray12le'
+ | 'gray10be'
+ | 'gray10le'
+ | 'p016le'
+ | 'p016be'
+ | 'd3d11'
+ | 'gray9be'
+ | 'gray9le'
+ | 'gbrpf32be'
+ | 'gbrpf32le'
+ | 'gbrapf32be'
+ | 'gbrapf32le'
+ | 'drm_prime'
+ | 'opencl'
+ | 'gray14be'
+ | 'gray14le'
+ | 'grayf32be'
+ | 'grayf32le'
+ | 'yuva422p12be'
+ | 'yuva422p12le'
+ | 'yuva444p12be'
+ | 'yuva444p12le'
+ | 'nv24'
+ | 'nv42'
+ | 'vulkan'
+ | 'y210be'
+ | 'y210le'
+ | 'x2rgb10le'
+ | 'x2rgb10be'
+ | 'x2bgr10le'
+ | 'x2bgr10be'
+ | 'p210be'
+ | 'p210le'
+ | 'p410be'
+ | 'p410le'
+ | 'p216be'
+ | 'p216le'
+ | 'p416be'
+ | 'p416le'
+ | 'vuya'
+ | 'rgbaf16be'
+ | 'rgbaf16le'
+ | 'vuyx'
+ | 'p012le'
+ | 'p012be'
+ | 'y212be'
+ | 'y212le'
+ | 'xv30be'
+ | 'xv30le'
+ | 'xv36be'
+ | 'xv36le'
+ | 'rgbf32be'
+ | 'rgbf32le'
+ | 'rgbaf32be'
+ | 'rgbaf32le'
+ | 'p212be'
+ | 'p212le'
+ | 'p412be'
+ | 'p412le'
+ | 'gbrap14be'
+ | 'gbrap14le';
};
type SilentPart = {
diff --git a/packages/renderer/src/test/rust-get-video-metadata.test.ts b/packages/renderer/src/test/rust-get-video-metadata.test.ts
index e4daf9ce79..939144ab09 100644
--- a/packages/renderer/src/test/rust-get-video-metadata.test.ts
+++ b/packages/renderer/src/test/rust-get-video-metadata.test.ts
@@ -38,6 +38,7 @@ test('Should return video metadata', async () => {
colorSpace: 'bt601',
audioCodec: null,
audioFileExtension: null,
+ pixelFormat: 'yuv420p',
};
expect(metadataJson).toEqual(data);
});