sunvox lib + ffmpeg video export?

Pixilang programming language
Post Reply
User avatar
AutumnCheney
Posts: 165
Joined: Sun Dec 29, 2019 8:16 am
Location: durant, ok, usa
Contact:

sunvox lib + ffmpeg video export?

Post by AutumnCheney » Sat Oct 31, 2020 12:41 am

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
Attachments
contrapositive src.zip
(56.87 KiB) Downloaded 12 times
please check out my newgrounds account, i post music and talk to people here: https://autumncheney.newgrounds.com

i have a soundcloud and bandcamp too (just music here):
https://soundcloud.com/autumncheney
https://autumncheney.bandcamp.com

User avatar
NightRadio
Site Admin
Posts: 3392
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: sunvox lib + ffmpeg video export?

Post by NightRadio » Sun Nov 01, 2020 2:27 pm

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.

User avatar
AutumnCheney
Posts: 165
Joined: Sun Dec 29, 2019 8:16 am
Location: durant, ok, usa
Contact:

Re: sunvox lib + ffmpeg video export?

Post by AutumnCheney » Sun Nov 01, 2020 11:29 pm

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!
please check out my newgrounds account, i post music and talk to people here: https://autumncheney.newgrounds.com

i have a soundcloud and bandcamp too (just music here):
https://soundcloud.com/autumncheney
https://autumncheney.bandcamp.com

User avatar
leondustar
Posts: 83
Joined: Tue Feb 28, 2017 12:40 am
Contact:

Re: sunvox lib + ffmpeg video export?

Post by leondustar » Tue Nov 03, 2020 1:36 pm

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?

User avatar
NightRadio
Site Admin
Posts: 3392
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: sunvox lib + ffmpeg video export?

Post by NightRadio » Tue Nov 03, 2020 2:06 pm

did you also use this to generate the beautiful animated GIF's in the docs / pixilang website?
I used similar code in Pixilang :)

User avatar
NightRadio
Site Admin
Posts: 3392
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia
Contact:

Re: sunvox lib + ffmpeg video export?

Post by NightRadio » Tue Nov 03, 2020 2:09 pm

however, i noticed that the raw video and raw audio seems to be saved in different directories
Please try to use the updated version of the library:
demo.pixi
Pixilang Demoscene Engine 1.0.1
(26.21 KiB) Downloaded 5 times

User avatar
AutumnCheney
Posts: 165
Joined: Sun Dec 29, 2019 8:16 am
Location: durant, ok, usa
Contact:

Re: sunvox lib + ffmpeg video export?

Post by AutumnCheney » Tue Nov 03, 2020 8:23 pm

NightRadio wrote:
Tue Nov 03, 2020 2:09 pm
however, i noticed that the raw video and raw audio seems to be saved in different directories
Please try to use the updated version of the library: demo.pixi
thank you! it works perfectly now!
please check out my newgrounds account, i post music and talk to people here: https://autumncheney.newgrounds.com

i have a soundcloud and bandcamp too (just music here):
https://soundcloud.com/autumncheney
https://autumncheney.bandcamp.com

Post Reply