4

I am trying to resize a video from 1920x1800 to 1280x720 for phone viewing.

This is the command I used:

avconv -i input.mkv \
-map 0:v -map 0:a:1 -map 0:s:0 \ # map video, 2nd audio stream, and subtitles
-s 1280x720 \                    # resize
-c:a copy -c:s copy \            # copy audio and subtitles
output.mkv`

The output is indeed the correct resolution, but it suffers from artifacts.

Input:

input

Output:

output

Output detail:

enter image description here

2
  • 1
    I am pretty sure that if you don't specify a bitrate for the video it will use the default 256 kBit/s, which is low, hence the banding.
    – Paul
    Oct 2 '13 at 2:52
  • That's the reason! If you make this an answer I'll accept it as soon as I'm able. Oct 2 '13 at 3:29
8

If you don't specify a bitrate for the video, it will choose the mpeg4 video encoder for the MKV container. It uses a default of 200 kBit/s, which is low, hence the visual artifacts.

If you want to increase the quality, you have three options:

  • Choose a higher bitrate (e.g. -b:v 1000K)
  • Choose variable quality (e.g. -q:v 1). Lower means better. Good values are between 1 and 4.
  • Choose a higher quality video codec, e.g. H.264 (-c:v libx264) and set the CRF for quality (e.g. -crf 23). Lower means better, and sane values are between 18 and 28.

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.