Skip to content

Commit

Permalink
fix off-by-one errors in region
Browse files Browse the repository at this point in the history
workaround for upstream ffmpeg bug
  • Loading branch information
russelltg committed Nov 19, 2023
1 parent 36ea7cf commit e0945eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1628,12 +1628,15 @@ fn video_filter(
)
};

// exact=1 should not be necessary, as the input is not chroma-subsampled
// however, there is a bug in ffmpeg that makes it required: https://trac.ffmpeg.org/ticket/10669
// it is harmless to add though, so keep it as a workaround
g.output("in", 0)
.unwrap()
.input("out", 0)
.unwrap()
.parse(&format!(
"crop={roi_w}:{roi_h}:{roi_x}:{roi_y},scale_vaapi=format={output_real_pixfmt_name}:w={enc_w}:h={enc_h}{}",
"crop={roi_w}:{roi_h}:{roi_x}:{roi_y}:exact=1,scale_vaapi=format={output_real_pixfmt_name}:w={enc_w}:h={enc_h}{}",
if let EncodePixelFormat::Vaapi(_) = pix_fmt {
""
} else {
Expand Down

0 comments on commit e0945eb

Please sign in to comment.