Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a thread for ppm exporter #37

Closed
GoogleCodeExporter opened this issue Apr 12, 2016 · 7 comments
Closed

Use a thread for ppm exporter #37

GoogleCodeExporter opened this issue Apr 12, 2016 · 7 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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

  • Added labels: Type-Other
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

Nice. I will try it out later this week.

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

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant