Added a note about local development to examples that use build extensions
This commit is contained in:
@@ -4,6 +4,8 @@ sidebarTitle: "FFmpeg video processing"
|
||||
description: "These examples show you how to process videos in various ways using FFmpeg with Trigger.dev."
|
||||
---
|
||||
|
||||
import LocalDevelopment from "/snippets/local-development-extensions.mdx";
|
||||
|
||||
## Adding the FFmpeg build extension
|
||||
|
||||
To use these example tasks, you'll first need to add our FFmpeg extension to your project configuration like this:
|
||||
@@ -33,7 +35,7 @@ You'll also need to add `@trigger.dev/build` to your `package.json` file under `
|
||||
|
||||
This task demonstrates how to use FFmpeg to compress a video, reducing its file size while maintaining reasonable quality, and upload the compressed video to R2 storage.
|
||||
|
||||
### Key Features:
|
||||
### Key Features
|
||||
|
||||
- Fetches a video from a given URL
|
||||
- Compresses the video using FFmpeg with various compression settings
|
||||
@@ -130,7 +132,7 @@ export const ffmpegCompressVideo = task({
|
||||
});
|
||||
```
|
||||
|
||||
### Testing:
|
||||
### Testing
|
||||
|
||||
To test this task, use this payload structure:
|
||||
|
||||
@@ -144,7 +146,7 @@ To test this task, use this payload structure:
|
||||
|
||||
This task demonstrates how to use FFmpeg to extract audio from a video, convert it to WAV format, and upload it to R2 storage.
|
||||
|
||||
### Key Features:
|
||||
### Key Features
|
||||
|
||||
- Fetches a video from a given URL
|
||||
- Extracts the audio from the video using FFmpeg
|
||||
@@ -239,7 +241,7 @@ export const ffmpegExtractAudio = task({
|
||||
});
|
||||
```
|
||||
|
||||
### Testing:
|
||||
### Testing
|
||||
|
||||
To test this task, use this payload structure:
|
||||
|
||||
@@ -258,7 +260,7 @@ To test this task, use this payload structure:
|
||||
|
||||
This task demonstrates how to use FFmpeg to generate a thumbnail from a video at a specific time and upload the generated thumbnail to R2 storage.
|
||||
|
||||
### Key Features:
|
||||
### Key Features
|
||||
|
||||
- Fetches a video from a given URL
|
||||
- Generates a thumbnail from the video at the 5-second mark
|
||||
@@ -358,3 +360,5 @@ To test this task in the dashboard, you can use the following payload:
|
||||
"videoUrl": "<video-url>"
|
||||
}
|
||||
```
|
||||
|
||||
<LocalDevelopment packages={"ffmpeg"} />
|
||||
@@ -4,6 +4,8 @@ sidebarTitle: "PDF to image"
|
||||
description: "This example will show you how to turn a PDF into an image using MuPDF and Trigger.dev."
|
||||
---
|
||||
|
||||
import LocalDevelopment from "/snippets/local-development-extensions.mdx";
|
||||
|
||||
## Overview
|
||||
|
||||
This example demonstrates how to use Trigger.dev to turn a PDF into a series of images using MuPDF and upload them to Cloudflare R2.
|
||||
@@ -96,3 +98,7 @@ To test this task in the dashboard, you can use the following payload:
|
||||
"documentId": "unique-document-id"
|
||||
}
|
||||
```
|
||||
|
||||
<LocalDevelopment packages={"mupdf-tools from MuPDF"} />
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ This example demonstrates how to use Trigger.dev to generate a PDF using `react-
|
||||
|
||||
## Task code
|
||||
|
||||
<Info> This example must be a .tsx file to use React components. </Info>
|
||||
<Info> This example must be a .tsx file to use React components.</Info>
|
||||
|
||||
```ts trigger/generateResumePDF.tsx
|
||||
import { logger, task } from "@trigger.dev/sdk/v3";
|
||||
|
||||
@@ -4,6 +4,8 @@ sidebarTitle: "Sharp image processing"
|
||||
description: "This example demonstrates how to process images using the Sharp library with Trigger.dev."
|
||||
---
|
||||
|
||||
import LocalDevelopment from "/snippets/local-development-extensions.mdx";
|
||||
|
||||
## Overview
|
||||
|
||||
This task optimizes and watermarks an image using the Sharp library, and then uploads the processed image to R2 storage.
|
||||
@@ -130,3 +132,5 @@ To test this task in the dashboard, you can use the following payload:
|
||||
"watermarkUrl": "<an-image-url.png>" // Replace with a URL to a PNG watermark image
|
||||
}
|
||||
```
|
||||
|
||||
<LocalDevelopment packages={"the Sharp image processing library"} />
|
||||
@@ -0,0 +1,3 @@
|
||||
## Local development
|
||||
|
||||
To test this example task locally, be sure to install any packages from the build extensions you added to your `trigger.config.ts` file to your local machine. In this case, you need to install {packages}.
|
||||
Reference in New Issue
Block a user