Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 0/9] avisynth: add user options
@ 2022-08-29  0:02 Stephen Hutchinson
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 1/9] avformat/avisynth: read _SARNum/_SARDen from frame properties Stephen Hutchinson
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Stephen Hutchinson @ 2022-08-29  0:02 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Stephen Hutchinson

The introduction of reading _SARNum/Den values spurred
the idea of making sure that users can turn the frameprop
value reading ability on and off.

Resizing is a much more common activity in AviSynth scripts
than the kind of broad color work that would potentially
severely impact the usage of the color-related frameprops.
Since the source filter sets the SAR values, but then it
would be quite possible for a user to manipulate the resolution
without updating the prop values for _SARNum and _SARDen, it
would become extremely easy to get it wrong.

So reading _SARNum/_SARDen is *possible*, but requires
user opt-in with the -read_frameprop_sar boolean option.
And that then lead to fleshing out the others into their
own options, and a mass frameprop on/off setting.

Stephen Hutchinson (9):
  avformat/avisynth: read _SARNum/_SARDen from frame properties
  avformat/avisynth: add read_frameprop_sar option
  avformat/avisynth: add read_frameprops option
  avformat/avisynth: add read_frameprop_field_order option
  avformat/avisynth: add read_frameprop_range option
  avformat/avisynth: add read_frameprop_primaries option
  avformat/avisynth: add read_frameprop_transfer option
  avformat/avisynth: add read_frameprop_matrix option
  avformat/avisynth: add read_frameprop_chroma_location option

 libavformat/avisynth.c | 462 +++++++++++++++++++++++------------------
 1 file changed, 259 insertions(+), 203 deletions(-)

-- 
2.34.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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [FFmpeg-devel] [PATCH 1/9] avformat/avisynth: read _SARNum/_SARDen from frame properties
  2022-08-29  0:02 [FFmpeg-devel] [PATCH 0/9] avisynth: add user options Stephen Hutchinson
@ 2022-08-29  0:02 ` Stephen Hutchinson
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 2/9] avformat/avisynth: add read_frameprop_sar option Stephen Hutchinson
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Stephen Hutchinson @ 2022-08-29  0:02 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Stephen Hutchinson

Initialized to 1:1, but if the script sets these properties, it
will be set to those instead (0:0 disables it, apparently).

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
---
 libavformat/avisynth.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index 3d9fa2be50..d978e6ec40 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -251,6 +251,8 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
     AVS_VideoFrame *frame;
     int error;
     int planar = 0; // 0: packed, 1: YUV, 2: Y8, 3: Planar RGB, 4: YUVA, 5: Planar RGBA
+    int sar_num = 1;
+    int sar_den = 1;
 
     st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
     st->codecpar->codec_id   = AV_CODEC_ID_RAWVIDEO;
@@ -728,6 +730,12 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
                 st->codecpar->chroma_location = AVCHROMA_LOC_UNSPECIFIED;
             }
         }
+
+        /* Sample aspect ratio */
+        sar_num = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARNum", 0, &error);
+        sar_den = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARDen", 0, &error);
+        st->sample_aspect_ratio = (AVRational){ sar_num, sar_den };
+
         avs_library.avs_release_video_frame(frame);
     } else {
         st->codecpar->field_order = AV_FIELD_UNKNOWN;
-- 
2.34.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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [FFmpeg-devel] [PATCH 2/9] avformat/avisynth: add read_frameprop_sar option
  2022-08-29  0:02 [FFmpeg-devel] [PATCH 0/9] avisynth: add user options Stephen Hutchinson
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 1/9] avformat/avisynth: read _SARNum/_SARDen from frame properties Stephen Hutchinson
@ 2022-08-29  0:02 ` Stephen Hutchinson
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 3/9] avformat/avisynth: add read_frameprops option Stephen Hutchinson
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Stephen Hutchinson @ 2022-08-29  0:02 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Stephen Hutchinson

Because SAR is much more likely to be negatively affected by
operations made in-script, given that resizing is probably far more
common than the sort of color manipulation involved in most of the
other frame properties, the safest option is to disable reading
it by default, allowing users to opt in.

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
---
 libavformat/avisynth.c | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index d978e6ec40..d503c7ed40 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -21,6 +21,7 @@
 
 #include "libavutil/attributes.h"
 #include "libavutil/internal.h"
+#include "libavutil/opt.h"
 
 #include "libavcodec/internal.h"
 
@@ -86,6 +87,7 @@ typedef struct AviSynthLibrary {
 } AviSynthLibrary;
 
 typedef struct AviSynthContext {
+    const AVClass *class;
     AVS_ScriptEnvironment *env;
     AVS_Clip *clip;
     const AVS_VideoInfo *vi;
@@ -100,6 +102,9 @@ typedef struct AviSynthContext {
 
     int error;
 
+    /* (de)activate reading frame properties */
+    int frameprop_sar;
+
     /* Linked list pointers. */
     struct AviSynthContext *next;
 } AviSynthContext;
@@ -732,9 +737,11 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
         }
 
         /* Sample aspect ratio */
-        sar_num = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARNum", 0, &error);
-        sar_den = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARDen", 0, &error);
-        st->sample_aspect_ratio = (AVRational){ sar_num, sar_den };
+        if (avs->frameprop_sar) {
+            sar_num = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARNum", 0, &error);
+            sar_den = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARDen", 0, &error);
+            st->sample_aspect_ratio = (AVRational){ sar_num, sar_den };
+        }
 
         avs_library.avs_release_video_frame(frame);
     } else {
@@ -1140,6 +1147,19 @@ static int avisynth_read_seek(AVFormatContext *s, int stream_index,
     return 0;
 }
 
+#define OFFSET(x) offsetof(AviSynthContext, x)
+static const AVOption avisynth_options[] = {
+    { "read_frameprop_sar", "Read SAR from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_sar), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+    { NULL },
+};
+
+static const AVClass avisynth_demuxer_class = {
+    .class_name = "AviSynth demuxer",
+    .item_name  = av_default_item_name,
+    .option     = avisynth_options,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
+
 const AVInputFormat ff_avisynth_demuxer = {
     .name           = "avisynth",
     .long_name      = NULL_IF_CONFIG_SMALL("AviSynth script"),
@@ -1149,4 +1169,5 @@ const AVInputFormat ff_avisynth_demuxer = {
     .read_close     = avisynth_read_close,
     .read_seek      = avisynth_read_seek,
     .extensions     = "avs",
+    .priv_class     = &avisynth_demuxer_class,
 };
-- 
2.34.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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [FFmpeg-devel] [PATCH 3/9] avformat/avisynth: add read_frameprops option
  2022-08-29  0:02 [FFmpeg-devel] [PATCH 0/9] avisynth: add user options Stephen Hutchinson
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 1/9] avformat/avisynth: read _SARNum/_SARDen from frame properties Stephen Hutchinson
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 2/9] avformat/avisynth: add read_frameprop_sar option Stephen Hutchinson
@ 2022-08-29  0:02 ` Stephen Hutchinson
  2022-08-29  0:41   ` Andreas Rheinhardt
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 4/9] avformat/avisynth: add read_frameprop_field_order option Stephen Hutchinson
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 14+ messages in thread
From: Stephen Hutchinson @ 2022-08-29  0:02 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Stephen Hutchinson

Allows turning the reading of frame properties entirely on and off.
Defaults to reading frame properties.

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
---
 libavformat/avisynth.c | 355 +++++++++++++++++++++--------------------
 1 file changed, 179 insertions(+), 176 deletions(-)

diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index d503c7ed40..5d726d70a5 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -103,6 +103,7 @@ typedef struct AviSynthContext {
     int error;
 
     /* (de)activate reading frame properties */
+    int frameprops;
     int frameprop_sar;
 
     /* Linked list pointers. */
@@ -522,227 +523,228 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
         frame  = avs_library.avs_get_frame(avs->clip, 0);
         avsmap = avs_library.avs_get_frame_props_ro(avs->env, frame);
 
-        /* Field order */
-        if(avs_library.avs_prop_get_type(avs->env, avsmap, "_FieldBased") == AVS_PROPTYPE_UNSET) {
-            st->codecpar->field_order = AV_FIELD_UNKNOWN;
-        } else {
-            switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_FieldBased", 0, &error)) {
-            case 0:
-                st->codecpar->field_order = AV_FIELD_PROGRESSIVE;
-                break;
-            case 1:
-                st->codecpar->field_order = AV_FIELD_BB;
-                break;
-            case 2:
-                st->codecpar->field_order = AV_FIELD_TT;
-                break;
-            default:
+        if(avs->frameprops) {
+            /* Field order */
+            if(avs_library.avs_prop_get_type(avs->env, avsmap, "_FieldBased") == AVS_PROPTYPE_UNSET) {
                 st->codecpar->field_order = AV_FIELD_UNKNOWN;
+            } else {
+                switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_FieldBased", 0, &error)) {
+                case 0:
+                    st->codecpar->field_order = AV_FIELD_PROGRESSIVE;
+                    break;
+                case 1:
+                    st->codecpar->field_order = AV_FIELD_BB;
+                    break;
+                case 2:
+                    st->codecpar->field_order = AV_FIELD_TT;
+                    break;
+                default:
+                    st->codecpar->field_order = AV_FIELD_UNKNOWN;
+                }
             }
-        }
 
-        /* Color Range */
-        if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ColorRange") == AVS_PROPTYPE_UNSET) {
-            st->codecpar->color_range = AVCOL_RANGE_UNSPECIFIED;
-        } else {
-            switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ColorRange", 0, &error)) {
-            case 0:
-                st->codecpar->color_range = AVCOL_RANGE_JPEG;
-                break;
-            case 1:
-                st->codecpar->color_range = AVCOL_RANGE_MPEG;
-                break;
-            default:
+            /* Color Range */
+            if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ColorRange") == AVS_PROPTYPE_UNSET) {
                 st->codecpar->color_range = AVCOL_RANGE_UNSPECIFIED;
+            } else {
+                switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ColorRange", 0, &error)) {
+                case 0:
+                    st->codecpar->color_range = AVCOL_RANGE_JPEG;
+                    break;
+                case 1:
+                    st->codecpar->color_range = AVCOL_RANGE_MPEG;
+                    break;
+                default:
+                    st->codecpar->color_range = AVCOL_RANGE_UNSPECIFIED;
+                }
             }
