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

pixiv.net - can't convert ugoira to both gif and webm simultaneously #5908

Closed
ForxBase opened this issue Jul 29, 2024 · 6 comments
Closed

pixiv.net - can't convert ugoira to both gif and webm simultaneously #5908

ForxBase opened this issue Jul 29, 2024 · 6 comments

Comments

@ForxBase
Copy link

ForxBase commented Jul 29, 2024

{
    "extractor": {
        "pixiv": {
            
            
            "ugoira": {
                "format": "webm", "gif",
                "ffmpeg-args": "-c:v libvpx-vp9 -b:v 0 -crf 30"
            }
        }
    }
}

not sure if this is the correct code. any correction to this?

@ForxBase ForxBase changed the title pixiv.net - can't convert ugoira pixiv.net - can't convert ugoira to both gif and webm simultaneously Jul 29, 2024
@mikf
Copy link
Owner

mikf commented Jul 29, 2024

{
    "extractor": {
        "pixiv": {
            "postprocessors": [
                {
                    "name": "ugoira",
                    "extension": "webm",
                    "ffmpeg-args": ["-c:v", "libvpx-vp9", "-b:v", "0", "-crf", "30"]
                }
            ]
        }
    }
}

@ForxBase
Copy link
Author

{
    "extractor": {
        "pixiv": {
            "postprocessors": [
                {
                    "name": "ugoira",
                    "format": "webm",
                    "ffmpeg-args": ["-c:v", "libvpx-vp9", "-b:v", "0", "-crf", "30"]
                }
            ]
        }
    }
}

I tried with this one and it does download the webm or gif, but not both simultaneously. I have to change the text manually each time.

@mikf
Copy link
Owner

mikf commented Jul 29, 2024

Add "keep-files": true to the ugoira settings.

https://gdl-org.github.io/docs/configuration.html#ugoira-keep-files

@mikf
Copy link
Owner

mikf commented Jul 29, 2024

Sorry, I initially misread your question.

To convert to multiple different formats, you need to specify one post processor for each, and keep-files needs to be enabled for all of them because gallery-dl will do some unexpected things otherwise.

            "postprocessors": [
                {
                    "name": "ugoira",
                    "extension": "webm",
                    "keep-files": true,
                    "ffmpeg-args": ["-c:v", "libvpx-vp9", "-b:v", "0", "-crf", "30"]
                },
                {
                    "name": "ugoira",
                    "extension": "gif",
                    "keep-files": true,
                    "ffmpeg-args": ["-filter_complex", "[0:v] split [a][b];[a] palettegen [p];[b][p] paletteuse"]
                }
            ]

@ForxBase
Copy link
Author

Thanks! It works now.

@Hrxn
Copy link
Contributor

Hrxn commented Jul 30, 2024

@ForxBase So this issue can be closed then?

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

No branches or pull requests

3 participants