Skip to content
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

fix media uploads with ffmpeg 5 #21191

Merged
merged 1 commit into from
Nov 25, 2022
Merged

fix media uploads with ffmpeg 5 #21191

merged 1 commit into from
Nov 25, 2022

Conversation

dead10ck
Copy link
Contributor

Fixes #21154. This was tested by running the ffmpeg command manually in a docker container on Ubuntu 20.04 and Debian 11, and this Ruby change was tested on my Fedora 36 server's mastodon instance.

@ineffyble ineffyble added the bug Something isn't working label Nov 24, 2022
Copy link
Member

@ineffyble ineffyble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the linter complaint?

@ClearlyClaire
Copy link
Contributor

Can you fix the linter complaint?

Nah, I wouldn't ask them to do it, it's unrelated to their change (annoyingly, the linter complains about already-existing issues anywhere in changed files, not just in the parts that were modified).

@dead10ck
Copy link
Contributor Author

No big deal, it's a simple fix

@@ -133,7 +134,7 @@ class MediaAttachment < ApplicationRecord
convert_options: {
output: {
'loglevel' => 'fatal',
vf: 'scale=\'min(400\, iw):min(400\, ih)\':force_original_aspect_ratio=decrease',
'vf': 'scale=\'min(400\, iw):min(400\, ih)\':force_original_aspect_ratio=decrease',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rubocop wants you to use

Suggested change
'vf': 'scale=\'min(400\, iw):min(400\, ih)\':force_original_aspect_ratio=decrease',
'vf' => 'scale=\'min(400\, iw):min(400\, ih)\':force_original_aspect_ratio=decrease',

(string-based hashes instead of symbol-based hashes)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thank you, it's been a long time since I've Ruby'd

@nightpool
Copy link
Member

Is this change backwards-compatible with older versions of FFMPEG? If so, which versions? Is there a link to the FFMPEG change in question that broke this, for posterity/reference?

@dead10ck
Copy link
Contributor Author

Is this change backwards-compatible with older versions of FFMPEG? If so, which versions? Is there a link to the FFMPEG change in question that broke this, for posterity/reference?

I looked, but I was not able to find any specific mention of this breakage. The change logs are extremely terse:

https://github.com/FFmpeg/FFmpeg/blob/1ff9c07fa696443d2d243e45d5794c8b19946a1b/Changelog#L57

But as I mentioned in the issue, I tested that adding b:v works in Ubuntu 20.04 (ffmpeg 4.2.7), and Debian 11 (4.3.5). This test was just manually invoking the CLI though, so it would be prudent for someone to test this on their mastodon instance on one of those two distros for sanity before putting the change into a stable release.

@ClearlyClaire
Copy link
Contributor

Is this change backwards-compatible with older versions of FFMPEG? If so, which versions? Is there a link to the FFMPEG change in question that broke this, for posterity/reference?

Making a few online searches, I could not find when this argument was introduced exactly, but I could find references to the b:v argument in pages dating back from around 10 years ago, so I think we should be safe with regards to backward compatibility.

No big deal, it's a simple fix

It is! But the comment was more about not introducing unrelated changes and e.g. muddying the output of git blame!

@dead10ck
Copy link
Contributor Author

It is! But the comment was more about not introducing unrelated changes and e.g. muddying the output of git blame!

Oh I see, ok, I've reverted the fix then

@Gargron Gargron merged commit 5b2ff8d into mastodon:main Nov 25, 2022
nametoolong pushed a commit to nametoolong/nuage that referenced this pull request Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gif to mp4 conversion fails on ffmpeg 5
5 participants