Video tutorial: producing H.264 video for Flash Distribution with Sorenson Squeeze

This is the second in a series of video tutorials on producing H.264, in this case detailing how to do so using Sorenson Squeeze.

Here's someĀ  background information explaining some of the encoding decisions made in the tutorial. First, the project involved a concert produced solely for streaming, so I shot in progressive mode. Hence no de-interlacing. Since music was involved, I encoded in 128 kbps stereo, where usually I produce in mono at 64 kbps or less.

I was producing for Flash distribution, so I encoded using H.264 and chose the F4V extension, rapidly becoming the standard for H.264 Flash output. The video will be distributed via progressive download (hence multipass encoding) solely to computers, and is not targeted at iPods or other devices. For this reason, I use H.264's high profile. Had I wanted to produce a file that would load on an iPod, I would have used the Baseline profile. Of course, had I been producing for a streaming server, I likely would have produced in CBR mode, though that's not essential.

If all this sound totally foreign to you, check out the streaming media primer, here, and the Producing H.264 Video for Flash: An Overview, here:


Comments (12)

Said this on 06/23/2009 At 02:51 pm
Final quality is fantastic ! Some questions :
1/ What is the need of 3rd pass when using Mainconcept ? Have you seen significant enhancements over 2pass mode ?
2/ Does Sorenson plan to use CUDA capabilities ? Because transcoding process is really slooow, using CPU a lot (C2D E8400 with Squeeze 5.1 Pro for Flash)

Thank you.
Said this on 06/23/2009 At 06:18 pm
I can't find where to change H264 level. When I choose High profile, level is 3.0. Guess whatever the profile, level will always be 3.0 ...
Jan Ozer
Said this on 06/23/2009 At 10:11 pm
1. Not sure what the point of the third pass is, but multipass is the highest quality option.

2. Not sure on the CUDA, I'll ask Sorenson and see what they say.

3. On levels - levels aren't really relevant when producing for computers - there are no quality options or limitations. you just need a level that supports the resolution and data rate that you're inputting. So this shouldn't be a concern.
Jan Ozer
Said this on 06/25/2009 At 12:44 pm
Here's what Sorenson's Director of Product Management said regarding CUDA:

"This is simple question but the answer is complicated. We have researched many acceleration methods and Cuda is one of many. There are several pieces that need to be accelerated in the encoding process. These include; decoding, preprocessing, and encoding. Generally the UI isn't the bottleneck for encoding. We work with several codec partners and technologies for decoding, preprocessing, and encoding.
Sorenson Media is working with it's partners to accelerate each peice of the encoding workflow and Cuda is one of the technologies being considered."
Said this on 07/08/2009 At 05:33 am
I am a bit confused as the video speaks of the settings being for Progressive Download from the start then changes to Streaming at the point of Aspect Ratio. Which settings are the video for?
I have purchased Squeeze and I am keen to learn
Said this on 07/14/2009 At 04:19 pm
Wonderful Tutorial sir, Thanks a ton. I love sorenson squeeze for my H.264 needs.

Just one more question i.e Hey here in our country 256 Kbps is more preferred speed. Can you tell me the H.264 Encoding Options suitable for the this 256 Kbps Mode. I assume that user can buffer 10-20 Seconds in advance.

I'm using Main profile with
* Frame Rate = 2:1
* Interlaced Mode = Progressive
*B-Frames = 3
*CABAC Coding = Enabled

are they fine or I need to disable any of these options for better quality streaming ? My Main Preference is to out the best quality avaiable in 256 Kbps. I'm streaming dance music videos so lots of fast movements might be expected

Thanks in advance
Said this on 07/14/2009 At 06:25 pm
These look good. I would use the High profile, but I don't think it would make a huge difference in this case. I like that you're trying 15 fps, which makes sense in low bitrate videos.
Said this on 07/24/2009 At 01:52 pm
To address @Vibhor, in my experience encoding f4v h.264 i have realized (mainly from observations on my own computer's CPU and RAM activity monitor) that the High profile can be CPU-intensive. I have a dual-core Intel at 2.8GHz as my primary desktop -- and I think I am fortunate for that, but video at the High profile and 4.0+ level can put a lot of strain on even my very nice iMac.

I would recommend sticking with Main. 256k is going to be rather limiting in what you can really do though I think with 'dance music videos [snip] lots of fast movements' ---

Ok here's the deal. You are going to want 96-128k audio for your music and stereo too. F4V H.264 is AAC, which to my ears sounds better at an equivalent mp3 bitrate. with mp3 and music i have to push to 160k. AAC though you can do very well with 128k.

Then there's the fast movement part. Flash and Adobe _used_ to recommend halving (or dividing into thirds) the frame rate but no longer is this the suggestion. if the video is shot at 29.97 or 30fps it might want to stay there in H.264 F4V.
It is true that (especially older versions of) Flash Player handle 15fps better for some cases where there is moderate motion. for fast dance music videos with dancing et al you will need the full frame rate.

BEST suggestion: use a very small frame size -- it's the only way at that bitrate -- and use dimensions of 8 or preferably 16 in the frame size (width and height). An OK size would have to be smaller than SD resolution (around 300px max either direction).

Hope that helps a bit; good luck!
Said this on 07/26/2009 At 09:39 pm

Good info; thanks for taking the time to write.

Said this on 07/29/2009 At 02:21 am
Dear Jan and James,

Well after doign lots of Research and All I have realized that for 256 Kbps Streaming increasing Frame Rate more than 15 might actually create big quality losses. So this is my final configuration which I'm enjoying in playing over 256 Kbps Streaming (streaming directly from RTMP so no progressive download)

* Profile = Main
* Frame Rate = 15
* Interlaced Mode = Progressive
* B-Frames = 3
* CABAC Coding = Enabled
* Frame Size: 320 x 240
* Audio : 28 Kbps, 22 Khz
* Video Rate:200 Kbps (Peak Rate:225 Kbps)

A 256 Kbps Stream means that we have to target everything at 230 Kbps MAX cuz here 256 Kbps isn't actually 256 Kbps ;) ;) ...

Thanks for helping me out :)
Said this on 07/29/2009 At 08:04 am

Sorry it took so long to reply - was traveling and missed your note.

I spoke of progressive download at the front to explain why I was producing using VBR, not CBR. To explain.

When I say "streaming," I mean distributing via a streaming server; while not absolutely essential for streaming servers, many producers use CBR when producing for streaming.

When I say progressive download, I mean distributing without a streaming server, which means that the web server actually transmits the video. When encoding for progressive download, I use VBR as do most producers.

Check this out for more technical background.

Sorry if my language in the video tutorial got a bit sloppy.


Many video publishers producing for streaming use CBR. Since I wasn't using a streaming server for my video, So the settings I used were for distributing via progr
Said this on 07/29/2009 At 08:06 am
Glad you were able to formulate a configuration that worked for you -- send a link, i'd love to see it.


New comments are currently disabled.