Trinning a video in Node.js is as easy as:
const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path
const ffmpeg = require('fluent-ffmpeg')
ffmpeg.setFfmpegPath(ffmpegPath)
ffmpeg('path_to_video_on_server/video.mp4')
.setStartTime('00:00:03')
.setDuration('10')
.output('video_out.mp4')
.on('end', function(err) {
if(!err) { console.log('conversion Done') }
})
.on('error', err => console.log('error: ', err))
.run()
But the issue is what if we store our videos in another server?
I mean now we have a path for the video like :
path_to_video_on_server/video.mp4
But what if we have this video in another server with this path:
www.example.com/path_to_video_on_server/video.mp4
Does replacing this new path work ?
If not how to trim a video stored in another sever via our node.js server ?