Skip to content

Commit

Permalink
Pass thread count to ffmpeg's filtergraph (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
romanmeta authored Sep 10, 2024
1 parent 59cc022 commit ec24944
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/torchcodec/decoders/_core/VideoDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ void VideoDecoder::initializeFilterGraphForStream(
}
filterState.filterGraph.reset(avfilter_graph_alloc());
TORCH_CHECK(filterState.filterGraph.get() != nullptr);
if (options.ffmpegThreadCount.has_value()) {
filterState.filterGraph->nb_threads = options.ffmpegThreadCount.value();
}
const AVFilter* buffersrc = avfilter_get_by_name("buffer");
const AVFilter* buffersink = avfilter_get_by_name("buffersink");
enum AVPixelFormat pix_fmts[] = {AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE};
Expand Down

0 comments on commit ec24944

Please sign in to comment.