diff --git a/src/modules/ffmpeg/producer/av_producer.cpp b/src/modules/ffmpeg/producer/av_producer.cpp index ce52ff8a11..9b2078a073 100644 --- a/src/modules/ffmpeg/producer/av_producer.cpp +++ b/src/modules/ffmpeg/producer/av_producer.cpp @@ -500,6 +500,11 @@ struct Filter AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, AV_PIX_FMT_ABGR, + AV_PIX_FMT_BGR48LE, + AV_PIX_FMT_RGB48LE, + AV_PIX_FMT_BGRA64LE, + AV_PIX_FMT_RGBA64LE, + // AV_PIX_FMT_X2RGB10LE TODO AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, @@ -511,14 +516,12 @@ struct Filter AV_PIX_FMT_YUV444P10LE, AV_PIX_FMT_YUV422P10LE, AV_PIX_FMT_YUV420P10LE, - // AV_PIX_FMT_YUV410P10LE, AV_PIX_FMT_YUV444P16LE, AV_PIX_FMT_YUV422P16LE, AV_PIX_FMT_YUV420P16LE, AV_PIX_FMT_YUVA444P10LE, AV_PIX_FMT_YUVA422P10LE, AV_PIX_FMT_YUVA420P10LE, - // AV_PIX_FMT_UYVY42210LE, AV_PIX_FMT_YUVA444P16LE, AV_PIX_FMT_YUVA422P16LE, AV_PIX_FMT_YUVA420P16LE, diff --git a/src/modules/ffmpeg/util/av_util.cpp b/src/modules/ffmpeg/util/av_util.cpp index 633841eedd..7214be49c5 100644 --- a/src/modules/ffmpeg/util/av_util.cpp +++ b/src/modules/ffmpeg/util/av_util.cpp @@ -115,14 +115,18 @@ core::pixel_format get_pixel_format(AVPixelFormat pix_fmt) case AV_PIX_FMT_GRAY8: return core::pixel_format::gray; case AV_PIX_FMT_RGB24: + case AV_PIX_FMT_RGB48LE: return core::pixel_format::rgb; case AV_PIX_FMT_BGR24: + case AV_PIX_FMT_BGR48LE: return core::pixel_format::bgr; case AV_PIX_FMT_BGRA: + case AV_PIX_FMT_BGRA64LE: return core::pixel_format::bgra; case AV_PIX_FMT_ARGB: return core::pixel_format::argb; case AV_PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA64LE: return core::pixel_format::rgba; case AV_PIX_FMT_ABGR: return core::pixel_format::abgr; @@ -175,14 +179,18 @@ core::pixel_format_desc pixel_format_desc(AVPixelFormat pix_fmt, int width, int } case core::pixel_format::bgr: case core::pixel_format::rgb: { - desc.planes.emplace_back(linesizes[0] / 3, height, 3); + auto depth = (pix_fmt == AV_PIX_FMT_BGR48LE || pix_fmt==AV_PIX_FMT_RGB48LE) ? common::bit_depth::bit16:common::bit_depth::bit8; + auto scale = depth == common::bit_depth::bit16?6:3; + desc.planes.emplace_back(linesizes[0] / scale, height, 3, depth); return desc; } case core::pixel_format::bgra: case core::pixel_format::argb: case core::pixel_format::rgba: case core::pixel_format::abgr: { - desc.planes.emplace_back(linesizes[0] / 4, height, 4); + auto depth = (pix_fmt == AV_PIX_FMT_BGRA64LE || pix_fmt==AV_PIX_FMT_RGBA64LE) ? common::bit_depth::bit16:common::bit_depth::bit8; + auto scale = depth == common::bit_depth::bit16?8:4; + desc.planes.emplace_back(linesizes[0] / scale, height, 4, depth); return desc; } case core::pixel_format::ycbcr: