On 2021-01-21 14:10, Stephen Hutchinson wrote:
Yeah, never mind about that. I didn't notice that those are declared
AVSC_INLINE, not AVSC_API, so they don't get used through the dynamic
API loader.
The comment formatting seems to have been messed up in the second
version, though.
/* The following typically only works when assumetff (-bff) and
* assumefieldbased is used in-script. Additional
* logic using GetParity() could deliver more accurate results
* but also decodes a frame which we want to avoid. */
OK, i have to admit formatting comments is in the top 10 of my greatest
weaknesses :D
Thanks for your patience and also thanks for telling me directly how the
formatting is done correctly.
New patch with formatted comment attached
From 243bb2cbae9fabc78fe7f48cb90ae1c620c51a51 Mon Sep 17 00:00:00 2001
From: emcodem <emco...@ffastrans.com>
Date: Thu, 21 Jan 2021 18:59:45 +0100
Subject: [PATCH] Populate field order returned by avs script, Trac Ticket 8757
---
libavformat/avisynth.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index 2c08ace8db..22ae8c0dd3 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -241,6 +241,23 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
st->nb_frames = avs->vi->num_frames;
avpriv_set_pts_info(st, 32, avs->vi->fps_denominator, avs->vi->fps_numerator);
+ av_log(s, AV_LOG_TRACE, "avs_is_field_based: %d\n", avs_is_field_based(avs->vi));
+ av_log(s, AV_LOG_TRACE, "avs_is_parity_known: %d\n", avs_is_parity_known(avs->vi));
+
+ /* The following typically only works when assumetff (-bff) and
+ * assumefieldbased is used in-script. Additional
+ * logic using GetParity() could deliver more accurate results
+ * but also decodes a frame which we want to avoid. */
+ st->codecpar->field_order = AV_FIELD_UNKNOWN;
+ if (avs_is_field_based(avs->vi)) {
+ if (avs_is_tff(avs->vi)) {
+ st->codecpar->field_order = AV_FIELD_TT;
+ }
+ else if (avs_is_bff(avs->vi)) {
+ st->codecpar->field_order = AV_FIELD_BB;
+ }
+ }
+
switch (avs->vi->pixel_type) {
/* 10~16-bit YUV pix_fmts (AviSynth+) */
case AVS_CS_YUV444P10:
--
2.25.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".