Home > Blogs > Tags > Widescreen Video Encoding Blog Posts
When you encode normal video (4:3 aspect ration) to widescreen (16:9) video, or in reverse widescreen to normal video, video is stretch out and in result output distorted or bad in view and quality.
In order to avoid video stretching out and keep aspect ratio of video persistent, you can use technique called pillars. This is the "pure" method as it does not distort or lose any part of the original video or image. In this technique you will calculate space and add padding accordingly on proper direction to keep the aspect ratio of video consistent.
Logic to calculate padding size and direction.

1: Widescreen (16:9) to Normal (4:3) video conversion:

Example:
i: Calculate width and height of source video (16:9): e.g 800x450 = 1.7777.
ii: Width and height of normal video that you want to publish e.g 320x240 = 1.333.
iii: Actual widescreen height of video based on output width : 320/1.77777 = 180.
iv: Calculate the difference between normal height and widescreen height = 240 - 180 = 60.
v: Divide 60 in two pieces will get the padding size for each side of video 60/2 = 30.
vi: In case of widescreen to normal conversion, difference comes in height so you will add padding on top and bottom of video.
So parameters for widescreen video (800x450) to normal video (320x240) conversion without stretching is
  • Width: 320px
  • Height: 180px
  • Padding Top: 30px
  • Padding Bottom: 30px
The result video size will be 320x240 or (4:3 aspect ratio) video.

You can achieve same settings through  ASP.NET Media Handler Pro as
[quote]
      _mhandler.Width = 320;
      _mhandler.Height = 180;
      _mhandler.PadTop = 30;
  
complete story
Posted in Media Handler Pro ,
© 2007 - 2012, mediasoftpro.com  | Site Map | Privacy Policy | Terms of Use