I am using ffmpeg to cut a video accurately at a given time to another time. I know, we can simply re-encode it, but will lose the quality. Also, I do not want to use copy option because of key frames issue (i.e, the video won't be cutt accurately). These are the commands that I used.
ffmpeg -ss 55 -i input.mp4 -t 00:03:06 -vcodec copy -acodec copy out.mp4
ffmpeg -ss 55 -i input.mp4 -t 00:03:06 out.avi
It's impossible. Either you have to re-encode the video, or include the keyframes needed for other frames which reference them.
If you do not want to lose quality, you could output to a lossless file (e.g., YUV, HuffYUV, FFV1, …) or continue working visually losslessly (e.g., ProRes, DNxHD, high-quality H.264 / H.265, …).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With