e621ng icon indicating copy to clipboard operation
e621ng copied to clipboard

[Uploads] Allow for AV1 Webms to be uploaded by making mimetype "audio/webm" part of webm.

Open Mocha3218 opened this issue 11 months ago • 5 comments

Seems to work. If someone tries to upload an audio only WebM it gets caught.

Mocha3218 avatar Jan 02 '25 22:01 Mocha3218

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.

github-actions[bot] avatar Jan 02 '25 22:01 github-actions[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.

liamwhite avatar Jan 20 '25 17:01 liamwhite

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.

ghost avatar Jan 21 '25 17:01 ghost

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.

liamwhite avatar Jan 21 '25 17:01 liamwhite

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.

ghost avatar Jan 22 '25 05:01 ghost

Closed in favor of #987.

Sindrake avatar Apr 23 '25 13:04 Sindrake