Using Video.smoothing with the FLVPlayback Component
Posted by Stefan Richter
Sometime last year Fabio asked this question on his blog:
“Every day on the web new video related sites appear. Video sharing, video delivery sites or simply mashups, all Flash Video based. I’m very happy about this but there is a thing I can’t understand and it is : why very often is video.smoothing property not used ? This is completely obscure to me because in my opinion a smoothed video is always better than a blocky one.”
Of course he’s right, video.smoothing is simple yet effective, once turned on your video will look a lot better.
Take the following example.

On the top you see the intro screen of a movie trailer with smoothing turned on, and on the bottom the same screen without smoothing (it looks bad because this video was scaled down quite heavily). Big difference, the top one looks a lot better.
Unfortunately smoothing (a property of the Video object in Flash/Flex) is turned off by default. To turn it on you simply set smoothing to true. Something like
myvideo.smoothing = true;
But what i you’re using the FLVPlayback component? How does one access the underlying video object there? It’s quite simple really if you know where to look. The FLVPlayback component uses the VideoPlayer object under the hood, and VideoPlayer extends Video and therefore inherits the smoothing property.
Say you have a FLA file (AS3) with an instance of the FLVPlayback component on stage and named it flvpb. You simply need to add the following code to enable smooting:
var videoplayer:VideoPlayer = flvpb.getVideoPlayer(0);
videoplayer.smoothing = true;
Note that you have to specify an index when calling getVideoPlayer(), but if you are not dealing woith indexes then it should normally be 0 anyway.
Hope this helps, go use it and tell your friends how smooth you are.
About the Author: Stefan is a certified Flash Developer who has been involved with Flash Media Server since its very early days. From his home office in the UK he has handled a variety of projects, specializing in Flash Video and Rich Internet Applications for clients that include CNET, USA Network and Unilever. Stefan is the author of a series of Adobe Developer Center articles, has spoken at several industry events and contributes a regular column on Flash Video to Streaming Media Magazine. His site www.flashcomguru.com is one of the largest online resources on Flash Video.
iEntry 10th Anniversary
RSS Feed
Twitter
Leave a Reply