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
02b398ef
Commit
02b398ef
authored
Dec 13, 2009
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add avg_frame_rate.
Originally committed as revision 20826 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
1261b07f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
avformat.h
libavformat/avformat.h
+5
-0
utils.c
libavformat/utils.c
+6
-0
No files found.
libavformat/avformat.h
View file @
02b398ef
...
...
@@ -466,6 +466,11 @@ typedef struct AVStream {
* used internally, NOT PART OF PUBLIC API, dont read or write from outside of libav*
*/
struct
AVPacketList
*
last_in_packet_buffer
;
/**
* Average framerate
*/
AVRational
avg_frame_rate
;
}
AVStream
;
#define AV_PROGRAM_RUNNING 1
...
...
libavformat/utils.c
View file @
02b398ef
...
...
@@ -2223,6 +2223,10 @@ int av_find_stream_info(AVFormatContext *ic)
}
for
(
i
=
0
;
i
<
ic
->
nb_streams
;
i
++
)
{
st
=
ic
->
streams
[
i
];
if
(
codec_info_nb_frames
[
i
]
>
2
)
av_reduce
(
&
st
->
avg_frame_rate
.
num
,
&
st
->
avg_frame_rate
.
den
,
(
codec_info_nb_frames
[
i
]
-
2
)
*
(
int64_t
)
st
->
time_base
.
den
,
codec_info_duration
[
i
]
*
(
int64_t
)
st
->
time_base
.
num
,
60000
);
if
(
st
->
codec
->
codec_type
==
CODEC_TYPE_VIDEO
)
{
if
(
st
->
codec
->
codec_id
==
CODEC_ID_RAWVIDEO
&&
!
st
->
codec
->
codec_tag
&&
!
st
->
codec
->
bits_per_coded_sample
)
st
->
codec
->
codec_tag
=
avcodec_pix_fmt_to_codec_tag
(
st
->
codec
->
pix_fmt
);
...
...
@@ -2900,6 +2904,8 @@ static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_out
display_aspect_ratio
.
num
,
display_aspect_ratio
.
den
);
}
if
(
st
->
codec
->
codec_type
==
CODEC_TYPE_VIDEO
){
if
(
st
->
avg_frame_rate
.
den
&&
st
->
avg_frame_rate
.
num
)
print_fps
(
av_q2d
(
st
->
avg_frame_rate
),
"fps"
);
if
(
st
->
r_frame_rate
.
den
&&
st
->
r_frame_rate
.
num
)
print_fps
(
av_q2d
(
st
->
r_frame_rate
),
"tbr"
);
if
(
st
->
time_base
.
den
&&
st
->
time_base
.
num
)
...
...
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