GithubHelp home page GithubHelp logo

Comments (4)

Trekky12 avatar Trekky12 commented on June 12, 2024

Could you please explain this in more detail? Indeed the ffmpeg command needs high ressources without temporary files. So for many slides it is recommended to use the temporary files option.

The ffmpeg command for the temporary files is optimized for speed. Nevertheless the general settings are used for the final video creation

def getFinalVideoCommand(self, output_file, burnSubtitles, srtInput,
srtFilename, inputs, temp_filter_script, overwrite=False):
cmd = [self.config["ffmpeg"],
"-hide_banner",
# "-v quiet",
"-stats",
"-y" if overwrite else "",
# slides
" ".join(["-i \"%s\" " % (f) for f in inputs]),
" ".join(["-i \"%s\" " % (track.file) for track in self.getBackgroundTracks()]),
# subtitles (only mkv)
"-i %s" % (srtFilename) if self.hasSubtitles() and not burnSubtitles else "",
# filters
"-filter_complex_script \"%s\"" % (temp_filter_script),
# define duration
# if video should be loopable, skip the start fade-in (-ss) and the end fade-out
# (video is stopped after the fade-in of the last image which is the same as the first-image)
"-ss %s -t %s" % (self.getSlideFadeOutDuration(0) / self.config["fps"], self.getOffset(-1, False))
if self.config["loopable"] else "-t %s" % (self.getTotalDuration()),
# "-t %s" % (self.getTotalDuration()),
# define output
"-map", "[out]:v",
"-c:v %s" % (self.config["output_codec"]) if self.config["output_codec"] else "",
# "-crf", "0" ,
# "-preset", "ultrafast",
# "-tune", "stillimage",
self.config["output_parameters"],
"-map [aout]:a" if self.hasAudio() else "",
# audio compression and bitrate
"-c:a aac" if self.hasAudio() else "",
"-b:a 160k" if self.hasAudio() else "",
# map subtitles (only mkv)
"-map %s:s" % (srtInput) if self.hasSubtitles() and not burnSubtitles else "",
# set subtitles enabled (only mkv)
"-disposition:s:s:0 default" if self.hasSubtitles() and not burnSubtitles else "",
"\"%s\"" % (output_file)
]
return cmd

from kburns-slideshow.

jedcooper avatar jedcooper commented on June 12, 2024

Hello, first thank you for your effort making this software! Appreciated! :D

Encoding with user setting be it speed or quality, your method using temporary files renders user quality/commandline obsolete.
The temp files created by hardcoded "-preset ultrafast" are always worse in quality and final reencoded in user commandline quality which can't be in good quality anymore, because the source (temp files) are of "ultrafast/quick quality" and not the user set quality (or better).

The source has to be same or better quality than target. This is not the case with your hardcoded "-preset ultrafast", default bitrate etc. for temporary files, if the user wants more quality than "ultrafast" and default bitrate.

I'd strongly recommend creating lossless or near lossless quality temporary files. You've had something in mind yet I guess with commented CRF = 0.

I don't know how to link code from Queue.py here. Therefore I put a snippet.txt in OP. It contains the hardcoded always same "-preset ultrafast" quality temporary file generation.

What else do you need to know in detail?

from kburns-slideshow.

Trekky12 avatar Trekky12 commented on June 12, 2024

You are right, I will look into it and maybe add a new setting field for the temporary files creation.

Feel free to add a PR for this feature.

from kburns-slideshow.

Trekky12 avatar Trekky12 commented on June 12, 2024

@jedcooper Could you please test the source from the latest development branch?

from kburns-slideshow.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.