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
0478d5f9
Commit
0478d5f9
authored
Jun 11, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: allow overriding framerate for stream copy
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
cb7f0622
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
ffmpeg.c
ffmpeg.c
+12
-7
No files found.
ffmpeg.c
View file @
0478d5f9
...
...
@@ -2870,6 +2870,10 @@ static int transcode_init(void)
codec
->
time_base
.
num
*=
icodec
->
ticks_per_frame
;
}
}
if
(
ost
->
frame_rate
.
num
)
codec
->
time_base
=
(
AVRational
){
ost
->
frame_rate
.
den
,
ost
->
frame_rate
.
num
};
av_reduce
(
&
codec
->
time_base
.
num
,
&
codec
->
time_base
.
den
,
codec
->
time_base
.
num
,
codec
->
time_base
.
den
,
INT_MAX
);
...
...
@@ -4573,25 +4577,26 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
AVStream
*
st
;
OutputStream
*
ost
;
AVCodecContext
*
video_enc
;
char
*
frame_rate
=
NULL
;
ost
=
new_output_stream
(
o
,
oc
,
AVMEDIA_TYPE_VIDEO
,
source_index
);
st
=
ost
->
st
;
video_enc
=
st
->
codec
;
MATCH_PER_STREAM_OPT
(
frame_rates
,
str
,
frame_rate
,
oc
,
st
);
if
(
frame_rate
&&
av_parse_video_rate
(
&
ost
->
frame_rate
,
frame_rate
)
<
0
)
{
av_log
(
NULL
,
AV_LOG_FATAL
,
"Invalid framerate value: %s
\n
"
,
frame_rate
);
exit_program
(
1
);
}
if
(
!
ost
->
stream_copy
)
{
const
char
*
p
=
NULL
;
char
*
forced_key_frames
=
NULL
,
*
frame_
rate
=
NULL
,
*
frame_
size
=
NULL
;
char
*
forced_key_frames
=
NULL
,
*
frame_size
=
NULL
;
char
*
frame_aspect_ratio
=
NULL
,
*
frame_pix_fmt
=
NULL
;
char
*
intra_matrix
=
NULL
,
*
inter_matrix
=
NULL
;
const
char
*
filters
=
"null"
;
int
i
;
MATCH_PER_STREAM_OPT
(
frame_rates
,
str
,
frame_rate
,
oc
,
st
);
if
(
frame_rate
&&
av_parse_video_rate
(
&
ost
->
frame_rate
,
frame_rate
)
<
0
)
{
av_log
(
NULL
,
AV_LOG_FATAL
,
"Invalid framerate value: %s
\n
"
,
frame_rate
);
exit_program
(
1
);
}
MATCH_PER_STREAM_OPT
(
frame_sizes
,
str
,
frame_size
,
oc
,
st
);
if
(
frame_size
&&
av_parse_video_size
(
&
video_enc
->
width
,
&
video_enc
->
height
,
frame_size
)
<
0
)
{
av_log
(
NULL
,
AV_LOG_FATAL
,
"Invalid frame size: %s.
\n
"
,
frame_size
);
...
...
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