Thread: avs2pipe
View Single Post
Old 7th April 2011, 12:20   #59  |  Link
doobry
Totally Clueless
 
doobry's Avatar
 
Join Date: Nov 2010
Location: Edinburgh, UK
Posts: 31
Thanks to IanB and Gavino causing me to look though the color space handling code, I've rewritten it for the "next" version. It now uses an internal buffer to organize each frame, before writing it to stdout with a single call to fwrite. Before it called fprintf for the FRAME header, and then fwrite for each row of data...

This has given me a huge speed boost, ~1.3 seconds to write 1000 frames to null, vs ~2.1 seconds using the old method, however I noticed that it will no longer output to the windows console, not a problem as you should never want to do that, but it did make me wonder if there is a limit to how much you can write to a pipe with a single fwrite... it still works fine via x264 or piping to a file, but I want to be sure.

So before I upload this and remove the link to the working version, does anyone want to have a test, or have any views on this... I will provide a download link via PM to a test version, but I'm not posting it here as I've noticed scrapers are linking to my downloads, which I don't really mind but I don't want some random site posting a possibly broken version without the info saying it might be busted.

Obviously this "huge" speed increase will be pretty insignificant vs the slowdown caused by say piping the output to x264 but it all helps.
doobry is offline   Reply With Quote