You are not logged in.

#1 2014-03-11 06:09:15

lano1106
Member
From: Canada, Montreal
Registered: 2012-11-22
Posts: 80
Website

GLCS official thread

Hi,

I have just release GLCS and Arch users have the privilege to be the first to try out my latest creation.

Here is a summary of what this app is all about:

glcs is a fork by Olivier Langlois from glc v0.5.8 written by Pyry Haulos.

without having tempered much with the original design,
several bugs have been fixed and pretty much all the code
went through review and modification to robustify the code
and replace calls to deprecated system calls.

Beside code quality improvement, the problem that glcs attempt to
resolve over the original is that the glc file format is not adequate
to store HD stream on disk.

As an example, to capture an opengl window at a 1080P resolution at 30fps,
this represents about 2 million pixels of 24 bits or roughly 6MB per frame or
180 MB per second. glc offer general lossless compression but the result is not
good enough to consider long session of HD capture.

glcs propose a new flexible option allowing to pipe directly the raw audio video
streams to a more specialised tool. for instance, ffmpeg. This allows to apply any video
codec on the stream for a better compression ratio and also by leveraging the capability
of the specialised tool, this open up new possibilities for glcs users such as live stream
of a video game session on youtube.

One more thing. glcs is optimized for Linux by using Linux specific functions. This is totally
non-portable and this is an assumed decision.

Here is my first 1080P real-time capture on Youtube:
http://youtu.be/EYYeIefOgq0

https://aur.archlinux.org/packages/glcs

https://aur.archlinux.org/packages/lib32-glcs/

Offline

#2 2014-03-11 06:44:02

fukawi2
Forum Moderator
From: .vic.au
Registered: 2007-09-28
Posts: 5,283
Website

Re: GLCS official thread

Moving to Community Contributions

Offline

#3 2014-03-11 13:16:27

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 3,474
Website

Re: GLCS official thread

GLCS is "an ALSA & OpenGL capture & streaming tool for Linux". It is a command line application.

Offline

#4 2014-03-19 06:04:00

lano1106
Member
From: Canada, Montreal
Registered: 2012-11-22
Posts: 80
Website

Re: GLCS official thread

I have just released v0.6.1 which allows to overlay a webcam video on top of the capture and mix several audio streams together.

Much of the work is done by ffmpeg but I had to tweak a little bit the piping code in glcs shared libraries to make that possible.

Here is a video on youtube showcasing the new version:

http://youtu.be/jVBYTrcC21Q

Offline

#5 2014-03-26 12:38:54

Svenstaro
Developer
From: Germany
Registered: 2008-11-19
Posts: 365

Re: GLCS official thread

Very nice work! I think this project deserves more exposure. If it can get 10 votes, I'll be happy to pull it into [community].

Offline

#6 2014-03-26 14:28:25

kokoko3k
Member
Registered: 2008-11-14
Posts: 1,482

Re: GLCS official thread

Hi lano1106, could you please post a line in how to capture and get an ffmpeg encoded file?
it is not really clear to me how to use capture.sh
thanks!

Offline

#7 2014-03-27 04:16:40

lano1106
Member
From: Canada, Montreal
Registered: 2012-11-22
Posts: 80
Website

Re: GLCS official thread

Hi kokoko3k,

The usage of the capture.sh is

capture.sh cmdline_of_the_app_that_you_want_to_capture

ie:

capture.sh glxgears -geometry 640x480+0+0

(BTW, glxgears is excellent to "practice" your understanding of glcs)

Then Press Shift-F8 to start the capture, and shift-F8 to stop it.

Second advice I can give you is to open capture.sh with an editor.

1. If you comment out the GLC_LOG_FILE, the log output will go into stderr which great if you launch capture.sh from a terminal.

2. With

export GLC_CAPTURE=back
export GLC_INDICATOR=1

you will see a small red square in the top left corner appear to indicate capture is on.

3. Notice that you will need to adjust GLC_FILE to a path that exist in your system. I need to change it to a more neutral dest in the next release.

Finally, you will need to tweak the pipe_ffmpeg.sh script.

1. Unless you have linux-ck, you'll need to remove 'schedtool -I -e'
2. To keep things simple, for now just keep the video and remove the lines related to audio:

--f alsa....
  -c:a libfdk_aac...

In the README file, I am explaining how to create an ALSA loop_capture device.
To have the libfdk_aac support, you need to install the package libfdk-aac and recompile ffmpeg with

--enable-libfdk-aac
--enable-nonfree

an easier and out of the box replacement would be to use the native ffmpeg aac encoder as described at:

http://trac.ffmpeg.org/wiki/AACEncodingGuide

but as I said, I would advocate to use an incremental approach.

1. First make video capture work
2. Then when it works, start thinking about adding sound.

Also note that when capture is launched, pipe_ffmpeg.sh creates a log file at /tmp/pipe_ffmpeg.out

If you still have questions, just report back the glcs log out (either from stderr or /tmp/glcs.log. Depending on your GLC_LOG_FILE settings) and the output of /tmp/pipe_ffmpeg.out

If it still does not work, I expect the content of these files to be very explicit about the problem.

greetings and happy capturing!

Offline

#8 2014-03-27 04:19:40

lano1106
Member
From: Canada, Montreal
Registered: 2012-11-22
Posts: 80
Website

Re: GLCS official thread

Svenstaro wrote:

Very nice work! I think this project deserves more exposure. If it can get 10 votes, I'll be happy to pull it into [community].

Sventaro, thank you very much for your interest!

this is appreciated.

Offline

#9 2014-03-27 08:11:33

Svenstaro
Developer
From: Germany
Registered: 2008-11-19
Posts: 365

Re: GLCS official thread

Please add proper sound capturing support though. Creating a look back device shouldn't be necessary.

Offline

#10 2014-03-27 10:24:55

kokoko3k
Member
Registered: 2008-11-14
Posts: 1,482

Re: GLCS official thread

Thanks lano, it is working right now.

Offline

#11 2014-03-27 17:03:49

Ziemas
Member
Registered: 2009-06-07
Posts: 12

Re: GLCS official thread

Hello, this is a very cool project. I'm curious to know if you've given any thought to integrating it into a streaming application like obs-studio.

obs-studio is total rewrite of OBS with the goal of being portable, it has a plugin system and already supports pulseaudio and X capture on Linux, but having a high performance GL capture would be absolutely excellent.

Last edited by Ziemas (2014-03-27 17:59:15)

Offline

#12 2014-03-28 03:03:53

lano1106
Member
From: Canada, Montreal
Registered: 2012-11-22
Posts: 80
Website

Re: GLCS official thread

Svenstaro wrote:

Please add proper sound capturing support though. Creating a look back device shouldn't be necessary.

I know your opinion. You've already expressed it. My opinion differs.

I do not think that I can handle better audio than what is already offered by ALSA in my humble project. If you think otherwise, you are welcome to share specific suggestion.

IMHO, the best that could be done, it is a GUI tool that help people managing ALSA sound config to not duplicate functionality already builtin Linux.

but then, this would be a completely different and independant project with GLCS. Any takers? there is probably a need for such piece of SW!

Offline

#13 2014-03-28 03:10:21

lano1106
Member
From: Canada, Montreal
Registered: 2012-11-22
Posts: 80
Website

Re: GLCS official thread

Ziemas wrote:

Hello, this is a very cool project. I'm curious to know if you've given any thought to integrating it into a streaming application like obs-studio.

obs-studio is total rewrite of OBS with the goal of being portable, it has a plugin system and already supports pulseaudio and X capture on Linux, but having a high performance GL capture would be absolutely excellent.

Hi Ziemas,

I haven't heard about obs-studio. Since I am not using that SW, it is unlikely that I work on integrating GLCS with obs.

Offline

#14 2014-05-08 06:57:17

lano1106
Member
From: Canada, Montreal
Registered: 2012-11-22
Posts: 80
Website

Re: GLCS official thread

Hi,

I just released a new version in AUR. It is a minor release containing few bug fixes. Here is the release notes:

Version 0.6.2 - May 08, 2014

- Fix invert_framewriter when restart capture after an interrupted one.
- Add the option to delay the writting of the frames in the pipe after having
  created the pipe reader process.
- Improve cmake files.
- Fix compiler warnings
- Replace sched_yield which is not implemented in Linux
- Robustify gl_capture multithread sync design
- Improve gl_capture logs
- Remove unneeded PTHREAD_CANCEL_ASYNCHRONOUS type use.

Offline

#15 2014-08-09 13:47:57

StooJ
Member
Registered: 2009-12-18
Posts: 5

