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
0ba84856
Commit
0ba84856
authored
Apr 16, 2011
by
Baptiste Coudurier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In mov muxer, compute avg bitrate in esds
parent
1aeb88b7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
8 deletions
+17
-8
movenc.c
libavformat/movenc.c
+14
-5
mov
tests/ref/lavf/mov
+1
-1
mpeg4
tests/ref/vsynth1/mpeg4
+1
-1
mpeg4
tests/ref/vsynth2/mpeg4
+1
-1
No files found.
libavformat/movenc.c
View file @
0ba84856
...
...
@@ -247,10 +247,20 @@ static void putDescr(AVIOContext *pb, int tag, unsigned int size)
avio_w8
(
pb
,
size
&
0x7F
);
}
static
unsigned
compute_avg_bitrate
(
MOVTrack
*
track
)
{
uint64_t
size
=
0
;
int
i
;
for
(
i
=
0
;
i
<
track
->
entry
;
i
++
)
size
+=
track
->
cluster
[
i
].
size
;
return
size
*
8
*
track
->
timescale
/
track
->
trackDuration
;
}
static
int
mov_write_esds_tag
(
AVIOContext
*
pb
,
MOVTrack
*
track
)
// Basic
{
int64_t
pos
=
avio_tell
(
pb
);
int
decoderSpecificInfoLen
=
track
->
vosLen
?
5
+
track
->
vosLen
:
0
;
unsigned
avg_bitrate
;
avio_wb32
(
pb
,
0
);
// size
ffio_wfourcc
(
pb
,
"esds"
);
...
...
@@ -282,11 +292,10 @@ static int mov_write_esds_tag(AVIOContext *pb, MOVTrack *track) // Basic
avio_w8
(
pb
,
track
->
enc
->
rc_buffer_size
>>
(
3
+
16
));
// Buffersize DB (24 bits)
avio_wb16
(
pb
,
(
track
->
enc
->
rc_buffer_size
>>
3
)
&
0xFFFF
);
// Buffersize DB
avio_wb32
(
pb
,
FFMAX
(
track
->
enc
->
bit_rate
,
track
->
enc
->
rc_max_rate
));
// maxbitrate (FIXME should be max rate in any 1 sec window)
if
(
track
->
enc
->
rc_max_rate
!=
track
->
enc
->
rc_min_rate
||
track
->
enc
->
rc_min_rate
==
0
)
avio_wb32
(
pb
,
0
);
// vbr
else
avio_wb32
(
pb
,
track
->
enc
->
rc_max_rate
);
// avg bitrate
avg_bitrate
=
compute_avg_bitrate
(
track
);
// maxbitrate (FIXME should be max rate in any 1 sec window)
avio_wb32
(
pb
,
FFMAX3
(
track
->
enc
->
bit_rate
,
track
->
enc
->
rc_max_rate
,
avg_bitrate
));
avio_wb32
(
pb
,
avg_bitrate
);
if
(
track
->
vosLen
)
{
// DecoderSpecific info descriptor
...
...
tests/ref/lavf/mov
View file @
0ba84856
439684b82ccc1fdd24a23392c238ae53
*./tests/data/lavf/lavf.mov
a901cd05609080e8f5c09ca5da7290f0
*./tests/data/lavf/lavf.mov
357681 ./tests/data/lavf/lavf.mov
./tests/data/lavf/lavf.mov CRC=0x2f6a9b26
tests/ref/vsynth1/mpeg4
View file @
0ba84856
080e75117f8142001b096cd977ba287e
*./tests/data/vsynth1/odivx.mp4
d2405fd9e350854a161f48bc63f49253
*./tests/data/vsynth1/odivx.mp4
540156 ./tests/data/vsynth1/odivx.mp4
8828a375448dc5c2215163ba70656f89 *./tests/data/mpeg4.vsynth1.out.yuv
stddev: 7.97 PSNR: 30.10 MAXDIFF: 105 bytes: 7603200/ 7603200
tests/ref/vsynth2/mpeg4
View file @
0ba84856
8ffbe8ce43fe126b12cf9621717d641
b *./tests/data/vsynth2/odivx.mp4
2e3bf184668d4807ae6df0bdceba487
b *./tests/data/vsynth2/odivx.mp4
119809 ./tests/data/vsynth2/odivx.mp4
90a3577850239083a9042bef33c50e85 *./tests/data/mpeg4.vsynth2.out.yuv
stddev: 5.34 PSNR: 33.57 MAXDIFF: 83 bytes: 7603200/ 7603200
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