7Lesson 7: Video, Audio and Image Techniques

Objectives By the end of this lesson, you will be able to:  2.2.2: Distinguish among and identify the uses and benefits of various graphic file formats, including GIF, GIF89a, JPEG, PNG, TIFF, BMP.  2.2.4: Create and link client-side image maps.  2.2.5: Perform advanced image formatting techniques.  2.2.7: Distinguish between raster and vector graphics.  2.2.8: Scan and edit hard copy sources and images.  2.2.9: Identify steps for creating images, including resolution, format and layers.  2.2.10: Identify benefits and drawbacks of using stock photography.  2.2.11: Create a photo and portfolio management strategy, including online and offline storage, software and services.  2.10.3: Evaluate the benefits and drawbacks of proprietary technologies such as Adobe Flash and Microsoft Silverlight.  2.10.5: Create a basic video file using video capture and editing software.  2.10.6: Insert a video file into a Web page using the HTML5

7-2 Site Development Associate

Pre-Assessment Questions

1. What

2. Which

3. Which syntax is used for defining a circle-shaped hot spot area in an image map? a. coords="x1,y1,x2,y2" b. coords="radius,y1,x1" c. coords="x1,y1,x2,y2,xn,yn" d. coords="x1,y1,radius"

© 2014 Certification Partners, LLC — All Rights Reserved. Version 2.1 Lesson 7: Video, Audio and Image Techniques 7-3

Introduction to Web Video, Audio and Image Techniques A primary ingredient of any successful Web page is well-placed video, audio and images. You have already learned about the video, audio and image file formats used on the Web. In this lesson, you will learn more about techniques used in Web pages, including:

• The

• Animation. You will also learn about several methods you can use to create and edit video and images.

® CIW Online Resources – Movie Clips Visit CIW Online at http://education.Certification-Partners.com/CIW to watch a movie clip about this topic. Lesson 7: Video, Audio and Image Techniques

OBJECTIVE 2.10.6: Inserting video with

NOTE: HTML5 has introduced the

© 2014 Certification Partners, LLC — All Rights Reserved. Version 2.1 7-4 Site Development Associate

Table 7-1: Video elements and attributes

Element or attribute Description

The MP4 video format (MPEG 4 files) is widely used. YouTube recently reformatted most videos away from Flash, which required a plug-in, to MP4. MP4 often uses the H.264 video codec, which is native to most browsers that support HTML5. This codec uses far less processor and battery power because it does not require a plug-in.

The WebM and Ogg video formats are also used. The WebM video format often uses the VP8 codec. VP8 is an open video compression format owned by Google. Ogg uses the Theora format for HTML5 video, which is a free video compression format that can be distributed without licensing fees.

To ensure all browsers and devices can access your video, you should format your video to these three formats and identify them in the element. If that is not possible, then choose one, such as the MP4 format, as the default format.

In the following lab, you will create a video. Suppose your supervisor has decided that a page on the company Web site should be more accessible to visual and auditory learners. She asks you to post a video on the page that shows you talking about the contents of the Web page. You will need to create a video of yourself reading some of the Web page's content.

OBJECTIVE 2.10.5: Creating Lab 7-1: Creating a video videos In this lab, you will create a video of yourself talking about the Habitat for Humanity NOTE: Ensure that you Summer Youth Blitz. have Windows Movie Maker Note: This lab assumes your computer has a built-in Webcam and microphone. If it does installed on your computer. If you do not, modify the lab to select your external devices. not, download and install Windows 1. Create a new folder named Lab_7-1 on your Desktop. Essentials from the Web. 2. Open Windows Movie Maker by selecting Start | All Programs | Windows Movie Maker.

© 2014 Certification Partners, LLC — All Rights Reserved. Version 2.1 Lesson 7: Video, Audio and Image Techniques 7-5

3. Movie Maker: Click the Webcam video button on the toolbar.

4. Webcam video: If prompted, select your video and microphone devices. The Webcam tab will open.

5. Webcam tab: Center yourself in the Webcam screen. Remember to convey a professional appearance. Click the Record button and read aloud the following text while you record yourself:

The Summer Youth Blitz is a unique service experience for a diverse group of youth, ages 16 to 18, from high schools and youth organizations around the United States.

During this program, 15 to 20 youth participants and adult leaders "blitz build" an entire Habitat house in two weeks. Apply now!

6. Click the Stop button. Save the video as webcam.wmv in your Desktop folder Lab_7-1\.

Tech Note: Movie Maker only saves files and exports them as .wmv files (Windows Media Video), which is a Microsoft proprietary video format. In the next lab, you will convert the .wmv file to an HTML5-supported .mp4 file.

7. Movie Maker: Review your video and re-record it if necessary. Only keep one "take" of your video. Delete all the others.

