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

Upgrade to FFMPEG 5.1.2 and pull our own FFMPEG builds from S3 #30

Closed
wants to merge 10 commits into from

Conversation

schneems
Copy link
Contributor

@schneems schneems commented Feb 21, 2023

Previously we were hosting a .deb with the updates from #28 we are now using a tar.gz.

We can get rid of the cache as we have to download from S3 either way. This change is gated on the full rollout of https://devcenter.heroku.com/changelog-items/2547 as #28 relies on updated system packages to be present.

It's worth noting that the common runtime and private spaces runtime update their stack images at different intervals. Due to this, merge will be delayed.

Developers can test use this branch before merge by running:

heroku buildpacks:remove https://github.com/heroku/heroku-buildpack-activestorage-preview
heroku buildpacks:add -i 1 https://github.com/heroku/heroku-buildpack-activestorage-preview#schneems/update-ffmpeg-binaries

Once merged, you should switch back or your app will not receive updates or security fixes. You can switch back by running:

heroku buildpacks:remove https://github.com/heroku/heroku-buildpack-activestorage-preview#schneems/update-ffmpeg-binaries
heroku buildpacks:add -i 1 https://github.com/heroku/heroku-buildpack-activestorage-preview

If you're using pipelines, make sure you run commands on your staging app so binaries are properly promoted.

@schneems schneems force-pushed the schneems/update-ffmpeg-binaries branch 5 times, most recently from caf8030 to 8bbcc0c Compare February 21, 2023 22:03
Previously we were hosting a `.deb` with the updates from #28 we are now using a `tar.gz`.

We can get rid of the cache as we have to download from S3 either way. This change is gated on the full rollout of https://devcenter.heroku.com/changelog-items/2547 as #28 relies on updated system packages to be present.
@schneems schneems force-pushed the schneems/update-ffmpeg-binaries branch from 8bbcc0c to 6cd0e14 Compare February 21, 2023 22:06
@schneems schneems force-pushed the schneems/update-ffmpeg-binaries branch 2 times, most recently from 823a922 to 3b8634c Compare February 21, 2023 22:48
@schneems schneems force-pushed the schneems/update-ffmpeg-binaries branch from 3b8634c to 05ba412 Compare February 21, 2023 22:51
@schneems schneems marked this pull request as ready for review February 21, 2023 22:53
Copy link
Contributor

@dzuelke dzuelke left a comment

Choose a reason for hiding this comment

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

IMO we should drop the mp4 file from the fixtures; no need to have binaries in the repo. We can use e.g. https://samples.ffmpeg.org/MPEG-4/turn-on-off.mp4 directly (you can ffprobe https://samples.ffmpeg.org/MPEG-4/turn-on-off.mp4).

If you remove it, make sure to rewrite history to drop the commit, or the binary data will remain in history.

bin/compile Show resolved Hide resolved
@dzuelke dzuelke changed the title Update buildpack to pull from S3 Pull our own FFMPEG builds from S3 Feb 22, 2023
bin/compile Outdated
else
CACHED_SFFMPEG=$SFFMPEG_VERSION
fi
SFFMPEG_VERSION="5.1.2"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we rename this to FFMPEG_VERSION please? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, check and resolve please.

@schneems
Copy link
Contributor Author

IMO we should drop the mp4 file from the fixtures; no need to have binaries in the repo. We can use e.g. https://samples.ffmpeg.org/MPEG-4/turn-on-off.mp4 directly (you can ffprobe https://samples.ffmpeg.org/MPEG-4/turn-on-off.mp4).

It's 443 KB and means that we don't have to depend on the network failing or that site going down or any other host of potential testing inconsistencies. I think the cost of a slightly larger git repo is worth it. If we start adding tons of other fixtures then I'll be happy to remove. If you're strongly wanting to remove it still for file size, I would suggest we use a shorter/smaller video instead.

@schneems schneems changed the title Pull our own FFMPEG builds from S3 Upgrade to FFMPEG 5.1.2 and pull our own FFMPEG builds from S3 Feb 22, 2023
- Remove cache of deb packages

Previously we stored a cache of the static ffmpeg binary, however both the cache and the binary are stored on S3 so this does not improve compile times. By moving to not use the cache and deleting old contents we can reduce cache size while preserving compile times

- Move location of `dpkg -x` to be logically consistent with installing poppler

Previously we were installing ffmpeg and poppler via the apt-get mechanism. With the move to have FFMPEG be a simple curl to disk, it makes more sense to have the `dpkg -x` logic be with the poppler download code.

- Add additional logging

Log download and install for poppler and ffmpegcache. Adds the version of ffmpeg to the log output.
@schneems schneems force-pushed the schneems/update-ffmpeg-binaries branch from 272a179 to a3b1aa4 Compare February 22, 2023 16:01
@schneems
Copy link
Contributor Author

Please re-review. Let's hold of on giving an approval though until we're sure dogwood is fully rolled out. I added instructions for using this branch in the description.

@schneems schneems closed this Feb 22, 2023
@edmorley edmorley deleted the schneems/update-ffmpeg-binaries branch May 29, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants