sunvox lib + ffmpeg video export?
- AutumnCheney
- Posts: 507
- Joined: Sun Dec 29, 2019 8:16 am
- Location: tahlequah, ok, usa
- Contact:
sunvox lib + ffmpeg video export?
i made a visualizer for sunvox files in pixilang using the new built-in sunvox library, and i want to allow it to export video using ffmpeg. the issue is, i don't know where to get started. i'm trying to analyze the compo player code, but there's too much other code to connect the video export parts
can someone give me some hints on how i can impliment it in my own program? thanks!
i've included the program and the files it references in a zip file; just run it in the unzipped directory
can someone give me some hints on how i can impliment it in my own program? thanks!
i've included the program and the files it references in a zip file; just run it in the unzipped directory
- Attachments
-
- contrapositive src.zip
- (56.87 KiB) Downloaded 174 times
- NightRadio
- Site Admin
- Posts: 3954
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: sunvox lib + ffmpeg video export?
Unfortunately there is no simple way to do the AV export...
But I created a special framework for such purposes - lib/demo.pixi
You can see examples in the graphics/demoscene folder
Especially such an example as demo_test_sunvox.pixi
You can put your visualizer in the scene1() function
Then uncomment the following line:
demo_video_export = "video.avi" //export to AVI using FFMPEG (only in Linux and macOS) or MJPEG AVI (work on any system)
or
demo_video_export = "video.gif" //export to animated GIF :)
Ask any questions about this library - I'll be happy to answer.
It may seem a little complicated at first, but it's actually a very handy environment for creating all sorts of visualizations, demos, etc.
But I created a special framework for such purposes - lib/demo.pixi
You can see examples in the graphics/demoscene folder
Especially such an example as demo_test_sunvox.pixi
You can put your visualizer in the scene1() function
Then uncomment the following line:
demo_video_export = "video.avi" //export to AVI using FFMPEG (only in Linux and macOS) or MJPEG AVI (work on any system)
or
demo_video_export = "video.gif" //export to animated GIF :)
Ask any questions about this library - I'll be happy to answer.
It may seem a little complicated at first, but it's actually a very handy environment for creating all sorts of visualizations, demos, etc.
- AutumnCheney
- Posts: 507
- Joined: Sun Dec 29, 2019 8:16 am
- Location: tahlequah, ok, usa
- Contact:
Re: sunvox lib + ffmpeg video export?
thank you so much!!! i got video export to work with the demo library
however, i noticed that the raw video and raw audio seems to be saved in different directories (the directory that pixilang was run in and the pixilang root directory, respectively) and the video can't fully render because it can't find the audio file. a workaround is to render it twice and move the raw audio from the first render to the directory that the second render will be ran in. this really only works if the audio will be the same in both exports, generative sunvox files won't work very well with this. it's enough for me, but you may want to take a look at this
again, thank you!
however, i noticed that the raw video and raw audio seems to be saved in different directories (the directory that pixilang was run in and the pixilang root directory, respectively) and the video can't fully render because it can't find the audio file. a workaround is to render it twice and move the raw audio from the first render to the directory that the second render will be ran in. this really only works if the audio will be the same in both exports, generative sunvox files won't work very well with this. it's enough for me, but you may want to take a look at this
again, thank you!
- leondustar
- Posts: 138
- Joined: Tue Feb 28, 2017 12:40 am
- Contact:
Re: sunvox lib + ffmpeg video export?
Awesome I was just about to ask this.
Will check out this demo lib.
@Nightradio did you also use this to generate the beautiful animated GIF's in the docs / pixilang website?
Will check out this demo lib.
@Nightradio did you also use this to generate the beautiful animated GIF's in the docs / pixilang website?
- NightRadio
- Site Admin
- Posts: 3954
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: sunvox lib + ffmpeg video export?
I used similar code in Pixilang :)did you also use this to generate the beautiful animated GIF's in the docs / pixilang website?
- NightRadio
- Site Admin
- Posts: 3954
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: sunvox lib + ffmpeg video export?
Please try to use the updated version of the library:however, i noticed that the raw video and raw audio seems to be saved in different directories
- AutumnCheney
- Posts: 507
- Joined: Sun Dec 29, 2019 8:16 am
- Location: tahlequah, ok, usa
- Contact:
Re: sunvox lib + ffmpeg video export?
thank you! it works perfectly now!NightRadio wrote: ↑Tue Nov 03, 2020 2:09 pmPlease try to use the updated version of the library: demo.pixihowever, i noticed that the raw video and raw audio seems to be saved in different directories
Re: sunvox lib + ffmpeg video export?
I also need to comment out the content of Scenes 2 - 4, right?
Code: Select all
include "../lib/demo.pixi"
//demo_show_fps = 1
//demo_opengl = 1
//demo_xsize = 320
//demo_ysize = 240
//demo_video_export = "video.avi"
//demo_load_sunvox( "../../sound/sound_files/test2.sunvox" )
demo_init()
demo_add_scene( 0, 0, 0, scene1 )
demo_add_scene( 0, 0, 1000, scene2 )
demo_add_scene( 0, 0, 2000, scene3 )
//demo_add_scene( 0, 0, 3000, DEMO_STOP )
demo_add_scene( 0, 1, 0, scene4 )
demo_play()
demo_deinit()
fn scene1( $t1, $t2, $len )
{
include "boot.pixi"
}
fn scene2( $t1, $t2, $len )
{
// clear( #304050 )
// sprintf( demo_ts, "SCENE #2\n%d\n%d\n%d", $t1, $t2, $len )
// print( demo_ts )
}
fn scene3( $t1, $t2, $len )
{
// clear( #405060 )
// sprintf( demo_ts, "SCENE #3\n%d\n%d\n%d", $t1, $t2, $len )
// print( demo_ts )
}
fn scene4( $t1, $t2, $len )
{
//time function = 1 (SunVox player); time unit = line;
// $t = $t1
// fbox( -demo_xsize/2 + $t, 32, 4, 1000, WHITE )
}
sv_remove(sv, 0)
show_memory_debug_messages( 1 )
You can download my exclusive Sunvox-Metamodules here: https://label.weddinger-schule.de/category/tools/
Re: sunvox lib + ffmpeg video export?
Is it possible, that the rendering is reaaaaly slow. I'm testing it with a 6 secondes sunvox file and it's exporting already half day.
You can download my exclusive Sunvox-Metamodules here: https://label.weddinger-schule.de/category/tools/
- NightRadio
- Site Admin
- Posts: 3954
- Joined: Fri Jan 23, 2004 12:28 am
- Location: Ekaterinburg. Russia
- Contact:
Re: sunvox lib + ffmpeg video export?
Try to add the follofing optionIs it possible, that the rendering is reaaaaly slow.
maxfps 1000
to ~/.config/Pixilang/pixilang_config.ini
Re: sunvox lib + ffmpeg video export?
Thx. I think the mistake was somewhere else. Autostop of an implemented sunvox project, doesn't work, if it's inside a demoscene. So the project is looping and export never ends. I tried different things and export works like a charm, if I don't try to build those complex sunvox-reacting visualisations inside the demoscene, but more straight forward visuals.
You can download my exclusive Sunvox-Metamodules here: https://label.weddinger-schule.de/category/tools/