[FFmpeg-devel,3/3] ffmpeg: apply frame cropping between filter graph and encoder

Submitted by Aman Gupta on Nov. 18, 2017, 12:36 a.m.

Details

Message ID 20171118003648.33514-4-ffmpeg@tmm1.net
State New
Headers show

Commit Message

Aman Gupta Nov. 18, 2017, 12:36 a.m.
From: Aman Gupta <aman@tmm1.net>

---
 fftools/ffmpeg.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index babd85f7bc..159b8e0016 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1265,6 +1265,10 @@  static void do_video_out(OutputFile *of,
                    enc->time_base.num, enc->time_base.den);
         }
 
+        // apply any frame cropping added by filters
+        av_frame_apply_cropping(in_picture, ist->dec_ctx->flags & AV_CODEC_FLAG_UNALIGNED ?
+                                            AV_FRAME_CROP_UNALIGNED : 0);
+
         ost->frames_encoded++;
 
         ret = avcodec_send_frame(enc, in_picture);