Resizing with avconv causes pixellation in output

4

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

Matthew Piziak

Posted 2013-10-02T02:20:36.823

Reputation: 202

1I 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 – 2013-10-02T02:52:12.810

That's the reason! If you make this an answer I'll accept it as soon as I'm able. – Matthew Piziak – 2013-10-02T03:29:33.077

Answers

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.

Paul

Posted 2013-10-02T02:20:36.823

Reputation: 52 173