History

avisynth: populate field order

Fixes Trac ticket #8757

emcodem committed 5 years ago

Commit 8b744581 parent 4c406861 file · +17 −0Browse files

Unified · Split

libavformat/avisynth.c+17−0
@@ -243,6 +243,23 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) · 242 unmodified lines
243243 st->nb_frames = avs->vi->num_frames;
244244 avpriv_set_pts_info(st, 32, avs->vi->fps_denominator, avs->vi->fps_numerator);
245245
246+ av_log(s, AV_LOG_TRACE, "avs_is_field_based: %d\n", avs_is_field_based(avs->vi));
247+ av_log(s, AV_LOG_TRACE, "avs_is_parity_known: %d\n", avs_is_parity_known(avs->vi));
248+
249+ /* The following typically only works when assumetff (-bff) and
250+ * assumefieldbased is used in-script. Additional
251+ * logic using GetParity() could deliver more accurate results
252+ * but also decodes a frame which we want to avoid. */
253+ st->codecpar->field_order = AV_FIELD_UNKNOWN;
254+ if (avs_is_field_based(avs->vi)) {
255+ if (avs_is_tff(avs->vi)) {
256+ st->codecpar->field_order = AV_FIELD_TT;
257+ }
258+ else if (avs_is_bff(avs->vi)) {
259+ st->codecpar->field_order = AV_FIELD_BB;
260+ }
261+ }
262+
246263 switch (avs->vi->pixel_type) {
247264 /* 10~16-bit YUV pix_fmts (AviSynth+) */
248265 case AVS_CS_YUV444P10:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t