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

Set the field order when interlace is on #534

Merged
merged 6 commits into from
Oct 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/FFmpegWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,14 @@ void FFmpegWriter::SetOption(StreamType stream, std::string name, std::string va
st = video_st;
// Get codec context
c = AV_GET_CODEC_PAR_CONTEXT(st, video_codec_ctx);
// Was a codec / stream found?
if (c) {
if (info.interlaced_frame) {
c->field_order = info.top_field_first ? AV_FIELD_TT : AV_FIELD_BB;
// We only use these two version and ignore AV_FIELD_TB and AV_FIELD_BT
// Otherwise we would need to change the whole export window
}
}
} else if (info.has_audio && stream == AUDIO_STREAM && audio_st) {
st = audio_st;
// Get codec context
Expand Down