Friday, February 8, 2013

How to Easily Incorporate External Video Into an iBooks Author Project

The iBookstore limits the size of of *.ibooks files created with iBook Author (henceforth, IBA) to 2 GB and recommends that you keep the size of your iBook file under one gigabyte if possible in order to avoid taking too much space on your readers' iPads as well as to avoid your readers having to endure long download times. Although including video that is internal to your IBA project is a simple drag and drop application using the Media Widget in IBA, that kind of video will very quickly increase the size of your iBook and may place an unwelcome burden on some of your readers.

The alternative is to include external video in your IBA project using a custom made HTML Widget. The big advantage is that a one megabyte HTML Widget can play a 70 megabyte video in your iBook. The downside, of course, is that the reader must have an active internet connection and the availability of the video must be maintained. If a video used in your iBook should become unavailable, you can provide your readers with a free upgrade correcting that issue via the iBookstore's versioning feature.

Unfortunately, many people are persuaded not to use this approach because it involves writing HTML code but this post will offer you a way around that obstacle. If you can use a text editor, you can modify an HTML widget template that plays an external video that you select for your iBook. Here's how:

As you'll learn from
this Apple support document, an HTML widget is nothing more than a collection of text files enclosed in a folder with the suffix ".wdgt" added to it. On the Mac, adding that suffix to the folder name changes the appearance of the folder into a widget icon. The minimum HTML widget contains three files: a Default.png file, an index.html file and an info.plist file. I have prepared an HTML widget that you can use as both an example and a template. It is a ZIP archive containing a complete working widget that you can add to a test IBA project. Once you have it in an IBA project you may use the Preview function to see how it works in the iBooks.app on an iPad. Download that HTML widget here and then double-click on it to extract it.

This example widget plays a video called "Open Access Explained" that is hosted on a server that I have access to. In this tutorial, I will show you how to open the widget and modify it so that it will play another video, one that is on a server that I do not have access to, a video that you choose. All I'll have to do to accomplish this feat is to open the widget, change the Default.png file and edit the text of the index.html and info.plist files so that they reference a different video. It's just that easy.

Of course that video must be playable on an iPad so no Flash. These
tech specs provide all the necessary details. The great thing about video on the iPad is that the HTML 5 video tag works without having to create multiple fallback versions of your video (*.mp4, *.ogg and *webm) as one would have to do on a web site. As long as it's using the MPEG-4 H.264 video and AAC audio CODECs, it can be in either a MOV, MP4 or M4V container. More simply, if the video plays on your iPad, it will play in this widget.

The video that I'll be modifying the widget to use in this tutorial is:
http://movies.apple.com/media/us/mac/ibooks-author/2012/tours/apple-ibooks-tour-ipad_ibooks_author-cc-us-20120314_r848-9cie.mov Because I'll be changing the widget to play another movie with different dimensions, I'll need to create a new Default.png file and change all of the references from the old video to the new video. I'll be using the BBEdit text editor but any plain text editor such as TextEdit will do just as well. Here's a screencast showing how this is done. Click HERE or click the image below.

poster


Caveats: Some video services such as Vimeo and YouTube go to great lengths to tie their hosted video to their own web sites so that they can generate data about you and get paid for exposing advertising to you. Thus, it is just a little more difficult to use these videos in an iBook but it can be done. I may take that topic up in the next post.

NOTES:

• About the "auto play" attribute. You'll notice that I use the optional "auto play" attribute in the HTML 5 "video" tag. All HTML widgets take over the entire screen when invoked. Under iOS 6.x (tested), tapping this external video player widget will bring the poster (Default.png) image to full size atop a white background that also displays the widget's title and caption as well as a close button. A standard iOS "play" icon will be superimposed on the center. The video will begin to play automatically without the reader having to tap this play button. The time that auto play takes depends upon the size of the video and the speed of the network. The operating system tries to estimate when it can play the external video without interruption. The reader can always tap the play button prior to auto play. Simply delete the "auto play" attribute if you rather not have this feature operative.

