fluent-ffmpeg / node-fluent-ffmpeg

A fluent API to FFMPEG (http://www.ffmpeg.org)
MIT License
7.63k stars 873 forks source link

Video cut from active video stream #1229

Open Lamerat opened 9 months ago

Lamerat commented 9 months ago

Version information

Code to reproduce

//Just exmaple for here
const url = "http://example.com/playlist.m3u8?DVR"
const startTime = '03:00:00'
const duration = 20

ffmpeg(url).setStartTime(startTime).setDuration(duration).output('myVideo.mp4')
    .on('end', function(err) {
      console.log(err)
      return resolve()
    }).on('error', function(err) {
      console.log(err)
      reject(err)
    }).run()

Observed results

When use this code to cut part of file or url all is ok, but when try to use it in active live video stream, don't receive the error or something like this, but created file is not from given start time. Not sure when start but maybe is from current end of streaming video, and first few seconds is frozen. Have a way to create cut vdeo from live stream past duration? Example current stream is online from 01:00:00, I want to create cut from 00:30:00 to 00:45:00. Stream is m3u8?DVR

njoyard commented 7 months ago

Live video streams usually cannot be seeked into as regular files (or fixed streams), that's probably your issue. For a more precise answer we need to see the actual stream you're using.