PapaJohn Productions

Newsletter #135 - January 27, 2007
the Bitrate of Stories


If you need to review your bitrate math, and brush up on your understanding of CBR versus VBR, here's a quick brief...
Bits and bytes and bitrate...
What's bitrate? If you watch a video file that is 100 MB (megabyte) in size and is 10 minutes long, the math says it's 100,000,000 bytes (or 800,000,000 bits, as a byte = 8 bits) over 600 seconds.
Smooth transmission and playing of such a file means the data flows at an average rate of 133,333 bits per second, or 133.3 Kbps (Kilobits per second).
The Profile Editor for Movie Maker and Photo Story gives you a choice of CBR (Constant bitrate) or VBR (Variable bitrate)...
When you plan a long car-ride and use an average of 60 miles per hour for the whole trip, that would be a constant rate.... but in the real world you go faster on better roads and slower on city streets... you use variable speed to adjust for conditions.
A video file of constant bitrate makes for nice easy calculations, but in the real world with variations in visual scenes, the overall quality is better if more bits are used when there's a lot of visual changes going on, and fewer bits when there's little change from one frame to the next. It's like you can save or budget your bits for use when most needed. In the long run the video average might be the same.
For a Movie Maker movie you can choose either CBR or VBR. But when making a profile for Photo Story, the Image codec will only work if you select VBR. Like it or not, we use VBR for stories.
When doing a file download, the buffering of bits offers the luxury of having some saved-up bits ready to use when the bitrate needs demand them. Streaming video on the other hand, demands that your player use the bits as provided... and when the flow of bits can't keep up with the demand, the video goes to blackness. We'll see that illustrated in the example for this issue. 

Newsletters #130 and #131 were about making a story from a video clip, and then notching it up in size to higher-def ones that still play smoothly online... over a good broadband connection....
This week takes all the successes to make my 'best-ever story'... the first good draft of a Florence story, one of my Europe-301 vacation projects. In doing it I found some things that worked, and others that didn't. As I explored the failures I found myself deeply into bitrates.
Florence StoryHere's the link to the finished 9-1/2 minute story (or click the picture). The 'video-like' segment that I thought would make a good opening clip is in it, but it starts 1-1/2 minutes into it.
Florence, Italy
It's the most complex story I ever made... with 270 pictures... 187 of them are those pictures of the river with the moving boats, pictures being flipped through at the rate of 5 per second to make a 'video-like' segment.
It turns out the segment needs a lot of saved up bits. They were when playing the file-download video, but not the streaming file.
What didn't work?
To check why the story would download smoothly but not stream, I took WMSnoop out of my toolbox and studied the bitrate frame by frame. The modest overall video bitrate of 108.4 Kbps says it should play well... but the batch of 187 pictures going through quickly needs almost 3 Mbps for a 40 second period.
The mydeo streaming starts into the segment, but the overall bitrate can't flow through the pipeline between mydeo and me fast enough to satisfy the playing, and the visual turns to blackness. It recovers by itself when the story returns to a normal bitrate after that segment. 
High Bitrate Segment
Why doesn't the file download run into the issue? Because the long buffering before starting saves up enough bits to get over the hill smoothly....
... pause for a few notes...

