1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

[postprocessor:ugoira] auto-select demuxer by default

This commit is contained in:
Mike Fährmann 2022-03-26 21:10:59 +01:00
parent e45792a5c4
commit 5c2d953766
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 20 additions and 12 deletions

View File

@ -3239,7 +3239,7 @@ ugoira.ffmpeg-demuxer
Type
``string``
Default
``concat``
``auto``
Description
FFmpeg demuxer to read and process input files with. Possible values are
@ -3247,6 +3247,9 @@ Description
* "`image2 <https://ffmpeg.org/ffmpeg-formats.html#image2-1>`_" (accurate timecodes, not usable on Windows)
* "mkvmerge" (accurate timecodes, only WebM or MKV, requires `mkvmerge <ugoira.mkvmerge-location_>`__)
`"auto"` will select `mkvmerge` if possible and fall back to `image2` or
`concat` depending on the local operating system.
ugoira.ffmpeg-location
----------------------

View File

@ -43,23 +43,28 @@ class UgoiraPP(PostProcessor):
mkvmerge = options.get("mkvmerge-location")
self.mkvmerge = util.expand_path(mkvmerge) if mkvmerge else "mkvmerge"
rate = options.get("framerate", "auto")
if rate != "auto":
self.calculate_framerate = lambda _: (None, rate)
demuxer = options.get("ffmpeg-demuxer")
if demuxer == "image2":
self._process = self._process_image2
self._finalize = None
self.log.debug("using image2 demuxer")
elif demuxer == "mkvmerge":
if demuxer is None or demuxer == "auto":
if self.extension in ("webm", "mkv") and (
mkvmerge or shutil.which("mkvmerge")):
demuxer = "mkvmerge"
else:
demuxer = "concat" if util.WINDOWS else "image2"
if demuxer == "mkvmerge":
self._process = self._process_mkvmerge
self._finalize = self._finalize_mkvmerge
self.log.debug("using image2+mkvmerge demuxer")
elif demuxer == "image2":
self._process = self._process_image2
self._finalize = None
else:
self._process = self._process_concat
self._finalize = None
self.log.debug("using concat demuxer")
self.log.debug("using %s demuxer", demuxer)
rate = options.get("framerate", "auto")
if rate != "auto":
self.calculate_framerate = lambda _: (None, rate)
if options.get("libx264-prevent-odd", True):
# get last video-codec argument