Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Encoding audio formats with VLC

From: HTML5: Video and Audio in Depth

Video: Encoding audio formats with VLC

To create our audio files, we are going to use a program called VLC. VLC is a free media player that can play just about any type of file and we can also use it for encoding our audio files. First you will need to download and install VLC, which you can find at http://www.videolan.org/vlc. All right, when we open VLC we are presented with the media player and the first thing we need to do is open the file that we want to encode. So I am going to open our audio source which is in our _audio assets folder and it's our podcast-audio.mov.

Encoding audio formats with VLC

To create our audio files, we are going to use a program called VLC. VLC is a free media player that can play just about any type of file and we can also use it for encoding our audio files. First you will need to download and install VLC, which you can find at http://www.videolan.org/vlc. All right, when we open VLC we are presented with the media player and the first thing we need to do is open the file that we want to encode. So I am going to open our audio source which is in our _audio assets folder and it's our podcast-audio.mov.

(Music playing) And you can see it starts playing that as if we want to listen to it, but we don't right now. What we want to do is to go under the File menu and select the Streaming/Exporting Wizard. We will open that up and now we are basically taking through a step by step process to create the files that we want. The first step is to select Transcode/ Save to file and click Next and then select in our Existing playlist, we find our podcast-audio movie. So we will choose the first one in the list and then check the audio checkbox for Transcode audio and the first source we are going to do is actually the MP3 source, so we will go ahead and leave it set to MP3 and 192 is actually a good bit rate for web video playback.

So we will leave that at 192. All right, then we will click Next. Now the output format, it says here the Encapsulation format. It's also the container format that we talked about before and for the MP3 we are going to select the RAW container format, because remember I said that the MP3 format is the one that doesn't actually have a container format. So we use the RAW format here then click Next. Then we are going to choose a folder to put it in, so we are going to use the encoded folder inside of our _audio assets folder,just like we did with video, and save it there and I am going to call it podcast-audio.mp3.

Now it's going to yell at us and says it doesn't want to use the mp3 extension for the RAW format. So for now we will just say use .raw, then actually in this save file dialog box we can change it from .raw to .mp3 and it will keep that for us. So let me click Next and it gives us a summary of all the settings, which all look right so I am going to click Finish. It's going to look like it's playing it, but what it's actually doing is encoding the file and now it's done. And if we go over to our folder and look in our _audio encoded folder, I am going to see we now have our podcast-audio.mp3 file there. Great! That worked.

Let's go and create our other two versions which we can do both in VLC. We will go back up to our Streaming/ Exporting Wizard. Transcode/Save to file, Next, and the same source file, click Next, and we have Transcode audio, and for this one we need to do MPEG 4 audio and this is going to be our aac format. Let's click MPEG 4 audio and keep the Bitrate at 192 and then click Next, and then for our Encapsulation or container format we are going to select the MPEG 4/MP4 format and we will choose the location, and it already has the location of our last one so actually I can just go over here and change the extension to what we want it to be and that's m4a.

That is our podcast audio m4a. All right then we can click Next. It gives us a summary again. And click Finish and it's encoding it and we can see it has already created in that folder. All right! One more time let's do this for our OGG format. So Files > Exporting Wizard, Transcode, select the source, and now for the Codec we want to select Vorbis. Vorbis is our audio codec for OGG Vorbis format and we can keep it at 192 bit rate and click Next and we will have one option for the container format, OGG.

So that's easy and then we can change the extension and our output name and that will be .oga and click Next. Get a summary and click Finish and it's creating that format. You can see it's already created it and it's building it in our folder. Now we have our three versions. Let's go ahead and plug those into our code. Go back to our text editor and scroll down to our audio tag. We can plug in the two versions that we need and they are now in the encoded folder.

I will do that for both sources and save that and so now the m4a version should play in Safari, while the OGG version should play in Firefox. So let's open up Safari first and reload the page and scroll down to our audio and play that. (Music playing) All right! And we can see that worked. So let's go over and make sure it worked in Firefox. I am going to open up our Podcast page, reload.

(Music playing) All right. It shifted down there because of the Firefox issue that kind of puts space above the audio player, but the audio file worked and so those two versions worked. Let's go ahead and try the mp3 version just to make sure that worked in case that's the version you want to use. So I am going to replace the m4a with mp3 and open Safari again, reload and play that. (Music playing) So that's working as well. Okay, so all the audio formats work and with that now we know how to create all the audio and video files we need for HTML5.

Show transcript

This video is part of

Image for HTML5: Video and Audio in Depth
HTML5: Video and Audio in Depth

37 video lessons · 14782 viewers

Steve Heffernan
Author

 
Expand all | Collapse all
  1. 1m 24s
    1. Welcome
      42s
    2. Using the exercise files
      42s
  2. 15m 18s
    1. Understanding HTML5 video and audio
      4m 46s
    2. The state of HTML5 video and audio
      4m 29s
    3. Understanding the format war
      3m 53s
    4. Configuring your server to deliver HTML5 media formats
      2m 10s
  3. 32m 36s
    1. Using the video and audio tags
      5m 34s
    2. Using multiple sources for browser compatibility
      5m 53s
    3. Preloading
      4m 16s
    4. Autoplaying
      2m 2s
    5. Looping
      5m 11s
    6. Setting a poster frame
      3m 43s
    7. Setting the video width and height
      3m 40s
    8. Displaying subtitles and captions
      2m 17s
  4. 12m 40s
    1. Falling back to Flash
      4m 4s
    2. Falling back to download links
      6m 21s
    3. Using an embed code builder
      2m 15s
  5. 22m 17s
    1. Understanding HTML5 video formats
      5m 10s
    2. Understanding HTML5 audio formats
      2m 57s
    3. Encoding MP4/H.264 video with HandBrake
      3m 13s
    4. Encoding Ogg, Theora, and WebM with Firefogg
      3m 18s
    5. Encoding audio formats with VLC
      5m 54s
    6. Automating video and audio encoding
      1m 45s
  6. 34m 59s
    1. Setting up the JavaScript
      4m 39s
    2. Creating Play and Pause buttons
      7m 52s
    3. Creating a Play Progress bar
      5m 49s
    4. Creating a Load Progress bar
      9m 29s
    5. Creating a Current Time and Duration display
      7m 10s
  7. 4m 37s
    1. Overview of known issues
      35s
    2. Autobuffer or preload?
      56s
    3. Load progress in Firefox 3.6
      41s
    4. Android 2.0 issues
      1m 5s
    5. iOS 3 issues
      1m 20s
  8. 2m 8s
    1. Flight of the Navigator
      50s
    2. ZEN Audio Player by simurai
      34s
    3. The Wilderness Downtown by Google and Arcade Fire
      44s
  9. 1m 40s
    1. Further exploration
      1m 40s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed HTML5: Video and Audio in Depth.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.