Re: GLCS official thread

Hi

Recording glx-gears works fine, and I tried torcs as well, but I can't seem to record minecraft. Something is happening before any data gets piped to pipe_ffmpeg, because that log file is not created (it gets created fine when I record other stuff).

Here's the glc log

[   0.00s        log  info ] opened /tmp/glcs.log for log
[   0.00s       main   dbg ] flags: 00000093
[   0.00s       util  info ] version cf1d6d9
[   0.00s       util   dbg ] Aug  8 2014 20:16:00, 4.9.1
[   0.02s     opengl   dbg ] initializing
[   0.02s gl_capture  info ] capturing at 30.000000 fps, interval 33333333 with a rational fix of 1 every 3 frames
[   0.02s gl_capture  info ] reading frames from GL_BACK
[   0.02s gl_capture  info ] reading data as dword aligned
[   0.02s       alsa   dbg ] initializing
[   0.02s       util  info ] system information
  threads hint = 1
[   0.02s       util  info ] stream information
  signature    = 0x00434c47
  version      = 0x05
  flags        = 0
  fps          = 30.000000
  pid          = 9760
  name         = /usr/lib/jvm/java-7-openjdk/jre/bin/java
  date         = Sat Aug  9 23:40:52 2014
[   0.02s       main  info ] starting glc
[   0.02s       core  info ] single proc num 3 multi proc num 0, threads num per multi proc 1
[   0.02s       pipe   dbg ] pipe_set_callback
[   0.02s       pipe   dbg ] pipe_set_sync
[   0.02s       pipe  info ] /usr/lib/jvm/java-7-openjdk/jre/bin/java (9760) capture on Sat Aug  9 23:40:52 2014 at 30.000000 fps
[   0.02s       main  warn ] compression disabled
[   0.02s gl_capture  info ] reading frames in GL_BGRA format
[   0.02s       main  info ] glc running
[   0.02s      state   dbg ] applying 89958 nsec time difference
[   0.02s gl_capture  info ] starting capturing
[   0.02s       main  info ] started capturing
[   0.02s     signal   dbg ] installing rtsig 63
[   0.02s       pipe  warn ] '/usr/lib/jvm/java-7-openjdk/jre/bin/java' host app is handling SIGPIPE. There is a risk of interfering with it
[   0.02s       main  info ] glc initialized
[   0.02s       main   dbg ] LD_PRELOAD=libglc-hook.so
[ 147.24s       main  info ] closing glc
[ 147.24s       alsa   dbg ] closing
[ 147.24s     opengl   dbg ] closing
[ 147.24s gl_capture  info ] stopping capturing
[ 147.24s       main  perf ] uncompressed buffer stats:
 run time    : 147.220683 secs
 averages
  written
   packets   : 0.01
   bytes     : 0 B
   % waited  : 0.00 %
  read
   packets   : 0.01
   bytes     : 0 B
   % waited  : 100.00 %
 totals
  written
   packets   : 1
   bytes     : 1 B
  read
   packets   : 1
   bytes     : 1 B
[ 147.24s        log  info ] log closed

Is the SIGPIPE warning the issue?

Many thanks.

Last edited by StooJ (2014-08-09 13:49:21)

Offline

#16 2014-08-11 01:39:43

lano1106
Member
From: Canada, Montreal
Registered: 2012-11-22
Posts: 80
Website

Re: GLCS official thread

hi stooj,

I think that what you are experiencing is because minecraft like some other games that can be captured spawn another child process that do the actual rendering.

This has been resolved by this problem fix:

https://github.com/lano1106/glcs/issues/11

you can either manually apply the patch or let me push new pkgfiles that picks up the latest improvements in git. I will take care of that this week.

Greetings,
Olivier

Offline

#17 2014-08-13 03:41:09

StooJ
Member
Registered: 2009-12-18
Posts: 5

Re: GLCS official thread

Oh! Completely missed that bug report - sorry about that.
I've upgraded to 0.6.3 and can now record, but hitting a performance wall - glcs just stops recording after a few seconds because the game can't keep up with the pipe's requirements.

[ 353.89s       pipe error ] epoll to after 333 ms. Child process too slow

I've tried increasing buffer sizes, lowering fps, locking fps, adding a pipe delay, but no joy. I think I'm just going to need a bigger boat.

Offline

Board footer

Powered by FluxBB