sâmbătă, 26 iulie 2008

How to publish 16:9 video content on Vimeo

I recently purchased a widescreen camera and wanted to publish some home-made clips on the internet.
First choice was Youtube, but I soon found that I had to add black stripes on the top and bottom of the video, otherwise Youtube would strech it to 4:3 format.
I thought that it was't too nice, but my friends were happy with the result so I never searched for alternatives until I found about Vimeo. Their homepage has a special HD video section with 16:9 aspect and the help details optimum parameters for encoding and uploading HD video.
Video uses 1280x720p format and detects it automaticaly so I though that it will also be able to display standard definition widescreen video at 720x576. Unfortunately, uploading a clip with the resolution 720x576 resulted in a vertically streched 640x480 clip on Vimeo.

I could add black borders and still get double resolution than on Youtube, but I wanted a real 16:9 clip so I though about upscaling the video from 720x576 to 1280x720.
The result is astonishing :




Bellow is the Youtube version of the same clip :



The video source for both clips is the same : 9mbps mpeg2 from a HDD camera. Both clips were transcoded to x264 using mencoder, but with different settings.
The Youtube clip was downscaled, croped and encoded at 1mbps with the following parameters and profile "mencoder %1 -profile x264-YouTube-TV -vf-add expand=:480 -o %2" :

[x264-YouTube-TV]
profile-desc="H.264 YouTube TV (640x480)"
vf=pullup,softskip,pp=fd,scale=640:-2,crop=640:480,hqdn3d,harddup
lavdopts=threads=2
ovc=x264=yes
x264encopts=threads=auto:subq=5:frameref=4:me=umh:partitions=all:b-pyramid=yes:qcomp=0.8:trellis=1:8x8dct=yes:bframes=3:weightb=yes:bitrate=1000
oac=faac=yes
faacopts=br=192:raw=yes:mpeg=4:tns=yes
af=volnorm=2


The Vimeo clip was upscaled and encoded at 3mbps with the following profile "mencoder %1 -profile x264-vimeo -o %2":

[x264-vimeo]
profile-desc="h264 high res"
vf=pullup,softskip,pp=fd,hqdn3d,harddup,scale=1280:-2
lavdopts=threads=2
ovc=x264=yes
x264encopts=threads=auto:subq=5:frameref=4:me=umh:partitions=all:b-pyramid=yes:qcomp=0.8:trellis=1:8x8dct=yes:bframes=3:weightb=yes:bitrate=3000
oac=faac=yes
faacopts=br=128:raw=yes:mpeg=4:tns=yes
af=volnorm=2
sws=10