Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
a220b07b
Commit
a220b07b
authored
Mar 17, 2014
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avconv: split printing the final statistics into a separate function
parent
baeb59d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
30 deletions
+36
-30
avconv.c
avconv.c
+36
-30
No files found.
avconv.c
View file @
a220b07b
...
@@ -736,6 +736,40 @@ static int poll_filters(void)
...
@@ -736,6 +736,40 @@ static int poll_filters(void)
return
ret
;
return
ret
;
}
}
static
void
print_final_stats
(
int64_t
total_size
)
{
uint64_t
video_size
=
0
,
audio_size
=
0
,
extra_size
=
0
,
other_size
=
0
;
uint64_t
data_size
=
0
;
float
percent
=
-
1
.
0
;
int
i
;
for
(
i
=
0
;
i
<
nb_output_streams
;
i
++
)
{
OutputStream
*
ost
=
output_streams
[
i
];
switch
(
ost
->
st
->
codec
->
codec_type
)
{
case
AVMEDIA_TYPE_VIDEO
:
video_size
+=
ost
->
data_size
;
break
;
case
AVMEDIA_TYPE_AUDIO
:
audio_size
+=
ost
->
data_size
;
break
;
default:
other_size
+=
ost
->
data_size
;
break
;
}
extra_size
+=
ost
->
st
->
codec
->
extradata_size
;
data_size
+=
ost
->
data_size
;
}
if
(
data_size
&&
total_size
>=
data_size
)
percent
=
100
.
0
*
(
total_size
-
data_size
)
/
data_size
;
av_log
(
NULL
,
AV_LOG_INFO
,
"
\n
"
);
av_log
(
NULL
,
AV_LOG_INFO
,
"video:%1.0fkB audio:%1.0fkB other streams:%1.0fkB global headers:%1.0fkB muxing overhead: "
,
video_size
/
1024
.
0
,
audio_size
/
1024
.
0
,
other_size
/
1024
.
0
,
extra_size
/
1024
.
0
);
if
(
percent
>=
0
.
0
)
av_log
(
NULL
,
AV_LOG_INFO
,
"%f%%"
,
percent
);
else
av_log
(
NULL
,
AV_LOG_INFO
,
"unknown"
);
av_log
(
NULL
,
AV_LOG_INFO
,
"
\n
"
);
}
static
void
print_report
(
int
is_last_report
,
int64_t
timer_start
)
static
void
print_report
(
int
is_last_report
,
int64_t
timer_start
)
{
{
char
buf
[
1024
];
char
buf
[
1024
];
...
@@ -852,37 +886,9 @@ static void print_report(int is_last_report, int64_t timer_start)
...
@@ -852,37 +886,9 @@ static void print_report(int is_last_report, int64_t timer_start)
fflush
(
stderr
);
fflush
(
stderr
);
if
(
is_last_report
)
{
if
(
is_last_report
)
uint64_t
video_size
=
0
,
audio_size
=
0
,
extra_size
=
0
,
other_size
=
0
;
print_final_stats
(
total_size
);
uint64_t
data_size
=
0
;
float
percent
=
-
1
.
0
;
for
(
i
=
0
;
i
<
nb_output_streams
;
i
++
)
{
OutputStream
*
ost
=
output_streams
[
i
];
switch
(
ost
->
st
->
codec
->
codec_type
)
{
case
AVMEDIA_TYPE_VIDEO
:
video_size
+=
ost
->
data_size
;
break
;
case
AVMEDIA_TYPE_AUDIO
:
audio_size
+=
ost
->
data_size
;
break
;
default:
other_size
+=
ost
->
data_size
;
break
;
}
extra_size
+=
ost
->
st
->
codec
->
extradata_size
;
data_size
+=
ost
->
data_size
;
}
if
(
data_size
&&
total_size
>=
data_size
)
percent
=
100
.
0
*
(
total_size
-
data_size
)
/
data_size
;
av_log
(
NULL
,
AV_LOG_INFO
,
"
\n
"
);
av_log
(
NULL
,
AV_LOG_INFO
,
"video:%1.0fkB audio:%1.0fkB other streams:%1.0fkB global headers:%1.0fkB muxing overhead: "
,
video_size
/
1024
.
0
,
audio_size
/
1024
.
0
,
other_size
/
1024
.
0
,
extra_size
/
1024
.
0
);
if
(
percent
>=
0
.
0
)
av_log
(
NULL
,
AV_LOG_INFO
,
"%f%%"
,
percent
);
else
av_log
(
NULL
,
AV_LOG_INFO
,
"unknown"
);
av_log
(
NULL
,
AV_LOG_INFO
,
"
\n
"
);
}
}
}
static
void
flush_encoders
(
void
)
static
void
flush_encoders
(
void
)
...
...
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