-        }
 
-        /* Color Primaries */
-        switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Primaries", 0, &error)) {
-        case 1:
-            st->codecpar->color_primaries = AVCOL_PRI_BT709;
-            break;
-        case 2:
-            st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED;
-            break;
-        case 4:
-            st->codecpar->color_primaries = AVCOL_PRI_BT470M;
-            break;
-        case 5:
-            st->codecpar->color_primaries = AVCOL_PRI_BT470BG;
-            break;
-        case 6:
-            st->codecpar->color_primaries = AVCOL_PRI_SMPTE170M;
-            break;
-        case 7:
-            st->codecpar->color_primaries = AVCOL_PRI_SMPTE240M;
-            break;
-        case 8:
-            st->codecpar->color_primaries = AVCOL_PRI_FILM;
-            break;
-        case 9:
-            st->codecpar->color_primaries = AVCOL_PRI_BT2020;
-            break;
-        case 10:
-            st->codecpar->color_primaries = AVCOL_PRI_SMPTE428;
-            break;
-        case 11:
-            st->codecpar->color_primaries = AVCOL_PRI_SMPTE431;
-            break;
-        case 12:
-            st->codecpar->color_primaries = AVCOL_PRI_SMPTE432;
-            break;
-        case 22:
-            st->codecpar->color_primaries = AVCOL_PRI_EBU3213;
-            break;
-        default:
-            st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED;
-        }
-
-        /* Color Transfer Characteristics */
-        switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Transfer", 0, &error)) {
-        case 1:
-            st->codecpar->color_trc = AVCOL_TRC_BT709;
-            break;
-        case 2:
-            st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED;
-            break;
-        case 4:
-            st->codecpar->color_trc = AVCOL_TRC_GAMMA22;
-            break;
-        case 5:
-            st->codecpar->color_trc = AVCOL_TRC_GAMMA28;
-            break;
-        case 6:
-            st->codecpar->color_trc = AVCOL_TRC_SMPTE170M;
-            break;
-        case 7:
-            st->codecpar->color_trc = AVCOL_TRC_SMPTE240M;
-            break;
-        case 8:
-            st->codecpar->color_trc = AVCOL_TRC_LINEAR;
-            break;
-        case 9:
-            st->codecpar->color_trc = AVCOL_TRC_LOG;
-            break;
-        case 10:
-            st->codecpar->color_trc = AVCOL_TRC_LOG_SQRT;
-            break;
-        case 11:
-            st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_4;
-            break;
-        case 12:
-            st->codecpar->color_trc = AVCOL_TRC_BT1361_ECG;
-            break;
-        case 13:
-            st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_1;
-            break;
-        case 14:
-            st->codecpar->color_trc = AVCOL_TRC_BT2020_10;
-            break;
-        case 15:
-            st->codecpar->color_trc = AVCOL_TRC_BT2020_12;
-            break;
-        case 16:
-            st->codecpar->color_trc = AVCOL_TRC_SMPTE2084;
-            break;
-        case 17:
-            st->codecpar->color_trc = AVCOL_TRC_SMPTE428;
-            break;
-        case 18:
-            st->codecpar->color_trc = AVCOL_TRC_ARIB_STD_B67;
-            break;
-        default:
-            st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED;
-        }
-
-        /* Matrix coefficients */
-        if(avs_library.avs_prop_get_type(avs->env, avsmap, "_Matrix") == AVS_PROPTYPE_UNSET) {
-            st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
-        } else {
-            switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Matrix", 0, &error)) {
-            case 0:
-                st->codecpar->color_space = AVCOL_SPC_RGB;
-                break;
+            /* Color Primaries */
+            switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Primaries", 0, &error)) {
             case 1:
-                st->codecpar->color_space = AVCOL_SPC_BT709;
+                st->codecpar->color_primaries = AVCOL_PRI_BT709;
                 break;
             case 2:
-                st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
+                st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED;
                 break;
             case 4:
-                st->codecpar->color_space = AVCOL_SPC_FCC;
+                st->codecpar->color_primaries = AVCOL_PRI_BT470M;
                 break;
             case 5:
-                st->codecpar->color_space = AVCOL_SPC_BT470BG;
+                st->codecpar->color_primaries = AVCOL_PRI_BT470BG;
                 break;
             case 6:
-                st->codecpar->color_space = AVCOL_SPC_SMPTE170M;
+                st->codecpar->color_primaries = AVCOL_PRI_SMPTE170M;
                 break;
             case 7:
-                st->codecpar->color_space = AVCOL_SPC_SMPTE240M;
+                st->codecpar->color_primaries = AVCOL_PRI_SMPTE240M;
                 break;
             case 8:
-                st->codecpar->color_space = AVCOL_SPC_YCGCO;
+                st->codecpar->color_primaries = AVCOL_PRI_FILM;
                 break;
             case 9:
-                st->codecpar->color_space = AVCOL_SPC_BT2020_NCL;
+                st->codecpar->color_primaries = AVCOL_PRI_BT2020;
                 break;
             case 10:
-                st->codecpar->color_space = AVCOL_SPC_BT2020_CL;
+                st->codecpar->color_primaries = AVCOL_PRI_SMPTE428;
                 break;
             case 11:
-                st->codecpar->color_space = AVCOL_SPC_SMPTE2085;
+                st->codecpar->color_primaries = AVCOL_PRI_SMPTE431;
                 break;
             case 12:
-                st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_NCL;
+                st->codecpar->color_primaries = AVCOL_PRI_SMPTE432;
                 break;
-            case 13:
-                st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_CL;
-                break;
-            case 14:
-                st->codecpar->color_space = AVCOL_SPC_ICTCP;
+            case 22:
+                st->codecpar->color_primaries = AVCOL_PRI_EBU3213;
                 break;
             default:
-                st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
+                st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED;
             }
-        }
 
-        /* Chroma Location */
-        if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ChromaLocation") == AVS_PROPTYPE_UNSET) {
-            st->codecpar->chroma_location = AVCHROMA_LOC_UNSPECIFIED;
-        } else {
-            switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ChromaLocation", 0, &error)) {
-            case 0:
-                st->codecpar->chroma_location = AVCHROMA_LOC_LEFT;
-                break;
+            /* Color Transfer Characteristics */
+            switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Transfer", 0, &error)) {
             case 1:
-                st->codecpar->chroma_location = AVCHROMA_LOC_CENTER;
+                st->codecpar->color_trc = AVCOL_TRC_BT709;
                 break;
             case 2:
-                st->codecpar->chroma_location = AVCHROMA_LOC_TOPLEFT;
-                break;
-            case 3:
-                st->codecpar->chroma_location = AVCHROMA_LOC_TOP;
+                st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED;
                 break;
             case 4:
-                st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOMLEFT;
+                st->codecpar->color_trc = AVCOL_TRC_GAMMA22;
                 break;
             case 5:
-                st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOM;
+                st->codecpar->color_trc = AVCOL_TRC_GAMMA28;
+                break;
+            case 6:
+                st->codecpar->color_trc = AVCOL_TRC_SMPTE170M;
+                break;
+            case 7:
+                st->codecpar->color_trc = AVCOL_TRC_SMPTE240M;
+                break;
+            case 8:
+                st->codecpar->color_trc = AVCOL_TRC_LINEAR;
+                break;
+            case 9:
+                st->codecpar->color_trc = AVCOL_TRC_LOG;
+                break;
+            case 10:
+                st->codecpar->color_trc = AVCOL_TRC_LOG_SQRT;
+                break;
+            case 11:
+                st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_4;
+                break;
+            case 12:
+                st->codecpar->color_trc = AVCOL_TRC_BT1361_ECG;
+                break;
+            case 13:
+                st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_1;
+                break;
+            case 14:
+                st->codecpar->color_trc = AVCOL_TRC_BT2020_10;
+                break;
+            case 15:
+                st->codecpar->color_trc = AVCOL_TRC_BT2020_12;
+                break;
+            case 16:
+                st->codecpar->color_trc = AVCOL_TRC_SMPTE2084;
+                break;
+            case 17:
+                st->codecpar->color_trc = AVCOL_TRC_SMPTE428;
+                break;
+            case 18:
+                st->codecpar->color_trc = AVCOL_TRC_ARIB_STD_B67;
                 break;
             default:
+                st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED;
+            }
+
+            /* Matrix coefficients */
+            if(avs_library.avs_prop_get_type(avs->env, avsmap, "_Matrix") == AVS_PROPTYPE_UNSET) {
+                st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
+            } else {
+                switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Matrix", 0, &error)) {
+                case 0:
+                    st->codecpar->color_space = AVCOL_SPC_RGB;
+                    break;
+                case 1:
+                    st->codecpar->color_space = AVCOL_SPC_BT709;
+                    break;
+                case 2:
+                    st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
+                    break;
+                case 4:
+                    st->codecpar->color_space = AVCOL_SPC_FCC;
+                    break;
+                case 5:
+                    st->codecpar->color_space = AVCOL_SPC_BT470BG;
+                    break;
+                case 6:
+                    st->codecpar->color_space = AVCOL_SPC_SMPTE170M;
+                    break;
+                case 7:
+                    st->codecpar->color_space = AVCOL_SPC_SMPTE240M;
+                    break;
+                case 8:
+                    st->codecpar->color_space = AVCOL_SPC_YCGCO;
+                    break;
+                case 9:
+                    st->codecpar->color_space = AVCOL_SPC_BT2020_NCL;
+                    break;
+                case 10:
+                    st->codecpar->color_space = AVCOL_SPC_BT2020_CL;
+                    break;
+                case 11:
+                    st->codecpar->color_space = AVCOL_SPC_SMPTE2085;
+                    break;
+                case 12:
+                    st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_NCL;
+                    break;
+                case 13:
+                    st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_CL;
+                    break;
+                case 14:
+                    st->codecpar->color_space = AVCOL_SPC_ICTCP;
+                    break;
+                default:
+                    st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
+                }
+            }
+
+            /* Chroma Location */
+            if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ChromaLocation") == AVS_PROPTYPE_UNSET) {
                 st->codecpar->chroma_location = AVCHROMA_LOC_UNSPECIFIED;
+            } else {
+                switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ChromaLocation", 0, &error)) {
+                case 0:
+                    st->codecpar->chroma_location = AVCHROMA_LOC_LEFT;
+                    break;
+                case 1:
+                    st->codecpar->chroma_location = AVCHROMA_LOC_CENTER;
+                    break;
+                case 2:
+                    st->codecpar->chroma_location = AVCHROMA_LOC_TOPLEFT;
+                    break;
+                case 3:
+                    st->codecpar->chroma_location = AVCHROMA_LOC_TOP;
+                    break;
+                case 4:
+                    st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOMLEFT;
+                    break;
+                case 5:
+                    st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOM;
+                    break;
+                default:
+                    st->codecpar->chroma_location = AVCHROMA_LOC_UNSPECIFIED;
+                }
             }
-        }
 
-        /* Sample aspect ratio */
-        if (avs->frameprop_sar) {
-            sar_num = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARNum", 0, &error);
-            sar_den = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARDen", 0, &error);
-            st->sample_aspect_ratio = (AVRational){ sar_num, sar_den };
+            /* Sample aspect ratio */
+            if (avs->frameprop_sar) {
+                sar_num = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARNum", 0, &error);
+                sar_den = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARDen", 0, &error);
+                st->sample_aspect_ratio = (AVRational){ sar_num, sar_den };
+            }
         }
