1. Trang chủ
  2. » Công Nghệ Thông Tin

Learning Flash CS4 Professional phần 9 pps

40 225 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 40
Dung lượng 0,93 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Editing a Sound Flash lets you do some basic volume and pan editing without having to use an external editor.. For example, you can mix 32 discrete audio channels, set the volume and pan

Trang 1

Timeline Use

Chapter 12, Audio 293

The Sound Settings dialog (Figure 12-3) offers access to the same

compres-sion algorithms available on a per-file basis The Default per-sound option,

which specifies that these global settings should be used for a specific sound,

has been replaced in Publish Settings with Disable This option disables all

sound in the SWF and is useful for testing or creating alternate versions of

your file with no audio

Compression options for internal sounds applied file-wide

Figure 12-3

At the bottom of the Publish Settings section (refer back to Figure 12-2), you

can choose to override the sound settings When you enable the Override

sound settings option, Flash will override the per-asset sound settings and

apply the global Publish Settings instead This is useful for creating a

low-quality alternate version of your file You can also use this option to speed up

SWF compilation during testing by switching to a Fast quality setting When

you’re finished with development and ready to publish your final file, you can

disable the override option, and the per-sound settings will be reapplied

Finally, you can enable the Export device sounds option to support Flash Lite

development, not covered in this book

Timeline Use

Adding sounds to the Timeline is very easy Select the frame in the Timeline

in which you want the sound to play, and choose any imported sound from

the Name property in the Sound section of the Properties panel (Figure

12-4)

A waveform representation of the sound will appear in that frame or span

of frames During playback, anytime the playhead is in contact with a

frame with sound in it, that sound will be played The Sync property in the

Properties inspector (described in the next section) controls how the sound

is played and when it stops

Because the normal layer height makes this waveform difficult to see, you can

increase the height of specific layers Double-click the layer icon to open the

N OT E

For more information about Flash Lite, visit http://www.adobe.com/products/ flashlite/.

The Sound section of the

Figure 12-4

Properties panel

Trang 2

Stream sounds begin playing after just a few frames of data have been downloaded They are best for long sounds and are well suited for anima-tion soundtracks because Flash attempts to keep the Timeline and sound synchronized You can also scrub through a stream sound and hear pieces

of it in authoring mode

Event

Event sounds must be fully downloaded and play through to completion

no matter what For example, if a one-second sound ordinarily requires

24 frames to play through to completion, an Event sync type will cause that sound to play until complete, even if only allocated one frame This is important because this sync type is used to play sound effects that often occur in very short frame spans, and the sound must be allowed to finish

A sound effect in the Down state of a button, for example, would likely only occupy one frame, leaving only 1/24th of a second to play a sound Sound effects also usually need to play every time they are requested, making the prospect of waiting for the sound to finish problematic For this reason, the Event sync type will play a new instance of the sound even if the prior instance is still playing If not used carefully, this can result in a chaotic din of sound and eat up memory quickly, as in the case

Increasing layer height to

Figure 12-5

increase the scale of a displayed sound

wave

WA R N I N G

The large variance in computer

proces-sor power, quantity of RAM, bus speeds,

video card performance, and connection

speeds (among other contributing

fac-tors) makes synchronizing audio with

animation in Flash as much an art

as a science When planning

synchro-nized sound, aim for the lowest common

denominator among minimum system

requirements, and test early and often.

N OT E

If you accidentally play a long sound set

to the Event sync type, press the Escape

key on your keyboard to stop the sound

Trang 3

Editing a Sound

Chapter 12, Audio 295

Start

The Start sync type is similar to Event in every respect but one If the

play-head returns to the frame before a prior instance of the sound is finished

playing, it will not play another instance of the sound

Stop

The Stop sync type silences the specified sound This will even work on

Event sounds that are designed not to stop until they are finished playing

Repeating and Looping

With a sound frame selected in the Timeline panel, you can loop a sound or

repeat it a finite number of times by using the menu and repeat count input

below the Sync menu (Figure 12-7) Loop will show no visual change in the

Timeline, but will loop the sound as long as the playhead is in contact with

