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
ActiveStorage: Allow the parameters sent to ffmpeg
to be configurable
#42471
Conversation
Looks like the failure was a transient failure to connect to S3. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this, @brendon!
...ib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_0.rb.tt
Outdated
Show resolved
Hide resolved
Looks good but we usually have some configuration tests in railties to ensure that the defaults for upgrading apps and new apps are set correctly - can we add those please. |
Ok, all the changes are made. Apologies for all the commits. I have to admit I don't know how to fix that. The guidance here didn't seem to work for me. |
5a7da2c
to
3d3f34d
Compare
Managed to squish everything into one commit. Hopefully the tests are green and this is good to go :) |
The configuration key is `config.active_storage.video_preview_arguments`. This commit also better documents a previous commit from Jonathan Hefner (@ jonathanhefner) that changes the default video image preview to use scene detection to generate a better preview.
@brendon thanks! 👍🏻 |
You're welcome @pixeltrix :) I'll fix up the back-port now :) |
@pixeltrix, @zzak Sorry for the disturbance. Maybe, something like this will make sense for the Blob#default_variant_transformations ? For example auto_orient: true and/or gravity: 'Center' as default options can work well for all variants in some projects. |
@crawler actually I think a better feature would be to have named transformations, e.g. config.active_storage.variations = {
thumbnail: { resize_to_limit: [100, 100] }
}
avatar.variant(:thumbnail).processed.url This seems fairly easy to implement by extending Having said that I'm not opposed to also adding default transformations as long as it allows you to override the default file format as well to something like JPEG. |
Or maybe allow to set defaults, through some combination with #39135 |
LOL, didn't know about #39135 🤦🏻 |
I also just found this 😅 |
Summary
The parameters sent to
ffmpeg
for generating a video preview image are now configurable underconfig.active_storage.video_preview_arguments
.This PR also better documents a previous commit from Jonathan Hefner (@jonathanhefner) that changes the default video image preview to use scene detection to generate a better preview.
Other Information
I don't think any additional tests are required since preview generation should be tested under both configurations in the CI suite.
Concerns: #39096