-
         avs_library.avs_release_video_frame(frame);
     } else {
         st->codecpar->field_order = AV_FIELD_UNKNOWN;
@@ -1149,6 +1151,7 @@ static int avisynth_read_seek(AVFormatContext *s, int stream_index,
 
 #define OFFSET(x) offsetof(AviSynthContext, x)
 static const AVOption avisynth_options[] = {
+    { "read_frameprops", "Read frame properties from script (AviSynth+ v3.7.1+).", OFFSET(frameprops), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_sar", "Read SAR from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_sar), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { NULL },
 };
-- 
2.34.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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [FFmpeg-devel] [PATCH 4/9] avformat/avisynth: add read_frameprop_field_order option
  2022-08-29  0:02 [FFmpeg-devel] [PATCH 0/9] avisynth: add user options Stephen Hutchinson
                   ` (2 preceding siblings ...)
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 3/9] avformat/avisynth: add read_frameprops option Stephen Hutchinson
@ 2022-08-29  0:02 ` Stephen Hutchinson
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 5/9] avformat/avisynth: add read_frameprop_range option Stephen Hutchinson
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Stephen Hutchinson @ 2022-08-29  0:02 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Stephen Hutchinson

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
---
 libavformat/avisynth.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index 5d726d70a5..c76b50421c 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -104,6 +104,7 @@ typedef struct AviSynthContext {
 
     /* (de)activate reading frame properties */
     int frameprops;
+    int frameprop_field_order;
     int frameprop_sar;
 
     /* Linked list pointers. */
@@ -525,21 +526,23 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
 
         if(avs->frameprops) {
             /* Field order */
-            if(avs_library.avs_prop_get_type(avs->env, avsmap, "_FieldBased") == AVS_PROPTYPE_UNSET) {
-                st->codecpar->field_order = AV_FIELD_UNKNOWN;
-            } else {
-                switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_FieldBased", 0, &error)) {
-                case 0:
-                    st->codecpar->field_order = AV_FIELD_PROGRESSIVE;
-                    break;
-                case 1:
-                    st->codecpar->field_order = AV_FIELD_BB;
-                    break;
-                case 2:
-                    st->codecpar->field_order = AV_FIELD_TT;
-                    break;
-                default:
+            if(avs->frameprop_field_order) {
+                if(avs_library.avs_prop_get_type(avs->env, avsmap, "_FieldBased") == AVS_PROPTYPE_UNSET) {
                     st->codecpar->field_order = AV_FIELD_UNKNOWN;
+                } else {
+                    switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_FieldBased", 0, &error)) {
+                    case 0:
+                        st->codecpar->field_order = AV_FIELD_PROGRESSIVE;
+                        break;
+                    case 1:
+                        st->codecpar->field_order = AV_FIELD_BB;
+                        break;
+                    case 2:
+                        st->codecpar->field_order = AV_FIELD_TT;
+                        break;
+                    default:
+                        st->codecpar->field_order = AV_FIELD_UNKNOWN;
+                    }
                 }
             }
 
@@ -1152,6 +1155,7 @@ static int avisynth_read_seek(AVFormatContext *s, int stream_index,
 #define OFFSET(x) offsetof(AviSynthContext, x)
 static const AVOption avisynth_options[] = {
     { "read_frameprops", "Read frame properties from script (AviSynth+ v3.7.1+).", OFFSET(frameprops), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+    { "read_frameprop_field_order", "Read field order from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_field_order), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_sar", "Read SAR from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_sar), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { NULL },
 };
-- 
2.34.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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [FFmpeg-devel] [PATCH 5/9] avformat/avisynth: add read_frameprop_range option
  2022-08-29  0:02 [FFmpeg-devel] [PATCH 0/9] avisynth: add user options Stephen Hutchinson
                   ` (3 preceding siblings ...)
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 4/9] avformat/avisynth: add read_frameprop_field_order option Stephen Hutchinson
@ 2022-08-29  0:02 ` Stephen Hutchinson
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 6/9] avformat/avisynth: add read_frameprop_primaries option Stephen Hutchinson
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Stephen Hutchinson @ 2022-08-29  0:02 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Stephen Hutchinson

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
---
 libavformat/avisynth.c | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index c76b50421c..65d8448e89 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -105,6 +105,7 @@ typedef struct AviSynthContext {
     /* (de)activate reading frame properties */
     int frameprops;
     int frameprop_field_order;
+    int frameprop_range;
     int frameprop_sar;
 
     /* Linked list pointers. */
@@ -547,18 +548,20 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
             }
 
             /* Color Range */
-            if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ColorRange") == AVS_PROPTYPE_UNSET) {
-                st->codecpar->color_range = AVCOL_RANGE_UNSPECIFIED;
-            } else {
-                switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ColorRange", 0, &error)) {
-                case 0:
-                    st->codecpar->color_range = AVCOL_RANGE_JPEG;
-                    break;
-                case 1:
-                    st->codecpar->color_range = AVCOL_RANGE_MPEG;
-                    break;
-                default:
+            if(avs->frameprop_range) {
+                if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ColorRange") == AVS_PROPTYPE_UNSET) {
                     st->codecpar->color_range = AVCOL_RANGE_UNSPECIFIED;
+                } else {
+                    switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ColorRange", 0, &error)) {
+                    case 0:
+                        st->codecpar->color_range = AVCOL_RANGE_JPEG;
+                        break;
+                    case 1:
+                        st->codecpar->color_range = AVCOL_RANGE_MPEG;
+                        break;
+                    default:
+                        st->codecpar->color_range = AVCOL_RANGE_UNSPECIFIED;
+                    }
                 }
             }
 
@@ -1156,6 +1159,7 @@ static int avisynth_read_seek(AVFormatContext *s, int stream_index,
 static const AVOption avisynth_options[] = {
     { "read_frameprops", "Read frame properties from script (AviSynth+ v3.7.1+).", OFFSET(frameprops), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_field_order", "Read field order from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_field_order), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+    { "read_frameprop_range", "Read color range from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_range), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_sar", "Read SAR from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_sar), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { NULL },
 };
-- 
2.34.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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [FFmpeg-devel] [PATCH 6/9] avformat/avisynth: add read_frameprop_primaries option
  2022-08-29  0:02 [FFmpeg-devel] [PATCH 0/9] avisynth: add user options Stephen Hutchinson
                   ` (4 preceding siblings ...)
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 5/9] avformat/avisynth: add read_frameprop_range option Stephen Hutchinson
@ 2022-08-29  0:02 ` Stephen Hutchinson
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 7/9] avformat/avisynth: add read_frameprop_transfer option Stephen Hutchinson
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 14+ messages in thread
From: Stephen Hutchinson @ 2022-08-29  0:02 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Stephen Hutchinson

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
---
 libavformat/avisynth.c | 82 ++++++++++++++++++++++--------------------
 1 file changed, 43 insertions(+), 39 deletions(-)

diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index 65d8448e89..945ce0e245 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -106,6 +106,7 @@ typedef struct AviSynthContext {
     int frameprops;
     int frameprop_field_order;
     int frameprop_range;
+    int frameprop_primaries;
     int frameprop_sar;
 
     /* Linked list pointers. */
@@ -566,45 +567,47 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
             }
 
             /* Color Primaries */
-            switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Primaries", 0, &error)) {
-            case 1:
-                st->codecpar->color_primaries = AVCOL_PRI_BT709;
-                break;
-            case 2:
-                st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED;
-                break;
-            case 4:
-                st->codecpar->color_primaries = AVCOL_PRI_BT470M;
-                break;
-            case 5:
-                st->codecpar->color_primaries = AVCOL_PRI_BT470BG;
-                break;
-            case 6:
-                st->codecpar->color_primaries = AVCOL_PRI_SMPTE170M;
-                break;
-            case 7:
-                st->codecpar->color_primaries = AVCOL_PRI_SMPTE240M;
-                break;
-            case 8:
-                st->codecpar->color_primaries = AVCOL_PRI_FILM;
-                break;
-            case 9:
-                st->codecpar->color_primaries = AVCOL_PRI_BT2020;
-                break;
-            case 10:
-                st->codecpar->color_primaries = AVCOL_PRI_SMPTE428;
-                break;
-            case 11:
-                st->codecpar->color_primaries = AVCOL_PRI_SMPTE431;
-                break;
-            case 12:
-                st->codecpar->color_primaries = AVCOL_PRI_SMPTE432;
-                break;
-            case 22:
-                st->codecpar->color_primaries = AVCOL_PRI_EBU3213;
-                break;
-            default:
-                st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED;
+            if(avs->frameprop_primaries) {
+                switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Primaries", 0, &error)) {
+                case 1:
+                    st->codecpar->color_primaries = AVCOL_PRI_BT709;
+                    break;
+                case 2:
+                    st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED;
+                    break;
+                case 4:
+                    st->codecpar->color_primaries = AVCOL_PRI_BT470M;
+                    break;
+                case 5:
+                    st->codecpar->color_primaries = AVCOL_PRI_BT470BG;
+                    break;
+                case 6:
+                    st->codecpar->color_primaries = AVCOL_PRI_SMPTE170M;
+                    break;
+                case 7:
+                    st->codecpar->color_primaries = AVCOL_PRI_SMPTE240M;
+                    break;
+                case 8:
+                    st->codecpar->color_primaries = AVCOL_PRI_FILM;
+                    break;
+                case 9:
+                    st->codecpar->color_primaries = AVCOL_PRI_BT2020;
+                    break;
+                case 10:
+                    st->codecpar->color_primaries = AVCOL_PRI_SMPTE428;
+                    break;
+                case 11:
+                    st->codecpar->color_primaries = AVCOL_PRI_SMPTE431;
+                    break;
+                case 12:
+                    st->codecpar->color_primaries = AVCOL_PRI_SMPTE432;
+                    break;
+                case 22:
+                    st->codecpar->color_primaries = AVCOL_PRI_EBU3213;
+                    break;
+                default:
+                    st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED;
+                }
             }
 
             /* Color Transfer Characteristics */
@@ -1160,6 +1163,7 @@ static const AVOption avisynth_options[] = {
     { "read_frameprops", "Read frame properties from script (AviSynth+ v3.7.1+).", OFFSET(frameprops), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_field_order", "Read field order from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_field_order), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_range", "Read color range from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_range), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+    { "read_frameprop_primaries", "Read color primaries from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_primaries), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_sar", "Read SAR from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_sar), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { NULL },
 };
-- 
2.34.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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [FFmpeg-devel] [PATCH 7/9] avformat/avisynth: add read_frameprop_transfer option
  2022-08-29  0:02 [FFmpeg-devel] [PATCH 0/9] avisynth: add user options Stephen Hutchinson
                   ` (5 preceding siblings ...)
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 6/9] avformat/avisynth: add read_frameprop_primaries option Stephen Hutchinson
@ 2022-08-29  0:02 ` Stephen Hutchinson
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 8/9] avformat/avisynth: add read_frameprop_matrix option Stephen Hutchinson
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 9/9] avformat/avisynth: add read_frameprop_chroma_location option Stephen Hutchinson
  8 siblings, 0 replies; 14+ messages in thread
From: Stephen Hutchinson @ 2022-08-29  0:02 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Stephen Hutchinson

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
---
 libavformat/avisynth.c | 112 +++++++++++++++++++++--------------------
 1 file changed, 58 insertions(+), 54 deletions(-)

diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index 945ce0e245..ff4435758e 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -107,6 +107,7 @@ typedef struct AviSynthContext {
     int frameprop_field_order;
     int frameprop_range;
     int frameprop_primaries;
+    int frameprop_transfer;
     int frameprop_sar;
 
     /* Linked list pointers. */
@@ -611,60 +612,62 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
             }
 
             /* Color Transfer Characteristics */
-            switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Transfer", 0, &error)) {
-            case 1:
-                st->codecpar->color_trc = AVCOL_TRC_BT709;
-                break;
-            case 2:
-                st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED;
-                break;
-            case 4:
-                st->codecpar->color_trc = AVCOL_TRC_GAMMA22;
-                break;
-            case 5:
-                st->codecpar->color_trc = AVCOL_TRC_GAMMA28;
-                break;
-            case 6:
-                st->codecpar->color_trc = AVCOL_TRC_SMPTE170M;
-                break;
-            case 7:
-                st->codecpar->color_trc = AVCOL_TRC_SMPTE240M;
-                break;
-            case 8:
-                st->codecpar->color_trc = AVCOL_TRC_LINEAR;
-                break;
-            case 9:
-                st->codecpar->color_trc = AVCOL_TRC_LOG;
-                break;
-            case 10:
-                st->codecpar->color_trc = AVCOL_TRC_LOG_SQRT;
-                break;
-            case 11:
-                st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_4;
-                break;
-            case 12:
-                st->codecpar->color_trc = AVCOL_TRC_BT1361_ECG;
-                break;
-            case 13:
-                st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_1;
-                break;
-            case 14:
-                st->codecpar->color_trc = AVCOL_TRC_BT2020_10;
-                break;
-            case 15:
-                st->codecpar->color_trc = AVCOL_TRC_BT2020_12;
-                break;
-            case 16:
-                st->codecpar->color_trc = AVCOL_TRC_SMPTE2084;
-                break;
-            case 17:
-                st->codecpar->color_trc = AVCOL_TRC_SMPTE428;
-                break;
-            case 18:
-                st->codecpar->color_trc = AVCOL_TRC_ARIB_STD_B67;
-                break;
-            default:
-                st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED;
+            if(avs->frameprop_transfer) {
+                switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Transfer", 0, &error)) {
+                case 1:
+                    st->codecpar->color_trc = AVCOL_TRC_BT709;
+                    break;
+                case 2:
+                    st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED;
+                    break;
+                case 4:
+                    st->codecpar->color_trc = AVCOL_TRC_GAMMA22;
+                    break;
+                case 5:
+                    st->codecpar->color_trc = AVCOL_TRC_GAMMA28;
+                    break;
+                case 6:
+                    st->codecpar->color_trc = AVCOL_TRC_SMPTE170M;
+                    break;
+                case 7:
+                    st->codecpar->color_trc = AVCOL_TRC_SMPTE240M;
+                    break;
+                case 8:
+                    st->codecpar->color_trc = AVCOL_TRC_LINEAR;
+                    break;
+                case 9:
+                    st->codecpar->color_trc = AVCOL_TRC_LOG;
+                    break;
+                case 10:
+                    st->codecpar->color_trc = AVCOL_TRC_LOG_SQRT;
+                    break;
+                case 11:
+                    st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_4;
+                    break;
+                case 12:
+                    st->codecpar->color_trc = AVCOL_TRC_BT1361_ECG;
+                    break;
+                case 13:
+                    st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_1;
+                    break;
+                case 14:
+                    st->codecpar->color_trc = AVCOL_TRC_BT2020_10;
+                    break;
+                case 15:
+                    st->codecpar->color_trc = AVCOL_TRC_BT2020_12;
+                    break;
+                case 16:
+                    st->codecpar->color_trc = AVCOL_TRC_SMPTE2084;
+                    break;
+                case 17:
+                    st->codecpar->color_trc = AVCOL_TRC_SMPTE428;
+                    break;
+                case 18:
+                    st->codecpar->color_trc = AVCOL_TRC_ARIB_STD_B67;
+                    break;
+                default:
+                    st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED;
+                }
             }
 
             /* Matrix coefficients */