the frames in which the sound resides Repeat will play the sound again as

many times as you specify using the repeat count It will also repeat the

wave-form in the Timeline a corresponding number of times (Figure 12-8)

A repeating sound displayed in the Timeline

Figure 12-8

Editing a Sound

Flash lets you do some basic volume and pan editing without having to use

an external editor The Effect menu in the Properties panel contains a list

of preset effects, including confining the sound to the Left channel or Right

channel, channel panning options (Fade to left and Fade to right), and

multi-channel volume fades (Fade in and Fade out) You can also edit any of these

options or assign a custom option to edit an effect from scratch

Setting Volume and Pan

When you choose Custom from the Effect menu or edit a preset, the Edit

Envelope dialog opens Figure 12-9 shows the dialog with the Fade Out

pre-set To edit the volume or pan of the sound, first click on the horizontal line

that runs across the waveform to add a handle In stereo sounds, a handle will

be created in both the left (top) and right (bottom) channels In any

chan-nel, you can then drag the handles down or up to reduce or increase volume,

respectively

N OT E

The companion website for this book includes sample source files that demon- strate all four sync types

recom-is looped.

Trang 4

Editing a Sound

Figure 12-9 Fading a sound in the Edit Envelope dialog

Figure 12-9 shows a reduction in volume at the end of the sound, as both channels fade to 0 Figure 12-10 shows a change in pan as the sound moves from the left to right channels The volume is decreased in the left channel and simultaneously increased in the right channel

Figure 12-10 Panning a sound from left to right

During editing, you can test your work without leaving the dialog or testing your movie Simply use the stop and play buttons in the lower-left corner of the dialog to audition your effect No changes are made to the original file, so

Trang 5

ActionScript Use

Chapter 12, Audio 297

In the lower-right corner of the dialog, you can zoom in and out of the

wave-form (clicking the magnifying glass icons) and switch between a time-based

(watch icon) or frame-based (movie icon) display The latter two options

change the horizontal numbered strip between the channels to show either

frames or seconds In Figure 12-9, for example, the sound starts to fade at three

seconds, and is muted by the fourth second

Using an External Editor

Flash even provides a convenient workflow for editing your sounds in an

external sound editor Control+clicking (Mac) or right-clicking (Windows)

on a sound asset in the Library displays a context-sensitive menu that

reveals editing options Figure 12-11 illustrates your editing choices: the

cross-platform, open source editor Audacity; an editor you select on the fly; or

Adobe Soundbooth, an entry-level sound editor targeted at Flash users

When you select one of these options, the sound opens in the selected

exter-nal editor so you can then edit the file When you save the file, it will

auto-matically be updated in Flash

ActionScript Use

Using ActionScript, you can exert much greater control over sound than you

could if it were a part of the Timeline For example, you can mix 32 discrete

audio channels, set the volume and pan of each sound, and query the

ampli-tude of the left and right stereo channel of every sound

Playing a Library Sound

Playing an embedded sound from the Library is very similar to adding a

symbol instance to the display list The process begins by assigning the sound

a Linkage class (Figure 12-12)

Assigning a sound’s Linkage class

Figure 12-12

Create a new file using File

proj-ect, so the book template is not needed

Trang 6

ActionScript Use

Select the

3 beep.wav sound in the Library and click the Properties

but-ton (the i icon at the bottom of the Library panel) to open the Sound

5 Export for ActionScript option and enter Beep in the Class

field Note that the class you are creating extends the Sound class, so the

Beep class will behave like a sound in many respects

Add the following script to the first frame of the Timeline and test your

6

movie:

var beepAlert:Beep = new Beep();

beepAlert play ();

Your file should play a short beep sound from the embedded beep.wav file If

needed, compare your file with the furnished play_embedded_sound.fla file.

Playing an External Sound

In addition to playing embedded sounds, you can load external audio files to play at runtime This is advantageous for many reasons, including reducing SWF file size and making it easier to edit, update, or replace the external file.The following exercise will span the next three sections of this chapter, add-ing functionality to your script as the chapter progresses:

Create a new file using File

