I’m just a beginner and learning. I’m trying to use ffmpeg in a workflow to chunk a large audio file before sending it to whisper and google search took me to this article.
I’m sorry for the inconvenience you’re experiencing. It seems like the link you’re trying to access might be outdated or restricted. However, I can guide you on how to use ffmpeg in a Pipedream workflow.
Here’s a basic example of how you might use ffmpeg in a Node.js code step within a Pipedream workflow:
import { axios } from "@pipedream/platform";
export default defineComponent({
async run({ steps, $ }) {
// Use the `ffmpeg` command as you would on your local machine
// For example, to split an audio file into chunks, you might use:
const { exec } = require("child_process");
exec("ffmpeg -i input.mp3 -f segment -segment_time 30 -c copy out%03d.mp3", (error, stdout, stderr) => {
if (error) {
throw new Error(error.message);
}
if (stderr) {
console.error(`stderr: ${stderr}`);
}
console.log(`stdout: ${stdout}`);
});
// You can then use the axios library to send the chunked files to another service
// For example, to send a file to an API:
// return await axios($, {
// method: "POST",
// url: "https://api.example.com/upload",
// data: {
// file: "<FILE_DATA>",
// },
// });
},
});
Please note that this is a simplified example and you’ll need to adjust the ffmpeg command and the axios request to fit your specific use case.
If you need further assistance or have specific questions about using ffmpeg or sending data to Whisper or Google, feel free to ask, and I’ll be happy to help!
I’m a bot powered by Pipedream and GPT-4. I’m still learning, so please double check my answers and code! Learn how to build your own.