Flash support in modern browsers - #644
Conversation
Works with far more SWFs than ffmpeg. Using OpenGL backend.
Something weird was happening during templating, it worked but would surround the style attribute with %%%template1 and %%%template3
|
I think the javascript library should be vendored like the other libraries Lines 23 to 31 in 46e3295 |
|
If anyone wants to help, all that's left before merging is adding the ruffle exporter to the Docker install. |
Are you planning on bundling the JS? |
|
I'd love to, I'll definitely merge if such a PR ends up on my repo :^) |
|
Hmm… I'm unable to get the I get this error when running |
|
Getting the ruffle exporter to work in an Alpine docker was much less trivial than I thought, but it's done now. (: |
ffprobe fails on some swf files and blocks uploading
| "-g", | ||
| "gl", |
There was a problem hiding this comment.
| "-g", | |
| "gl", |
Error I got with this flag left in:
szurubooru.func.posts Error while processing image.
Error: Ruffle requires hardware acceleration, but no compatible graphics device was found supporting Open GL
Traceback (most recent call last):
File "szurubooru/func/posts.py", line 650, in update_post_content
image = images.Image(content)
File "szurubooru/func/images.py", line 31, in __init__
self.content = self.swf_to_png()
~~~~~~~~~~~~~~~^^
File "szurubooru/func/images.py", line 79, in swf_to_png
return self._execute(
~~~~~~~~~~~~~^
[
^
...<7 lines>...
program="exporter",
^^^^^^^^^^^^^^^^^^^
)
^
File "szurubooru/func/images.py", line 310, in _execute
raise errors.ProcessingError(
"Error while processing image.\n" + err.decode("utf-8")
)
szurubooru.errors.ProcessingError: Error while processing image.
There was a problem hiding this comment.
Refer to the Docker install, we expect to have mesa-dri-gallium (software OpenGL rendering) and mesa-egl for systems without a GPU. This is necessary as Ruffle uses wgpu, which has no software renderer. I'm following their advice of using something to translate GPU APIs to software.
I don't mind this approach, as it means there is no need to configure anything within szurubooru. If the GPU can be used, it will be.
Please let me know what you think should be done instead. If you're on Mac, it can work without changes with ANGLE. I don't remember exactly why I'm forcing OpenGL rather than letting it use whatever, but I think there was a reason (for the GPU-less case, anyway).
There was a problem hiding this comment.
I'm not sure I understand the question. I don't understand the details. All I know is that it worked for me on Debian 13 without the flag.
| @@ -1,13 +1,14 @@ | |||
| <div class='post-content post-type-<%- ctx.post.type %>'> | |||
| <div class='post-content post-type-<%- ctx.post.type %>' style='<%- ctx.post.type === 'flash' ? 'background-image: url('+ctx.post.thumbnailUrl+')' : '' %>'> | |||
There was a problem hiding this comment.
This background image needs to be unset when the flash object is played, otherwise you run into this:
Screen.Recording.2026-05-20.at.02.14.45.mov
| <div id='content-holder'></div> | ||
| <script type='text/javascript' src='js/vendor.min.js'></script> | ||
| <script type='text/javascript' src='js/app.min.js'></script> | ||
| <script type='text/javascript' src='https://unpkg.com/@ruffle-rs/ruffle' async></script> |
There was a problem hiding this comment.
This should be vendored (as discussed, sorry).
| "Failed to execute {program} command (cli=%r, err=%r)".format(program=program), | ||
| " ".join(shlex.quote(arg) for arg in cli), | ||
| err, |
There was a problem hiding this comment.
Minor nitpick:
| "Failed to execute {program} command (cli=%r, err=%r)".format(program=program), | |
| " ".join(shlex.quote(arg) for arg in cli), | |
| err, | |
| "Failed to execute %s command (cli=%r, err=%r)", | |
| program, | |
| " ".join(shlex.quote(arg) for arg in cli), | |
| err, |
|
@CrawlerBleak Thank you the the review, I will address the issues when I can. |
|
I took a stab at taking my own advice: po5#4 |
Makes the booru able to generate thumbnails for any SWF supported by Ruffle, and adds a polyfill for modern browsers.
For non-docker setups, build ruffle's exporter binary with
cargo build --release --package=exporter.This also fixes uploading of all SWF files submitted in #427.
Closes #541.