proj-ect, so the book template is not needed

Save the file as

the companion source file song.mp3 into the same directory.

Type the following script into frame 1 of the FLA:

5 channel: SoundChannel = new SoundChannel ();

Save and test your movie It will play the external audio file

Trang 7

ActionScript Use

Chapter 12, Audio 299

snd addEventListener ( Event.COMPLETE , onSoundLoaded);

function onSoundLoaded(evt: Event ): void {

channel = snd play ();

}

Now when the sound finishes loading, the complete event will be dispatched

When the event is received, the sound will play again from the beginning,

into the same channel

With regard to line numbering, the next two sections of this exercise assume

this option was not added If you chose to play the sound upon loading,

adjust your file’s line numbers accordingly

Setting Volume and Pan

You set the volume of a sound using a range of 0 to 1 A value of 0 mutes a

sound and a value of 1 sets the sound to full volume The pan of a sound is set

using a slightly different scale, from –1 to 1 The sound pan can be centered

(0), entirely in the left channel (–1), or entirely in the right channel (1)

Continue with the previous example and add the following code to the

2 volume and pan are properties of the SoundTransform class To change

either value, you must first create an instance of the class One way to

accomplish this is by using the new keyword, shown in line 7 This

cre-ates a neutral instance with default values of full volume and center pan

After altering these values (to half volume in line 8 and full-left pan in

line 9) you must then apply the transformation to the sound channel’s

soundTransform property (line 10) Without this final step, you are only

adjusting the SoundTransform instance, not the sound channel itself

Save and test your movie This time, the sound will play at half volume, in

3

the left stereo speaker only

Visualizing Volume

The final topic covered in this chapter lets you visually represent the volume

of an audio file during playback Two properties of the SoundChannel instance,

leftPeak and rightPeak, contain the volume of the left stereo channel and

right stereo channel, respectively (when analyzing monaural sounds, both

values are equal)

N OT E

An alternative approach to creating a

SoundTransform instance is to query the

soundTransform property of a sound, as

Trang 8

Project Progress

In this example, two circles that represent left and right stereo speakers will expand and contract with the sound channel’s volume during sound playback:

Continue with the previous example Using the Oval tool, draw a circle

1

on the Stage

Select the circle with the Selection tool and convert it to a movie clip

2

(Modify→Convert to Symbol) Name the movie clip speaker and choose

a center registration point

Copy and paste the on-Stage instance of the

one speaker an instance name of leftSpeaker and the other an instance name of rightSpeaker

Add the following code to the script in frame 1, save your work, and test

13 onLoop(evt: Event ): void { leftSpeaker.

14 scaleX = 1 + channel leftPeak ; leftSpeaker.

15 scaleY = 1 + channel leftPeak ; rightSpeaker.

16 scaleX = 1 + channel rightPeak ; rightSpeaker.

17 scaleY = 1 + channel rightPeak ; }

18 This script creates an event listener that listens for an enter frame event (lines

11 and 13) and adjusts the scaleX and scaleY of each speaker based on the volume of the sound channel’s left and right stereo channels, respectively Instead of setting these properties to the leftPeak and rightPeak values directly, they are added to a value of 1 This prevents the speakers from shrinking, possibly to a scale of 0, during quiet portions of the audio That is, rather than displaying scales that correspond with volumes of 0, 0.5, and 1, the resulting scales are 1, 1.5, and 2 When the volume is muted, the speaker size

is 100%, and at full volume the speaker size is 200%, or double the original dimensions

Project Progress

In this chapter you will add the ActionScript required to activate the sound controller widget of the portfolio project

Scripting the Sound Controller

In prior chapters, you created the sound controller and integrated it into the master project file The following script will load an external MP3 file, toggle between playing and disabled states, and visualize the amplitude of the left

N OT E

The term “channel” is necessarily used

in two contexts in the discussions in this

chapter First, stereo playback is achieved

by dividing the sound data into left and

right channels, while monaural sounds

have no such separation Second, every

sound, whether stereo or mono, is played

into its own discrete sound channel for

mixing purposes Each file can have 32