8. Trim the beginning and end of the video by selecting the Edit tab and clicking the Trim tool button. Determine the Set start point and the Set end point to remove any unwanted footage at the beginning and ending of your video. Click Save trim. NOTE: You are welcome to 9. Optional: Add a fade-in and fade-out effect to the video by selecting the Visual experiment with Effects tab. Click the down arrow to the right of the effects. Select Multiple Effects. additional Movie Maker tools, such as In the Add or Remove Effects window, select Fade in from black and Fade out to visual effects and black and Add them, as shown in Figure 7-1. Click Apply. animations.

Figure 7-1: Adding fade-in and fade-out effects in Movie Maker

10. Optional: Add the text "The Summer Youth Blitz" to the beginning of the video and "Apply Now" to the end. Do not spend more than 10 minutes creating the video — it does not need to be perfect. Figure 7-2 shows a sample video.

© 2014 Certification Partners, LLC — All Rights Reserved. Version 2.1 7-6 Site Development Associate

Figure 7-2: Sample video in Movie Maker

11. Movie Maker: Save your project as My Movie.wlmp to the Lab_7-1\ folder on your Desktop. Keep the program open.

12. Select the Home tab and click the Save movie button. Save the video as syb.wmv to the Lab_7-1\ folder on your Desktop.

13. Exit Movie Maker.

In this lab, you created a video for the Summer Youth Blitz Web page.

In the following lab, you will convert this video to the MP4 video format. Suppose your supervisor has asked you to make the video accessible to those with an HTML5- compliant browser that supports the MP4 format.

Lab 7-2: Converting video to support HTML5 formats

OBJECTIVE In this lab, you will convert a .wmv video to an HTML5-supported MP4 video format using 2.10.6: Inserting video with

1. From the C:\CIW\Site_Dev\Lab Files\Lesson07\ directory, copy the Lab_7-2\ OBJECTIVE folder to your Desktop. This directory contains the video converter application. 2.10.5: Creating videos 2. Open the Lab_7-2\ folder and double-click the video-converter.zip file. Extract the video-converter.exe file to the same folder.

