[MPlayer-users] incomplete avi files and mencoder

D Richard Felker III dalias at aerifal.cx
Tue Jan 15 08:44:01 CET 2002

here's an issue i just found using mencoder that could perhaps be
handled better. when mencoder starts writing an avi file, it puts a
dummy header at the beginning, with information to be filled in later
after the encoding is complete. the dummy header is good enough that
mplayer can play an incomplete file generated by mencoder, but not
good enough for mplayer (or mencoder in stream copy mode) to be able
to rebuild an index for seeking. i've looked at aviwrite.c a bit, and
although i'm not terribly familiar with the avi header format, it
looks like aviwrite_write_header is putting several negative numbers
in the header the first time it's called, whereas it probably should
put 0 or the largest number that fits to make things work better when
playing incomplete files. perhaps there should be a separate function
aviwrite_write_dummy_header or something to handle all that. i hope
you don't think this is nitpicking -- it's not absolutely necessary,
but it would be very helpful to be able to seek (using -idx) in the
file before it's complete, to confirm that the quality is adequate and
such before spending all the time to encode the whole thing.

btw, as a wishlist item that's sort of related...think it would be
feasible to support resuming prematurely terminated encoding with
mencoder, presumably at the last successful keyframe? it might be
necessary to save some extra status info, but it would be rather


More information about the MPlayer-users mailing list