
I tried all sorts of variations on ffmpeg -y -ss 00:00:00 -i video.mp4 -t 0.04 -codec copy video.mkv, but that command seems to really bug out with videos of length 1-2 frames - while it works for longer videos no problem.

txt file from disk (performance is very important in this project).īut worse yet, I couldn't generate the intermediate videos with ffmpeg, I had to use avidemux. This produces the expected output, although is of course not as efficient as I would like since it requires creating intermediate files and reading the. I then create a concat.txt file with the following contents: file video.mkvĪnd run ffmpeg -y -f concat -i concat.txt -c copy output.mp4. I can turn the original video into two intermediate videos - one with just the i-frame before the sequence jump, and one with the p-frame that was two frames later. I have one way of going about it, but it doesn't work for one frustrating reason (mentioned later).

I am currently using h.264 but would like to be able to do this with VP9 and AV1 as well. I am making a datamoshing program in C++, and I need to find a way to remove one frame from a video (specifically, the p-frame right after a sequence jump) without re-encoding the video.
