Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

81
Views
How to precisely trim a video

Using code below I tried to trim a video clip:

const ffmpegPath = require('@ffmpeg-installer/ffmpeg').path
const ffmpeg = require('fluent-ffmpeg')
ffmpeg.setFfmpegPath(ffmpegPath)

const video_path = `${root}/views/app/files/sources/videos/`;

ffmpeg(video_path + 'Frozen 2013.mp4')
  .setStartTime('5:20.994')
  .setDuration('0:19.352')

  .output(video_path + 'video_out_high.mp4')
  .on('end', function(err) {
    if(!err) { console.log('conversion Done..') }
  })
  .on('error', function(err){
    console.log('error: ', err)
  }).run()

But there is this issues :

the output video seems to be jerky at start, like there are some frames lost at the very beginning. or there is a frame at start and suddenly some frames removed then normal frames playing

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Both of the issues likely stem from just copying the frames. The initial jerkiness comes from the first requested frame is not a keyframe, and an mp4 video may require to end with a keyframe (not 100%). So, you have a choice of (1) reencode or (2) pick start and end times according to the keyframes of the input video.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!