FLASH VIDEO
Importing Video While Still Retaining a Small Overall File Size
Before we discuss importing video, we need to define what is optimization. Optimization is compressing a video to make is more web-friendly. However, like images (*.jpg, .png, .gif), it is a balancing act between file size and video quality.
The original video needs to be optimized in order for it to be web-friendly. However, the amount of optimization is depending upon your audience. If you are targeting broadband users this is less of an issue. However, if you are targeting dial-up users than optimized become a more serious concern.
Ways to deploy (import) video:
- Locally:
- Progressive download from a local file (recommended) — stream video using HTTP streaming by converting video to FLV format and configure a Flash Video component to play video.
- Embed video in SWF and play in timeline — should only be used for short video (few seconds)
- As mobile device video bundled in SWF
- Remote:
- Web server
- Stream from a Flash Video Streaming Service
- Stream from Flash Media Server
NOTE: Dreamweaver can not convert raw video to the FLV format. It must be done in Flash, Premiere Pro, QT export for Flash Video, the stand-alone Flash Video Encoder, or a third-party encoder.
There are many techniques to help to reduce file size so that video can load fast and look good on the web. There techniques come in the form of pre- post-production. The adage "garbage in garbage out" hold true for video.
Pre-Production Tips to Help Reduce File Size
- Shoot with the Best Possible Format and Equipment
- Problem:Using inexpensive equipment
- Solution: If possible, use a camera that supports progressive instead of interlacing recording. 24p or 30p preserves frame detail and is easier to compress.
- Problem: Using the wrong format
- Solution: Whenever possible shoot in HDV, HD, or a higher quality standard definition format (i.e., DVC-Pro 50) which retains more picture information that is easier for post-production techniques flexibility.
- NOTE: Shooting in 24p mode or 24fps means footer has 6 fewer fps to compress. Also, progressive mode keep all information intact in a single frame so it is easier to set a key frame. In contrast, in interlace mode, the motion is split within a frame across two video fields making it more difficult to set a keyframe since the motion is slight skewed.
- SD -- 720x480
- HD -- 1280x720 or 1920x1080 (also known as 1080i or 1080p) Both are widescreen formats which has a 16:9 aspect ratio
- Control Camera and Subject Movement
- Problem: Minimize Camera's Quick Zooms and Panning.
- Solution: Instead use fixed length lens. If you want to move closer to the subject, move camera and not the lens which is more natural and create less blurry video which is easier to compress. Instead of zooming in on a subject, cut from a medium shot to a close-up shot -- the viewers' eye will fill in the motion gaps between the cut based on the concept can persistence vision.
NOTE: Zooming in or out is changing the focal length of the camera lens. Panning is rotating the camera left or right on the y axis. Tilting is moving the camera up and down. If any of these need to be done, it should be done with a tripod.
- Problem: Taking handheld videos
- Solution: Whenever possible, use a fluid-effect or fluid head tripod that can dampen jerky movement in both the horizontal and vertical direction and offer better stabilization which result in better compression especially for "talking heads."
NOTE: If you have to pan, pan slowly and turn off the camera Optical Image Stabilization (OIS) if it has this feature.
- Simply Background
- Problem: Lots of motion
- Solution: Limit motion, if possible, in your scene. For every movement in a scene less compression is possible.
- Problem: Use a busy background
- Solution: If possible, use a solid background which compress very well compared to a busy background (i.e., gradients, multi-colors, etc.)
- Problem: Lots of detail in video
- Solution: Limit detail by using a shallow depth of field (DOF). Bring subject into foreground focus and set background in soft focus. This will let the compressor preserve detail in the foreground while reducing the chance of motion artifacts in the background.
- NOTE: Depth of Field (DOF) is the area in front of the camera where subjects look sharp and in focus
- Good Lighting and Exposure
- Problem: Poor lighting
- Solution: Video taken with soft, even light compresses better than video with hard edges created by shadows and overly bright lights.
NOTE: Soft light is achieved by applying a diffusion material to the lights or by applying a soft box to the key light. Four points (key, fill, rim and back) lighting can vastly improve video quality.
- Problem: Too much sharpness
- Solution: A camera sharpening setting is good for video that will not have any post-production work. Most codecs will create additional compression artifacts known as ringing and overly sharp the images.
Post-Production Tips
- Reduce video size by using the appropriate media (i.e., web) by cropping video
- Use a good codec
- Use a Variable Bit Rate (VBR) instead of Constant Bit Rate (CBR).
- Lower frame rate if there is not much movement (15-20fps)
Other Alternatives:
- Use Flash movies instead of Flash Video
- Use Captivate instead of Flash Video (Sprite-based animation)
Keeping Audio Synced
- Capture audio at the same time as video, if possible. If video is playing slowly, it will continue to play the the audio and will "drop" frames to keep up.
- Use embedded video only for short video because:
- Flash cannot maintain audio sync for 120 seconds
- The maximum length is 16,000 frames
- File size is increased because it is embedded
- FLV must have same frame rate as Flash file or video will not play at its intended speed.
TIP FROM CLASS AND ADOBE
- You can stop a video from repeating by putting a stop action in the final frame of the video's movie clip timeline.
- The "Save and Compact" option is a good method to shrink the Flash file size.
- Edit your video and audio files through the Adobe Media Encoder to make sure that they aren't too big. You can, for example, use the Encoder to create smaller audio files that you loop to create a longer playing sound.
- There is a LOT to learn about compressing audio and video in Flash, but let's focus on the basics. You can use the FlashVideoFAQ to compare how different compression choices impact the quality of the video in Flash. Flash Video Comparison: http://www.flashvideofaq.com/
- Save your file often and save different versions, because Flash can be "shaky" and unpredictable.
- Name all instances on your stage. Be sure to name your library objects and instances correctly so you can use the AS hints. Name buttons, for example, as btnOn in the library and instances on the stage as on_btn. You will control all action through the instance names.
- Develop your unit a piece at a time. First, add the sound and make sure that your on/off buttons are working. Second, add the volume control. Third, add the video. Then, add code that controls start/stop sound with start/stop video. Continuously use the "check" symbol to check your AS and the formatting symbol to clearly organize your AS. It will help with readability.
- Review the NetStream class for playing external video (http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/net/NetStream.html).
- +++++++ Review Adobe help documentation for controlling video feedback. (http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d4d.html)
- You can have multiple instances of the same FLVPlayback component on the stage. Use the Component Inspector to change the skin and source. Use the instance name to identify your specific FLVPlayback-Video.