Chicos, solo quiero recortar un video como, quiero que el usuario elija la hora de inicio y finalización del video y, en consecuencia, quiero descargar solo esa parte del video y ya estoy usando el módulo ytdl node js para eso
Aquí está mi código, dígame cómo puedo usar ffmpeg en este caso, estoy confundido
// Code owner: Elderny1 on telegram const express = require("express"); const ytdl = require("ytdl-core"); const ffmpeg = require("fluent-ffmpeg"); const app = express(); const port = process.env.PORT || 80 // opens the url in the default browser let info = []; app.use(express.json()); app.use(express.static("public")); app.get("/", (req, res) => { res.sendFile(__dirname + "public/index.html"); }); app.get("/videoInfo", async (req, res) => { const videoURL = req.query.videoURL; info = await ytdl.getInfo(videoURL); res.status(200).json(info); }); app.get("/download", (req, res) => { const videoURL = req.query.videoURL; const itag = req.query.itag; const vid_title = info.videoDetails.title; let filesize = ""; for (i = 0; i < info.formats.length; i++) { if (info.formats[i].itag == itag) { filesize = info.formats[i].contentLength; break; } } let filenamee = ""; for (i = 0; i < info.formats.length; i++) { if (info.formats[i].itag == itag) { filenamee = vid_title + "." + info.formats[i].container; break; } } if (filesize != undefined) { res.header({ "Content-Disposition": 'attachment; filename="' + filenamee + '"', "Content-Length": filesize }); } else { res.header("Content-Disposition", 'attachment; filename="' + filenamee + '"'); } ytdl(videoURL, { filter: (format) => format.itag == itag, }).pipe(res); }); app.listen(port);