[FFmpeg-devel] [PATCH v2] Add "sar" alias to "aspect" option of video encoders
Andrey Utkin
andrey_utkin at fastmail.com
Wed May 4 02:06:31 CEST 2016
It is impossible to pass "aspect" parameter to encoder from ffmpeg CLI
because option from lavc/options_table.h is eclipsed by option with same
name in ffmpeg_opt.c, which has different meaning (DAR, not SAR).
---
v2: Updated tests reference results as suggested by Michael Niedermayer.
libavcodec/options_table.h | 1 +
tests/ref/fate/api-mjpeg-codec-param | 2 ++
tests/ref/fate/api-png-codec-param | 2 ++
3 files changed, 5 insertions(+)
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index d29996f..8efb889 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -254,6 +254,7 @@ static const AVOption avcodec_options[] = {
{"median", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PRED_MEDIAN }, INT_MIN, INT_MAX, V|E, "pred"},
#endif
{"aspect", "sample aspect ratio", OFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 0, 10, V|E},
+{"sar", "sample aspect ratio", OFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 0, 10, V|E},
{"debug", "print specific debug info", OFFSET(debug), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT }, 0, INT_MAX, V|A|S|E|D, "debug"},
{"pict", "picture info", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_PICT_INFO }, INT_MIN, INT_MAX, V|D, "debug"},
{"rc", "rate control", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_RC }, INT_MIN, INT_MAX, V|E, "debug"},
diff --git a/tests/ref/fate/api-mjpeg-codec-param b/tests/ref/fate/api-mjpeg-codec-param
index 26822fd..c67d1b1 100644
--- a/tests/ref/fate/api-mjpeg-codec-param
+++ b/tests/ref/fate/api-mjpeg-codec-param
@@ -62,6 +62,7 @@ stream=0, decode=0
bits_per_coded_sample=0
pred=0
aspect=180/180
+ sar=180/180
debug=0x00000000
vismv=0x00000000
cmp=0
@@ -218,6 +219,7 @@ stream=0, decode=1
bits_per_coded_sample=0
pred=0
aspect=180/180
+ sar=180/180
debug=0x00000000
vismv=0x00000000
cmp=0
diff --git a/tests/ref/fate/api-png-codec-param b/tests/ref/fate/api-png-codec-param
index 46ac8eb..bd53441 100644
--- a/tests/ref/fate/api-png-codec-param
+++ b/tests/ref/fate/api-png-codec-param
@@ -62,6 +62,7 @@ stream=0, decode=0
bits_per_coded_sample=0
pred=0
aspect=2835/2835
+ sar=2835/2835
debug=0x00000000
vismv=0x00000000
cmp=0
@@ -218,6 +219,7 @@ stream=0, decode=1
bits_per_coded_sample=0
pred=0
aspect=2835/2835
+ sar=2835/2835
debug=0x00000000
vismv=0x00000000
cmp=0
--
2.8.2
More information about the ffmpeg-devel
mailing list