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
85ae55ec
Commit
85ae55ec
authored
Apr 11, 2018
by
Vishwanath Dixit
Committed by
Karthick Jeyapal
Apr 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/dashenc: logic to compute muxer overhead
parent
99038036
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
dashenc.c
libavformat/dashenc.c
+10
-0
No files found.
libavformat/dashenc.c
View file @
85ae55ec
...
...
@@ -86,6 +86,8 @@ typedef struct OutputStream {
char
full_path
[
1024
];
char
temp_path
[
1024
];
double
availability_time_offset
;
int
total_pkt_size
;
int
muxer_overhead
;
}
OutputStream
;
typedef
struct
DASHContext
{
...
...
@@ -1219,6 +1221,13 @@ static int dash_flush(AVFormatContext *s, int final, int stream)
}
}
if
(
!
os
->
muxer_overhead
)
os
->
muxer_overhead
=
((
int64_t
)
(
range_length
-
os
->
total_pkt_size
)
*
8
*
AV_TIME_BASE
)
/
av_rescale_q
(
os
->
max_pts
-
os
->
start_pts
,
st
->
time_base
,
AV_TIME_BASE_Q
);
os
->
total_pkt_size
=
0
;
if
(
!
os
->
bit_rate
)
{
// calculate average bitrate of first segment
int64_t
bitrate
=
(
int64_t
)
range_length
*
8
*
AV_TIME_BASE
/
av_rescale_q
(
os
->
max_pts
-
os
->
start_pts
,
...
...
@@ -1353,6 +1362,7 @@ static int dash_write_packet(AVFormatContext *s, AVPacket *pkt)
else
os
->
max_pts
=
FFMAX
(
os
->
max_pts
,
pkt
->
pts
+
pkt
->
duration
);
os
->
packets_written
++
;
os
->
total_pkt_size
+=
pkt
->
size
;
if
((
ret
=
ff_write_chained
(
os
->
ctx
,
0
,
pkt
,
s
,
0
))
<
0
)
return
ret
;
...
...
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