Reader's Comments about Last Week's Newsletter...
One provided info about the c:\Windows\Prefetch folder, with things that auto-start at bootup... an interesting place I'd never explored. 
I looked in my prefetch folder, and sure enough, it explained why I had an iPodService.exe and an iTunesHelper.exe running even though the services list in Computer Management shows iPod Service as a Manual startup type. The prefetch list is what turns it on at startup. I'm using 3,852 K of memory for my laptop as it waits for me to plug in my iPod, but I don't own one. I changed the setting from 'Manual' to 'Disabled' and it turned it off, so the prefetch item no longer 'manually' turns it on. Turning off iPod Services also turned off the iTunesHelper.exe process, which used another 5,032 K.
Another reader passed around the comments about laptop batteries to some 'in-the-know'... who say the limited number of "cycles" for Li-Ion batteries is in the order of 300-500 IIRC (if I recall/remember correctly), but leaving it plugged in when shut down shouldn't be cycling it. He also provided a link to a site with useful info about getting great battery life.... charge often and alternate batteries.
Vista Corner... 
The transition from the marketing team to the tech support team happens in a few days. 
Vista scored again in better memory management, saving my final story when my laptop XP system with twice the RAM couldn't.
I think highly of TripAdvisor... mostly for the useful trip planning info we've gotten from their site, but partly because they've rejected me three times so far.
We did a lot of trip planning last year using their website, and will be doing more this year... if they are that careful screening my stuff, they must do it to everyone, a clue that info on their site is highly credible.
While bleeping and rejecting, they have been very quick to turn around each item, and responsive to my questions and comments... and they recently started accepting videos, which adds a whole different slant on our possible relationships.
Lesley at TripAdvisor, who I've been working with lately, uses a Mac, so she couldn't view the online Photo Story for this newsletter, and didn't know if they could accept such a file. She checked with their engineers, who use Linux machines and said they couldn't view it either... they asked if I'd upload it to see if their conversion process would handle it... conversion to flash format.
... and it did. Here's the link to my playlist at Trip Advisor... this week's story is 
An Overview of Florence
As a widescreen story, it's got the right aspect ratio, but I suggested moving it up to the middle vertically, more normal letterboxing. 
.... back to the main topic...

the Rest of the Story for this Story
CBR versus VBR...
A video produced to play at a Constant Bitrate (CBR) has a fairly even pattern... here's a picture of what the story looks like when I run it through Movie Maker and save it to a 2.1 Mbps CBR file. Relatively nice and even throughout, at least compared to the VBR story pattern.
Note the average file bitrate of 1.907 Mbps versus the 108.4 Kbps of the story file... the movie is 18+ times the bitrate of the story, too much for even good broadband internet pipelines to deliver a steady streaming file..... file download is possible, but it's a long time between starting the download and being able to start viewing a smoothly playing video. 
CBR Pattern
Photo Story, using the Image 2 codec, only does VBR mode.... which rules out the bitrate leveling of a CBR setting.  

Frames per second and keyframe intervals
File SizesMy starting profile used 30 frames per second with keyframe intervals of 8 seconds.
I made changes to the profile to see what effects changes to them would have. You can see from the file list at the right that the changes had minimal effect on file sizes.
And the bitrate patterns in WMSnoop were remarkably similar.
Verifying fps and keyframe interval
To check what the wave patterns were saying, I uploaded the 24 fps story with keyframes every second to mydeo.... not only did it not resolve the blackness in the video-like segment, but the viewing was terrible throughout. It was easy to see that reducing the frame rate or the interval of keyframes isn't the way to resolve the streaming issue.
The quality of the local playback for all of the files was too close to call. I have a personal preference for online viewing at the same rate as movies, 24 fps... but I'm not seeing enough reduction in file sizes to adopt or recommend it as anything more than a personal choice.
My last shot at a frame rate change was to try 5 fps... more curiosity about the bitrate pattern than the visually jerky playback. The playback was as far from smooth as you'd guess, and the file size and bitrate pattern aligned with the other changes.  

Conclusion and Closing... and What's Next?
For large-size high quality stories, go with a file-downloading process and not streaming video... I wrote to mydeo a few days ago asking for any comments, but haven't heard back yet.
I started into the next layer of exploring, but didn't do enough except to say where I was heading. It's the profile settings which you don't see or tweak when using the Profile Editor... could lines such as these in the profile mean anything?
They can be changed manually using Notepad... and I noticed that if I temporarily toggle to CBR mode in the Profile Editor, change the bitrate setting that isn't an option when the mode is VBR, and then switch back to VBR... the setting change in the profile remains where you left it, so you can change the setting (but does it do anything or does the quality setting drive it all?).
Have a great week!!
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write("\