Skip to content

Commit ec24944

Browse files
authored
Pass thread count to ffmpeg's filtergraph (#209)
1 parent 59cc022 commit ec24944

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/torchcodec/decoders/_core/VideoDecoder.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ void VideoDecoder::initializeFilterGraphForStream(
254254
}
255255
filterState.filterGraph.reset(avfilter_graph_alloc());
256256
TORCH_CHECK(filterState.filterGraph.get() != nullptr);
257+
if (options.ffmpegThreadCount.has_value()) {
258+
filterState.filterGraph->nb_threads = options.ffmpegThreadCount.value();
259+
}
257260
const AVFilter* buffersrc = avfilter_get_by_name("buffer");
258261
const AVFilter* buffersink = avfilter_get_by_name("buffersink");
259262
enum AVPixelFormat pix_fmts[] = {AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE};

0 commit comments

Comments
 (0)