Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

high quality ugoira #432

Closed
aeosynth opened this issue Sep 28, 2019 · 3 comments
Closed

high quality ugoira #432

aeosynth opened this issue Sep 28, 2019 · 3 comments

Comments

@aeosynth
Copy link

Hi, the default settings for ugoira conversion can give a lot of artifacts. Could there be a simple quality option to make high quality conversions? I don't know enough (anything) about video to come up with the right settings on my own.

@kattjevfel
Copy link
Contributor

kattjevfel commented Sep 28, 2019

PixivUtil2 uses -lossless 1 -vsync 2 -r 999 -pix_fmt yuv420p with libvpx-vp9, which shouldn't have any loss in quality, I haven't tested this myself in gallery-dl yet but I have no reason to believe it wouldn't work here as well.

@wankio
Copy link
Contributor

wankio commented Sep 28, 2019

  "postprocessors": [
                {
                    "name": "ugoira",
                    "extension": "webm",
                   "ffmpeg-location": "C:\\ffmpeg\\bin\\ffmpeg.exe",
"ffmpeg-args":["-c:v", "libvpx-vp9", "-an", "-b:v", "2M"]
                }
]       

you can have your own setting by change ffmpeg commands, i have no problem at all

mikf added a commit that referenced this issue Oct 26, 2019
and cleanup the arguments for the regular '--ugoira-conv':
- remove '-an'
- enable two-pass encoding
@mikf
Copy link
Owner

mikf commented Oct 26, 2019

There is now --ugoira-conv-lossless that uses the VP9 lossless option, which should produce the highest quality possible.

The default settings, which are the same as used by Danbooru by the way, are

"postprocessors": [{
    "name"          : "ugoira",
    "ffmpeg-args"   : ("-c:v", "libvpx", "-crf", "4", "-b:v", "5000k"),
    "ffmpeg-twopass": True,
    "whitelist"     : ("pixiv", "danbooru")
}]

You can put this in your config and increase the target bitrate to something that suits your needs. The crf value is already as low as possible, according to the VP8 encoding guide

If you want to use VP9 instead, try ["-c:v", "libvpx-vp9", "-b:v", "0", "-crf", "30"] for ffmpeg-args and adjust crf down until you get a satisfactory result. From the VP9 encoding guide:

The CRF value can be from 0–63. Lower values mean better quality. Recommended values range from 15–35, with 31 being recommended for 1080p HD video. See ​this guide for more info.

@mikf mikf closed this as completed Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants