[FFmpeg-devel] [PATCH 2/3] avformat/avienc: add reserve_index_space option

Michael Niedermayer michael at niedermayer.cc
Tue Jan 10 01:15:19 EET 2017


On Mon, Jan 09, 2017 at 09:56:51AM +0100, Tobias Rapp wrote:
> Allows the user to reserve space for the ODML master index. A sufficient
> sized master index in the AVI header avoids storing follow-up master
> indexes within the 'movi' data later.
> 
> Signed-off-by: Tobias Rapp <t.rapp at noa-archive.com>
> ---
>  libavformat/avi.h     |  1 -
>  libavformat/avienc.c  | 36 +++++++++++++++++++++++++++++-------
>  libavformat/version.h |  2 +-
>  3 files changed, 30 insertions(+), 9 deletions(-)

iam not against this but as the only way to write strictly spec
compiant files >= 256g, i think this is not very user friendly

FFmpeg should work out of the box not requireing the user to tune
options

Here are some random ideas:

Enlarge the default index depending on expected bitrate, a high res
rawvideo input should by default get a bigger reserved index space

Use the input file duration (aka pass it to the muxer) and use it as
a guess on duration, enlarge the space accordingly

Or, do the hard but correct and just enlarge it
As in when you hit some SIZE1 like lets say 1GB leave 1mb space
(which at this filesize is a insignificant 0.1%)
and when writing the trailer and the file exceeded 256G go back and
move the first 1gb forward to make space for a larger master index.
(this at that point just moves 0.5% of the file)
You can also use the 1mb space for holding a 2nd master index prior
to writing the trailer. Either way the file should ideally be partially
indexed while it is being written so a 2nd process could read and mostly
seek in it


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170110/4ee7efa4/attachment.sig>


More information about the ffmpeg-devel mailing list