• About the "controls" attribute. I also use the optional "controls" attribute. This provides the reader with a standard video controller with which they can control playback of the video such as audio volume and two "full screen" options as well as a scrubber for moving the play head to arbitrary points along the time line. Simply delete the "controls" attribute if you'd rather not have this feature be available to your readers. The following image shows these various controls and their effects.


VideoControlElements

Resources:

Safari HTML 5 Audio and Video Guide

iBooks Author: About HTML widget creation

Saturday, December 8, 2012

Space-efficient Interactive Lectures in iBooks Author

One of the most useful widgets for iBooks Author is the Keynote widget. It enables you to add a presentation to an interactive iBook using the features of the Keynote.app for MacOS X and iOS, including many of the transitions and builds. You can even convert a PowerPoint presentation to Keynote and bring that content into your iBook as well. The full details are in this technical note.
The one disappointment I had was that this widget does not support voiceover narration. This can seriously diminish the value of a slide presentation. The reader can flip through the slides forward and backward but they have to guess what the presenter might have said. Peter Norvig did a wonderful six slide Powerpoint presentation illustrating this very point. See the slides for President Lincoln's Gettysburg Address
here. View the slides on-line or download the presentation as a *.ppt file.


Gettsyburg PPT

As you'll see, there is something missing, something very important.

Of course there is a way around this. In Keynote, you can add a voiceover and export the presentation as a video to include in your iBooks Author project using the media widget. You can also use screen casting software such as ScreenFlow to capture slides, narration and even a secondary video source such as a PIP (picture-in-picture) of the speaker. The problem with these audio-annotated slideshows done as video is that their file sizes are unnecessarily large. This is a problem for iBooks both because of the 2 GB limit and the time it takes for readers to download very large iBooks. This might well reduce ones audience.
My use of the word "unnecessarily" should signal that there might be an even better workaround and there is – sort of. What I'm about to describe would be a great workaround
if it were supported by iBooks Author. It is not currently supported in iBooks Author but users of that application can change that. Request an enhancement right from within iBooks Author like this:


iBooks AuthorScreenSnapz003

The workaround that's better than a video is called an "enhanced audio" file. It is created in GarageBand and carries the *.m4a file name suffix.. You may also see it referred to as an "enhanced podcast" file. What makes the enhanced audio file such a great alternative to video is that it uses one static image of a slide over its entire time on screen instead of 30 frames per second as in a video. If a 50k slide is on-screen for 100 seconds in an enhanced audio file, that image contributes only 50k to the total file size. If a 50k slide is on screen for 100 seconds in a video file, that image contributes 150,000k ([50*30]*100) to the total file size. That's 50k vs 150 Mb, a 3000:1 ratio in this example! In real life, the difference is somewhat less than this because good video encoding uses a number of neuroscience-based tricks to present incomplete data in between the key frames that are full representations of what the camera captured. That fools the eye and takes less space. Still, the difference is quite significant. We'll look at a real world comparison below.

Since this is not a how-to post, I'll leave that task to others. There are many fine tutorials teaching you how to use GarageBand to create enhanced audio files on the web. Here's a good
one in the form of a PDF.

I created an example using some ancient media describing the beginnings of the Space Shuttle program. Intended for school use, the package contained a cassette audio tape and a set of photo slides. The audio tape has sharp "beeps" to tell the projector operator when to advance to the next slide image. I've left those beeps in for their nostalgia value. Here's the enhanced audio file slide show:



You may download a copy of this file
here and it will play (larger) in QuickTime X Player, in the iTunes.app and may other venues that support QuickTime but just not iBooks Author and the iBooks it creates. This 18 minute presentation is only 21.4 MB in size! Space-efficiency isn't the only advantage of enhanced audio files. The assembly of the static images creates a chapter track that enables the viewer to quickly and easily move to any part of the presentation. This is great for studying a topic where revisiting a difficult section is helpful. Here's a screenshot to illustrate what a chapter track looks like:

QuickTime PlayerScreenSnapz002

Here's a view of the GarageBand project that created this enhanced audio file:

GarageBandScreenSnapz001