individual sound channels, and one

mas-ter mixing channel, similar to a mixing

desk that you might see in a recording

studio.

These two uses of the word “channel”

are not the same For example, your file

can have 32 channels of sound, all of

which are in stereo This does not create

64 channels of sound because you can’t

manipulate the left and right stereo

divi-sions of an audio file independently.

N OT E

This book’s companion volume, Learning

ActionScript 3.0: A Beginner’s Guide

(O’Reilly), includes an example that

visualizes the entire frequency spectrum

of a sound, drawing waveforms during

playback.

Trang 9

Project Progress

Chapter 12, Audio 301

Open your master portfolio FLA and add the following script to the frame 99

of the actions layer Frame 99 is the last intro frame (prior to the Home screen)

and initializes both the navigation and sound controls:

Lines 1 through 5 load and play a sound, as described in the “Playing an

External Sound” section, earlier in this chapter The only difference here is

that, for the portfolio project, you are placing the sound file in your external

assets directory, with the other external assets used throughout the book.

Lines 7 through 11 visualize the volume of the sound’s left and right stereo

channels To understand how this script works, it helps to recall the structure

of the sound controller movie clip from Chapter 3 It has an instance name

of soundControl and contains two child instances of a volume meter, one for

each channel, named lPeak and rPeak Within the meter is another movie clip

named barMask that sits in a mask layer By manipulating the scaleX property

of the mask movie clip (lines 9 and 10), you expose different widths of the

meter, and therefore different temperatures of color, during sound playback

Every enter frame (lines 7 and 8), the leftPeak and rightPeak properties return

a percentage value, between 0 and 1, of the full volume of each channel

When playing relatively quiet sounds, your visualization meter may appear a

bit listless If you want to liven things up a bit, you can increase the effect the

actual peak values have on your artwork Simply multiply the values of the

leftPeak and rightPeak properties by an adjustment factor, as seen in lines 9

and 10 For example, these lines multiply low-level settings of 0.1 by 4 to become

0.4 The larger values increase the widths of the masks, showing larger meters

Lines 13 through 20 toggle the sound playback states With every mouse

click (lines 13 and 14), a simple test is performed If there is any volume in

the left channel, the sound is stopped If the left channel is silent, the sound

is played again from the beginning This basic script lets you turn the sound

on and off

N OT E

The conditional test in the function

onSoundToggle() relies on the volume

in the left channel for simplicity, so it’s not well suited to sounds with lots of quiet passages The companion website demonstrates other techniques for turn- ing sound on and off.

Trang 10

Project Progress

The Project Continues

In the next chapter, you will encode video, review its use in the project’s Gallery screen, and learn ActionScript alternatives for displaying and control-ling video in your own files

Trang 11

13CHAPTER

Introduction

Whether you realize it or not, Flash has become the most widely used video

playback platform on the Web, and it is becoming more and more common in

the distributed desktop video playback market According to Nielson’s online

video ratings, YouTube alone, which uses Flash Player, accounted for over 5

billion streams, and more than 77 million unique visitors just in the month of

July 2008 Add in just a handful of other top video sites that use Flash, such

as Nickelodeon, Disney, Hulu, and CNN, and it’s easy to see how ubiquitous

Flash video has become

The number of streams, or even unique visitors, isn’t really the most telling

statistic, however According to August 2008 data compiled by independent

research firm comScore (commissioned by Adobe), Flash Player is used to

view 86% of online videos in the United States, and 80% of online videos

worldwide, making Flash the number one technology for viewing video

online

Why is Flash video so omnipresent? The main reason is that it uses Flash

Player and doesn’t require any additional installation just for viewing video

Depending on which version of Flash Player you’re considering, up to 99%

of all online users have Flash Player already installed on their systems It is

also operating system–neutral, making development for the platform much

simpler and more economical

A particularly good reason, however, for the popularity of Flash video is that

it’s easy for everyone—not just experienced video professionals—to create

and use This chapter will show you how to prepare video for Flash delivery

and also how to add it to your files Adding a video to your Flash projects

can be as simple as dropping a component onto the Stage, or as dynamic as