@@ -1164,6 +1167,7 @@ static const AVOption avisynth_options[] = {
     { "read_frameprop_field_order", "Read field order from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_field_order), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_range", "Read color range from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_range), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_primaries", "Read color primaries from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_primaries), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+    { "read_frameprop_transfer", "Read color transfer characteristics from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_transfer), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_sar", "Read SAR from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_sar), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { NULL },
 };
-- 
2.34.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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [FFmpeg-devel] [PATCH 8/9] avformat/avisynth: add read_frameprop_matrix option
  2022-08-29  0:02 [FFmpeg-devel] [PATCH 0/9] avisynth: add user options Stephen Hutchinson
                   ` (6 preceding siblings ...)
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 7/9] avformat/avisynth: add read_frameprop_transfer option Stephen Hutchinson
@ 2022-08-29  0:02 ` Stephen Hutchinson
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 9/9] avformat/avisynth: add read_frameprop_chroma_location option Stephen Hutchinson
  8 siblings, 0 replies; 14+ messages in thread
From: Stephen Hutchinson @ 2022-08-29  0:02 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Stephen Hutchinson

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
---
 libavformat/avisynth.c | 98 ++++++++++++++++++++++--------------------
 1 file changed, 51 insertions(+), 47 deletions(-)

diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index ff4435758e..99173a8d51 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -108,6 +108,7 @@ typedef struct AviSynthContext {
     int frameprop_range;
     int frameprop_primaries;
     int frameprop_transfer;
+    int frameprop_matrix;
     int frameprop_sar;
 
     /* Linked list pointers. */
@@ -671,54 +672,56 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
             }
 
             /* Matrix coefficients */
-            if(avs_library.avs_prop_get_type(avs->env, avsmap, "_Matrix") == AVS_PROPTYPE_UNSET) {
-                st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
-            } else {
-                switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Matrix", 0, &error)) {
-                case 0:
-                    st->codecpar->color_space = AVCOL_SPC_RGB;
-                    break;
-                case 1:
-                    st->codecpar->color_space = AVCOL_SPC_BT709;
-                    break;
-                case 2:
-                    st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
-                    break;
-                case 4:
-                    st->codecpar->color_space = AVCOL_SPC_FCC;
-                    break;
-                case 5:
-                    st->codecpar->color_space = AVCOL_SPC_BT470BG;
-                    break;
-                case 6:
-                    st->codecpar->color_space = AVCOL_SPC_SMPTE170M;
-                    break;
-                case 7:
-                    st->codecpar->color_space = AVCOL_SPC_SMPTE240M;
-                    break;
-                case 8:
-                    st->codecpar->color_space = AVCOL_SPC_YCGCO;
-                    break;
-                case 9:
-                    st->codecpar->color_space = AVCOL_SPC_BT2020_NCL;
-                    break;
-                case 10:
-                    st->codecpar->color_space = AVCOL_SPC_BT2020_CL;
-                    break;
-                case 11:
-                    st->codecpar->color_space = AVCOL_SPC_SMPTE2085;
-                    break;
-                case 12:
-                    st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_NCL;
-                    break;
-                case 13:
-                    st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_CL;
-                    break;
-                case 14:
-                    st->codecpar->color_space = AVCOL_SPC_ICTCP;
-                    break;
-                default:
+            if(avs->frameprop_matrix) {
+                if(avs_library.avs_prop_get_type(avs->env, avsmap, "_Matrix") == AVS_PROPTYPE_UNSET) {
                     st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
+                } else {
+                    switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Matrix", 0, &error)) {
+                    case 0:
+                        st->codecpar->color_space = AVCOL_SPC_RGB;
+                        break;
+                    case 1:
+                        st->codecpar->color_space = AVCOL_SPC_BT709;
+                        break;
+                    case 2:
+                        st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
+                        break;
+                    case 4:
+                        st->codecpar->color_space = AVCOL_SPC_FCC;
+                        break;
+                    case 5:
+                        st->codecpar->color_space = AVCOL_SPC_BT470BG;
+                        break;
+                    case 6:
+                        st->codecpar->color_space = AVCOL_SPC_SMPTE170M;
+                        break;
+                    case 7:
+                        st->codecpar->color_space = AVCOL_SPC_SMPTE240M;
+                        break;
+                    case 8:
+                        st->codecpar->color_space = AVCOL_SPC_YCGCO;
+                        break;
+                    case 9:
+                        st->codecpar->color_space = AVCOL_SPC_BT2020_NCL;
+                        break;
+                    case 10:
+                        st->codecpar->color_space = AVCOL_SPC_BT2020_CL;
+                        break;
+                    case 11:
+                        st->codecpar->color_space = AVCOL_SPC_SMPTE2085;
+                        break;
+                    case 12:
+                        st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_NCL;
+                        break;
+                    case 13:
+                        st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_CL;
+                        break;
+                    case 14:
+                        st->codecpar->color_space = AVCOL_SPC_ICTCP;
+                        break;
+                    default:
+                        st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
+                    }
                 }
             }
 
@@ -1168,6 +1171,7 @@ static const AVOption avisynth_options[] = {
     { "read_frameprop_range", "Read color range from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_range), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_primaries", "Read color primaries from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_primaries), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_transfer", "Read color transfer characteristics from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_transfer), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+    { "read_frameprop_matrix", "Read matrix coefficients from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_matrix), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_sar", "Read SAR from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_sar), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { NULL },
 };
-- 
2.34.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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [FFmpeg-devel] [PATCH 9/9] avformat/avisynth: add read_frameprop_chroma_location option
  2022-08-29  0:02 [FFmpeg-devel] [PATCH 0/9] avisynth: add user options Stephen Hutchinson
                   ` (7 preceding siblings ...)
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 8/9] avformat/avisynth: add read_frameprop_matrix option Stephen Hutchinson
@ 2022-08-29  0:02 ` Stephen Hutchinson
  8 siblings, 0 replies; 14+ messages in thread
From: Stephen Hutchinson @ 2022-08-29  0:02 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Stephen Hutchinson

Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
---
 libavformat/avisynth.c | 50 +++++++++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 23 deletions(-)

diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index 99173a8d51..4e7395c22b 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -109,6 +109,7 @@ typedef struct AviSynthContext {
     int frameprop_primaries;
     int frameprop_transfer;
     int frameprop_matrix;
+    int frameprop_chroma_location;
     int frameprop_sar;
 
     /* Linked list pointers. */
@@ -726,30 +727,32 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
             }
 
             /* Chroma Location */
-            if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ChromaLocation") == AVS_PROPTYPE_UNSET) {
-                st->codecpar->chroma_location = AVCHROMA_LOC_UNSPECIFIED;
-            } else {
-                switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ChromaLocation", 0, &error)) {
-                case 0:
-                    st->codecpar->chroma_location = AVCHROMA_LOC_LEFT;
-                    break;
-                case 1:
-                    st->codecpar->chroma_location = AVCHROMA_LOC_CENTER;
-                    break;
-                case 2:
-                    st->codecpar->chroma_location = AVCHROMA_LOC_TOPLEFT;
-                    break;
-                case 3:
-                    st->codecpar->chroma_location = AVCHROMA_LOC_TOP;
-                    break;
-                case 4:
-                    st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOMLEFT;
-                    break;
-                case 5:
-                    st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOM;
-                    break;
-                default:
+            if(avs->frameprop_chroma_location) {
+                if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ChromaLocation") == AVS_PROPTYPE_UNSET) {
                     st->codecpar->chroma_location = AVCHROMA_LOC_UNSPECIFIED;
+                } else {
+                    switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ChromaLocation", 0, &error)) {
+                    case 0:
+                        st->codecpar->chroma_location = AVCHROMA_LOC_LEFT;
+                        break;
+                    case 1:
+                        st->codecpar->chroma_location = AVCHROMA_LOC_CENTER;
+                        break;
+                    case 2:
+                        st->codecpar->chroma_location = AVCHROMA_LOC_TOPLEFT;
+                        break;
+                    case 3:
+                        st->codecpar->chroma_location = AVCHROMA_LOC_TOP;
+                        break;
+                    case 4:
+                        st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOMLEFT;
+                        break;
+                    case 5:
+                        st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOM;
+                        break;
+                    default:
+                        st->codecpar->chroma_location = AVCHROMA_LOC_UNSPECIFIED;
+                    }
                 }
             }
 
