I tried many video cutters powered by ffmpeg, and they all have the same issue: Fast custting is not accurate without re-encoding. I tried many solution in my own app, but nothing works as I need. So, I have this idea to fix this issue: suppose I want to generate a new video that doesn't contain the chuck starts at t1 to t2. I want ffmpeg to do this to divide the segment (t1, t2) to 3 parts:
- a part (t1-x, t1+y), which is a complete encoded block that should be re-encoded to be able to copy the part (t1, y) precisely.
- a part (t2-z, t3+w), which is a complete encoded block that should be re-encoded to be able to copy the part (z, t2) precisely.
- a middle part (y, z) which contains complete encoded blocks, where it can be copied as is.
Then join the 3 parts resulted from the above steps. Note that the first two parts are expected to be small (and one of them or both can be zero length), so, the re-encoding process will be fast. This will make us able to have exact cuts with slightly slower operation but still super faster than re-encoding the full video. It can be even faster if we can do multiple cuts with one command, so we traverse the frames once.
So, can I do that today with ffmpeg? Or, can ffmpeg support it soon? I hope if someone can apply this, and tell us how, or mention some of the ffmpeg team, or deliver it to them anyhow.