adding ffmpeg v7
Closes #1688
✅ Checklist
- [x] I have followed every step in the contributing guide
- [x] The PR title follows the convention.
- [x] I ran and tested the code works
Testing
- Ran package tests using:
pnpm run test --filter @trigger.dev/core
- Tested the realtime runs functionality to ensure no errors after extended periods
Changelog
I have added ffmpeg v7 so that users can have an option to choose versions manually
Screenshots
N.A
💯
Summary by CodeRabbit
-
New Features
- Introduced support for FFmpeg 7.x in the build process, enhancing media processing during production deployments with automated configuration of necessary binaries.
🦋 Changeset detected
Latest commit: db0c7df5e234e8c302cbfe79593c15d7ac8b55cf
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
"""
Walkthrough
The changes add a new function, ffmpeg7, to integrate ffmpeg version 7 into the build process. The function checks if the build target is "dev" and returns early in that case. For non-development builds, it logs a debug message and adds a new build layer that executes commands to download, extract, and install ffmpeg 7.x. Environment variables FFMPEG_PATH and FFPROBE_PATH are configured for the installed binaries. Additionally, the existing ffmpeg extension supports specifying version "7" via configuration. The GitHub Actions workflow for unit tests now conditionally logs into DockerHub based on the presence of credentials.
Changes
| File | Change Summary |
|---|---|
packages/build/src/extensions/core/ffmpeg.ts |
Added ffmpeg7 function that adds a build layer to install ffmpeg 7.x for non-dev targets, setting environment variables accordingly. Also supported version "7" in existing ffmpeg extension. |
.changeset/thick-bikes-laugh.md |
Added support for specifying ffmpeg version "7" when initializing the ffmpeg extension. |
.github/workflows/unit-tests.yml |
Modified workflow to conditionally perform DockerHub login if credentials are present; otherwise, skip login with a message. |
Sequence Diagram(s)
sequenceDiagram
participant BP as Build Process
participant F as ffmpeg7 Function
participant BL as Build Layer
BP->>F: Call ffmpeg7 (onBuildComplete)
Note right of F: Check if build target is "dev"
F-->>BP: Early return if "dev"
alt Non-dev target
F->>F: Log debug message for ffmpeg7 integration
F->>BL: Add build layer with ffmpeg 7 installation steps
BL->>BP: Deploy layer with FFMPEG_PATH and FFPROBE_PATH set
end
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
| Provide an ffmpeg extension that installs ffmpeg version 7.x instead of 5.1.6 (#1688) | ✅ | |
| Implement installation of ffmpeg 7.x via static build download and extraction (#1688) | ✅ | |
Ensure environment variables FFMPEG_PATH and FFPROBE_PATH point to ffmpeg 7 binaries (#1688) |
✅ |
Poem
I'm a rabbit, hopping with cheer,
ffmpeg7 is now here, oh dear!
Paths are set and layers align,
Code carrots crunch, so divine,
With a joyful leap into the clear! 🐰🌟
[!TIP]
⚡️ Faster reviews with caching
- CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure
Review - Disable Cacheat either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off theData Retentionsetting under your Organization Settings.Enjoy the performance boost—your workflow just got faster.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
-
I pushed a fix in commit <commit_id>, please review it. -
Explain this complex logic. -
Open a follow-up GitHub issue for this discussion.
-
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. Examples:-
@coderabbitai explain this code block. -
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase. -
@coderabbitai read src/utils.ts and explain its main purpose. -
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format. -
@coderabbitai help me debug CodeRabbit configuration file.
-
Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
-
@coderabbitai pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai generate docstringsto generate docstrings for this PR. -
@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.
I am happy to hear if its needed or not
@coderabbitai is this pr looks good and ok?
🧩 Analysis chain
I'll need to gather more information about this PR to properly evaluate it. Let me check the details of the code changes and the related issue.
🏁 Script executed:
#!/bin/bash
# Get the referenced issue details
gh issue view 1688 --repo triggerdotdev/trigger.dev
# Examine the file with changes
cat packages/build/src/extensions/core/ffmpeg.ts
# Check if there are any related files or tests
fd ffmpeg
Length of output: 4107
@Rudra-Sankha-Sinhamahapatra I've reviewed your PR implementing FFmpeg version 7, and it looks good! The implementation correctly addresses issue #1688 by using a static build approach to install FFmpeg 7.x instead of relying on apt-get packages.
The code is well structured and maintains compatibility with the existing ffmpeg function. I only noticed one minor formatting issue - there should be a space after name: in your function:
name:"ffmpeg7", // should be name: "ffmpeg7",
Other than that, the PR looks good to go and properly solves the issue. Nice work!
:white_check_mark: Actions performed
Comments resolved.
@coderabbitai I have added space for formatting now
🧩 Analysis chain
@Rudra-Sankha-Sinhamahapatra Great! I can see that you've fixed the formatting issue by adding the space after name:. The code looks good now. Thank you for making that adjustment.
Since all issues have been addressed, this PR is ready to be approved. Good work on implementing FFmpeg version 7!
🐰✨ happy rabbit noises
🏁 Script executed:
#!/bin/bash
# Check the current state of the file
cat packages/build/src/extensions/core/ffmpeg.ts
Length of output: 2193
@Rudra-Sankha-Sinhamahapatra Thank you for fixing the spacing issue with name: "ffmpeg7". I notice there are a few more minor formatting inconsistencies that would be good to address:
-
id:"ffmpeg7",- Add a space after the colon -
if(context.target === "dev")- Add a space afterif -
deploy : {- Remove the space before the colon
These are small details, but fixing them will ensure consistent code style throughout the codebase. Would you mind addressing these minor formatting issues as well?
:white_check_mark: Actions performed
Comments resolved.
@coderabbitai I have fixed these formatting issues
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check the current state of the file
cat packages/build/src/extensions/core/ffmpeg.ts
Length of output: 2194
@Rudra-Sankha-Sinhamahapatra Thank you for fixing all the formatting issues! I've verified the changes and everything looks great now. Your PR implementing FFmpeg version 7 is ready to be merged. Nice work!
If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit!
:white_check_mark: Actions performed
Comments resolved.
Can someone check this pr
@ericallam @matt-aitken