So, what would this presentation cost us in terms of file size if it were a video? I created an *.mp4 version with ScreenFlow using the same assets. That version weighed in at 198.2 MB. You may download a copy of that file here. The *.m4a file tipped the scales at 21.4 MB. The video version is approximately 9.3 times larger than the enhanced audio file yet playing them side by side reveals no important differences. Here's a screencast of that analysis:



If you'd like to download and view a larger version of this video, you may do that
here.

The one on the left is the c. 200 Mb video and the one on the right is the c. 20 Mb enhanced audio file. So, if you are at all impressed by the potential advantages of being able to use an enhanced audio file in an iBooks Author project, send in that enhancement request to Apple as described above and do that ASAP.

By the way, you can add an enhanced audio file to an iBooks Author project and it will play the audio part. No slides though and that's where the biggest advantage is. Here's what that looks like in iBooks Author.

iBooks AuthorScreenSnapz004

Note that there is an option for "Show Audio As:" that includes an "Image" option. That doesn't make the slides appear though. That's for drag/dropping a single image onto it that will appear throughout the duration of the audio. Yes, I got real excited when I first saw that.

iBooks AuthorScreenSnapz005

Wednesday, November 21, 2012

New Book: The Coming ePublishing Revolution in Higher Education

It's been quiet here since last January when I talked about the new iBooks Author and its implications for eTextbooks in higher education. That's because writing that piece in January raised questions in my mind that couldn't be set aside. Even while vacationing in Europe its grip never lessened.
First things first, here's where you can buy this book for the munificent sum of $0.99:

iBookstore_Badge_US_UK_126x40_0311
(click on the badge above)

Why $0.99? At first, I wanted to make it free since the book is, in part, about making eTextbooks free to students. However, I wanted to know how many copies were actually read as opposed to how many copies were downloaded. My thought is that people are more likely to read what they have paid for, even if it is just a token sum. I suppose we'll see about that. By the way, the copyright is CC-BY-NC-SA so one is free to use or re-use any part of the book as long as they attribute the work to me and share any improvements they might make with me.
So what's the book about? Thinking about the potential implications of new digital authoring software such as iBooks Author, Pages, Sigil et. al., I realized that higher education might be a spacial case with regard to the potential for the dis-intermediation of the academic publishing industry. After all, most of the people who write academic papers, books and textbooks are also employed in the higher education sector. This brought forth the entangled relationships between academics seeking promotion and tenure, the institutions that employ them and commercial publishing houses. I wanted to see if the technical potential to dis-intermediate could actually be translated into action in this byzantine culture. I think that I've gotten a handle on it and laying that understanding out is what the book is about.
Why an iBook that is only readable on the iPad? It's one thing to assert that a single subject matter expert (professor) can develop and deliver an eTextbook without assistance from a publisher and make it available to students at little or no cost. I wanted to test that assertion and use the results of that testing as evidence in support of the idea that dis-intermediation of the academic publishing is technically and economically feasible.
If dis-intermediation is technically possible, what's to stop it? As it turns out, the most formidable obstacle has little to do with technology. The primary barrier to dis-intermediation is not a technology problem. It's a people problem. It's the culture of academe exacerbated by recent economic issues that make the outcome of this story so difficult to foresee. What I think is achieved in this book is that we now have a better idea as to where we should cast our gaze and what to be looking for. Those who know what to look for will be among the first to understand how this will all turn out.


Sunday, January 22, 2012

iBooks Author and the Coming eTextbook Revolution in Higher Education

On January 19, 2012, Apple announced the availability of iBooks 2, an iOS app, and iBooks Author, a MacOS X application. These two free applications compliment one another. One creates interactive, rich media eTextbooks (iBooks Author) and the other enables those eTextbooks to be read on an iPad (iBooks 2). Actually, their repertoire goes well beyond eTextbooks to include picture books, art catalogs, cookbooks, travelogues and so on.

iBooks Author128x128 iBooks_icon128x128

At first, there was a great hue and cry about constraints on the use of .ibooks files created with iBooks Author and the lack of constraint by the EPUB 3 eBook standard released last October. Now that the "barking dog syndrome" that fuels today's echo-blogging has spent itself and the bit stream is calmer, more thoughtful analyses are beginning to emerge. For example, this, from John Gruber regarding conformance to the EPUB 3 eBook standard.

