Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
722762f7
Commit
722762f7
authored
12 years ago
by
Stefano Sabatini
Browse files
Options
Downloads
Patches
Plain Diff
lavfi/setpts: add FRAME_RATE constant
Useful for dealing with constant frame-rate video.
parent
e14725ce
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/filters.texi
+3
-0
3 additions, 0 deletions
doc/filters.texi
libavfilter/f_setpts.c
+9
-2
9 additions, 2 deletions
libavfilter/f_setpts.c
libavfilter/version.h
+1
-1
1 addition, 1 deletion
libavfilter/version.h
with
13 additions
and
3 deletions
doc/filters.texi
+
3
−
0
View file @
722762f7
...
...
@@ -4194,6 +4194,9 @@ Accept in input an expression evaluated through the eval API, which
can contain the following constants:
@table @option
@item FRAME_RATE
frame rate, only defined for constant frame-rate video
@item PTS
the presentation timestamp in input
...
...
This diff is collapsed.
Click to expand it.
libavfilter/f_setpts.c
+
9
−
2
View file @
722762f7
...
...
@@ -35,6 +35,7 @@
#include
"video.h"
static
const
char
*
const
var_names
[]
=
{
"FRAME_RATE"
,
///< defined only for constant frame-rate video
"INTERLACED"
,
///< tell if the current frame is interlaced
"N"
,
///< frame number (starting at zero)
"NB_CONSUMED_SAMPLES"
,
///< number of samples consumed by the filter (only audio)
...
...
@@ -54,6 +55,7 @@ static const char *const var_names[] = {
};
enum
var_name
{
VAR_FRAME_RATE
,
VAR_INTERLACED
,
VAR_N
,
VAR_NB_CONSUMED_SAMPLES
,
...
...
@@ -107,8 +109,13 @@ static int config_input(AVFilterLink *inlink)
if
(
setpts
->
type
==
AVMEDIA_TYPE_AUDIO
)
setpts
->
var_values
[
VAR_SAMPLE_RATE
]
=
inlink
->
sample_rate
;
av_log
(
inlink
->
src
,
AV_LOG_VERBOSE
,
"TB:%f SAMPLE_RATE:%f
\n
"
,
setpts
->
var_values
[
VAR_TB
],
setpts
->
var_values
[
VAR_SAMPLE_RATE
]);
setpts
->
var_values
[
VAR_FRAME_RATE
]
=
inlink
->
frame_rate
.
num
&&
inlink
->
frame_rate
.
den
?
av_q2d
(
inlink
->
frame_rate
)
:
NAN
;
av_log
(
inlink
->
src
,
AV_LOG_VERBOSE
,
"TB:%f FRAME_RATE:%f SAMPLE_RATE:%f
\n
"
,
setpts
->
var_values
[
VAR_TB
],
setpts
->
var_values
[
VAR_FRAME_RATE
],
setpts
->
var_values
[
VAR_SAMPLE_RATE
]);
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
libavfilter/version.h
+
1
−
1
View file @
722762f7
...
...
@@ -30,7 +30,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 16
#define LIBAVFILTER_VERSION_MICRO 10
1
#define LIBAVFILTER_VERSION_MICRO 10
2
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment