Blogs & Articles

The latest news and announcements about our products and services.

Normal and widescreen video conversion without stretching.

  • 19 January 2010

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

     _mhandler.Width = 320; _mhandler.Height = 180; _mhandler.PadTop = 30; _mhandler.PadBottom = 30;



1: Normal (4:3) to Widescreen (16:9) video conversion:
Example
i: Same as above first get width and height of source video (4:3). e.g 800x600 = 1.3333.
ii: Width and height of output widescreen video. e.g 320x180 = 1.7777.
iii: Actual normal width of video based on widescreen height = 180x1.333 = 240
iv: Calculate the different between normal and widescreen widths = 320-240 = 60
v:  Divide 60 in two pieces will get the padding size for each side of video 60/2 = 30.
vi: In case of normal to widescreen conversion, difference comes in widths so you will add padding on left and right of video.
So parameters for normal video (800x600) to widescreen video (320x160) conversion without stretching is

 

    • Width: 240px
    • Height: 180px
    • Padding Left: 30px
    • Padding Right: 30px

 

You can achieve same settings through ASP.NET Media Handler Pro as

      _mhandler.Width = 320;      _mhandler.Height = 180;     _mhandler.PadLeft= 30;     _mhandler.PadRight= 30;


Checking video aspect ration:

Just divide width/height you will get aspect ratio of video. If you receive value like 1.333 it means video is normal video. If you receive value like 1.777 it means its widescreen video.

Note: In order to achieve conversion without stretching you must know

    • Source video type whether its widescreen or normal video.
    • In case of widescreen to normal video conversion, padding to be put on top and bottom of video based on logic describe above.
    • In case of normal to widescreen video conversion, padding to be put on left and right of video based on logic as discussed above.

 

ASP.NET Media Handler Pro Documentation:
http://www.mediasoftpro.com/mediahandlerpro-v4-documentation.html
We appreciate feedback and comments.

Flash video progressive download & streaming via HTTP in ASP.NET

  • 17 January 2010

Flash Video files can be stream & delivered in several different ways on the web. Main delivery options are.

    • As a standalone .FLV file.
    • Embedded in SWF file using Flash Authoring Tool.
      Progressive Download via HTTP.
    • Streaming via RTMP to the Flash Player using Flash Media Server.

 

Standalone .FLV File:
It is the normal way to deliver Flash video using a Flash player to control. The .FLV file itself is only playable with an FLV player.
Embedded in SWF File:
In this approach, the entire file must be transferred before playback can begin. Changing the video requires rebuilding the SWF file.
Streaming via RTMP to the Flash Player using Flash Media Server.
Streamed via RTMP to the Flash Player using the Flash Media Server (formerly called Flash Communication Server).
Progressive Download via Http:
This method uses ActionScript to include an externally hosted Flash Video file for playback. Progressive download has serveral advantages, including buffering, use of generic HTTP servers and the ability to reuse a single SWF player for multiple Flash Video sources.
In this way you can access video files using the partial download functionality of HTTP, sometime referred to as streaming.
However, unlike streaming using RTMP, HTTP "streaming" does not support real-time broadcasting.
Streaming via HTTP requires a custom player and the injection of specific Flash video metadata containing the exact starting position in bytes and timecode of easy keyframe. Using this specific information, a custom Flash Video player can request any part of the Flash Video file starting at a specified keyframe.
e.g our demo kit, Video Starter Kit Advance Edition support pseudo-streaming & progressive downloading and can seek to any part of the video before buffering is complete.
The server side part of this "HTTP pseudo-streaming" method is fairly simple to implement. Here we add information about how to use or generate server script in ASP.NET to achieve Flash video pseudo-streaming or progressive download capability.
We generate pseudo-streaming script for ASP.NET that can help you to implement Flash video HTTP progressive download & pseudo streaming in ASP.NET
Live demo of ASP.NET pseudo-streaming script is on
http://www.remix-video.com/video/374/legion-trailer.aspx
You can download streaming script from
http://www.mediasoftpro.com/downloads/stream.zip
Configuring ASP.NET HTTP streaming Script:
1: Configuring Flash video directory path

private string _vsk_path_files = "/contents/member/";

The above code will set directory root path where Flash video store and will stream.
2: Configure list of allowed domains for streaming.
 private static string[] _allowed_domains = new string[] { "www.remix-video.com", "www.mediasoftpro.com"};

Put list of domains that you want only to be allowed for streaming or accessing Flash video files.
3: Configure list of restricted domains for accessing Flash content.
 private static string[] _restricted_domains = new string[] { "www.sampledomain.com", "www.sampledomain2.com", "www.sampledomain3.com" };

Using ASP.NET HTTP streaming Script in Flash Player:
First you need to make sure that whether Flash Player that you are using support HTTP Streaming.
The below example uses JW Player for accessing ASP.NET HTTP streaming script, read configuration and stream video based on configuration.
s1.addVariable("streamer","http://www.example.com/vsk/stream/streamer.ashx");s1.addVariable("token","UserID");

The above two lines configure HTTP streaming for JW Player. Token can be any value and is used for validation purpose.
In demo kit Video Starter Kit Advance Edition we used token for sending unique user id to script that helps to generate path for user video files for streaming.
Your feedback is appreciated to improve ASP.NET script more for HTTP streaming.

ASP.NET Media Handler Pro Basic Features.

  • 17 January 2010

ASP.NET Media Handler Pro is an ASP.NET video encoding utility that provide ability to publish / encode any format videos from one format to another format, prepare videos to be stream on the web, grab single / multiple thumbs, post watermark, retrieve information from videos and perform lots of other useful video processing tasks.
\r\nYou can use ASP.NET Media Handler Pro component in any applications that is compatible with Microsoft .NET Framework.
\r\nApplication may include.

  • ASP.NET web applications written in C# or VB.NET.
  • .NET windows based applications.
  • .NET web services.
  • .NET win services.
  • and more.

Main purpose of ASP.NET Media Handler Pro is to

    • Encode videos to be stream and play on variety of devices and web browsers.
    • Grab thumbs to represent videos in galleries.
    • Post watermark on videos while encoding to protect copyright contents.
    • Prepare online streaming videos (Flash Videos etc) to be playable on variety of devices.
    • Prepare different format audio files from videos.
    • and more.

 

In case of ASP.NET applications, ASP.NET Media Handler Pro can be used on both shared hosting plans that support full trust asp.net configuration & dedicated servers.
You can download ASP.NET Media Handler Pro trial version from
http://www.mediasoftpro.com/downloads.html

ASP.NET Media Handler Pro Documentation:
url]http://www.mediasoftpro.com/mediahandlerpro-v4-documentation.html[/url]

We appreciate your feedback for improving ASP.NET Media Handler Pro functionality more to make it more useful for your needs.

Blog Section Introduced in MediaSoft Pro Website.

  • 16 January 2010

At last we added blog section in our website http://www.mediasoftpro.com to provide information to customers regarding any development occurs in our products, services & tools.
\r\nIn bog section we will add articles related to our products, additional utilities that we work on it and other technologies related to video encoding, streaming & managing.
In contrast we will post articles about.

We also appreciate that you keep posting thoughts, ideas, comments regarding ASP.NET and video technologies.
We will try our best to share our ideas and services that we provide to our customers.