Skip to content

Commit

Permalink
disable ffmpeg multi-thread
Browse files Browse the repository at this point in the history
  • Loading branch information
huww98 committed May 6, 2020
1 parent b4e44aa commit 76333af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/video/ffmpeg/filter_graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ void FFMPEGFilterGraph::Init(std::string filters_descr, AVCodecContext *dec_ctx)
filter_graph_.reset(avfilter_graph_alloc());
/* automatic threading */
//LOG(INFO) << "Original GraphFilter nb_threads: " << filter_graph_->nb_threads;
filter_graph_->nb_threads = 0;
// filter_graph_->nb_threads = 0;
filter_graph_->thread_type = 0;
/* buffer video source: the decoded frames from the decoder will be inserted here. */
std::snprintf(args, sizeof(args),
"video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",
Expand Down
2 changes: 1 addition & 1 deletion src/video/video_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void VideoReader::SetVideoStream(int stream_nb) {
}

auto dec_ctx = avcodec_alloc_context3(dec);
dec_ctx->thread_count = 0;
// dec_ctx->thread_count = 0;
// LOG(INFO) << "Original decoder multithreading: " << dec_ctx->thread_count;
// CHECK_GE(avcodec_copy_context(dec_ctx, fmt_ctx_->streams[stream_nb]->codec), 0) << "Error: copy context";
// CHECK_GE(avcodec_parameters_to_context(dec_ctx, fmt_ctx_->streams[st_nb]->codecpar), 0) << "Error: copy parameters to codec context.";
Expand Down

0 comments on commit 76333af

Please sign in to comment.