Gamatora / gource

Automatically exported from code.google.com/p/gource
0 stars 0 forks source link

Use a thread for ppm exporter #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently the gource processing is completely blocked while waiting to
write a frame to the output stream. On a system with more than 1 CPU core
you can get better throughput by using a separate thread to write the
output. A rudimentary patch is provided as an example. It works for me but
you may want to dress it up a bit.

Original issue reported on code.google.com by Highland...@gmail.com on 18 Jan 2010 at 7:28

Attachments:

GoogleCodeExporter commented 9 years ago
Good idea.

FYI ppm.cpp has changed a bit (not released yet) as I improved the performance 
by
doing less writes, so the patch will need some merging.

http://github.com/acaudwell/Gource/commit/7857f6fe0e5dd3e25034f7d6b31ec83fd3564e
14

Original comment by acaudw...@gmail.com on 18 Jan 2010 at 7:42

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Here's a patch against current git. It's a bit more C++ oriented...

Original comment by Highland...@gmail.com on 18 Jan 2010 at 8:40

Attachments:

GoogleCodeExporter commented 9 years ago
Nice. I will try it out later this week.

Original comment by acaudw...@gmail.com on 18 Jan 2010 at 8:48

GoogleCodeExporter commented 9 years ago
Hi. I've merged your code into this branch:

http://github.com/acaudwell/Gource/tree/ppmthread

http://gource.googlecode.com/files/gource-0.24-beta1.tar.gz

I've changed the code to use the SDL_thread API since that is more portable (the
SDL_thread API is essentially identical). I made a few other changes like adding
double buffering, and doing the pixel flipping on the video card.

In my tests its about 2fps faster (11fps vs 9fps) with the thread than without 
using
this command line:

./gource --stop-at-end --output-ppm-stream - | ffmpeg -y -b 3000K -r 60 -f 
image2pipe
-vcodec ppm -i - -vcodec libx264 gource.mp4

(running against Gource.git)

It'd be good if you could have a look over changes before I add this to the 
master.

Cheers

Original comment by acaudw...@gmail.com on 28 Jan 2010 at 3:02

GoogleCodeExporter commented 9 years ago
I've updated the beta:

http://gource.googlecode.com/files/gource-0.24-beta2.tar.gz

Original comment by acaudw...@gmail.com on 31 Jan 2010 at 10:30

GoogleCodeExporter commented 9 years ago

Original comment by acaudw...@gmail.com on 31 Jan 2010 at 10:37