i have a rtsp link and i need to in some moments capture few seconds and save that file in my computer like a mp4 file or something like
i tried to use that code but doesnt worked for me
const ffmpeg = require('fluent-ffmpeg');
// RTSP stream URL
const streamUrl = 'mycamlink';
// Output file path
const outputPath = 'output.mp4';
// Create the FFmpeg command
const command = ffmpeg(streamUrl)
.inputOptions('-rtsp_transport', 'tcp')
.outputOptions('-c', 'copy')
.outputOptions('-flags', '+global_header')
.output(outputPath);
console.log('Recording started.');
// Start recording
command.run();
// Stop recording after 10 seconds
setTimeout(() => {
command.kill();
console.log('Recording stopped.');
}, 10000);
that give me this error Error: Cannot find ffmpeg