From 4fc2eda3f7fdb4731e6c4238a35e2dbfd024664f Mon Sep 17 00:00:00 2001 From: Ahmad Sharif Date: Thu, 15 Aug 2024 08:01:47 -0700 Subject: [PATCH] Added colorspace and color_range to torchcodec --- src/torchcodec/decoders/_core/VideoDecoder.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/torchcodec/decoders/_core/VideoDecoder.cpp b/src/torchcodec/decoders/_core/VideoDecoder.cpp index a5c0fddf..c6d4694a 100644 --- a/src/torchcodec/decoders/_core/VideoDecoder.cpp +++ b/src/torchcodec/decoders/_core/VideoDecoder.cpp @@ -359,14 +359,16 @@ void VideoDecoder::initializeFilterGraphForStream( snprintf( args, sizeof(args), - "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d", + "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d:colorspace=%d:range=%d", codecContext->width, codecContext->height, codecContext->pix_fmt, activeStream.stream->time_base.num, activeStream.stream->time_base.den, codecContext->sample_aspect_ratio.num, - codecContext->sample_aspect_ratio.den); + codecContext->sample_aspect_ratio.den, + codecContext->colorspace, + codecContext->color_range); int ffmpegStatus = avfilter_graph_create_filter( &filterState.sourceContext,