Пример #1
0
function clearCommand() {
    command = new ffmpeg();
    command.input(MOVIE_FILE);
    command.noAudio();
    command.on('error', function(err) {
            console.log('An error occurred: ' + err.message);
        })
        .on('end', function() {
            console.log('Processing finished !');
            processNextSnapshot();
        })

}
Пример #2
0
  /**
   * Sets up the FFMpeg command to run
   * @author Johan Kanefur <*****@*****.**>
   * @return {Recorder} Self
   */
  setup() {
    // Construct the file name
    const fileName = `${this._cam.id}_%05d.${this._options.ext}`;

    // Set the input source
    this._cmd
      .noAudio()
      //.audioCodec('copy')
      //.videoCodec('copy')
      .size('640x?')
      .addOutputOption('-map 0')
      .addOutputOption(`-segment_time ${this._options.split}`)
      .addOutputOption('-f segment')
      .addOutputOption('-reset_timestamps 1')
      .addOutputOption('-segment_list_flags +live')
      .addOutputOption('-segment_list_size 10')
      .output(path.join(this._options.storage, fileName));
      //.output(this._options.outStream);

    return this;
  }