The other big gripe had to do with the End User License Agreement (EULA) for iBooks Author. The part that irked most said that if you use iBooks Author to create an .ibooks file AND you set out to sell that .ibooks file, you can only do so through Apple's iBookstore. There are no restrictions if your eTextbook is free. Since I think that eTextbooks should be free to students and that textbook authors should be rewarded in new and better ways than the grossly inefficient and unfair systems inherited from the print era, Apple's EULA doesn't bother me a bit. But for those who do care, the salient fact is that the .ibooks format is unencumbered and quite transparent. Thus, it is entirely possible to understand this format and either hand code *.ibooks files or build tools that do exactly the same thing as the iBooks Author app does. As well, there is nothing to stop those who make other hardware and software eReaders from endeavoring to develop the ability to display .ibooks files just as well as iBooks 2 does.

We really have bigger and more important fish to fry here. There is a revolution coming and these apps and others that will follow are its harbingers.

For the first time in history, colleges and universities fully control the means of eTextbook production, start to finish, inception to delivery. They need no help in producing world class eTextbooks. The seeds of revolution are in hand.

The only imponderable is whether colleges and universities will sow those seeds and tend their gardens effectively. There are forces aligned against this so the outcome is not certain. Obviously, commercial textbook publishers will work very hard to avoid being dis-intermediated. Subject matter experts essential to the textbook creation process, such as faculty, will weigh their options carefully. The odds are, so far, with the status quo but that could change. Here's how that could happen. Here's how that revolution might occur.

iBooks Author plus iPad
iBooks Author (left) with iBooks on iPad (right)



Caveat: My focus here is on higher education. The K-12 eTextbook situation is so different that it will have to be dealt with separately and at a later time. However, it is worth noting there are some interesting interrelationships between K-12 and higher education such as the fact that many K-12 textbooks are written by college and university academics. How higher education responds to these new opportunities will also have a profound effect on K-12. My coming from a teacher education background means that I am vitally interested in both. So, on to the revolution in higher education. It's actually been a long time coming.

Not that long ago, publishing paper textbooks (pTextbooks) meant having to make large capital investments in paper, printing, binding, transportation, and storage. Additionally, one had to command a substantial corps of human talent in the form of editors, sales and marketing people. Textbooks were much more challenging than fiction due to the need for fact checking, illustrations, supplementary materials, exercises and so on. Fiction is composed primarily of linear text, all handled by a single author.

The desktop publishing revolution of the early 90s was significant in that it empowered anyone with a computer and laser printer to create documents with graphics and complex layouts that rivaled commercial pTextbook offerings. Any subject matter expert could create a small number of pTextbooks equal in quality and aesthetics to a commercial pTextbook. Of course the economics of paper still favored the commercial publisher and so, the commercial pTextbook publishers held on to their dominant position but the idea of independent textbook publishing was born.

Very little changed until the Internet of the late 90s made it possible to distribute digital documents far and wide, usually in the form of Adobe PDF files or as web sites that perform the same function as a pTextbook. The rise of web-based Learning Management Systems (LMS) brought all of these components together under a single roof adding things such as automated testing. However, the commercial pTextbook persisted throughout all of this and continues to do so up to and including the present day. Why?

Publishers saw this threat and took action. The pTextbook grew digital supplements such as CDs and even DVDs with both interactive and rich media content. A pTextbook adoption might also include access to a publisher-hosted LMS or a 'course pack' that populated an institution-hosted LMS. Instructors were happy to adopt these 'turn-key' courses-in-a-box because creating their own video and interactive supplements, test item banks and building their own LMS courses was both onerous and unrewarding or just downright impossible.

