On Tue, Jul 12, 2011 at 5:40 PM, Bosi Daniele <[email protected]> wrote:
> Enrico,
> your one is not a silly question. I tested both "write" and "fwrite" 
> functions, reaching the best performances with "fwrite" that AFAIK is 
> buffered.
> I also tried splitting the write on the file pointer / file descriptor on 
> packets of 32 kBytes (the drivers try to write 64 packets, 512 bytes long), 
> but the best solution I found until now on the FAT file system is:
> fwrite without splitting the frames. So basically I have a loop for every 
> video file where the software writes a frame at a time.
>
> Thanks for your help,
> ciao Daniele

Just thinking about it, if you have a cbr h264 stream with 1 Mb
bitrate you are writing 128 KB/s, or an average of 5 KB/s per frame.
So you are writing 5 KB of data, 25 times a second. Grand total for
two threads: 50 writes/s just to write 256KB!

You can add logic to batch writes based on a threshold, but i think
it's much more simple to try to disable sync and fflush every X
seconds (even 1 or 2).

Ciao,

Enrico
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to