e621ng
e621ng copied to clipboard
[Uploads] Allow for AV1 Webms to be uploaded by making mimetype "audio/webm" part of webm.
Seems to work. If someone tries to upload an audio only WebM it gets caught.
Thank you for your submission, we really appreciate it.
Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by making a comment following the format below:
I have read the CLA Document and I hereby sign it
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.
You'd probably want to use ffprobe to more thoroughly analyze the streams, since the WebM container can be stuffed with invalid codecs. In this way you would be properly rejecting uploads that the site can't process.
You'd probably want to use ffprobe to more thoroughly analyze the streams, since the WebM container can be stuffed with invalid codecs. In this way you would be properly rejecting uploads that the site can't process.
That is already done with video codecs and video containers in the code. The problem here is that only specific mime types are allowed regardless of file extension. vp9 has a mime type of video/webm, but av1 has a mime type of audio/webm.
It does not have a mime type of audio/webm, that is just some garbage output by libmagic. Its mime type is video/webm and should be corrected to such if you already verify streams.
Ok, I made a bad assumption that the browser was sending in the wrong mime type (audio/webm) and that the server was correct and was wrong.
The actual problem lies with Marcel: https://github.com/rails/marcel/issues/80
So this patch should be scrapped since it isn't a proper fix and Marcel should just be forked (temporarily) and patched to fix the av1 bug.
Closed in favor of #987.