So here we are in the first part of the 21
st century. Made possible by the emergence of powerful mobile devices such as the Kindle, iPhone and iPad, the eBook is for the first time eclipsing pBook sales. Once again, commercial publishing is challenged as authors of fiction begin to succeed at self-publishing. The tools for doing this are all in hand: web sites with payment processing, the EPUB standard and applications that make EPUB-based eBook creation trivially easy. New intermediaries (e.g. Smashwords) and new outlets (Amazon Books, Google Books and Apple's iBookstore) with more favorable terms (viz. author gets up to 70% of sales instead of 25% royalties) have arisen to meet this new demand.

Textbooks, on the other hand, are a bit more involved than creating a linear stream of text as is the case with a typical work of fiction or non-fiction. Even more so the eTextbook because it can contain interactive elements and rich media such as audio and video. Layout and exercises to facilitate learning are also key elements. Given these requirements, one might think that eTextbooks are best left to the professionals who work in the commercial publishing industry. Perhaps but this is by no means foreordained, especially now that software such as iBooks Author and iBooks 2 for the iPad are freely available.

It is now possible for subject matter experts (SMEs) such as college and university professors to create and distribute world class eTextbooks for the iPad with iBooks Author. No doubt, these will be accompanied by competing applications and hardware platforms. Apple has set both a good example and a good pace. The Internet and all of its social networking and collaboration tools has also made it unnecessary for the all the work that an eTextbook requires be done by a single individual. The means with which to create eTextbooks that are pedagogically superior and significantly less expensive are in hand.

Having in hand the means of production is a necessary but not a sufficient condition for this revolution to actually occur. SMEs are essential to this process and have had opportunities to dis-intermediate the publishing industry before but didn't do it. Why didn't that happen and why might that not happen in the near future? The answer and therefore the enemy of this revolution, is institutional tradition. Let's take a look at that.

Academic institutions employ SMEs to teach classes, do research and perform community service. Above and beyond the contracted salary and benefits, they reward these activities with promotion (Assistant Professor, Associate Professor, Professor) and tenure. Promotion usually means a higher salary and tenure generally means greater job security where on e can only be denied a contract for cause which implies due process. Typically, committees are formed to examine records and determine whether an eligible academic is worthy of promotion and/or tenure. One of the things that these committees value highly and therefore look closely at are the candidates' record of publication which may include one or more textbooks. Traditionally, it is the esteem in which the journal or publisher is held that determines the value assigned to the work. A textbook published by one publisher may be rated lower than a textbook published by another recognized commercial publisher. A self-published textbook might well be deemed as worthless as something published by a known "vanity" publisher who will print (for a fee) anything sent to them. In other words, most institutions of higher education outsource the evaluation of faculty textbook production to commercial publishers.

Being such a key part of the academic food chain, commercial publishers have been virtually guaranteed to have the right of first refusal on any textbook that might be written by a university professor. Although they are no longer the only game in town, they are still quite important to SMEs desiring promotion, tenure and royalties to supplement their income. The new alternative of publishing an an eTextbook via Apple's iBookstore appears to have only one of these incentives, 70% of the income derived from sales which may well be confined to one's home institution.

I suspect that this is not sufficient to entice large numbers of academics to try their hand at self-publishing an eTextbook. The consequence of this would likely be a continuation of high prices for nationally distributed, one-size-fits-all eTextbooks. Obviously, this is bad for students but it's also bad for society in that fewer citizens will be able to afford completing a college degree and bad for institutions seeking to maintain enrollments. What can be done?

Given that institutions can tolerate more risk than individual employees, I propose that we add textbook creation to the list of responsibilities for college and university faculty. Include that activity in the definition of teaching and point out that this responsibility can be met in collaboration with others in your academic field. Institutional support for that objective should include items such as the following:

  • Add "teaching and learning materials creation" to the criteria for promotion and tenure decisions. Creating all or part of an eTextbook would be subsumed under this heading.
  • Invest in the development of assessment techniques to evaluate "teaching and learning materials creation" that does not involve commercial entities. A multi-institutional consortium might be a good way to approach this objectively.
  • Provide ways and means for faculty to be eligible to receive either released time (e.g. one less class to teach) or extra compensation for eTextbook creation work such that the resulting eTextbook is a "work for hire" giving the institution copyright. Note that faculty are still free to create and market eTextbooks on their own time.
  • Provide support for faculty collaborating with colleagues elsewhere on developing eTextbooks in their field. This is likely a simple matter of arranging access to collaboration software (Internet access assumed).
  • Where the copyright to an eTextbook is held by the institution, provide copies of that textbook to students needing it for the lowest possible price, including free.
  • Where the copyright to an eTextbook is held by the institution, provide copies of that textbook to other non-profit institutions at the least cost possible consistent with cost recovery principles.
  • Enter into collaborative agreements with other institutions to develop eTextbooks that are especially challenging such that the copyright to the resulting eTextbook is jointly held.

With institutional support such as suggested in the list above, participating institutions would be able to take fuller responsibility for and exercise more effective control of the educational experiences enjoyed by their students. This would lower costs for students and help colleges and universities better recruit and retain students. Faculty participating in the effort would receive important scholarly recognition and credit toward promotion and tenure as well as released time or extra compensation. Their teaching would involve less compromise because they'd have had a hand in the making of the textbooks assigned. This is a revolution that ought to happen and could come with a strong commitment to forge new traditions in higher education, a bit of good fortune and a great deal of hard work.

Lastly, let's deal with that bugaboo called copyright. With so many textbooks already in existence won't it be hard or impossible not to violate someone's copyright? What institution can afford to discover what permissions are needed and then secure them? First of all, state institutions and their employees are shielded by the 11
th amendment to the U.S. Constitution establishing sovereign immunity for state governments. That doesn't cover all cases and isn't nearly as potent as the next point. Second and most importantly, there is very little in textbooks that is copyrightable. Specifically:

  • You cannot copyright a fact, concept or idea. You can only copyright the unique expression of an idea. Textbooks are primarily composed of facts, concepts and ideas.
  • The content of most academic subjects has been covered so many times in so many ways, it would be difficult to meet the uniqueness criterion. For example, how many World History textbooks have described Hannibal's crossing the Alps? Which of those descriptions is unique?

I really don't know whether todays higher education leadership is both willing and able to attempt this revolution or not. One could argue that tough economic times make leaders more timid. They don't want to loose what little they've got. On the other hand, one could argue that tough economic times mean that there is less to loose and more to gain. I am convinced that if there is a will, there is now a way.

Sunday, April 3, 2011

Standard Definition Video in ePub Documents

So far, we've been focused on the use of HD video in ePub documents but what about SD? Standard definition video is still quite common, especially for older works produced for television. Whereas HD has an aspect ratio of 1.78:1 or 16:9, SD has an aspect ratio of 1.33:1 or 4:3. xxx

As we have seen, iOS devices (iPad, iPhone and iPod touch), introduce black bars (letterbox, pillarbox and windowbox) and cropping/scaling in order to maintain the aspect ratio of the source video. Without these, the video we see on these devices would be stretched or squished which is not what the author intended. This is due to the fact that iOS devices do not have 16:9 screens. The iPad is 1024x768 which is 1:33:1 or 4:3. The iPhone and iPod touch are 480x320 (older) or 960x640 (newer, retina displays) which is 1.5:1 or 3:2. In other words, iOS devices have screens with aspect ratios that are the same as or very close to standard definition TV dimensions.

I've created the following screencast to illustrate the many ways that the iBooks application on these iOS devices will present Standard Definition (SD) video. There's a lot to account for with different orientations (portrait vs landscape) and whether the reader chooses to view video embedded in an EPUB-based eBook in situ, proportional full screen or non-proportional full screen. It's best to see all of this in action.



If your source is SD, QuickTime X Player will maintain that aspect ratio in all of its export options. This is ideal for video embedded in EPUB-based eBooks. Playback at 640x480 minimizes the use of black bars, cropping and scaling, the iPod bit rate keeps a good balance between file size and fidelity in most cases and the MPEG-4 Baseline Profile assures that the video will play wherever the iBooks.app is found.

Revisiting "Playable Audio and Video in ePub" (revised 4/3/2011)

Last September, I looked at the need to make sure that video embedded in an ePub document would play and play well on all of the devices where the iBooks.app is found (iPhone, iPod touch and iPad). Since then, new developments not only make this topic more important but also warrant a review of the principles involved.

New developments include the fact that the ePub standard is now at version three and formally specifies the embedding of audio and video files in ePub documents using the same HTML 5 video and audio tags that the iBooks.app has long supported. Thus, there will likely be more eReaders supporting rich media beside iBooks. When those new eReaders do arrive, we'll need to look at them closely. For now, the iBooks.app is still the only game in town for rich media in ePub documents. As well, we have new hardware and operating systems to consider and that brings up "backward compatibility" as an increasingly important factor.

So, let's take another look at this topic and bring our earlier conclusions up to date.

Hardware Targeting The iBooks.app, now at version 1.2.1, requires iOS 4 or later so that reduces the range of hardware that it will run on to iPhone 3G, iPhone 3GS, iPhone 4, iPad plus the 2nd or later generation iPod touch. The most recent of these (iPhone 4, iPad and 4G iPod touch) sport the significantly more powerful A4 processor and, thus, are capable of decoding more advanced versions of the MPEG-4 H.264 standard. Specifically, these newer models can handle H.264 Main Profile whereas the older models can only handle the Baseline Profile. Simply put, baseline will play everywhere iBooks runs whereas video encoded using the Main Profile will only play on newer iOS devices. Thus, aiming for the greatest reach means that we need to stick with Baseline Profile for maximum backward compatibility.

Viewport Targeting Thanks to an article by video wizard Jan Ozer entitled "Encoding for the iPad", I've learned that, thanks to the video scaling function on the iPad, encoding HD (16:9) video at 640x360 pixels looks great for most content regardless of viewport size. The exception to this is video with fine detail such as smallish text. That gets very blurry but since we're talking about ePub here, that shouldn't be a problem. Save the text for the body of your eBook and use static images for fine visual detail.

Bit-rate & File Size Targeting An ePub document is self-contained. Generally speaking, there are no external dependencies for video or audio. Thus, video, audio, image and text files are all found inside the ePub file. Actually, an ePub document is a special kind of Zip archive that eReader apps know how to handle. Because of this self-sufficiency, bit-rate is not as critical as it would be if ePub video required an Internet download as a web page does. On the other hand, video file size is a function of bit-rate and, so, has a lot to do with the file size of your ePub document, how long it takes to download and how long your audience will have to wait before they can start reading. A frame size of 640x360 and a bit-rate of 1.4 Mbps (mega-bits per second) using the MPEG-4 Baseline Profile should produce pristine video for most HD (16:9) sourced content.

The Golden Mean Of course there are good use cases that diverge from this golden mean. The iPad's 1024x768 screen, for example, will accommodate 720p (1280x720) by scaling it down to 1024x576. The iPad will also support MPEG-4 Main Profile and very high bit rates for optimal quality playback. However, unlike other media synched to iOS devices via the iTunes.app, the video content of self-contained ePub documents is not evaluated, Thus, it is quite possible to create an eBook containing video or audio that will not play properly or at all. It is critical that ePub documents be tested on the smallest, least capable iOS devices as well as the iPad and iPhone 4 if your goal is to have the video in your ePub documents accessible wherever iBooks is found.

Reviewing Our Recommended Methods Previously, I had recommended using the iPhone presets that are found in the output options of many applications such as QuickTime Player, Screenflow, Miro and Handbrake. This is still a viable strategy though it is not optimal. The iPhone preset in QuickTime Player, for example, currently encodes a 480x300 video at 880 Kbps using the Baseline Profile. It will scale and play everywhere that iBooks runs but its not the best that we can do. Actually, the iPod preset comes closer at: 1.463 Mbps, 640x360, Baseline@3.0 when the source is 1280x720. This is much better for 16:9 source.

Scalability Testing As mentioned above, testing is critical. Not only do we have to test on multiple devices but we also need to test using all of the orientation and scaling options. Here is an illustrated list to guide your testing:

The iPod touch and the iPhone all share the same screen size (viewport). Here is the portrait view:

Composite iPod Portrait

Here, we see a proportional scaling of the video constrained by the width of the screen in this orientation. Note the "expander" button in the upper right corner of the center image. Tapping that button fills the screen without regard for aspect ratio (proportion) like this:

composite iPod Portrait-Max

Notice that the expander button has now become a collapse button.

Next, we look at the landscape orientation where the same controls are operative but the visual effect is, of course, different.

composite iPod landscape full screen2

Next, we look at the iPad where video can be played in-situ, full-screen (proportional) and full screen (non-proportional). We start with the portrait in-situ view.

composite iPad Portrait in-situ2

Here, the iPad advantage is that video can be played in context with other book elements such as text. Tapping on the expander button will bring us to the proportional full screen view which looks like this:

composite full-screen prop & non-prop

Notice that the collapse button on the video control bar (bottom) is the same in both images. Tapping this element will return to the in-situ video where you may continue watching or stop the video and resume reading text. The expander buttons at the top have a different function. The one on the leftmost image expands to the non-proportional full-screen image on the right. The one on the rightmost image returns the full screen proportional video on the left.

All of these views need to be checked in order to assure that your audience is seeing the video as you intend. Fortunately, the algorithms that Apple uses to scale video in these widely different environments is very good. If you start with high quality source at 1280x720 and then export using the iPod preset, you will likely be satisfied with all of these views.

Friday, December 24, 2010

Influencing EPUB Version 3

As we know, the EPUB standard is being revised to version 3. It's on a fast track (approval expected Q3 2011) and the 14 point charter is ambitious. In addition to danger, change also presents opportunity.

Apple is among those who have an interest in shaping that change and they have been overtly busy with the iBooks.app for iPad, iPhone and iPod touch as well as the iBookstore that supports that app. Apple has also been busy in the background. Among the many things that Apple is doing that are just out of view for most of the general public is what I believe can only be characterized as a concerted effort to influence the evolution of version three of the EPUB standard.

Although Apple claims to follow the EPUB standard, they have recently introduced features supported in the iBooks app that do not conform to the current standard. Conforming EPUB files play just fine in iBooks but these new, super, EPUBs do things in iBooks that haven't been possible before, especially on mobile devices.

Using the HTML 5 [video] and [audio] tag was the first, simple but dramatic move. This has been followed by other features that require rather sophisticated Javascript coding such as the recent implementation of "fully illustrated books" in iBooks 1.2 that open graphic and tabular information in a new window that overrides the conventional ePub "flowed" text format in favor of full-screen display, even in landscape mode.

Deconstructing these super ePub files reveals important insights into both the iBooks app and Apple's EPUB strategy. Standard ePub files are but Zip archives containing text and image files. Those contained files evidence a striking similarity with the code of the web. Thus, eReaders are akin to web browsers, albeit very specialized ones. Apple has simply added Javascript and new HTML 5 constructs to the CSS, XHTML and so on found in conventional ePub files and interpreted by conventional eReaders. Rather than web-like, Apple's ePub files are web files, period. Similarly, the iBooks app is more of a modern HTML 5 web browser than an ePub eBook reader.

It has been
pointed out that Apple isn't currently sharing how-to information on these techniques with medium to small publishers and self-publishers. I suspect that there's more that's not being shared. It may well be that Apple isn't yet sharing the tools to easily implement these features except with the chosen few. Why do I think that? Here is why:

Apple developers have access to tools and documentation that others do not. One of the tools recently released to Apple developers is the iAd Producer application. It looks like this:

iAd first look

What iAd Producer does is provide one with a drag and drop UI to assemble an interactive, animated display, an iAd. This iAd is actually an HTML 5 mini-web site. That is, a folder containing HTML, CSS, images, media and Javascript that any modern web browser will display properly because it is standards-based. This tool is only available to Apple developers.

Might there be a similar tool that is only available to the larger publishers? I don't know for sure but confirmation of the existence of such a tool would be unsurprising to me. It would be trivial. I think, to adapt what we see as iAd developer to an application that could be called iBook Developer. Nowadays, web and mobile technology are all converging toward HTML 5.

So, why is Apple out in front on this? Alan Kay, former Apple Fellow, said it this way in 1971: "The best way to predict the future is to invent it." By putting out living examples of EPUB that human readers respond positively to, Apple is inventing the future. It is, thereby, also influencing the development of this key standard. Those who are working on the standard simply cannot ignore these events.

Apple is engaged in a very smart campaign that will benefit all those who create and read digital books as well as benefit Apple. Yet another example of "doing well by doing good."