Opened 13 years ago
Closed 13 years ago
#288 closed defect (worksforme)
Theora encode bitrate bug.
Reported by: | igor | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avcodec |
Version: | Keywords: | ||
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
In ./libavcodec/libtheoraenc.c:
t_info.target_bitrate = avc_context->bit_rate;
It's wrong!
Right way is:
From ffmpeg2theora (http://svn.xiph.org/trunk/ffmpeg2theora/src/ffmpeg2theora.c)
/*Account for the Ogg page overhead. This is 1 byte per 255 for lacing values, plus 26 bytes per 4096 bytes for the page header, plus approximately 1/2 byte per packet (not accounted for here). */ t_info.target_bitrate = (int) (64870 * (ogg_int64_t)avc_context->bit_rate >> 16);
Attach small path
Attachments (1)
Change History (5)
by , 13 years ago
Attachment: | libtheora.c.patch added |
---|
comment:1 by , 13 years ago
Priority: | important → normal |
---|---|
Status: | new → open |
comment:2 by , 13 years ago
This parameter is used only for bitrate in theora coder. It doesn't affect the container. In other words, we specify the quality of a coded frame we would like to get from encoder.
comment:3 by , 13 years ago
So you are saying the overhead applies even if not muxing into ogg?
Doesn't that mean the comment in the ffmpeg2theora source is wrong?
comment:4 by , 13 years ago
Resolution: | → worksforme |
---|---|
Status: | open → closed |
the matrix lobby scene with 1000kbps without patch: bitrate=1001.6kbits/s
the matrix lobby scene with 1000kbps with patch: bitrate= 991.8kbits/s
Thus i cannot reproduce this bug
FFmpeg allows to mux theora into other containers (avi, mkv, nut): Isn't the patch wrong assuming only ogg?