From: Stephen Hutchinson <qyot27@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Stephen Hutchinson <qyot27@gmail.com>
Subject: [FFmpeg-devel] [PATCH 7/9] avformat/avisynth: add read_frameprop_transfer option
Date: Sun, 28 Aug 2022 20:02:42 -0400
Message-ID: <20220829000244.71123-8-qyot27@gmail.com> (raw)
In-Reply-To: <20220829000244.71123-1-qyot27@gmail.com>
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".
next prev parent reply other threads:[~2022-08-29 0:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Stephen Hutchinson [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220829000244.71123-8-qyot27@gmail.com \
--to=qyot27@gmail.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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