-
Notifications
You must be signed in to change notification settings - Fork 184
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
Add HEIF/HEIC/AVIF upload support #399
Conversation
ffmpeg doesn't support HEIC decoding yet...
To be honest I don't see any harm in merging this, especially considering how it's well tested and doesn't introduce any changes or regressions – only a new feature. |
I did some research and it turns out that AVIF is the only format out of the three that's starting to be supported in web browsers. HEIC/HEIF cannot be embedded with So as it stands HEIC/HEIF files won't be displayed properly (yet), only the thumbnails. However it could be the case that the sheer number of iPhone users will cause the format to gain ubiquity. See python-pillow/Pillow#2806 (comment). FFmpeg support is unlikely to happen overnight as it's been an open issue for 4 years. The format itself is complicated to implement in its entirety since it includes things like composite images (HDR) wrapped up in a large number of extensions to ISO standards. |
I personally have already encountered a few images which where in AVIF format, so I already had that on my backlog. It looks like most major browsers (except safari, of course) support it. Starting on the first of june Firefox will have AVIF support enabled by default (atm it is still opt-in). As for the HEIC stuff (which I assume is standalone from AVIF?) I don't really see an use case for it atm, because the image display doesn't work, but I guess it also doesn't hurt. I can install all required dependencies on my Debian stable, which means that most users who deploy manually should still be able to do so. I also read the FFmpeg thread, and it doesn't look like that is going to change anytime soon. |
Seeing as there are no objections against this I'll (try to) merge it this weekend. Same goes for your other PRs. |
I had to make a few changes to get this to work. You can see those in #413, please post any questions/objections you might have. |
Hi - sorry I've just started trying out szurubooru but I'm getting internal server errors when trying to upload any .mp4 file, with the following being logged in the server-container's log:
I've tried mp4-files which were downloaded with youtube-dl, as well as files which were downloaded through Firefox. Is this related to the discussion in here? If so, is there any way one can make sure that some mp4 file can be uploaded, like converting it in some way? |
@Giraffaman It looks like this PR broke the mp4 upload in some way. I'll take a look at it asap! |
@Giraffaman Could you try again? The newest version (also published to docker hub) should have fixed this issue. |
@neobooru looks good - I removed the client, server and sql container and recreated them, pulling the latest image. Now I am able to upload any mp4 file and also playback works like a charm. |
Adds support for uploading HEIF/HEIC/AVIF files using
libheif
andlibavif
. Chromium appears to request this format by default on some sites (hitomi.la) and in Firefox support can be enabled with a config option.Because FFmpeg does not support HEIF, any HEIF format images are converted to PNG before being passed to FFmpeg if extra processing is needed (like for thumbnail generation). But the original file is preserved as the post's content.
Also, it seems that support for displaying certain HEIF images inside
img
tags is still limited even inside Chromium, but the primary use case is for downloading HEIF images that are being properly displayed on other sites and uploading them to szuru.Closes #398.