-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Using ly2video on Windows seems hard. I've only tried it via Wine.
I know github can package python projects into an exe, but I figured I'd try it locally first. Eventually, it could become a github action to ease the pain of using it on windows. The same could be done for linux if it made sense.
In a new wineprefix, I installed python, ly2video requirements, and auto-py-to-exe (pyinstaller). This created an executable from ly2video.git that ran under wine. That was easy and doesn't require the end user to have python installed
However, the external dependencies, lilypond, ffmpeg, and timidity, are a bit of a pain.
Neither lilypond or ffmpeg, come with installers. That means you have to place them somewhere and tell ly2video where they are via the PATH variable. Then timidity has the same problem, but doesn't come with any soundfonts.
On Ubuntu anyway, you can just "apt-get install tmidity" and it will play midi right out of the box. On Windows, it's a different story.
On Ubuntu timidity uses the FluidR3_GM.sf2 soundfont. It's available in various places.
Since timidity is a bear to install on windows (for someone less savvy), it would be nice to provide a working zip file with timidity and the soundfont ready to go. I don't know if it's in the scope of ly2video to host that soundfont. There is another project that has the soundfont in a sister repo where they are added as Release artefacts. Because they are too big to commit to github:
https://github.com/pianobooster/fluid-soundfont/releases
It's a one time operation. Then I guess a github action could wrap them into a zip file.
To make timidity work on Windows, I borrowed the timidity.cfg from my machine with slight modification. Running ly2video in wine produces a video file with sound. So it works, but there's also an error message at the end:
Traceback (most recent call last):
File "ly2video\cli.py", line 1657, in <module>
File "ly2video\cli.py", line 1650, in main
File "shutil.py", line 516, in rmtree
File "shutil.py", line 404, in _rmtree_unsafe
File "shutil.py", line 402, in _rmtree_unsafe
PermissionError: [WinError 32] Sharing violation: 'C:\\users\\notme\\Temp\\ly2video4r_l02rv'
[205] Failed to execute script 'cli' due to unhandled exception!
The temp directory is deleted so I don't know what that error means yet.
I think some solutions might involve telling ly2video where lilypond and ffmpeg are installed, like is done for timidity. And then providing a way to install timidity along with ly2video. It might also be a good idea to add a config file and look for it in the directory where ly2video is. Then ly2video could be deployed as a bundle, pulling from the release builds of lilypond, ffmpeg, and timidity. Maybe this is done in a sister repo.
Lastly, it might be easier to let the user make the audio file however they want and then pass that file in through a command line argument. Is there any reason this can't be done?