Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the incompatibility issue of ffmpeg 5.0 and 5.1 #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion bmf/c_modules/src/ffmpeg_encoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,11 @@ int CFFEncoder::init_codec(int idx, AVFrame *frame) {
}
}

out_stream->codec->time_base = enc_ctxs_[idx]->time_base;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line of code is not used, can it be deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this is for future consideration, waiting for maintainer's opinion~

/**
* @deprecated codec has been deprecated since ffmpeg 5.0
* use out_stream->time_base instead of out_stream->codec->time_base.
*/
out_stream->time_base = enc_ctxs_[idx]->time_base;
}

out_stream->time_base = enc_ctxs_[idx]->time_base;
Expand Down
1 change: 1 addition & 0 deletions bmf/sdk/cpp_sdk/include/bmf/sdk/filter_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ extern "C" {
#include <libavutil/bprint.h>
#include <libswscale/swscale.h>
#include <libavutil/opt.h>
#include <libavutil/channel_layout.h>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

av_get_default_channel_layout was declared in <libavutil/channel_layout.h>
when the ffmpeg version is 5.x.x, the ffmpeg header file used by BMF does not include <libavutil/channel_layout.h>
and when the ffmpeg version is 4.x.x, there is no such problem

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no problem for me using 5.1.2 without this header

Copy link
Contributor Author

@JackLau1222 JackLau1222 Oct 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please try other version. like 5.0.3 or 5.1.6

#include <libavutil/error.h>
};

Expand Down
Loading