necessary through ActionScript control

vIdeo

IN THIS CHAPTER

Introduction Video FormatsEncoding SoftwarePlaying Video with the FLVPlayback Component

Full-Screen VideoCaptioning VideoStreaming Versus Progressive

Download Embedding Videos in a SWF

Project Progress

Trang 12

Video Formats

Video Formats

Before you can use video in Flash, a little preparation is required In addition

to any editing that you might have to do to make your videos suitable for distribution, you will also have to encode, and most likely compress, your files into a Flash-compatible format

Although the terms encoding and compression are often used interchangeably,

there is a difference between the two In simple terms, encoding is translating

information from one format to another In the video world, this might refer

to converting from analog to digital, or translating from one digital format into a more appropriate specification needed for the job

Compression, on the other hand, is the process of reducing the size of an asset

Compression and decompression algorithms (codecs) are used to reduce file size during authoring, and decompress at runtime for optimal performance and visual quality The reason encoding and compression are sometimes used interchangeably is because most video is compressed during encoding However, it is not uncommon to work with uncompressed video, particularly during editing

When used in Flash, uncompressed video is not a practical reality, so video is both encoded and compressed into two primary formats:

FLV

FLV is a proprietary format that can be used by Flash Player version 6 and later The audio in FLV files is usually compressed using the MP3 codec, but use of uncompressed audio is also possible Video can be compressed using one of two codecs: Sorenson Spark (H.263), available for Flash Player versions 6 and later, and On2 VP6, available for Flash Player ver-sions 8 and later

Which video codec you choose is typically based on need Within Flash, On2 VP6 is considered by most to deliver better quality than Sorenson Spark at the same data rate It can also encode alpha data for runtime compositing effects like chroma key (green screen), in which videos have a transparent background and can be blended with dynamic backgrounds However, On2 VP6 is more processor-intensive, making Sorenson Spark a favored codec for older or less powerful computers

F4V

The latest versions of Flash Player, beginning with version 9 update 3 and later, can also use the H.264 codec for video and the AAC codec for audio These are the codecs used for MPEG4 video—commonly used by later generation iPods and most other recent hardware and software vendors for audio and video playback

Trang 13

Encoding Software

Chapter 13, Video 305

Although these files are typically referred to as F4V files, Flash does not

rely on the extension of the file for playback As such, other files that have

been properly encoded using H.264 and AAC, such as QuickTime movies,

can also be handled by Flash Player 9 Update 3 and later

Encoding Software

There are numerous software packages available to encode video into

Flash-compatible formats This chapter will focus on three Developed by the

inven-tors of FLV codecs, Sorenson Squeeze and On2 Flix are both commercial

products that offer commercial-grade versions of their codecs Adobe Media

Encoder ships with Flash CS4 Professional and will be discussed in greater

detail

On2 Flix

