How do I convert avi and mkv to Mp4 using ffmpeg? I would like to preserve the quality of the video during conversion as best as possible.

  • I don't think that's possible. You're talking about different compressions. You're going to get some quality loss no matter how you try. – James Mertz May 8 '14 at 15:06
  • Hi, how to convert with less loss quality ? – user3614540 May 8 '14 at 15:07
  • I've edited your question to better match what you're asking for. I don't know how to use ffmpeg but I'm someone around here does. – James Mertz May 8 '14 at 15:13
  • 1
    The comment by KronoS is totally incorrect. This is a container conversation. – szatmary May 8 '14 at 18:07

Assuming the the source material is using codecs that the mp4 container supports, then what you are looking for is a simple transmux. in ffmpeg you can accomplish this like:

ffmpeg -i {your in file} -acodec copy -vcodec copy {your out file}

This tells ffmpeg not to decode and re-encode the elementary streams, but simply copy them from one container to another.

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.