[Prev][Next][Index][Thread]

Re: mpeg encoder



>The problem is with the disk access- it's killing me- it appears the
>system is not multitasking the disk io, instead it buffers up over
>several frames, then it writes to disk and a couple frames are lost.

	Yes, this is the way Unix systems usually run.  See "bdflush",
for instance, and the ongoing changes in linux-1.3.58+, for a
discussion of how this operates.  You are also fighting for time with
other processes, of course, so tuning sendmail and other background
processes might help.

...
>What I want to happen is this:
>	capture frame
>	write frame

	Just for kicks, try "fsync(fd)", where "fd" is file descriptor
for the output file, after writing the frame.  If you are using stdio
for your output file -- don't!  Switch to "write", instead.  However,
if the fsync() *does* work for you, you should make it a configurable
parameter, because systems with low-overhead disk I/O might get better
performance without the fsync().

					Craig Milo Rogers

References: