Reduce size of mp4 using avconv

libavvideo

I'm looking at this question

Reduce size of MP4

and I want to do it using avconv, however, I'd also like to shrink the frame size by about half. My problem is when I do

avconv -i "$file" -s 640x480 -strict experimental "mp4/$file.mp4"

The output is incredibly pixelated and degrades quality of video too much. I'm trying to convert video file to smaller size for my handheld. Basically, I'm trying to get this:

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L3.1
Format settings, CABAC                   : No
Format settings, ReFrames                : 4 frames
Format settings, GOP                     : M=2, N=48
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 21mn 31s
Bit rate mode                            : Variable
Maximum bit rate                         : 1 101 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 23.976 fps
Standard                                 : Component
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Default                                  : Yes
Forced                                   : No

To look like this

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.0
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 21mn 45s
Bit rate                                 : 218 Kbps
Width                                    : 624 pixels
Height                                   : 352 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.041
Stream size                              : 33.9 MiB (60%)
Writing library                          : x264 core 138 r2 9e941d1
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00

Question: How do you reduce bit rate and frame size using avconv? If it can't be done in avconv, can it me done in ffmpeg? Video in upper part ~= 200mb, video in lower part ~=50mb, I want to get 50mb with as little pixelation as possible.

Best Answer

Please, whenever you ask for help with avconv, attach its full output. Otherwise whoever replies has to resort to guessing.

My guess in this situation would be that your avconv (or more precisely libavcodec) isn't compiled with libx264, so the internal mpeg4 ASP encoder (with atrocious defaults) is used. So the solution is to get libavcodec with libx264 support - on Ubuntu you should install libavcodec-extra-53, otherwise you might need to compile on your own.

Related Question