Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cutting a video accurately at a specific time without losing quality

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
like image 511
mdasari Avatar asked Nov 25 '25 11:11

mdasari


1 Answers

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, …).

like image 134
slhck Avatar answered Nov 27 '25 15:11

slhck



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!