Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
7cd5fa35
Commit
7cd5fa35
authored
Aug 16, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/testsrc: set output framerate
parent
e5ae2f91
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
version.h
libavfilter/version.h
+1
-1
vsrc_testsrc.c
libavfilter/vsrc_testsrc.c
+12
-12
No files found.
libavfilter/version.h
View file @
7cd5fa35
...
...
@@ -30,7 +30,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 10
#define LIBAVFILTER_VERSION_MICRO 10
0
#define LIBAVFILTER_VERSION_MICRO 10
1
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
libavfilter/vsrc_testsrc.c
View file @
7cd5fa35
...
...
@@ -50,9 +50,9 @@ typedef struct {
const
AVClass
*
class
;
int
w
,
h
;
unsigned
int
nb_frame
;
AVRational
time_base
;
AVRational
time_base
,
frame_rate
;
int64_t
pts
,
max_pts
;
char
*
rate
;
///< video frame rate
char
*
frame_rate_str
;
///< video frame rate
char
*
duration
;
///< total duration of the generated video
AVRational
sar
;
///< sample aspect ratio
int
nb_decimals
;
...
...
@@ -77,8 +77,8 @@ typedef struct {
static
const
AVOption
options
[]
=
{
{
"size"
,
"set video size"
,
OFFSET
(
w
),
AV_OPT_TYPE_IMAGE_SIZE
,
{.
str
=
"320x240"
},
0
,
0
,
FLAGS
},
{
"s"
,
"set video size"
,
OFFSET
(
w
),
AV_OPT_TYPE_IMAGE_SIZE
,
{.
str
=
"320x240"
},
0
,
0
,
FLAGS
},
{
"rate"
,
"set video rate"
,
OFFSET
(
rate
),
AV_OPT_TYPE_STRING
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"r"
,
"set video rate"
,
OFFSET
(
rate
),
AV_OPT_TYPE_STRING
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"rate"
,
"set video rate"
,
OFFSET
(
frame_rate_str
),
AV_OPT_TYPE_STRING
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"r"
,
"set video rate"
,
OFFSET
(
frame_rate_str
),
AV_OPT_TYPE_STRING
,
{.
str
=
"25"
},
0
,
0
,
FLAGS
},
{
"duration"
,
"set video duration"
,
OFFSET
(
duration
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
{
"d"
,
"set video duration"
,
OFFSET
(
duration
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
{
"sar"
,
"set video sample aspect ratio"
,
OFFSET
(
sar
),
AV_OPT_TYPE_RATIONAL
,
{.
dbl
=
1
},
0
,
INT_MAX
,
FLAGS
},
...
...
@@ -96,7 +96,7 @@ static const AVOption options[] = {
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
TestSourceContext
*
test
=
ctx
->
priv
;
AVRational
frame_rate_q
;
AVRational
time_base
;
int64_t
duration
=
-
1
;
int
ret
=
0
;
...
...
@@ -105,8 +105,8 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
if
((
ret
=
(
av_set_options_string
(
test
,
args
,
"="
,
":"
)))
<
0
)
return
ret
;
if
((
ret
=
av_parse_video_rate
(
&
frame_rate_q
,
test
->
rate
))
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid frame rate: '%s'
\n
"
,
test
->
rate
);
if
((
ret
=
av_parse_video_rate
(
&
test
->
frame_rate
,
test
->
frame_rate_str
))
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid frame rate: '%s'
\n
"
,
test
->
frame_rate_str
);
return
ret
;
}
...
...
@@ -133,16 +133,15 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
}
}
test
->
time_base
.
num
=
frame_rate_q
.
den
;
test
->
time_base
.
den
=
frame_rate_q
.
num
;
test
->
time_base
=
av_inv_q
(
test
->
frame_rate
);
test
->
max_pts
=
duration
>=
0
?
av_rescale_q
(
duration
,
AV_TIME_BASE_Q
,
test
->
time_base
)
:
-
1
;
test
->
nb_frame
=
0
;
test
->
pts
=
0
;
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"size:%dx%d rate:%d/%d duration:%f sar:%d/%d
\n
"
,
test
->
w
,
test
->
h
,
frame_rate_q
.
num
,
frame_rate_q
.
den
,
duration
<
0
?
-
1
:
test
->
max_pts
*
av_q2d
(
t
est
->
t
ime_base
),
test
->
w
,
test
->
h
,
test
->
frame_rate
.
num
,
test
->
frame_rate
.
den
,
duration
<
0
?
-
1
:
test
->
max_pts
*
av_q2d
(
time_base
),
test
->
sar
.
num
,
test
->
sar
.
den
);
return
0
;
}
...
...
@@ -162,7 +161,8 @@ static int config_props(AVFilterLink *outlink)
outlink
->
w
=
test
->
w
;
outlink
->
h
=
test
->
h
;
outlink
->
sample_aspect_ratio
=
test
->
sar
;
outlink
->
time_base
=
test
->
time_base
;
outlink
->
frame_rate
=
test
->
frame_rate
;
outlink
->
time_base
=
test
->
time_base
;
return
0
;
}
...
...
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