|
|
Shooting, Editing and Distributing Video |
|||
![]() |
The Flash Guru: Serving FLV Files Over Slow ConnectionsApril 30, 2008 By Troy Dreier In this latest installment of our popular monthly series, we again turn to our favorite Flash Video expert, Stefan Richter, to answer a question from our forum. This time: How to serve video to users with slow Internet connections.
If you're not familiar with him, Stefan Richter is a certified Flash developer and he's been involved with Flash since it first began. Regular readers to this site will recognize the excerpt "Everything You Don't Know About Flash" from his book Hands-On Guide to Flash Video, (co-written with Jan Ozer). Reader "cantthinkofanic" Asked: I am not an experienced Flash user. I have converted a mpeg video of some 75Mb using Flash 8 to a set of files (FLV, SWF - not sure what they all do). I find that the FLV downloads and plays intermittently on slower PCs even to the point where the picture freezes and the sound works OK. Stefan's Reply: A new user might not understand that when they encode an FLV file, they're choosing a bit rate for that file. If you've encoded your file at 300kbps, then anyone with a slower Internet connection (like someone using a 56kbps dial-up connection) will get stuttering, jerky playback. Try encoding your file at 256kbps, where you'll get a decent picture and still stream well over slow connections. That's still too much data for dial-up, but dial-up really isn't suited to video. If you've mistakenly encoded your work at a high rate, like 1000kbps, this is likely the problem. Most Internet users will have trouble getting a 1000kbps FLV file to play smoothly. If changing the encoding rate doesn't take care of the problem, you may want to set your FLV player to pre-buffer the video. Pre-buffering means that the video will load for a given length of time before playback begins. For perfectly smooth playback, you can have the entire video load first, although this might keep your viewers waiting for too long a time. There are two ways to initiate a buffer, and both are a little bit involved. You'll need to learn some ActionScript to get them to work. First, you can use the wizard within Adobe Flash to create a SWF file that includes both the player and the video. Choose File Import and then Video from the program's File menu. The wizard will walk you through the necessary steps. When you're done, you'll have a SWF file than you can embed in your page. The wizard itself doesn't create the buffer, though, You'll need to use ActionScript to select a keyframe and set the buffer time. The second way to create a customized player from scratch using ActionScript and build a buffer into it. ActionScript is too complex to go into here, but you can learn the needed coding with the documentation that comes with Flash. Alternatively, Richter recommends going to the Flash section of the Adobe Developer Center and selecting the Video category. You'll find plenty of examples that will get you started. If you're not sure about how much buffer to use, Richter recommends going big. "If in doubt, use a slightly larger buffer," he says. Other Flash Guru articles:
Go to page:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||