aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorTim Nicholson <Tim.Nicholson@bbc.co.uk>2012-11-02 13:09:48 +0000
committerMichael Niedermayer <michaelni@gmx.at>2012-11-22 05:30:43 +0100
commitdcbf72836c90d077067248a0ddc4e4c7556e2461 (patch)
tree15f70105e48fa918ac316cf547a665b73c34f65b /ffmpeg.c
parent91743fb7305a0212655e4841c20d8cd0cbc1be99 (diff)
downloadffmpeg-dcbf72836c90d077067248a0ddc4e4c7556e2461.tar.gz
ffmpeg: add setting of field_order flag
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 71a9bea77e..2c3dfa21ae 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -846,6 +846,10 @@ static void do_video_out(AVFormatContext *s,
method. */
enc->coded_frame->interlaced_frame = in_picture->interlaced_frame;
enc->coded_frame->top_field_first = in_picture->top_field_first;
+ if (enc->coded_frame->interlaced_frame)
+ enc->field_order = enc->coded_frame->top_field_first ? AV_FIELD_TB:AV_FIELD_BT;
+ else
+ enc->field_order = AV_FIELD_PROGRESSIVE;
pkt.data = (uint8_t *)in_picture;
pkt.size = sizeof(AVPicture);
pkt.pts = av_rescale_q(in_picture->pts, enc->time_base, ost->st->time_base);
@@ -868,6 +872,14 @@ static void do_video_out(AVFormatContext *s,
big_picture.top_field_first = !!ost->top_field_first;
}
+ if (big_picture.interlaced_frame) {
+ if (enc->codec->id == AV_CODEC_ID_MJPEG)
+ enc->field_order = big_picture.top_field_first ? AV_FIELD_TT:AV_FIELD_BB;
+ else
+ enc->field_order = big_picture.top_field_first ? AV_FIELD_TB:AV_FIELD_BT;
+ } else
+ enc->field_order = AV_FIELD_PROGRESSIVE;
+
big_picture.quality = ost->st->codec->global_quality;
if (!enc->me_threshold)
big_picture.pict_type = 0;