3

I was reading Cut part from video file from start position to end position with FFmpeg a few days back and I tried the following and it worked. While the video part was good, I am not sure if the audio could be made better or not. This is how I went about it

$ ffmpeg -ss 00:11:50 -i input.mkv -t 165 -c:v libx264 -preset slower -crf 22 -c:a copy output.mkv

I was cutting a portion of a video for my own requirements. Something like a clip or something from a movie or an audio/video piece that is nice, quirky etc.

Is there a better way?

I am using ffmpeg 4.2.2 on Debian testing which will eventually become Debian Bullseye (11.0)

4

No, there is no better way.

When you copy the audio stream with -c:a copy, you are not doing any re-encoding, so you are getting the exact same quality in the source. The only way to improve the quality further beyond what the source provides is by using sound editing software to remove noise or use other features.

You didn't mention why you re-encoded the video, and in case you only want to cut the video, a better way would be to remove the re-encoding and do

$ ffmpeg -ss 00:11:50 -i input.mkv -t 165 -c copy output.mkv

4
  • I was using -c:a copy because I didn't know any other way, if you have some other ideas without needing audio software (using only ffmpeg) would be nice to figure out things.
    – shirish
    Feb 19 '20 at 5:06
  • Are you satisfied with the quality of the audio in the source input.mkv? The other ways are to encode the audio which would make it worse not better. People use encoding not to improve the quality but to decrease the size or to convert it to a format different than the source. In your case, you don't need that so what you did the best thing, really. Feb 19 '20 at 5:10
  • @shirish I updated the answer to show how to stream copy the video as well in case you have no reason to do the re-encoding. Feb 19 '20 at 11:42
  • Edited my answer as well, thank you for your comments and support :)
    – shirish
    Feb 21 '20 at 18:09

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.