I'm trying to cut a video (a debate on TV) with FFmpeg without re-encoding, and I need to cut between 2 sentences a guy pronounce. I think the precise moment is between two keyframes, because whatever the timestamp I try to cut at, I always get too much sound (and video) or too few. Here is my ffmpeg command line :

ffmpeg -i video.mp4 -ss 0:0:0.9 -vcodec copy -acodec copy videoB.mp4 -y

I'm aware that the position of the -ss option in the command line matters: here, it is supposed to give me all the accuracy FFmpeg can offer. I know I'm probably trying to cut my video neither on a I-frame, nor on P- or B-frames.

So is there a way to get the closest (P- or B-) frame, doing some calculations with the preceding I-frame to generate a new I-frame, then start the video with this brand new I-frame and no sound, until the correct timestamp is reached. Then the video could go on normally.

I really don't want to bother me with re-encoding (which is an use of FFmpeg I don't master on command line). I'm using FFmpeg version 2.5.8-0ubuntu0.15.04.1.


  • You only wish to re-encode the split GOPs - that's called smart rendering. AFAIK, that's tricky to do manually with ffmpeg. Try SolveigMM Video Splitter - videohelp.com/software/SolveigMM-Video-Splitter – Gyan Nov 1 '15 at 13:06
  • Thanks but I'm under Linux. Any other tool which would be more suitable to my environment ? – natsirt Nov 1 '15 at 17:08
  • 1
    Also SolveigMM video splitter seems to not be free anymore ;D – user3450548 Nov 2 '15 at 13:59
  • "without re-encoding". Not going to happen on any keyframe based file type, with any tool. Only possible on non-keyframe based files. Just re-encode with high fidelity. If you do this a lot, reconsider your workflow to include non-keyframe based files, or port directly from your source files to your end-user file with a single encode (difficult to create a workflow like that, but well worth it if you can). – user24601 Jun 20 '19 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.