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
e0791c5a
Commit
e0791c5a
authored
8 years ago
by
Carl Eugen Hoyos
Browse files
Options
Downloads
Patches
Plain Diff
lavf/flvdec: Set avg_frame_rate for video streams.
Requested-by: qw, applemax82 at 163 dot com Reviewed-by: Steven Liu
parent
334775f5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libavformat/flvdec.c
+8
-1
8 additions, 1 deletion
libavformat/flvdec.c
libavformat/version.h
+1
-1
1 addition, 1 deletion
libavformat/version.h
with
9 additions
and
2 deletions
libavformat/flvdec.c
+
8
−
1
View file @
e0791c5a
...
@@ -67,6 +67,7 @@ typedef struct FLVContext {
...
@@ -67,6 +67,7 @@ typedef struct FLVContext {
int64_t
*
keyframe_times
;
int64_t
*
keyframe_times
;
int64_t
*
keyframe_filepositions
;
int64_t
*
keyframe_filepositions
;
int
missing_streams
;
int
missing_streams
;
AVRational
framerate
;
}
FLVContext
;
}
FLVContext
;
static
int
probe
(
AVProbeData
*
p
,
int
live
)
static
int
probe
(
AVProbeData
*
p
,
int
live
)
...
@@ -142,8 +143,10 @@ static AVStream *create_stream(AVFormatContext *s, int codec_type)
...
@@ -142,8 +143,10 @@ static AVStream *create_stream(AVFormatContext *s, int codec_type)
s
->
ctx_flags
&=
~
AVFMTCTX_NOHEADER
;
s
->
ctx_flags
&=
~
AVFMTCTX_NOHEADER
;
if
(
codec_type
==
AVMEDIA_TYPE_AUDIO
)
if
(
codec_type
==
AVMEDIA_TYPE_AUDIO
)
flv
->
missing_streams
&=
~
FLV_HEADER_FLAG_HASAUDIO
;
flv
->
missing_streams
&=
~
FLV_HEADER_FLAG_HASAUDIO
;
if
(
codec_type
==
AVMEDIA_TYPE_VIDEO
)
if
(
codec_type
==
AVMEDIA_TYPE_VIDEO
)
{
flv
->
missing_streams
&=
~
FLV_HEADER_FLAG_HASVIDEO
;
flv
->
missing_streams
&=
~
FLV_HEADER_FLAG_HASVIDEO
;
st
->
avg_frame_rate
=
flv
->
framerate
;
}
avpriv_set_pts_info
(
st
,
32
,
1
,
1000
);
/* 32 bit pts in ms */
avpriv_set_pts_info
(
st
,
32
,
1
,
1000
);
/* 32 bit pts in ms */
...
@@ -555,6 +558,10 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
...
@@ -555,6 +558,10 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
if
(
!
st
)
if
(
!
st
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
st
->
codecpar
->
codec_id
=
AV_CODEC_ID_TEXT
;
st
->
codecpar
->
codec_id
=
AV_CODEC_ID_TEXT
;
}
else
if
(
!
strcmp
(
key
,
"framerate"
))
{
flv
->
framerate
=
av_d2q
(
num_val
,
1000
);
if
(
vstream
)
vstream
->
avg_frame_rate
=
flv
->
framerate
;
}
else
if
(
flv
->
trust_metadata
)
{
}
else
if
(
flv
->
trust_metadata
)
{
if
(
!
strcmp
(
key
,
"videocodecid"
)
&&
vpar
)
{
if
(
!
strcmp
(
key
,
"videocodecid"
)
&&
vpar
)
{
int
ret
=
flv_set_video_codec
(
s
,
vstream
,
num_val
,
0
);
int
ret
=
flv_set_video_codec
(
s
,
vstream
,
num_val
,
0
);
...
...
This diff is collapsed.
Click to expand it.
libavformat/version.h
+
1
−
1
View file @
e0791c5a
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
// Also please add any ticket numbers that you believe might be affected here
// Also please add any ticket numbers that you believe might be affected here
#define LIBAVFORMAT_VERSION_MAJOR 57
#define LIBAVFORMAT_VERSION_MAJOR 57
#define LIBAVFORMAT_VERSION_MINOR 58
#define LIBAVFORMAT_VERSION_MINOR 58
#define LIBAVFORMAT_VERSION_MICRO 10
0
#define LIBAVFORMAT_VERSION_MICRO 10
1
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
LIBAVFORMAT_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