Tech Note: If necessary, visit www.videoconverterfactory.com/free-video-converter/and download the program. Other free video converters are available from HAMSTER soft (http://videoconverter.hamstersoft.com/) and freemake.com (www.freemake.com/free_video_converter/).

3. Double-click the video-converter.exe file. This program is called Free Video Converter Factory and has been recommended by Microsoft for converting .wmv to .mp4.

© 2014 Certification Partners, LLC — All Rights Reserved. Version 2.1 Lesson 7: Video, Audio and Image Techniques 7-7

4. Setup: The Video Converter Factory welcome screen appears. Click Next. Accept the license agreement and click Next.

5. In the Select Destination Location window, accept the default settings by clicking Next. In the Choose Start Menu Folder window, accept the default settings by clicking Next.

6. In the Select Additional Tasks window, make sure the Create a desktop icon check box is selected and click Next. Verify the settings in the Ready To Install window and click Install.

7. When setup is completed, a Completing The Video Converter Factory window will appear. The Launch Video Converter Factory check box is selected by default. Click Finish and the program will launch.

8. Before you continue, delete the video-converter.exe and video-converter.zip files from the Lab_7-2 folder. These files are no longer needed.

9. Video Converter Factory: Click the Add button to select a video file to import. You can also select the File menu and choose Add Files. Locate and select the syb.wmv file you created in the previous lab and click Open.

10. In the Profile drop-down menu, select Common Video and select MP4 AVC(*.mp4) H.264 Video configure. The H.264 encoder is required for HTML5 video. NOTE: The Free Video 11. Click the folder icon next to the Output field. Locate and select the Lab_7-2\ folder Converter Factory on your Desktop and click OK. Your screen should resemble Figure 7-3. does not convert all video file formats, including .ogg and .webm. In many cases, vendors require a product upgrade to support additional formats and conversions. Can you locate products that convert video to .ogg and .webm formats?

Figure 7-3: Video conversion from .wmv to .mp4

12. Click the Start button. After the conversion is complete, click Finish.

13. Exit Video Converter Factory.

14. Windows Explorer: Open the Lab_7-2 folder on your Desktop and double-click the syb_(new).mp4 file. It should play successfully using the computer's default video player.

15. Rename the file from syb_(new).mp4 to syb.mp4.

© 2014 Certification Partners, LLC — All Rights Reserved. Version 2.1 7-8 Site Development Associate

16. Close Windows Explorer. NOTE: Several different In this lab, you converted a video file from .wmv to .mp4 format. The MP4 video format is MP4 formats exist, supported by the HTML5

MP4 format with the H.264 codec. This is the codec used by In the following lab, you will embed your video into the Summer Youth Blitz Web page. Apple's mobile Suppose your supervisor has approved the video you created, and now you are ready to devices and insert it on the page. YouTube for video playback.

Lab 7-3: Adding video to an HTML5 Web page

OBJECTIVE In this lab, you will use the HTML5

2. Open the Lab_7-3\ folder and open the lab_7-3. file in a text editor.

3. Add the

text in the article section. The width will be determined by its ratio to the height pixel value (standard 4:3 ratio).

4. Add the default video controls (play, pause, volume, etc.) by including controls="controls" to the

5. Before you add the element, copy the syb.mp4 video from Lab_7-2\ into the Lab_7-3\syb\ folder.

Note: If you did not create a syb.mp4 video in Lab 7-2, then copy the syb.mp4 file from the C:\CIW\Site_Dev\Lab Files\Lesson07\Finished\Lab_7-2 folder.

6. Nest the element within the

7. Add text for browsers that do not support the

8. Your code may resemble the following:

HTML code:

CSS code:

video.center { display: block; margin-left: auto; margin-right: auto; }

9. Save your files and validate both at the W3C validator sites.

© 2014 Certification Partners, LLC — All Rights Reserved. Version 2.1 Lesson 7: Video, Audio and Image Techniques 7-9

10. Browser: Open lab_7-3.html in Chrome. Your screen should appear similar to Figure 7-4.

Figure 7-4: Video embedded using HTML5

If you open a Web page containing the HTML5

Figure 7-5: Browser or browser version that does not support the

© 2014 Certification Partners, LLC — All Rights Reserved. Version 2.1 7-10 Site Development Associate

NOTE: Some browsers and browser versions do not support the MP4 video format. How can Why do you think this issue be overcome with the element? How can it be solved with video some browsers and browser versions do formatting? As mentioned earlier in the lesson, multiple video formats can be not support the identified using the element. All three HTML5 video formats can be created extremely common MP4 video format? and listed (.mp4, .ogg and .webm). Research the issue. 11. If time permits: Add the

12. Close your files and browsers.

In this lab, you used the HTML5

OBJECTIVE As you have learned, HTML5-compliant browsers do not necessarily support all the 2.10.6: Inserting HTML5 video formats. This presents more work for Web developers, who must decide if video with

Table 7-2: HTML5-compliant browser support for HTML5 video formats and codecs

Supported by Browser? Video Format/Codec Chrome IE9 and Safari Firefox and Opera MP4/H.264 Yes Yes No** Ogg/Theora Yes No* Yes WebM/VP8 Yes No* Yes

*Manual installation available **Windows-only manual installation available for Firefox; no manual installation exists for Opera.

The

OBJECTIVE Similar to the

Embedding audio in an HTML5 document requires the following code:

As with the

© 2014 Certification Partners, LLC — All Rights Reserved. Version 2.1 Lesson 7: Video, Audio and Image Techniques 7-11

Multiple sources can be identified with the element to ensure various audio formats are supported. HTML5 supports three audio formats: .mp3, .wav and .ogg.

Not all HTML-compliant browsers support all of these audio formats. Table 7-3 lists the HTML5 audio formats and shows which HTML-compliant browsers support each format. (Information is current at the time of this writing.)

Table 7-3: HTML5-compliant browser support for HTML5 audio formats

Supported by Browser? Audio Format/Codec Chrome IE9 Safari Firefox and Opera MP3 Yes Yes Yes No Ogg Yes No No Yes Wav Yes No Yes Yes

In addition to the controls attribute, several other attributes are common to both the

Table 7-4: Additional

In the following lab, you will add voice-over audio and audio controls to a Web page. Suppose your supervisor has assigned you a new project. A company Web page needs voice-over audio for auditory learners who visit the page. Voice-over audio is necessary because anyone who visits the page could click the play button to hear parts of the Web page read aloud, not just users who require screen-reader software.

Lab 7-4: Adding audio to an HTML5 Web page

OBJECTIVE In this lab, you will use the HTML5

Note: You can also use your final Lab 7-3 files. However, you must copy the voiceover.mp3 file from the C:\CIW\Site_Dev\Lab Files\Lesson07\Lab_7-4\syb\ folder into your existing Lab_7-3\syb folder. You can rename your Desktop Lab_7-3 folder and lab_7-3.html file to Lab_7-4 and lab_7-4.html, respectively, to better follow the lab steps.

2. Open the Lab_7-4\ folder, and then open the lab_7-4.html file in a text editor.

3. Add the

section.

© 2014 Certification Partners, LLC — All Rights Reserved. Version 2.1 7-12 Site Development Associate

NOTE: 4. Add the default audio controls (play, pause, volume, etc.) by including Are there other controls="controls" to the

8. Your code may resemble the following:

HTML code:

For audio of this Web page, use the audio controls below.

CSS code:

audio.center { display: block; margin-left: auto; margin-right: auto; }

9. Save your files and validate both at the W3C validator sites.

10. Browser: Open lab_7-4.html in Chrome. Your screen should appear similar to Figure 7-6.

Figure 7-6: Audio embedded using HTML5

11. Editor: Notice that the audio controls overlap the text on the page. Fix this issue by extending the height of the