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
5fa255b6
Commit
5fa255b6
authored
May 23, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avconv: initialize output framerate earlier
This will be needed in the following commits.
parent
1e93c1e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
34 deletions
+42
-34
avconv.c
avconv.c
+0
-34
avconv_opt.c
avconv_opt.c
+42
-0
No files found.
avconv.c
View file @
5fa255b6
...
...
@@ -1954,40 +1954,6 @@ static int transcode_init(void)
enc_ctx
->
chroma_sample_location
=
dec_ctx
->
chroma_sample_location
;
}
/*
* We want CFR output if and only if one of those is true:
* 1) user specified output framerate with -r
* 2) user specified -vsync cfr
* 3) output format is CFR and the user didn't force vsync to
* something else than CFR
*
* in such a case, set ost->frame_rate
*/
if
(
enc_ctx
->
codec_type
==
AVMEDIA_TYPE_VIDEO
&&
!
ost
->
frame_rate
.
num
&&
ist
&&
(
video_sync_method
==
VSYNC_CFR
||
(
video_sync_method
==
VSYNC_AUTO
&&
!
(
oc
->
oformat
->
flags
&
(
AVFMT_NOTIMESTAMPS
|
AVFMT_VARIABLE_FPS
)))))
{
if
(
ist
->
framerate
.
num
)
ost
->
frame_rate
=
ist
->
framerate
;
else
if
(
ist
->
st
->
avg_frame_rate
.
num
)
ost
->
frame_rate
=
ist
->
st
->
avg_frame_rate
;
else
{
av_log
(
NULL
,
AV_LOG_WARNING
,
"Constant framerate requested "
"for the output stream #%d:%d, but no information "
"about the input framerate is available. Falling "
"back to a default value of 25fps. Use the -r option "
"if you want a different framerate.
\n
"
,
ost
->
file_index
,
ost
->
index
);
ost
->
frame_rate
=
(
AVRational
){
25
,
1
};
}
if
(
ost
->
enc
&&
ost
->
enc
->
supported_framerates
&&
!
ost
->
force_fps
)
{
int
idx
=
av_find_nearest_q_idx
(
ost
->
frame_rate
,
ost
->
enc
->
supported_framerates
);
ost
->
frame_rate
=
ost
->
enc
->
supported_framerates
[
idx
];
}
}
#if CONFIG_LIBMFX
if
(
qsv_transcode_init
(
ost
))
exit_program
(
1
);
...
...
avconv_opt.c
View file @
5fa255b6
...
...
@@ -1767,6 +1767,48 @@ loop_end:
}
}
}
/*
* We want CFR output if and only if one of those is true:
* 1) user specified output framerate with -r
* 2) user specified -vsync cfr
* 3) output format is CFR and the user didn't force vsync to
* something else than CFR
*
* in such a case, set ost->frame_rate
*/
if
(
ost
->
encoding_needed
&&
ost
->
enc_ctx
->
codec_type
==
AVMEDIA_TYPE_VIDEO
)
{
int
format_cfr
=
!
(
oc
->
oformat
->
flags
&
(
AVFMT_NOTIMESTAMPS
|
AVFMT_VARIABLE_FPS
));
int
need_cfr
=
!!
ost
->
frame_rate
.
num
;
if
(
video_sync_method
==
VSYNC_CFR
||
(
video_sync_method
==
VSYNC_AUTO
&&
format_cfr
))
need_cfr
=
1
;
if
(
need_cfr
&&
!
ost
->
frame_rate
.
num
)
{
InputStream
*
ist
=
ost
->
source_index
>=
0
?
input_streams
[
ost
->
source_index
]
:
NULL
;
if
(
ist
&&
ist
->
framerate
.
num
)
ost
->
frame_rate
=
ist
->
framerate
;
else
if
(
ist
&&
ist
->
st
->
avg_frame_rate
.
num
)
ost
->
frame_rate
=
ist
->
st
->
avg_frame_rate
;
else
{
av_log
(
NULL
,
AV_LOG_WARNING
,
"Constant framerate requested "
"for the output stream #%d:%d, but no information "
"about the input framerate is available. Falling "
"back to a default value of 25fps. Use the -r option "
"if you want a different framerate.
\n
"
,
ost
->
file_index
,
ost
->
index
);
ost
->
frame_rate
=
(
AVRational
){
25
,
1
};
}
}
if
(
need_cfr
&&
ost
->
enc
->
supported_framerates
&&
!
ost
->
force_fps
)
{
int
idx
=
av_find_nearest_q_idx
(
ost
->
frame_rate
,
ost
->
enc
->
supported_framerates
);
ost
->
frame_rate
=
ost
->
enc
->
supported_framerates
[
idx
];
}
}
}
/* check filename in case of an image number is expected */
...
...
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