Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
6752aac6
Commit
6752aac6
authored
Oct 16, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/aspect: add max option
parent
ccd6def9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
filters.texi
doc/filters.texi
+13
-0
version.h
libavfilter/version.h
+1
-1
vf_aspect.c
libavfilter/vf_aspect.c
+4
-2
No files found.
doc/filters.texi
View file @
6752aac6
...
...
@@ -3256,6 +3256,10 @@ named options, expressed as a sequence of @var{key}=@var{value} pairs,
separated by ":".
@table @option
@item max
Set the maximum integer value to use for expressing numerator and
denominator when reducing the expressed aspect ratio to a rational.
Default value is @code{100}.
@item r, ratio:
Set the aspect ratio used by the filter.
...
...
@@ -3268,6 +3272,9 @@ In case the form "@var{num}:@var{den}" the @code{:} character should
be escaped.
@end table
If the keys are omitted in the named options list, the specifed values
are assumed to be @var{ratio} and @var{max} in that order.
For example to change the display aspect ratio to 16:9, specify:
@example
setdar='16:9'
...
...
@@ -3283,6 +3290,12 @@ To change the sample aspect ratio to 10:11, specify:
setsar='10:11'
@end example
To set a display aspect ratio of 16:9, and specify a maximum integer value of
1000 in the aspect ratio reduction, use the command:
@example
setdar=ratio='16:9':max=1000
@end example
@section setfield
Force field for the output video frame.
...
...
libavfilter/version.h
View file @
6752aac6
...
...
@@ -30,7 +30,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 20
#define LIBAVFILTER_VERSION_MICRO 10
3
#define LIBAVFILTER_VERSION_MICRO 10
4
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
libavfilter/vf_aspect.c
View file @
6752aac6
...
...
@@ -35,12 +35,14 @@ typedef struct {
const
AVClass
*
class
;
AVRational
ratio
;
char
*
ratio_str
;
int
max
;
}
AspectContext
;
#define OFFSET(x) offsetof(AspectContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
options
[]
=
{
{
"max"
,
"set max value for nominator or denominator in the ratio"
,
OFFSET
(
max
),
AV_OPT_TYPE_INT
,
{.
i64
=
100
},
1
,
INT_MAX
,
FLAGS
},
{
"ratio"
,
"set ratio"
,
OFFSET
(
ratio_str
),
AV_OPT_TYPE_STRING
,
{.
str
=
"0"
},
0
,
0
,
FLAGS
},
{
"r"
,
"set ratio"
,
OFFSET
(
ratio_str
),
AV_OPT_TYPE_STRING
,
{.
str
=
"0"
},
0
,
0
,
FLAGS
},
{
NULL
}
...
...
@@ -49,7 +51,7 @@ static const AVOption options[] = {
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
,
const
AVClass
*
class
)
{
AspectContext
*
aspect
=
ctx
->
priv
;
static
const
char
*
shorthand
[]
=
{
"ratio"
,
NULL
};
static
const
char
*
shorthand
[]
=
{
"ratio"
,
"max"
,
NULL
};
char
c
;
int
ret
;
AVRational
q
;
...
...
@@ -66,7 +68,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, const AVClass *c
}
if
(
aspect
->
ratio_str
)
{
ret
=
av_parse_ratio
(
&
aspect
->
ratio
,
aspect
->
ratio_str
,
100
,
0
,
ctx
);
ret
=
av_parse_ratio
(
&
aspect
->
ratio
,
aspect
->
ratio_str
,
aspect
->
max
,
0
,
ctx
);
if
(
ret
<
0
||
aspect
->
ratio
.
num
<
0
||
aspect
->
ratio
.
den
<=
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid string '%s' for aspect ratio
\n
"
,
args
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment