jargij / gource

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

Headless mode #29

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It would be useful if gource could run without a visualisation window, to
render output to a file as fast as possible for batch runs.

Original issue reported on code.google.com by ffage...@gmail.com on 29 Dec 2009 at 2:26

GoogleCodeExporter commented 8 years ago
I agree. I was irritated and thought the piping was broken, because I expect an 
app
not to show a window if I pipe the visual output somewhere else :)

Original comment by qubodup on 30 May 2010 at 10:29

GoogleCodeExporter commented 8 years ago
Hi. I'm not sure if this is possible with OpenGL/SDL. I know you can create a
framebuffer object in OpenGL, but normally you have already initialized a 
display
context with a window before hand.

If someone pointed me to something that does this (hardware accelerated opengl
without creating a window) I will have a look.

Original comment by acaudw...@gmail.com on 30 May 2010 at 11:08

GoogleCodeExporter commented 8 years ago
And hence, would the lack of OpenGL hardware produce this kind of abort?

(gdb) where
#0  0x0000003f1c832bf8 in SDL_GL_SetAttribute ()
   from /usr/lib64/libSDL-1.2.so.0
#1  0x000000000040bfdb in SDLAppDisplay::init (this=0x64d1a0, 
    window_title=..., width=1024, height=768, fullscreen=<value optimized out>)
    at src/core/display.cpp:86
#2  0x0000000000431e48 in main (argc=<value optimized out>, 
    argv=<value optimized out>) at src/main.cpp:640

Original comment by CXJohnson@gmail.com on 16 Jul 2010 at 12:05

GoogleCodeExporter commented 8 years ago
Did it segfault? What version on what platform?

If possible could edit src/core/display.cpp to check the return code from 
SDL_Init. eg:

if(SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO) != 0) {
   throw SDLInitException(SDL_GetError());
}

I should really be checking that so it can die gracefully.

Cheers

Andrew

Original comment by acaudw...@gmail.com on 16 Jul 2010 at 3:13

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I'm pretty sure that's the problem. I will change it to do the check above.

Original comment by acaudw...@gmail.com on 16 Jul 2010 at 3:18

GoogleCodeExporter commented 8 years ago
$ gource --help | head
Gource v0.26b
Usage: gource [OPTIONS] [PATH]

$ uname -a
Linux chris 2.6.18-164.6.1.el5xen #1 SMP Tue Nov 3 16:48:13 EST 2009 x86_64 
x86_64 x86_64 GNU/Linux

$ cat /etc/redhat-release
CentOS release 5.5 (Final)

Hope the above answers your questions on version and platform.  If not, let me 
know what else you'd like to see.  I'll give the patch a try and report back.

Original comment by CXJohnson@gmail.com on 16 Jul 2010 at 6:02

GoogleCodeExporter commented 8 years ago
Hmm, that generates a compile error.  I'm not a C++ programmer, so it's not 
immediately obvious to me what's wrong, but I'm thinking maybe the thrown error 
function argument is of the wrong type:

src/core/display.cpp: In member function ‘void 
SDLAppDisplay::init(std::string, int, int, bool)’:
src/core/display.cpp:85: error: no matching function for call to 
‘SDLInitException::SDLInitException(char*)’
src/core/display.h:51: note: candidates are: 
SDLInitException::SDLInitException(std::string&)
src/core/display.h:47: note:                 
SDLInitException::SDLInitException(const SDLInitException&)
make: *** [src/core/display.o] Error 1

Original comment by CXJohnson@gmail.com on 16 Jul 2010 at 6:08

GoogleCodeExporter commented 8 years ago
If you edit display.h and change:
 SDLInitException(std::string& error) : error(error) {
to:
 SDLInitException(const std::string& error) : error(error) {

It should compile. I changed that since 0.26b.

I confirmed it was crashing due to not checking the return value of SDL_Init(), 
so thanks for your report. Your still going to need a video card to use Gource, 
however.

Original comment by acaudw...@gmail.com on 16 Jul 2010 at 11:59

GoogleCodeExporter commented 8 years ago
Yup, understand that.  Moved my efforts down to my laptop from the server.  :-)

Original comment by CXJohnson@gmail.com on 23 Jul 2010 at 8:31

GoogleCodeExporter commented 8 years ago
I'm not sure if this is still an issue or not, but I have figured out how to 
run it headless.  I am using a fresh install of Ubuntu Server 11.04 x64 in a 
virtual machine.  This worked for me, but your mileage may vary.

$ gource --help | head -n 1
Gource v0.28

$ uname -a
Linux ubuntu 2.6.38-11-generic #50-Ubuntu SMP Mon Sep 12 21:18:14 UTC 2011 i686 
i686 i386 GNU/Linux

The first step is to install all the necessary packages:
$ apt-get install git xvfb xfonts-base xfonts-75dpi xfonts-100dpi 
xfonts-cyrillic gource ffmpeg libavcodec-extra-52

After that, simply run something along the lines of:
$ xvfb-run -a -s "-screen 0 1280x720x24" gource -1280x720 -r 30 -o ../test.ppm

A full-blown gource -> ffmpeg example:
$ xvfb-run -a -s "-screen 0 1280x720x24" gource -1280x720 -r 30 -o - | ffmpeg 
-y -b 10000K -r 30 -f image2pipe -vcodec ppm -i - ../test.mov

I hope this helps!

Original comment by phragmun...@gmail.com on 30 Sep 2011 at 4:54

GoogleCodeExporter commented 8 years ago
Thanks for the tip.

Original comment by acaudw...@gmail.com on 2 Oct 2011 at 9:06

GoogleCodeExporter commented 8 years ago
Perhaps adding this to the documentation as how to run headless would be 
adequate to close this bug?

Original comment by dvh...@gmail.com on 2 Nov 2011 at 3:33

GoogleCodeExporter commented 8 years ago
The proposed solution currently targets linux only.
Is there a solution for windows?

Original comment by christia...@gmail.com on 10 Dec 2014 at 10:25

GoogleCodeExporter commented 8 years ago
+1 for a request for a headless Windows solution
https://code.google.com/p/gource/issues/detail?id=29#c14

Original comment by ino...@youappi.com on 9 Jul 2015 at 1:22