BrokenSource / DepthFlow

🌊 Image to → 2.5D Parallax Effect Video. High quality, user first. Free and Open Source Leiapix alternative
https://brokensrc.dev
GNU Affero General Public License v3.0
153 stars 11 forks source link

Changing the video codec #10

Closed HamletEagle closed 3 months ago

HamletEagle commented 3 months ago

Hello!

I have one quick question for you, is it possible to change the video codec used when saving the effect to a video? Currently, it appears it is using the h264 codec, and I would like to use the png codec.

If there is no such feature, could you please point me to where in the code I can make this change?

Thank you!

Tremeschin commented 3 months ago

Yes it is possible!

It's kinda hard coded right now as I'm yet to think of FFmpeg presets and better code paths for this configuration

You'll need to edit the file at BrokenSource/Projects/ShaderFlow/ShaderFlow/Scene.py on this linked line, depthflow uses this other project/package as the base for all video and shaders stuff

You can just comment out the stuff you don't want and call .custom("arguments", "strings") for manual work

eg. for using h265

self.ffmpeg = (
    self.ffmpeg
    .custom("-c:v", "libx265")
    .custom("-crf", "28")
    .custom("-preset", "veryslow")
    (...)
    .custom("-t", self.duration)
)
HamletEagle commented 3 months ago

Thank you, it works!