Flix from On2 (http://www.on2.com/) comes in Standard, Pro, and Exporter

configurations The Standard model is a great economical encoder that

encodes FLV for Flash video and FXM for JavaFX video It supports constant

bitrate encoding, one-pass variable bitrate encoding, input for a wide variety

of original sources, and output using both FLV and SWF formats

The Exporter is a QuickTime extension that supports exporting from

QuickTime-savvy applications such as Apple FinalCut Pro, Adobe AfterEffects

and Premiere, and Apple iMovie and QuickTime Movie Player It supports

most of the Flix Standard features, as well as two-pass VBR encoding and

alpha channel support

The Pro version offers all the features of the Standard version plus two-pass

encoding, high-definition (HD) output, support for cue points (markers that

can be used for seek points and to trigger events using ActionScript), alpha

channels, and batch encoding, and an HTML/player configuration that

out-puts final player files at the click of a mouse It also supports a really cool

feature that vectorizes your video during encoding This creates vector shapes

from every pixel-based video frame, a technique used in recent commercials

and feature films such as A Scanner Darkly.

Using Flix Pro (Figure 13-1), you can specify video and audio compression

settings, save and load setting presets, trim the video by setting in and out

points, add overlays (for logos and similar needs), deinterlace interlaced

sources like MPEG and DV, apply image filters (like brightness, contrast, hue,

and saturation), apply noise reduction, and more

N OT E

As the name implies, constant bitrate

(CBR) transfers a constant number of bits of data every second Variable bitrate

(VBR) encoding, on the other hand, adjusts the data transfer as the encoding progresses in an attempt to juggle maxi- mal quality and minimal file size The process encodes larger amounts of data when the video changes substantially from frame to frame, and encodes less data when the changes between frames are subtler

Using VBR, encoding can be completed

in one pass or two In the latter case, the first pass is used to analyze the file and the second to encode based on the data gathered in the prior pass The two-pass method usually yields better results, but can also take much longer.

Trang 14

Squeeze has a customizable interface (Figure 13-2) and also includes tional cool features like batch encoding; drag and drop; a watch folder feature (which will watch for and automatically compress any files dropped into a specific folder); the ability to digitize video; watermarking, hue, saturation, sharpen, and other filters; CBR and one- and two-pass VBR encoding; high-definition (HD) output (including Blu-Ray); and more.

Trang 15

addi-Encoding Software

Chapter 13, Video 307

The Sorenson Squeeze main interface

Figure 13-2

Adobe Media Encoder

The Adobe Media Encoder ships with Flash CS4 Professional and is both

feature-rich and simple to use It supports encoding to a wide variety of

video formats including QuickTime, MPEG2, MPEG4, and H.264, as well as

audio-only formats (AIFF, WAV, MP3) and Blu-Ray high-definition versions

of MPEG2 and MPEG4 For use with Flash, the application can encode to

FLV with both Sorenson Spark and On2 VP6, as well as to F4V using H.264

and a wide variety of other codecs for use in non-Flash-related video work

It supports audio and video settings, filters, cue points, trimming with in

and out points, cropping, batch encoding, and even FTP features that let you

upload your finished files to a server

This section will go through the basics of using Apple Media Encoder, so

you may want to open the application and locate the scaly_vid.mov furnished

source file to encode your own video in the process Where applicable,

encod-ing instructions like the first few followencod-ing this paragraph will run

through-out this section If you choose not to encode your own file, feel free to skip

them as you work through the material

Trang 16

Encoding Software

The first task in encoding a video is adding a file to the encoding queue Launching the application will display a basic screen (Figure 13-3) that allows you to add one or more files for encoding If you wish to try Adobe Media Encoder for yourself, start by adding a file

Adding a video in

Figure 13-3 Adobe Media Encoder

Click Add in the upper-right corner of the application

1

Locate the

Click Open in the file browser dialog to add the video to the encoding

3

queue

You can choose an encoding format, apply encoding presets, and set the

4

destination path for each video right from the encoding queue However,

we will take a more detailed look at each available option, so with the video selected, click Settings to open the Export Settings window (Figure 13-4)

Trang 17

Encoding Software

Chapter 13, Video 309

Figure 13-4 Configuring export settings in Adobe Media Encoder

The Export Settings window is the primary Adobe Media Encoder interface,

and is divided into quadrants The upper-left corner is the source and output

preview area This is where you crop the video and preview a sample frame

using the application’s current settings The lower-left corner is where you

trim the video to a smaller running time and add cue points

The lower-right corner is where you apply all other settings, and the

upper-right corner is where you select presets from menus and enable or disable

video or audio encoding It also summarizes the major settings for at-a-glance

updates

Before moving on, choose the

As a starting point, choose the second option from the encoding

menu, FLV – Same As Source (Flash 8 and Higher).

By default, the output file will be saved in the same directory as the source

7

file If you want to change this directory, click on the Output Name link

and specify a new location

Make sure

8 Export Video and Export Audio are enabled

The tabs in the lower-right corner of the interface allow you to

custom-ize your encoding settings For Flash video, the Format tab lets you switch

Trang 18

The Video tab is where you pick a codec and customize its settings These are the first settings you’re likely to customize.

Frame Rate.The Bitrate Settings let you set the Bitrate Encoding to constant bitrate encod-ing and one- and two-pass variable bitrate encoding You can also set a cus-tom Bitrate When you choose two-pass VBR encoding, you can set a target bitrate, minimum and maximum bitrate limits, and the degree to which the bitrate can vary from the target setting

Finally, the Advanced Settings provide optimization options beginning with how often a key frame is created (Set Key Frame Distance) Unrelated to ani-mation key frames, a video key frame is a forced, high-quality frame that is used to refresh the video display It is usually best to let the codec work its magic here, but if you are having problems with visual artifacts, particularly when compressing your source very aggressively, you can manually insert

a key frame every nth frame to try to improve the appearance of the frame

periodically

Simple Profile, available only when encoding with On2 VP6, will optimize encoding for playback on less powerful machines Undershoot, also available only when encoding with On2 VP6, lets you set a percentage of the target data rate to strive for, so that you can leave a little room for extra data to be allocated to sections of the video that are difficult to compress

Finally, Quality allows you to strike a balance between how good the file will look and how long it will take to encode Best yields the best results using the longest encoding time, Speed sacrifices a bit of quality for a faster encoding time, and Good falls somewhere in the middle

Continuing the example exercise, change the following video settings:

Configuring video settings in

When choosing how often to insert a

key frame, remember that high-quality

frames increase the size of the final

output file Furthermore, if you’ve set a

maximum data rate for the video, adding

key frames can reduce the overall

qual-ity of the entire video because the

high-quality frame reduces the amount of data

available for the surrounding frames Try

to use key frames only when needed, as

evidenced by trial and error.

Trang 19

Encoding Software

Chapter 13, Video 311

For Bitrate Settings, select VBR for

and 300 kbps for Bitrate, and accept the default minimum, maximum,

and variability bitrate encoding percent target values of 80, 120, and 80,

respectively

For Advanced Settings, disable

set the Undershoot (% target) to 90, and select Good Quality

Audio settings

Using FLV, you don’t have many choices for the audio settings (Figure 13-6)

because FLV uses the MP3 codec when compressing audio

Configuring audio settings in Adobe Media Encoder

Figure 13-6

In the Basic Audio Settings section, choose

For Bitrate Settings, select a

Trimming

Although you don’t need to trim the sample video, you can quickly learn

how to reduce the playing time of a video at encoding time without having

to return to your video editor

At the top of the lower-left quadrant of the interface are the trimming

controls (Figure 13-7) A horizontal bar representing the length of the video

anchors these controls

Setting In and Out points in Adobe Media Encoder

Figure 13-7

Trang 20

Encoding Software

By default, the bar is orange all the way across However, you can drag the right-angle triangles at left and right below the bar to set the in and out points of the video, respectively These controls will make a new video with

a shorter running time that starts at the in point and ends at the out point You can preview frames before setting the in or out points by dragging the playhead wedge above the bar

You can also click the orange time link to set a time-accurate position in the video The time units are separated by semicolons and are, from left to right, hours, minutes, seconds, and frames The latter will change based on the frame rate you specified in the Basic Video Settings

Once you’re displaying the time you like, you can click the right-angle angle buttons to the right of the time control; these correspond to the in- and out-point draggable markers, and clicking these buttons will automatically set the points for you

tri-The drop-down menu to the right of the trimming time and in/out buttons

is not related to trimming the video length Instead, it is situated below the video preview frame and controls the size of the preview

be slightly less accurate

Event cue points are used to trigger events in ActionScript, allowing you to synchronize surrounding assets with the video playback Navigation cue points can trigger events in ActionScript as well but also insert key frames into the video so you can jump to a specific time during playback Because key frames can increase file size or reduce the overall quality of the video, use navigation cue points only when required for seeking at runtime

To practice, you’ll add two cue points, which appear in the lower-left corner

of Figure 13-4 If you prefer to use a furnished data file, click the folder ton just above the Cue Points area and find the scaly_vid_cue_points.xml

but-file supplied with the companion source but-files This will import the but-file and prepopulate the cue point data

Ngày đăng: 09/08/2014, 11:20

TỪ KHÓA LIÊN QUAN