jarcode-foss / glava

GLava - OpenGL audio spectrum visualizer
GNU General Public License v3.0
1.17k stars 59 forks source link

Suport for non-realtime rendering to file #110

Closed Hideman85 closed 5 years ago

Hideman85 commented 5 years ago

Hello Glava team,

I'm looking for video making using a art picture in background and a overlay with a radial spectrum of the current sound playing and the title of sound in middle top.

I found Adobe after effect (using with wine) with spectrum generation module but it's not realistic because high freq are not visible (even if I put high freq cut off to 24kHz).

I can have also many ffmpeg tools but they don't look so cute...

I also found your soft and it look more accurate than Adobe Effect and can rendering full frequency 5Hz - 24kHz.

So I'm wondering if I can output directly to file without using a third party tool for recording? Can I also read from audio file directly instead hook an audio source?

Or do you know some other tools that can do this?

Thanks in advance for your further reply.

Hideman85

coderobe commented 5 years ago

glava does neither of these things

coderobe commented 5 years ago

you could use something like https://github.com/apitrace/apitrace to dump the gl draws to files and then reassemble them to a video with ffmpeg

Hideman85 commented 5 years ago

Not bad no I need to script it. When I dump image from apitrace I have a black background but it's transparent window when I just launch glava. Do you think the alpha channel is missing when I using apitrace?

jarcode-foss commented 5 years ago

@Hideman85

So I'm wondering if I can output directly to file without using a third party tool for recording?

That's more of an issue with the storage format. It looks like apitrace does handle the alpha channel, but I'm not sure what storage format it would work properly with. MP4 containers do not support this, but AVI does (if inclusion of the alpha channel is specified).

Encoding is another problem since H.264 also does not support alpha channels.

Also, you can use essentially any recording software that supports ffmpeg output and alpha channels, not just apitrace (perhaps record with ffmpeg itself?).

Can I also read from audio file directly instead hook an audio source?

GLava does not directly support this since it focuses on realtime rendering (in fact, when you remove the realtime aspect you can probably use smarter averaging functions and the full 44.1kHz input rate).

You can currently achieve a similar effect by playing an audio file to a null PulseAudio sink, and having GLava monitor it, or by playing file through MPD and having GLava listen from its FIFO file (which it directly supports).


This all being said, this is something I'm willing to directly support in GLava in the future by using ffmpeg. It does expand beyond the normal scope of GLava but there is also the reality that there does not seem to be any free linux tools to create an audio visualization from a file.

This would be something I would devote time to in the distant future, though, as other improvements/fixes are of higher importance.

At the moment it's definitely possible to achieve what you want with some workarounds, but you will have to wait for GLava to produce its output as if its playing in realtime (ie. duration of the audio track).

Hideman85 commented 5 years ago

Thank you for your complete reply.

Currently I take a look in many way in order to do what I want. I found this thread (https://stackoverflow.com/a/14324292/4545616) for rendering OpenGL app directly in file but it seems to be run as a standard application and not take the full power of graphic card to compute frames in parallel or maybe it's just my graphic card not enough to have a great frame rate.

I also made a python script for generate the background image with album cover and the main color of this picture and text with tittle, album and artist.

Sample1

Sample2

Now I need to make a video with these pictures and the radial spectrum vizualizer put in right part. Maybe by using some of ffmpeg options I can get the dump of apitrace with alpha channel and put it in the zone.

jarcode-foss commented 5 years ago

@Hideman85 the best option for you right now is to just setup a scene and record using OBS. It's probably the most flexible program for your purpose and can record GLava just fine.

jarcode-foss commented 5 years ago

This all being said, this is not a support forum for software unrelated to GLava, so if you have no issues with GLava itself at the moment (barring this feature request), then it's best you use the tracker(s) for the recording software you wish to use instead.

jarcode-foss commented 5 years ago

Closing in favor of #129.