Skip to content

Commit

Permalink
Merge pull request #534 from eisneinechse/interlace
Browse files Browse the repository at this point in the history
Set the field order when interlace is on
  • Loading branch information
jonoomph committed Oct 16, 2020
2 parents 8cf0483 + 47fca02 commit 7f08778
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/FFmpegWriter.cpp
Expand Up @@ -350,6 +350,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

0 comments on commit 7f08778

Please sign in to comment.