@@ -1172,6 +1175,7 @@ static const AVOption avisynth_options[] = {
     { "read_frameprop_primaries", "Read color primaries from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_primaries), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_transfer", "Read color transfer characteristics from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_transfer), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_matrix", "Read matrix coefficients from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_matrix), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
+    { "read_frameprop_chroma_location", "Read chroma location from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_chroma_location), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { "read_frameprop_sar", "Read SAR from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_sar), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
     { NULL },
 };
-- 
2.34.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-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [FFmpeg-devel] [PATCH 3/9] avformat/avisynth: add read_frameprops option
  2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 3/9] avformat/avisynth: add read_frameprops option Stephen Hutchinson
@ 2022-08-29  0:41   ` Andreas Rheinhardt
  2022-08-30 23:04     ` Stephen Hutchinson
  0 siblings, 1 reply; 14+ messages in thread
From: Andreas Rheinhardt @ 2022-08-29  0:41 UTC (permalink / raw)
  To: ffmpeg-devel

Stephen Hutchinson:
> Allows turning the reading of frame properties entirely on and off.
> Defaults to reading frame properties.
> 
> Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
> ---
>  libavformat/avisynth.c | 355 +++++++++++++++++++++--------------------
>  1 file changed, 179 insertions(+), 176 deletions(-)
> 
> diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
> index d503c7ed40..5d726d70a5 100644
> --- a/libavformat/avisynth.c
> +++ b/libavformat/avisynth.c
> @@ -103,6 +103,7 @@ typedef struct AviSynthContext {
>      int error;
>  
>      /* (de)activate reading frame properties */
> +    int frameprops;
>      int frameprop_sar;
>  
>      /* Linked list pointers. */
> @@ -522,227 +523,228 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st)
>          frame  = avs_library.avs_get_frame(avs->clip, 0);
>          avsmap = avs_library.avs_get_frame_props_ro(avs->env, frame);
>  
> -        /* Field order */
> -        if(avs_library.avs_prop_get_type(avs->env, avsmap, "_FieldBased") == AVS_PROPTYPE_UNSET) {
> -            st->codecpar->field_order = AV_FIELD_UNKNOWN;
> -        } else {
> -            switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_FieldBased", 0, &error)) {
> -            case 0:
> -                st->codecpar->field_order = AV_FIELD_PROGRESSIVE;
> -                break;
> -            case 1:
> -                st->codecpar->field_order = AV_FIELD_BB;
> -                break;
> -            case 2:
> -                st->codecpar->field_order = AV_FIELD_TT;
> -                break;
> -            default:
> +        if(avs->frameprops) {

This will make frameprops a global on-off which overrides everything
else even if some of the "else" stuff has been enabled explicitly. Worse
yet, if you want to disable everything except exactly one field, you
have to leave frameprops enabled and disable everything else explicitly.

Why not use a bitfield (with AV_OPT_TYPE_FLAGS and AV_OPT_TYPE_CONST)?
These properties certainly seem like a bitfield and the above would be
easily achievable with it.

> +            /* Field order */
> +            if(avs_library.avs_prop_get_type(avs->env, avsmap, "_FieldBased") == AVS_PROPTYPE_UNSET) {
>                  st->codecpar->field_order = AV_FIELD_UNKNOWN;
> +            } else {
> +                switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_FieldBased", 0, &error)) {
> +                case 0:
> +                    st->codecpar->field_order = AV_FIELD_PROGRESSIVE;
> +                    break;
> +                case 1:
> +                    st->codecpar->field_order = AV_FIELD_BB;
> +                    break;
> +                case 2:
> +                    st->codecpar->field_order = AV_FIELD_TT;
> +                    break;
> +                default:
> +                    st->codecpar->field_order = AV_FIELD_UNKNOWN;
> +                }
>              }
> -        }
>  
> -        /* Color Range */
> -        if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ColorRange") == AVS_PROPTYPE_UNSET) {
> -            st->codecpar->color_range = AVCOL_RANGE_UNSPECIFIED;
> -        } else {
> -            switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ColorRange", 0, &error)) {
> -            case 0:
> -                st->codecpar->color_range = AVCOL_RANGE_JPEG;
> -                break;
> -            case 1:
> -                st->codecpar->color_range = AVCOL_RANGE_MPEG;
> -                break;
> -            default:
> +            /* Color Range */
> +            if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ColorRange") == AVS_PROPTYPE_UNSET) {
>                  st->codecpar->color_range = AVCOL_RANGE_UNSPECIFIED;
> +            } else {
> +                switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ColorRange", 0, &error)) {
> +                case 0:
> +                    st->codecpar->color_range = AVCOL_RANGE_JPEG;
> +                    break;
> +                case 1:
> +                    st->codecpar->color_range = AVCOL_RANGE_MPEG;
> +                    break;
> +                default:
> +                    st->codecpar->color_range = AVCOL_RANGE_UNSPECIFIED;
> +                }
>              }
> -        }
>  
> -        /* Color Primaries */
> -        switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Primaries", 0, &error)) {
> -        case 1:
> -            st->codecpar->color_primaries = AVCOL_PRI_BT709;
> -            break;
> -        case 2:
> -            st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED;
> -            break;
> -        case 4:
> -            st->codecpar->color_primaries = AVCOL_PRI_BT470M;
> -            break;
> -        case 5:
> -            st->codecpar->color_primaries = AVCOL_PRI_BT470BG;
> -            break;
> -        case 6:
> -            st->codecpar->color_primaries = AVCOL_PRI_SMPTE170M;
> -            break;
> -        case 7:
> -            st->codecpar->color_primaries = AVCOL_PRI_SMPTE240M;
> -            break;
> -        case 8:
> -            st->codecpar->color_primaries = AVCOL_PRI_FILM;
> -            break;
> -        case 9:
> -            st->codecpar->color_primaries = AVCOL_PRI_BT2020;
> -            break;
> -        case 10:
> -            st->codecpar->color_primaries = AVCOL_PRI_SMPTE428;
> -            break;
> -        case 11:
> -            st->codecpar->color_primaries = AVCOL_PRI_SMPTE431;
> -            break;
> -        case 12:
> -            st->codecpar->color_primaries = AVCOL_PRI_SMPTE432;
> -            break;
> -        case 22:
> -            st->codecpar->color_primaries = AVCOL_PRI_EBU3213;
> -            break;
> -        default:
> -            st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED;
> -        }
> -
> -        /* Color Transfer Characteristics */
> -        switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Transfer", 0, &error)) {
> -        case 1:
> -            st->codecpar->color_trc = AVCOL_TRC_BT709;
> -            break;
> -        case 2:
> -            st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED;
> -            break;
> -        case 4:
> -            st->codecpar->color_trc = AVCOL_TRC_GAMMA22;
> -            break;
> -        case 5:
> -            st->codecpar->color_trc = AVCOL_TRC_GAMMA28;
> -            break;
> -        case 6:
> -            st->codecpar->color_trc = AVCOL_TRC_SMPTE170M;
> -            break;
> -        case 7:
> -            st->codecpar->color_trc = AVCOL_TRC_SMPTE240M;
> -            break;
> -        case 8:
> -            st->codecpar->color_trc = AVCOL_TRC_LINEAR;
> -            break;
> -        case 9:
> -            st->codecpar->color_trc = AVCOL_TRC_LOG;
> -            break;
> -        case 10:
> -            st->codecpar->color_trc = AVCOL_TRC_LOG_SQRT;
> -            break;
> -        case 11:
> -            st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_4;
> -            break;
> -        case 12:
> -            st->codecpar->color_trc = AVCOL_TRC_BT1361_ECG;
> -            break;
> -        case 13:
> -            st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_1;
> -            break;
> -        case 14:
> -            st->codecpar->color_trc = AVCOL_TRC_BT2020_10;
> -            break;
> -        case 15:
> -            st->codecpar->color_trc = AVCOL_TRC_BT2020_12;
> -            break;
> -        case 16:
> -            st->codecpar->color_trc = AVCOL_TRC_SMPTE2084;
> -            break;
> -        case 17:
> -            st->codecpar->color_trc = AVCOL_TRC_SMPTE428;
> -            break;
> -        case 18:
> -            st->codecpar->color_trc = AVCOL_TRC_ARIB_STD_B67;
> -            break;
> -        default:
> -            st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED;
> -        }
> -
> -        /* Matrix coefficients */
> -        if(avs_library.avs_prop_get_type(avs->env, avsmap, "_Matrix") == AVS_PROPTYPE_UNSET) {
> -            st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
> -        } else {
> -            switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Matrix", 0, &error)) {
> -            case 0:
> -                st->codecpar->color_space = AVCOL_SPC_RGB;
> -                break;
> +            /* Color Primaries */
> +            switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Primaries", 0, &error)) {
>              case 1:
> -                st->codecpar->color_space = AVCOL_SPC_BT709;
> +                st->codecpar->color_primaries = AVCOL_PRI_BT709;

You reindent everything once in this patch and then in every
switch/block once more when you add the relevant option. This is
unnecessary; it also makes this patch harder to read. Just take a look
at the above: It seems as if you were replacing setting color_space with
color_primaries, but it is just the git diff algorithm trying to
minimize the diff. For that reason the project policy states that
reindentation should be done in a separate commit (one commit at the end
of this patchset is enough).

>                  break;
>              case 2:
> -                st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
> +                st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED;
>                  break;
>              case 4:
> -                st->codecpar->color_space = AVCOL_SPC_FCC;
> +                st->codecpar->color_primaries = AVCOL_PRI_BT470M;
>                  break;
>              case 5:
> -                st->codecpar->color_space = AVCOL_SPC_BT470BG;
> +                st->codecpar->color_primaries = AVCOL_PRI_BT470BG;
>                  break;
>              case 6:
> -                st->codecpar->color_space = AVCOL_SPC_SMPTE170M;
> +                st->codecpar->color_primaries = AVCOL_PRI_SMPTE170M;
>                  break;
>              case 7:
> -                st->codecpar->color_space = AVCOL_SPC_SMPTE240M;
> +                st->codecpar->color_primaries = AVCOL_PRI_SMPTE240M;
>                  break;
>              case 8:
> -                st->codecpar->color_space = AVCOL_SPC_YCGCO;
> +                st->codecpar->color_primaries = AVCOL_PRI_FILM;
>                  break;
>              case 9:
> -                st->codecpar->color_space = AVCOL_SPC_BT2020_NCL;
> +                st->codecpar->color_primaries = AVCOL_PRI_BT2020;
>                  break;
>              case 10:
> -                st->codecpar->color_space = AVCOL_SPC_BT2020_CL;
> +                st->codecpar->color_primaries = AVCOL_PRI_SMPTE428;
>                  break;
>              case 11:
> -                st->codecpar->color_space = AVCOL_SPC_SMPTE2085;
> +                st->codecpar->color_primaries = AVCOL_PRI_SMPTE431;
>                  break;
>              case 12:
> -                st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_NCL;
> +                st->codecpar->color_primaries = AVCOL_PRI_SMPTE432;
>                  break;
> -            case 13:
> -                st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_CL;
> -                break;
> -            case 14:
> -                st->codecpar->color_space = AVCOL_SPC_ICTCP;
> +            case 22:
> +                st->codecpar->color_primaries = AVCOL_PRI_EBU3213;
>                  break;
>              default:
> -                st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
> +                st->codecpar->color_primaries = AVCOL_PRI_UNSPECIFIED;
>              }
> -        }
>  
> -        /* Chroma Location */
> -        if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ChromaLocation") == AVS_PROPTYPE_UNSET) {
> -            st->codecpar->chroma_location = AVCHROMA_LOC_UNSPECIFIED;
> -        } else {
> -            switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ChromaLocation", 0, &error)) {
> -            case 0:
> -                st->codecpar->chroma_location = AVCHROMA_LOC_LEFT;
> -                break;
> +            /* Color Transfer Characteristics */
> +            switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Transfer", 0, &error)) {
>              case 1:
> -                st->codecpar->chroma_location = AVCHROMA_LOC_CENTER;
> +                st->codecpar->color_trc = AVCOL_TRC_BT709;
>                  break;
>              case 2:
> -                st->codecpar->chroma_location = AVCHROMA_LOC_TOPLEFT;
> -                break;
> -            case 3:
> -                st->codecpar->chroma_location = AVCHROMA_LOC_TOP;
> +                st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED;
>                  break;
>              case 4:
> -                st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOMLEFT;
> +                st->codecpar->color_trc = AVCOL_TRC_GAMMA22;
>                  break;
>              case 5:
> -                st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOM;
> +                st->codecpar->color_trc = AVCOL_TRC_GAMMA28;
> +                break;
> +            case 6:
> +                st->codecpar->color_trc = AVCOL_TRC_SMPTE170M;
> +                break;
> +            case 7:
> +                st->codecpar->color_trc = AVCOL_TRC_SMPTE240M;
> +                break;
> +            case 8:
> +                st->codecpar->color_trc = AVCOL_TRC_LINEAR;
> +                break;
> +            case 9:
> +                st->codecpar->color_trc = AVCOL_TRC_LOG;
> +                break;
> +            case 10:
> +                st->codecpar->color_trc = AVCOL_TRC_LOG_SQRT;
> +                break;
> +            case 11:
> +                st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_4;
> +                break;
> +            case 12:
> +                st->codecpar->color_trc = AVCOL_TRC_BT1361_ECG;
> +                break;
> +            case 13:
> +                st->codecpar->color_trc = AVCOL_TRC_IEC61966_2_1;
> +                break;
> +            case 14:
> +                st->codecpar->color_trc = AVCOL_TRC_BT2020_10;
> +                break;
> +            case 15:
> +                st->codecpar->color_trc = AVCOL_TRC_BT2020_12;
> +                break;
> +            case 16:
> +                st->codecpar->color_trc = AVCOL_TRC_SMPTE2084;
> +                break;
> +            case 17:
> +                st->codecpar->color_trc = AVCOL_TRC_SMPTE428;
> +                break;
> +            case 18:
> +                st->codecpar->color_trc = AVCOL_TRC_ARIB_STD_B67;
>                  break;
>              default:
> +                st->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED;
> +            }
> +
> +            /* Matrix coefficients */
> +            if(avs_library.avs_prop_get_type(avs->env, avsmap, "_Matrix") == AVS_PROPTYPE_UNSET) {
> +                st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
> +            } else {
> +                switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_Matrix", 0, &error)) {
> +                case 0:
> +                    st->codecpar->color_space = AVCOL_SPC_RGB;
> +                    break;
> +                case 1:
> +                    st->codecpar->color_space = AVCOL_SPC_BT709;
> +                    break;
> +                case 2:
> +                    st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
> +                    break;
> +                case 4:
> +                    st->codecpar->color_space = AVCOL_SPC_FCC;
> +                    break;
> +                case 5:
> +                    st->codecpar->color_space = AVCOL_SPC_BT470BG;
> +                    break;
> +                case 6:
> +                    st->codecpar->color_space = AVCOL_SPC_SMPTE170M;
> +                    break;
> +                case 7:
> +                    st->codecpar->color_space = AVCOL_SPC_SMPTE240M;
> +                    break;
> +                case 8:
> +                    st->codecpar->color_space = AVCOL_SPC_YCGCO;
> +                    break;
> +                case 9:
> +                    st->codecpar->color_space = AVCOL_SPC_BT2020_NCL;
> +                    break;
> +                case 10:
> +                    st->codecpar->color_space = AVCOL_SPC_BT2020_CL;
> +                    break;
> +                case 11:
> +                    st->codecpar->color_space = AVCOL_SPC_SMPTE2085;
> +                    break;
> +                case 12:
> +                    st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_NCL;
> +                    break;
> +                case 13:
> +                    st->codecpar->color_space = AVCOL_SPC_CHROMA_DERIVED_CL;
> +                    break;
> +                case 14:
> +                    st->codecpar->color_space = AVCOL_SPC_ICTCP;
> +                    break;
> +                default:
> +                    st->codecpar->color_space = AVCOL_SPC_UNSPECIFIED;
> +                }
> +            }
> +
> +            /* Chroma Location */
> +            if(avs_library.avs_prop_get_type(avs->env, avsmap, "_ChromaLocation") == AVS_PROPTYPE_UNSET) {
>                  st->codecpar->chroma_location = AVCHROMA_LOC_UNSPECIFIED;
> +            } else {
> +                switch (avs_library.avs_prop_get_int(avs->env, avsmap, "_ChromaLocation", 0, &error)) {
> +                case 0:
> +                    st->codecpar->chroma_location = AVCHROMA_LOC_LEFT;
> +                    break;
> +                case 1:
> +                    st->codecpar->chroma_location = AVCHROMA_LOC_CENTER;
> +                    break;
> +                case 2:
> +                    st->codecpar->chroma_location = AVCHROMA_LOC_TOPLEFT;
> +                    break;
> +                case 3:
> +                    st->codecpar->chroma_location = AVCHROMA_LOC_TOP;
> +                    break;
> +                case 4:
> +                    st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOMLEFT;
> +                    break;
> +                case 5:
> +                    st->codecpar->chroma_location = AVCHROMA_LOC_BOTTOM;
> +                    break;
> +                default:
> +                    st->codecpar->chroma_location = AVCHROMA_LOC_UNSPECIFIED;
> +                }
>              }
> -        }
>  
> -        /* Sample aspect ratio */
> -        if (avs->frameprop_sar) {
> -            sar_num = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARNum", 0, &error);
> -            sar_den = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARDen", 0, &error);
> -            st->sample_aspect_ratio = (AVRational){ sar_num, sar_den };
> +            /* Sample aspect ratio */
> +            if (avs->frameprop_sar) {
> +                sar_num = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARNum", 0, &error);
> +                sar_den = avs_library.avs_prop_get_int(avs->env, avsmap, "_SARDen", 0, &error);
> +                st->sample_aspect_ratio = (AVRational){ sar_num, sar_den };
> +            }
>          }
> -
>          avs_library.avs_release_video_frame(frame);
>      } else {
>          st->codecpar->field_order = AV_FIELD_UNKNOWN;
> @@ -1149,6 +1151,7 @@ static int avisynth_read_seek(AVFormatContext *s, int stream_index,
>  
>  #define OFFSET(x) offsetof(AviSynthContext, x)
>  static const AVOption avisynth_options[] = {
> +    { "read_frameprops", "Read frame properties from script (AviSynth+ v3.7.1+).", OFFSET(frameprops), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
>      { "read_frameprop_sar", "Read SAR from script's frame properties (AviSynth+ v3.7.1+).", OFFSET(frameprop_sar), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
>      { NULL },
>  };
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [FFmpeg-devel] [PATCH 3/9] avformat/avisynth: add read_frameprops option
  2022-08-29  0:41   ` Andreas Rheinhardt
@ 2022-08-30 23:04     ` Stephen Hutchinson
  2022-08-30 23:17       ` Andreas Rheinhardt
  0 siblings, 1 reply; 14+ messages in thread
From: Stephen Hutchinson @ 2022-08-30 23:04 UTC (permalink / raw)
  To: ffmpeg-devel

On 8/28/22 8:41 PM, Andreas Rheinhardt wrote:
> This will make frameprops a global on-off which overrides everything
> else even if some of the "else" stuff has been enabled explicitly. Worse
> yet, if you want to disable everything except exactly one field, you
> have to leave frameprops enabled and disable everything else explicitly.
> 
> Why not use a bitfield (with AV_OPT_TYPE_FLAGS and AV_OPT_TYPE_CONST)?
> These properties certainly seem like a bitfield and the above would be
> easily achievable with it.
> 

How are flags supposed to be set to on by default? With av_dict_set or
a different mechanism?  Because the closest I was able to get¹,

if(avs->flags & AVISYNTH_FRAMEPROP_FIELD_ORDER | 
AVISYNTH_FRAMEPROP_DEFAULT) {

ends up correctly setting the flags that should be on by default,
with the new sar flag able to be enabled or disabled, but the ones
flagged as default refuse to be disabled now.

¹https://github.com/qyot27/FFmpeg/commit/6d3d6108145f9c7ac2dfcdaf09852b7472f6ca7f
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [FFmpeg-devel] [PATCH 3/9] avformat/avisynth: add read_frameprops option
  2022-08-30 23:04     ` Stephen Hutchinson
@ 2022-08-30 23:17       ` Andreas Rheinhardt
  2022-08-31  0:07         ` Stephen Hutchinson
  0 siblings, 1 reply; 14+ messages in thread
From: Andreas Rheinhardt @ 2022-08-30 23:17 UTC (permalink / raw)
  To: ffmpeg-devel

Stephen Hutchinson:
> On 8/28/22 8:41 PM, Andreas Rheinhardt wrote:
>> This will make frameprops a global on-off which overrides everything
>> else even if some of the "else" stuff has been enabled explicitly. Worse
>> yet, if you want to disable everything except exactly one field, you
>> have to leave frameprops enabled and disable everything else explicitly.
>>
>> Why not use a bitfield (with AV_OPT_TYPE_FLAGS and AV_OPT_TYPE_CONST)?
>> These properties certainly seem like a bitfield and the above would be
>> easily achievable with it.
>>
> 
> How are flags supposed to be set to on by default? With av_dict_set or
> a different mechanism?  Because the closest I was able to get¹,
> 
> if(avs->flags & AVISYNTH_FRAMEPROP_FIELD_ORDER |
> AVISYNTH_FRAMEPROP_DEFAULT) {
> 
> ends up correctly setting the flags that should be on by default,
> with the new sar flag able to be enabled or disabled, but the ones
> flagged as default refuse to be disabled now.
> 
> ¹https://github.com/qyot27/FFmpeg/commit/6d3d6108145f9c7ac2dfcdaf09852b7472f6ca7f
> 

{ "avisynth_flags", "set flags related to reading frame properties from
script (AviSynth+ v3.7.1 or higher)", OFFSET(flags), AV_OPT_TYPE_FLAGS,
{.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, "flags" },

This is wrong. It should be
{ "avisynth_flags", "set flags related to reading frame properties from
script (AviSynth+ v3.7.1 or higher)", OFFSET(flags), AV_OPT_TYPE_FLAGS,
{.i64 = AVISYNTH_FRAMEPROP_FIELD_ORDER | AVISYNTH_FRAMEPROP_RANGE |
AVISYNTH_FRAMEPROP_PRIMARIES | AVISYNTH_FRAMEPROP_TRANSFER |
AVISYNTH_FRAMEPROP_MATRIX | AVISYNTH_FRAMEPROP_CHROMA_LOCATION}, 0,
INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "flags" }
The default option should be removed. Users can then set the options via
avisynth_flags=+sar-range or via avisynth_flags=matrix or however they wish.
The AVISYNTH_FRAMEPROP_DEFAULT should also be removed (at least, it
should not be part of the bitfield, but you can of course add a define
(or an enum value) equivalent to the default value I used above and you
can use that for the default value above); to know whether field order
should be exported, you simply query via "if (avs->flags &
AVISYNTH_FRAMEPROP_FIELD_ORDER)". For this it is of course important
that the default value is a combination of other bits of the bitfield
and not a bit of its own.

- Andreas
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [FFmpeg-devel] [PATCH 3/9] avformat/avisynth: add read_frameprops option
  2022-08-30 23:17       ` Andreas Rheinhardt
@ 2022-08-31  0:07         ` Stephen Hutchinson
  0 siblings, 0 replies; 14+ messages in thread
From: Stephen Hutchinson @ 2022-08-31  0:07 UTC (permalink / raw)
  To: ffmpeg-devel

On 8/30/22 7:17 PM, Andreas Rheinhardt wrote:
> { "avisynth_flags", "set flags related to reading frame properties from
> script (AviSynth+ v3.7.1 or higher)", OFFSET(flags), AV_OPT_TYPE_FLAGS,
> {.i64 = 1}, 0, 1, AV_OPT_FLAG_DECODING_PARAM, "flags" },
> 
> This is wrong. It should be
> { "avisynth_flags", "set flags related to reading frame properties from
> script (AviSynth+ v3.7.1 or higher)", OFFSET(flags), AV_OPT_TYPE_FLAGS,
> {.i64 = AVISYNTH_FRAMEPROP_FIELD_ORDER | AVISYNTH_FRAMEPROP_RANGE |
> AVISYNTH_FRAMEPROP_PRIMARIES | AVISYNTH_FRAMEPROP_TRANSFER |
> AVISYNTH_FRAMEPROP_MATRIX | AVISYNTH_FRAMEPROP_CHROMA_LOCATION}, 0,
> INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "flags" }
> The default option should be removed. Users can then set the options via
> avisynth_flags=+sar-range or via avisynth_flags=matrix or however they wish.
> The AVISYNTH_FRAMEPROP_DEFAULT should also be removed (at least, it
> should not be part of the bitfield, but you can of course add a define
> (or an enum value) equivalent to the default value I used above and you
> can use that for the default value above); to know whether field order
> should be exported, you simply query via "if (avs->flags &
> AVISYNTH_FRAMEPROP_FIELD_ORDER)". For this it is of course important
> that the default value is a combination of other bits of the bitfield
> and not a bit of its own.
> 

I don't know why I didn't think to use it directly in the avisynth_flags
line.  Thanks.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-08-31  0:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-29  0:02 [FFmpeg-devel] [PATCH 0/9] avisynth: add user options Stephen Hutchinson
2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 1/9] avformat/avisynth: read _SARNum/_SARDen from frame properties Stephen Hutchinson
2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 2/9] avformat/avisynth: add read_frameprop_sar option Stephen Hutchinson
2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 3/9] avformat/avisynth: add read_frameprops option Stephen Hutchinson
2022-08-29  0:41   ` Andreas Rheinhardt
2022-08-30 23:04     ` Stephen Hutchinson
2022-08-30 23:17       ` Andreas Rheinhardt
2022-08-31  0:07         ` Stephen Hutchinson
2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 4/9] avformat/avisynth: add read_frameprop_field_order option Stephen Hutchinson
2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 5/9] avformat/avisynth: add read_frameprop_range option Stephen Hutchinson
2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 6/9] avformat/avisynth: add read_frameprop_primaries option Stephen Hutchinson
2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 7/9] avformat/avisynth: add read_frameprop_transfer option Stephen Hutchinson
2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 8/9] avformat/avisynth: add read_frameprop_matrix option Stephen Hutchinson
2022-08-29  0:02 ` [FFmpeg-devel] [PATCH 9/9] avformat/avisynth: add read_frameprop_chroma_location option Stephen Hutchinson

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git