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
dfa98c4f
Commit
dfa98c4f
authored
Nov 15, 2015
by
Bryan Huh
Committed by
Michael Niedermayer
Nov 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: Fixing typos and adding comments to fps code
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
7bf465ab
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
ffmpeg.c
ffmpeg.c
+8
-8
ffmpeg.h
ffmpeg.h
+1
-1
No files found.
ffmpeg.c
View file @
dfa98c4f
...
@@ -984,11 +984,11 @@ static void do_video_out(AVFormatContext *s,
...
@@ -984,11 +984,11 @@ static void do_video_out(AVFormatContext *s,
ost
->
last_nb0_frames
[
1
],
ost
->
last_nb0_frames
[
1
],
ost
->
last_nb0_frames
[
2
]);
ost
->
last_nb0_frames
[
2
]);
}
else
{
}
else
{
delta0
=
sync_ipts
-
ost
->
sync_opts
;
delta0
=
sync_ipts
-
ost
->
sync_opts
;
// delta0 is the "drift" between the input frame (next_picture) and where it would fall in the output.
delta
=
delta0
+
duration
;
delta
=
delta0
+
duration
;
/* by default, we output a single frame */
/* by default, we output a single frame */
nb0_frames
=
0
;
nb0_frames
=
0
;
// tracks the number of times the PREVIOUS frame should be duplicated, mostly for variable framerate (VFR)
nb_frames
=
1
;
nb_frames
=
1
;
format_video_sync
=
video_sync_method
;
format_video_sync
=
video_sync_method
;
...
@@ -1017,7 +1017,7 @@ static void do_video_out(AVFormatContext *s,
...
@@ -1017,7 +1017,7 @@ static void do_video_out(AVFormatContext *s,
if
(
delta0
<
-
0
.
6
)
{
if
(
delta0
<
-
0
.
6
)
{
av_log
(
NULL
,
AV_LOG_WARNING
,
"Past duration %f too large
\n
"
,
-
delta0
);
av_log
(
NULL
,
AV_LOG_WARNING
,
"Past duration %f too large
\n
"
,
-
delta0
);
}
else
}
else
av_log
(
NULL
,
AV_LOG_DEBUG
,
"Cliping frame in rate conversion by %f
\n
"
,
-
delta0
);
av_log
(
NULL
,
AV_LOG_DEBUG
,
"Clip
p
ing frame in rate conversion by %f
\n
"
,
-
delta0
);
sync_ipts
+=
cor
;
sync_ipts
+=
cor
;
duration
-=
cor
;
duration
-=
cor
;
delta0
+=
cor
;
delta0
+=
cor
;
...
@@ -1066,22 +1066,22 @@ static void do_video_out(AVFormatContext *s,
...
@@ -1066,22 +1066,22 @@ static void do_video_out(AVFormatContext *s,
sizeof
(
ost
->
last_nb0_frames
[
0
])
*
(
FF_ARRAY_ELEMS
(
ost
->
last_nb0_frames
)
-
1
));
sizeof
(
ost
->
last_nb0_frames
[
0
])
*
(
FF_ARRAY_ELEMS
(
ost
->
last_nb0_frames
)
-
1
));
ost
->
last_nb0_frames
[
0
]
=
nb0_frames
;
ost
->
last_nb0_frames
[
0
]
=
nb0_frames
;
if
(
nb0_frames
==
0
&&
ost
->
last_droped
)
{
if
(
nb0_frames
==
0
&&
ost
->
last_drop
p
ed
)
{
nb_frames_drop
++
;
nb_frames_drop
++
;
av_log
(
NULL
,
AV_LOG_VERBOSE
,
av_log
(
NULL
,
AV_LOG_VERBOSE
,
"*** dropping frame %d from stream %d at ts %"
PRId64
"
\n
"
,
"*** dropping frame %d from stream %d at ts %"
PRId64
"
\n
"
,
ost
->
frame_number
,
ost
->
st
->
index
,
ost
->
last_frame
->
pts
);
ost
->
frame_number
,
ost
->
st
->
index
,
ost
->
last_frame
->
pts
);
}
}
if
(
nb_frames
>
(
nb0_frames
&&
ost
->
last_droped
)
+
(
nb_frames
>
nb0_frames
))
{
if
(
nb_frames
>
(
nb0_frames
&&
ost
->
last_drop
p
ed
)
+
(
nb_frames
>
nb0_frames
))
{
if
(
nb_frames
>
dts_error_threshold
*
30
)
{
if
(
nb_frames
>
dts_error_threshold
*
30
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"%d frame duplication too large, skipping
\n
"
,
nb_frames
-
1
);
av_log
(
NULL
,
AV_LOG_ERROR
,
"%d frame duplication too large, skipping
\n
"
,
nb_frames
-
1
);
nb_frames_drop
++
;
nb_frames_drop
++
;
return
;
return
;
}
}
nb_frames_dup
+=
nb_frames
-
(
nb0_frames
&&
ost
->
last_droped
)
-
(
nb_frames
>
nb0_frames
);
nb_frames_dup
+=
nb_frames
-
(
nb0_frames
&&
ost
->
last_drop
p
ed
)
-
(
nb_frames
>
nb0_frames
);
av_log
(
NULL
,
AV_LOG_VERBOSE
,
"*** %d dup!
\n
"
,
nb_frames
-
1
);
av_log
(
NULL
,
AV_LOG_VERBOSE
,
"*** %d dup!
\n
"
,
nb_frames
-
1
);
}
}
ost
->
last_droped
=
nb_frames
==
nb0_frames
&&
next_picture
;
ost
->
last_drop
p
ed
=
nb_frames
==
nb0_frames
&&
next_picture
;
/* duplicates frame if needed */
/* duplicates frame if needed */
for
(
i
=
0
;
i
<
nb_frames
;
i
++
)
{
for
(
i
=
0
;
i
<
nb_frames
;
i
++
)
{
...
@@ -1632,7 +1632,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
...
@@ -1632,7 +1632,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
pts
=
FFMAX
(
pts
,
av_rescale_q
(
av_stream_get_end_pts
(
ost
->
st
),
pts
=
FFMAX
(
pts
,
av_rescale_q
(
av_stream_get_end_pts
(
ost
->
st
),
ost
->
st
->
time_base
,
AV_TIME_BASE_Q
));
ost
->
st
->
time_base
,
AV_TIME_BASE_Q
));
if
(
is_last_report
)
if
(
is_last_report
)
nb_frames_drop
+=
ost
->
last_droped
;
nb_frames_drop
+=
ost
->
last_drop
p
ed
;
}
}
secs
=
FFABS
(
pts
)
/
AV_TIME_BASE
;
secs
=
FFABS
(
pts
)
/
AV_TIME_BASE
;
...
...
ffmpeg.h
View file @
dfa98c4f
...
@@ -414,7 +414,7 @@ typedef struct OutputStream {
...
@@ -414,7 +414,7 @@ typedef struct OutputStream {
int64_t
max_frames
;
int64_t
max_frames
;
AVFrame
*
filtered_frame
;
AVFrame
*
filtered_frame
;
AVFrame
*
last_frame
;
AVFrame
*
last_frame
;
int
last_droped
;
int
last_drop
p
ed
;
int
last_nb0_frames
[
3
];
int
last_nb0_frames
[
3
];
void
*
hwaccel_ctx
;
void
*
hwaccel_ctx
;
...
...
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