Friday, September 30, 2011

Use the Photon App to Watch Amazon Instant Video on iPad

Amazon Prime customers such as myself can watch numerous Amazon Prime Instant Video titles for free. As a semi-old fogey, I just watched an episode of the fairly recent Doctor Who revival (with Christopher Eccleston as "The Doctor") and one of the original Star Trek series ... and I did it all on my iPad!

That's quite a feat, since Amazon Instant Videos use Adobe Flash technology, and the iPad doesn't support Flash.

The secret is Photon. The Photon Flash Web browser app for iPad ($4.99; icon at left) is an alternative browser that you can use on the iPad. You can use Safari most of the time, that is, but fire up Photon when you need to watch a Flash video. Or you can just use Photon as your main iPad browser, since it is a full-featured web browser.

There is also a Photon Flash Web browser app for iPhone that costs $3.99. It does the same kinds of things as the $4.99 iPad version, but it is iPhone-specific. It runs on the iPad, as well, but does not take advantage of the larger screen (for instance, no tabbed web pages). These two versions are very hard to tell apart at the App Store; be careful to get the one you want for the device you have. Remember: the iPad version does not run on an iPhone, while the iPhone version does run on an iPad, but does not use the larger iPad screen to best advantage.

Photon uses a neat workaround. When you watch a Flash video, it diverts the containing web page to its own web server, somewhere out there in the cloud. Then, working on the fly, it converts the Flash-based source video stream referenced in the web page into a video format the iPad can use, and it inserts the converted stream into a modified version of the original web page. Then it sends the modified web page out to the iPad. The converted video is thereby the one you see in Photon.

Will Photon let you play a Flash-dependent, interactive online game, by the way? I don't know. I haven't tried it. But I suspect it imposes unacceptably slow lag times, and that Photon's Flash compatibility is best reserved for streaming video.

Here's an iPad screen snap of an Upstairs, Downstairs episode that I paused in Photon:



I accessed the episode using Photon in its "normal" — i.e., not Flash-enabled — mode:



The presence of the "lightning" icon at upper right indicates that Photon is operating in its "normal" mode. My next move would normally be to touch the green "Watch now $0.00" button, but if I don't touch the "lightning" icon first, I see:



The "Flash player is not installed" message alerts me to touch the "lightning" icon, and I briefly see:



The "Connecting to streaming session for browsing Flash websites" overlay appears only temporarily, and then I see:



It looks almost like the screen shot I showed earlier in this post, three images above this one. But now the set of icons at upper right has changed from:

Not Flash-enabled.


To:

Flash-enabled. To enable Flash, I touched the "lightning" icon
shown in the previous image.


If I were now to tap the third icon from the right, by the way, I would go back to Photon's "normal," non-Flash-enabled mode.

The Amazon Instant Video player has various controls arrayed at bottom right (also see the first image in this post):


These controls disappear after a few seconds of screen inactivity,
but if you tap the video image on the screen, they reappear.


One of the drawbacks of the way Photon supports Flash is that the Adjust volume, Pop out, and Full screen controls are often hard to use and in some cases don't seem to work right at all. One of the problems is that there is considerable lag time between when I tap the screen and when the tap produces a result.

For example, it's very hard to adjust the volume. The workaround is to switch from Photon's "touch mode":


This is "touch mode." The "fingertip" icon is selected.

To its "pointer mode":

This is "pointer mode." The "arrow" icon has been selected.


Now I can drag my physical fingertip across the iPad screen to manually place an arrow cursor at the rightmost end of the volume slider:



Then, after I tap the screen once, the volume slider responds normally:



As for Amazon's Full screen control ...



... it gives weird results that I'm not going to reproduce here. I don't know how to use it to give a proper full-screen view of the video. I recommend not using it in Photon on the iPad.

Amazon's Pop out control in intended to play the video in a popup window, when used with a regular computer browser. In Photon for the iPad it enlarges the video within the original browser tab:



But, annoyingly, the controls at the bottom are partly obscured. Even if they weren't, they provide no way to pop the video back into its usual player. One way to do that is to pause playback by touching the (partially obscured) Pause button at lower left, then hit the Back arrow at upper left. The video will then show up (paused) in its regular player, and will take up where I left off if I hit the Play button at lower left.

If I use Pop out and then I touch the rightmost icon ...



... to expand Photon itself into full screen mode, then I actually get a full screen image:



I can tap the "expand" icon again (shown at upper right in the image above) to go back to ordinary not-popped-out mode.

Now, something that's really annoying:



This is what happens sometimes for no discernible reason. "Online Viewing Limit Reached" supposedly happens when you are trying to watch more than two videos at a time across all your devices — iPads, iPhones, computers, etc. But I've been getting it when I'm just trying to watch one video on one device, my iPad, using Photon.

Alas, hitting "Retry" never works to clear up the problem.

I suspect the problem must have to do with how Photon buffers the original video stream that it pulls over from Amazon's servers to its own servers. Something gets out of sync, and Amazon thinks I'm trying to access more than two copies of the stream.

I have tried every conceivable thing to get things working again, with no consistent success. Closing out the Flash-enabled session, closing Photon's tab for that session, going back to Amazon's home page and drilling down all over again to the video, exiting the Photon app, restarting the iPad — none of these seem to work.

However, the problem does seem to go away if I wait a few minutes and try again. Maybe the out-of-sync session between Photon and Amazon simply times out. I have no idea, really, what's going on.

I expect the developers of Photon will in some future release fix this and the other problems I've mentioned. Meanwhile, I have to say that it's extremely nice to be able to use Photon to play Flash-based streaming videos from Amazon Instant Video on my iPad!



Monday, May 23, 2011

Apple's AirPlay Comes to Air Video

Wouldn't it be nice if your iPad or iPhone or iPod Touch could shunt the videos you're viewing on its small screen over onto an HDTV so you could watch them at will, home theater-style, on a big screen?

Now you can, using AirPlay!

AirPlay is a new Apple thing. Using Home Sharing, another new Apple capability, AirPlay "pushes" video streams from an iOS-based handheld device such as iPad, iPhone, and iPod Touch over to an Apple TV 2 and thus onto the screen (and into the speakers) of an HDTV.

Given the advent of Home Sharing and AirPlay, it would be nice if there were an app for Apple mobile devices — the latest iPads, iPhones, iPod Touches — that would AirPlay videos streamed from a host computer over to an Apple TV 2 and its connected TV screen.

Air Video can do that.

Air Video, in contrast to Apple's own iPod app, has the advantage that the video files don't have to be synced the iOS handheld itself. They can reside on a Mac or PC connected to the same home WiFi network as the iOS device is connected to.

Air Video actually comes in two pieces, a client app that runs on an iOS 4.x-based mobile device from Apple, such as an iPad or iPhone or iPod Touch, and a server application that runs on a Mac or a Windows PC. (See the Air Video site to get the server software that matches your computer platform.)

If you're using an iPad, Air Video looks like this:



This is, of course, not Air Video's full-screen view of the movie, but the full-screen view likewise affords AirPlay capability. You can tell by the little icon that looks like this:


It's the AirPlay icon. Touch it, and an AirPlay selector menu appears, as shown in the earlier image. This menu shows all the AirPlay-capable devices in your home network. In the menu shown above, you can choose "iPad" or "Apple TV." The former puts the movie on the iPad's screen, while the latter shunts it onto the screen of the TV that is hooked to an Apple TV.

Notice that Home Sharing and AirPlay, used in tandem with Air Video, serve to integrate a Mac, an Apple handheld such as an iPad, and an Apple TV.

True, you can substitute a Windows platform for the Mac as the server machine that houses the videos to be streamed across the home network. Still, Apple hopes you won't, and that your will furthermore use one of its AirPort Extreme base stations as your network router ...

... and also that Apple's iTunes Store will be the source of the movie and TV show files that this little klatch of high-tech gadgetry is asked to stream. But that adds yet another wrinkle, since the movies and TV shows you download from the iTunes Store are DRM-protected. That means Air Video can't play them ...

... and yet Air Video does let you opt to watch such DRM-protected movies in the Safari web browser on the iPad/iPhone/iPod Touch. So when you play them in Air Video, they open in Safari ... which, like Air Video itself, has an AirPlay icon that can shunt playback to an Apple TV.

The AirPlay icon now appears in Air Video, in the iPad app, in the Videos app, and in Safari (among other apps) on an Apple handheld device like an iPad, iPhone, or iPod Touch. So all those apps can shunt video and/or just plain audio to Apple-branded co-conspirators such as an Apple TV ... or to an Apple AirPort Express wireless base station that can feed the digital audio streams it receives an analog signals to a home entertainment system.

The computer industry has long talked about integrating computers and home entertainment. With Home Sharing and AirPlay, Apple has taken great strides in that direction.

Friday, April 8, 2011

TiVo to Mac to Apple TV — Part IV, Fine Tuning

In my previous post, TiVo to Mac to Apple TV — Part III, One-Stop Shopping, I told how I use kmttg to download onto my Mac movies from the Turner Classic Movies HD channel that have been recorded on my TiVo Premiere. During the download, kmttg simultaneously decrypts the file: removes the copy protection so that the resulting file on my Mac is an ordinary .mpg file. Then, since .mpg files can't be used by an Apple TV, I tell kmttg to invoke the popular video reformatter HandBrake to re-encode the file as an .m4v file. I furthermore arrange to have HandBrake insert into that .m4v file, as soft subtitles — "soft" subtitles are subtitles which may be viewed optionally, at the user's discretion — the closed captions that were embedded in the original .mpg file.

It also works with movies from other cable channels such as Encore HD.

To do it in my last post, I created, in a text file called hb_my_appletv.enc, a kmttg "encoding profile":

# Description (single line, keep short)
Handbrake AppleTV: m4v container, AppleTV preset (h.264 video, aac & ac3 audio)

# Encode command or script (single line)# Known keywords: FFMPEG, MENCODER, HANDBRAKE, PERL, INPUT, OUTPUT, PWD, CPU_CORES, SRTFILE
HANDBRAKE -i INPUT --cpu CPU_CORES --preset AppleTV --subtitle 1 -f m4v -D 1,1 -A "Stereo","AC3" --rate 29.97 -v -o OUTPUT

# Encoded output file extension
m4v

That hb_my_appletv encoding profile has drawbacks when kmttg uses it, though. Its main problem is a bit on the geeky side: it fails to "detelecine" the film-based video that it encodes in the .m4v output file.

Now for some extremely nerdy stuff shown in italics with a yellow background to explain what I've just said (feel free to skip over it):


When a movie is shown on 1080i HDTV, it undergoes a "telecine" process to compensate for the fact that motion picture film consists of only 24 frames per second. The 1080i format used by TCM HD and most other HD movie channels uses 30 video frames per second. (Actually, for highly technical reasons, that 30 fps is slightly lowered to 29.97 fps.)


The "telecine" process, also known as "3:2 pulldown" or "2:3 pulldown," shows some of the original film's frames to the video camera for a slightly longer time than it shows other of the film's frames.


Each second, as 24 film frames are being exposed to the video camera, the video camera is recording 29.97 video frames — not 24 video frames — in such a way that each video frame is divided into two video "fields." The video fields are captured by the video camera at a "field rate" of (29.97 x 2), or 59.94, fields per second.


The division of each video frame into two separate video fields is called "interlacing." The "i" in 1080i indicates that the video is interlaced.


Each video field is missing exactly half of the horizontal scan lines that make up a complete video frame. For example, in 1080i video each frame has 1080 scan lines. Lines 1, 3, 5, 7, ... , 1079 (the odd-numbered lines) make us the first field in each pair of video fields. Lines 0, 2, 4, 6, ... , 1078 (the even-numbered lines) make up the second field of each pair.


Ordinarily, each pair of fields — even though the two fields in the pair are time-offset by a small fraction of a second  — can be thought of as making up a single video frame. In telecined video, though, problems arise when you do that.


The root of the problem is that the .m4v file which HandBrake creates isn't permitted to use interlaced video. It has to use "progressively scanned" (or, more simply, "progressive") video, meaning that each video frame is kept intact and not divided into two successive, time-offset video fields.


When interlaced video is re-encoded as progressive video — for instance, when kmttg's use of HandBrake invokes the hb_my_appletv encoding profile shown above — some of the film's frames are presented for a duration long enough to show up, in the original interlaced video, in three successive video fields instead of just two. Accordingly, in the progressive video that kmttg's re-encoding process creates, there wind up being two video frames out of each group of five successive video frames that are composites of two successive film frames.


When that happens, objects that are in motion on the screen (or seem to be moving because the film camera is panning) show up in two slightly different places in the progressive video frame. This graphic shows an exaggerated version of the "jaggies" that result:






Obviously, if you use a computer-based video player such as VLC or QuickTime Player that can freeze video motion and then do frame-by-frame video advance, you can readily see the jaggies that occur in precisely two successive progressive video frames out of each group of five progressive frames, i.e., the two of the five that are derived from different film frames. But the important thing is that you can also see a lack of smoothness, clarity, and motion uniformity when the resulting progressive video is watched at normal speed.


All this is due to the fact that, when interlaced video that has been telecined from 24-fps film at 29.97 video frames per second (actually, 59.94 video fields per second) is re-encoded as 29.97-fps progressive video that does not employ video fields at all, jaggies result ... and the motion you see on a TV screen loses clarity, uniformity, and smoothness.


The problem goes away, though, if you "detelecine" the interlaced video as it is being re-encoded as progressive video. Luckily, HandBrake knows how to do that. If you specify its --detelecine parameter, it can detect which two frames (or, actually, which two field pairs) out of every five field pairs in the 1080i input video had the paired two fields come from different film frames. Knowing that, it can simply strip out the redundant information which the telecine process used to pad out the 24 fps of the movie to get 29.97-fps interlaced video.


The result is that each video frame of the .m4v output matches up exactly, one for one, with a single frame of the original film.


Clearly, however, this works properly only when HandBrake is permitted to reduce the 29.97-fps frame rate of the input .mpg video to 24 fps in the .m4v output. In other words, HandBrake's video output has to wind up with the same frame rate as the original film had: 24 frames per second. This requires not giving HandBrake a -r or --rate setting — such as, for instance, --rate 29.97.

OK. That's the end of the nerdy stuff. The takeaway is that "telecined" video is padded out to a frame rate higher than that of the original film. I need a kmttg encoding profile that employs HandBrake's --detelecine option ... but does not specify its -r or --rate setting at all. This will turn the 29.97-fps 1080i video in the input file into 24-fps video in the output. Each of the output video frames will represent exactly one film frame from the original movie.

Here is my hb_my_appletv_1280 kmttg encoding profile that does all that:

# Description (single line, keep short)
m4v container, soft subtitles, 1280 x ___ video, detelecine

# Encode command or script (single line)# Known keywords: FFMPEG, MENCODER, HANDBRAKE, PERL, INPUT, OUTPUT, PWD, CPU_CORES, SRTFILE
HANDBRAKE -i INPUT --cpu CPU_CORES -e x264 -q 20.0 -X 1280 --subtitle 1 --detelecine --loose-anamorphic -x cabac=0:ref=2:me=umh:b-adapt=2:weightb=0:trellis=0:weightp=0 -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 1,1 -A "AAC","AC3" -f m4v -v -o OUTPUT

# Encoded output file extension
m4v

It is the --subtitle 1 specification that tells HandBrake to convert closed captions into "soft" subtitles, by the way.

(This page gives a full rundown on the various HandBrake settings such as, --subtitle--detelecine and --loose-anamorphic. You can learn what settings are specified in HandBrake's AppleTV and other built-in presets here.)

If you use the Finder's Duplicate command to make a copy of (say) the hb_appletv.enc file that already exists in the encode folder that comes with kmttg, you can then use TextEdit to edit the copy of the file. Copy the above text and paste it in place of the text already in the file, then save the file as hb_my_appletv_1280.enc. Launch kmttg (or if it is already running, choose the "Refresh Encoding Profiles" item in its File menu). Then you can select hb_my_appletv_1280 in its "Encoding Profile" popup menu.

Shortening the Encode

When I do that and then encode a video in kmttg using this hb_my_appletv_1280 encoding profile, the encode process takes up to, say, ten hours, the exact time depending on a number of factors. To shorten the encode time (at the expense of having lower video resolution in the output file) I created the kmttg encoding profile going by the filename hb_my_appletv_720.enc ...

# Description (single line, keep short)
m4v container, soft subtitles, 720 x ___ video, detelecine

# Encode command or script (single line)# Known keywords: FFMPEG, MENCODER, HANDBRAKE, PERL, INPUT, OUTPUT, PWD, CPU_CORES, SRTFILE
HANDBRAKE -i INPUT --cpu CPU_CORES -e x264 -q 20.0 -X 720 --subtitle 1 --detelecine --loose-anamorphic -x cabac=0:ref=2:me=umh:b-adapt=2:weightb=0:trellis=0:weightp=0 -a 1,1 -E faac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 1,1 -A "AAC","AC3" -f m4v -v -o OUTPUT

# Encoded output file extension
m4v

... to give me output video with not 1280 but 720 pixels per scan line across the screen. When I tell kmttg to encode with that hb_my_appletv_720 profile ...



... I wind up with an .m4v output file that is suitably detelecined, but it only has video resolution comparable to that of an ordinary DVD. The encode process takes much less time, though, so I consider the loss of video resolution to be a very small price to pay.

Monday, April 4, 2011

TiVo to Mac to Apple TV — Part III, One-Stop Shopping

In TiVo to Mac to Apple TV — Part I, Moving Movies I showed how I make Apple TV videos out of movies that my TiVo Premiere has recorded from, say, the Turner Classic Movies HD channel, and that I've then downloaded to my Mac. Then in TiVo to Mac to Apple TV — Part II, Capturing Captions I showed how to turn the closed captions in the original video into "soft" subtitles in the Apple TV version: subtitles I can turn on and off at will when I watch the video on my Apple TV.

I've now discovered a better way. It dawned on me that I can use a single application, kmttg, to do it all.

kmttg is a so-called "TiVoToGo" app that knows how to download recordings from a TiVo to a Mac or a PC over a home computer network. It's also a Swiss army knife of useful tools for decrypting and re-encoding the downloaded recordings for other uses.



In the above screenshot, kmttg is set to download and decrypt "The Picture of Dorian Gray," which my TiVo Premiere has already recorded from TCM HD. After the decryption takes place, I'll have a The Picture of Dorian Gray (03_12_2011).mpg file on my Mac, in whose name the (03_12_2011) reflects the date the movie was recorded by the TiVo. The .mpg filename extension reflects the format of the video that results from kmttg's "decrypt" stage ... a format that will not work on an Apple TV.

The checkmark by kmttg's "metadata" stage — next to the "Start Jobs" button, near the top of the kmttg window — tells kmttg to make a copy of this information:

title : The Picture of Dorian Gray
seriesTitle : The Picture of Dorian Gray
description : Corrupted by a lord, Oscar Wilde's London aristocrat stays young, but his portrait begins to age. 
time : 2011-03-12T13:30:00Z
mpaaRating : N8
movieYear : 1945
isEpisode : true
isEpisodic : false
showingBits : 1
starRating : x5
displayMajorNumber : 890
callsign : TCMHD
seriesId : MV006454
vActor : Sanders|George
vActor : Hatfield|Hurd
vActor : Lansbury|Angela
vActor : Reed|Donna
vActor : Gilmore|Lowell
vActor : Lawford|Peter
vActor : Fraser|Richard
vActor : Owen|Reginald
vActor : Bilbrook|Lydia
vActor : Lowry|Morton
vActor : Walton|Douglas
vActor : Forbes|Mary
vActor : Greig|Robert
vActor : Carpenter|Lisa
vActor : MacGill|Moyna
vActor : Bevan|Billy
vActor : Mander|Miles
vDirector : Lewin|Albert
vProducer : Berman|Pandro S.
vProgramGenre : Horror
vSeriesGenre : Horror
vSeriesGenre : Movies

That metadata information accompanied the movie itself when the TiVo recorded it. In certain situations, it's nice to save the original metadata information somewhere.

The checkmark next to the "decrypt" stage in the screenshot tells kmttg to not only download the movie file but also decode the downloaded file, removing TiVo's copy protection from it. This is perfectly legal to do, as long as you don't share the decrypted recording with other people.

I put a checkmark by the "encode" stage in the screenshot to tell kmttg to convert the downloaded movie file so it will be usable by an Apple TV. It learns what kind of conversion to do from the encoding profile I've selected just below the "Start Jobs" button: hb_my_appletv.

hb_my_appletv is an encoding profile I defined myself. In the ~/Desktop/kmttg_v0p7t/encode folder which came with kmttg are several files with an .enc extension, among them hb_appletv.enc. These are actually text files. After quitting kmttg, I duplicated hb_appletv.enc in Finder, changed the duplicated file's name to hb_my_appletv.enc, and opened it in TextEdit, seeing:

# Description (single line, keep short)
Handbrake AppleTV: m4v container, AppleTV preset (h.264 video, aac & ac3 audio)

# Encode command or script (single line)
# Known keywords: FFMPEG, MENCODER, HANDBRAKE, PERL, INPUT, OUTPUT, PWD, CPU_CORES, SRTFILE
HANDBRAKE -i INPUT --cpu CPU_CORES --preset AppleTV -f m4v -D 1,1 -A "Stereo","AC3" --rate 29.97 -v -o OUTPUT

# Encoded output file extension
m4v

The line beginning with HANDBRAKE is the important one. It tells kmttg how to invoke the popular video re-formatter HandBrake to encode my "The Picture of Dorian Gray" file for Apple TV as a file using the .m4v filename extension.

This HANDBRAKE ... line in the original hb_appletv.enc file doesn't, however, tell HandBrake to capture the closed captions that are embedded in the input .mpg file.

To do that, I need (I'm still in TextEdit) to change the line that begins with HANDBRAKE to include:

--subtitle 1

That gives, as the full contents of the modified hb_my_appletv.enc file:

# Description (single line, keep short)
Handbrake AppleTV: m4v container, AppleTV preset (h.264 video, aac & ac3 audio)

# Encode command or script (single line)
# Known keywords: FFMPEG, MENCODER, HANDBRAKE, PERL, INPUT, OUTPUT, PWD, CPU_CORES, SRTFILE
HANDBRAKE -i INPUT --cpu CPU_CORES --preset AppleTV --subtitle 1 -f m4v -D 1,1 -A "Stereo","AC3" --rate 29.97 -v -o OUTPUT

# Encoded output file extension
m4v

This insertion of --subtitle 1 simply says that HandBrake should include as optionally displayed "soft" subtitles in the output .m4v file the closed captions, embedded in the input .mpg file, whose "track number" is 1.

The line beginning with HANDBRAKE and ending with OUTPUT is a single line of text. In the TextEdit window it wraps around. I need to be sure, when I'm editing the line, not to accidentally hit the Return key, which would divide the one line into two and make the encoding profile fail to work properly in kmttg later on.

I can then save the edited hb_my_appletv.enc file and quit TextEdit. The next time I launch kmttg, I will be able to choose the encoding profile hb_my_appletv, as seen in the screenshot above.

Tips and pointers:

1. In iTunes Preferences: Advanced ...



... "Copy files to iTunes Media folder when adding to library," if checked, will cause iTunes to make a brand new copy of your (big) .m4v file when it is added to your iTunes Movies library, so to prevent that from happening, make sure "Copy files ... " is unchecked.

2. kmttg wants to run AtomicParsely at the end of its "encode" stage. AtomicParsely inserts the metadata information I mentioned earlier in this post into the encoded .m4v file. I find, unfortunately, that using AtomicParsely causes problems later on, when the .m4v file has been added to the iTunes Movies library. So, prior to downloading and decrypting The Picture of Dorian Gray.mpg and then encoding The Picture of Dorian Gray.m4v, I disabled AtomicParsely in the kmttg configuration:



Under the Programs tab I cleared the box next to AtomicParsely, and clicked OK. (To bring up kmttg's configuration window, just choose "Configure ... " from kmttg's File menu.)

3. Instead of using AtomicParsely, after kmttg is done with its "encode" stage and the (in this example) The Picture of Dorian Gray (03_12_2011).m4v file has been generated, I use the freeware application MetaX to specify its metadata tags. In Finder, I delete the date information in the filename to obtain The Picture of Dorian Gray.m4v. I drag the file's icon to the MetaX icon on my Dock ... or else, I launch MetaX and use its Open icon to locate The Picture of Dorian Gray.m4v. When I do so, I'm asked whether the file is a Movie, a TV Show, or a Music Video, and I choose Movie. MetaX finds the movie in an online database and fills in its metadata tags automatically:



Notice that it has found poster art for the movie. I can change it or any of the other metadata tags it has filled in for me. Once I am satisfied, I click on the Write & Share icon. MetaX takes a few minutes to rewrite my The Picture of Dorian Gray.m4v file with the new metadata tags filled in, and then the file is automatically added by MetaX to my iTunes Movies library.

5. When you download kmttg and run it for the first time, it automatically downloads various pieces of software that it wants to have in its arsenal, HandBrake included. However, the "command line interface" (CLI) version of HandBrake that kmttg downloads is currently an obsolete one, version 0.9.4. Not only does 0.9.4 have some bugs in it that can impair its use for kmttg encodes, the latest official version (0.9.5) of HandBrake CLI can run a whole lot faster on newer Macs that support so-called "64-bit" code.

You are well advised to go to this page and click on the "Download (64 bit Intel)" link under Mac OS. If you have an older Mac, click on the "Download (32 bit Intel)" link instead. You'll receive a disk image file called HandBrake-0.9.5-MacOSX.5_CLI_x86_64.dmg. (The final "_64" will be missing for the 32-bit version.)

Open that .dmg file and you will obtain a virtual disk on your desktop with the same name as the .dmg file. Open the virtual disk and you'll see a window containing a HandBrakeCLI app and a doc folder. Create a HandBrake 0.9.5 CLI folder somewhere (say, on your Desktop or in your Applications folder) and drag both of those items to it, thereby making copies of the two items. (You can then Trash the .dmg file and eject the virtual disk.)

I actually put my HandBrake 0.9.5 CLI folder in a subfolder of my Applications folder. Then I launched kmttg and, under its File menu, selected Configure ... . A kmttg configuration window opened, and I clicked on the Programs tab. Then I double-clicked in the handbrake box and navigated to my HandBrake 0.9.5 CLI folder, and within that to my HandBrakeCLI app. I clicked on Choose File to see:



I clicked on OK and the kmttg configuration window went away. From that point on, my HandBrake encodes in kmttg used the 0.9.5 version.

Saturday, March 26, 2011

Check out my "Streaming Media 101: Do You Hulu?" Google Doc

If you are, like many of us, baffled by the wide range of ways to stream videos from the Web to your computer or your television today, check out my "Streaming Media 101: Do You Hulu?" Google Doc.

The article is a work in progress, and I'm continually revising it and adding to it. If you have any questions or concerns that you would like me to address in the article, please feel free to leave a comment to this blog post telling me what changes or additions you'd like to see. Thanks.

Saturday, March 12, 2011

TiVo to Mac to Apple TV — Part II, Capturing Captions

In TiVo to Mac to Apple TV — Part I, Moving Movies I showed how to make Apple TV videos out of TiVo recordings of old movies shown on the Turner Classic Movies HD channel — or, for that matter, of any TV shows your TiVo has recorded and that you have downloaded to your Mac.

The workflow I gave there works miracles, but one miracle it cannot work is adding subtitles to an Apple TV-compatible video file.

TCM HD shows its movies — the vast majority of them — with closed captioning for the hearing-impaired, of whom I am one. When I, using kmttg, download one of these TCM HD recordings to my Mac, the closed captions come along for the ride. They're embedded in the digital video stream.

Let's say, for example, that I download a recording of the 1956 movie The Searchers from my TiVo Premiere to my Mac. A copy of the recording appears on my Mac in a file called The Searchers.TiVo. (The actual The Searchers ________.TiVo filename as saved by kmttg would contain the date of the original recording in place of the ________, but I'll ignore the inclusion of the date in the filename for purposes of this post.) I can then tell VideoReDo TV Suite version 4 with H.264 (VRD) to trim off the unwanted extra material at the beginning and end, and to save the result in a new Mac file. (To use VRD on a Mac, you also have to employ the likes of Parallels Desktop 6 for Mac to let the Mac run Windows.)

If I used the previous post's workflow, I would save the final result as The Searchers.mp4, a video "container" or "wrapper" file in the MPEG-4 format. That file would house an H.264 video stream along with an AAC audio stream. It could in fact be added to my iTunes movie library and played successfully on my Apple TV. The only problem is, VRD isn't presently capable of turning the closed captions in the original MPEG-2 file into subtitles in the MPEG-4/H.264 output file, the one that would be given an .mp4 filename extension.

That's a shame, because the Apple TV is perfectly capable of rendering subtitles that are contained in .mp4 files. An especially nice feature of the way it does so is that the user can turn subtitle rendering on and off for any particular video file at any moment in time, on the fly, while viewing the video on the TV to which the Apple TV connects.

When subtitles can be turned on and off at the whim of the user, they're called "soft" subtitles. When a video's subtitles can't be turned off and on — they're "burned into" the image, so to speak, and they're always "on," and so the video player (the Apple TV, in this case) simply can't turn them off — they're "hard" subtitles.

That's the difference between "hard" and "soft" subtitles. Now, how can I give my .mp4 files soft subtitles?

Step 1

The first step I do is to tell VRD to create a The Searchers Trimmed.mpg output file containing my trimmed selection of video material. The filename extension is now .mpg instead of .mp4. That means the VRD output file is an MPEG-2 "container" file that houses, basically, the selected swath of the original video ... and this time it's not going to be re-encoded to a different format, i.e., MPEG-4/H.264.

When you start VRD, you'll see this window. Click on the "Open Video" button ...

You see an "Open" dialog. Navigate to the (in this example) The Searchers.Tivo file and open it ...

Now, use VRD's editing tools to select a swath of the input video to save. Then, click on the "Save As" button ...

Clicking on the "Save As" button brings up another dialog. If "Save as type:" is not already set to "MPEG2 Program Stream (*.mpg)" click the V button to get ...

In the drop-down menu, select "MPEG2 Program Stream (*.mpg)". After the drop-down menu disappears, click on "Save" in the "Save As" dialog ...

The VRD window will shrink to become a small window with a progress bar while the "Fast Frame Copy" is happening. When it's done, the small window will replaced with one confirming the completion of the output operation. When you click "OK," the main VRD window reappears. You can close it at this point.


Step 1 goes pretty fast — about half an hour for a two-hour movie — because VRD is doing a "fast frame copy" instead of a major re-encoding of the video.

This way of doing things means the closed captioning embedded in the original video gets passed to the output The Searchers Trimmed.mpg video file absolutely intact.

Step 2

Next, I pass The Searchers Trimmed.mpg as input to CCExtractor, an application I run on my Mac from the command line in Terminal.

Drag the CCExtractor icon from the Desktop and drop it on a new Terminal window ...

Now, drag the (in this example) The Searchers Trimmed.mpg file from Step 1 and drop it on the Terminal window, and press Return ...

CCExtractor will begin extracting the closed captions from the The Searchers Trimmed.mpg file ...

When CCExtractor is done, the Terminal window looks like this. A file called The Searchers.srt will now be in the same folder as The Searchers.mpg is in. You can quit the Terminal application.  

CCExtractor creates, over a period of perhaps ten minutes, a text file called The Searchers.srt that contains the closed captions themselves, along with timing information to show when and for how long each caption should be displayed.

Step 3

Now I use HandBrake — specifically, I use the Mac GUI version — to re-encode The Searchers Trimmed.mpg, the output file I made when I used VRD in Step 1, as The Searchers Trimmed.m4v. The .m4v extension indicates an MPEG-4/H.264 video file that is internally constructed in a format that is specifically compatible with QuickTime, iTunes, and Apple TV. In other words, it's not a "generic" MPEG-4/H.264 video file; if it were, it would have an .mp4 filename extension instead.

Here, I have selected The Searchers Trimmed.mpg as the input file to HandBrake. The output file will be called The Searchers Trimmed.m4v. For purposes of re-encoding the input file, I'm using a group of video and audio parameters called "My Apple TV 2 960x544," which I have previously defined. 


I've clicked on the Subtitles tab, then on the "Add External SRT ..." button, to get the following file selection dialog ...


I choose The Searchers Trimmed.srt ...


... and I see this. Notice that I have not clicked the "Burned In" checkbox, although I've clicked the "Default" checkbox so that these will be the default subtitles to be used during playback. (Actually, they're the only subtitles I've specified, but it's theoretically possible to specify more than one set.) Now I'm ready to begin creating my The Searchers Trimmed.m4v output file, so I click on the "Start" button near the upper left corner, and pretty soon I see ... 


The progress bar at the bottom of the window may crawl along for several hours.


That's how I use HandBrake's GUI interface to tell it that, in re-encoding the original The Searchers Trimmed.mpg file as The Searchers Trimmed.m4v, it should use an external SRT file as a source of subtitles. This external file is, of course, The Searchers Trimmed.srt, as output earlier by CCExtractor. By expressly telling HandBrake not to burn these subtitles in, I in effect order it to produce soft, rather than hard, subtitles in its The Searchers Trimmed.m4v output file.

I also tell HandBrake to use my own specially constructed "My Apple TV 2 960x544" preset, which yields an .m4v output file that has 960x544-pixel video resolution at 29.97 frames per second. That resolution is exactly half of the input's in both the horizontal and vertical directions, while the frame rate of the output is the same as that of the input. I expressly tell HandBrake to do no cropping of the original image, so any black bars in the original will show up unchanged in the copy. (Purists will hate that, but I believe HandBrake operates more quickly this way, since cropping necessitates that it compute non-square, anamorphic pixels from the input's square, non-anamorphic ones.) I'm using HandBrake's RF 20 "constant quality" video quality setting, which I feel gives me perfectly acceptable video quality all through the movie.

Fair warning: This step can take a long time — up to six hours or so for a two-hour movie, depending on how slow your Mac is. Re-encoding a two-hour .mpg file as an .m4v can be a lengthy process, and adding soft subtitles makes it even longer.

Step 4

Finally, after the long wait for Step 3 to finish is over, I can add The Searchers Trimmed.m4v to my iTunes movies library. Before I do so, in its Finder window I'm going to rename it The Searchers (SS).m4v so that I'll remember from here on out that it contains soft subtitles. When I add it to my iTunes movies library, it will have the iTunes-internal name The Searchers (SS).

It is my custom to, at this juncture, type Command-I to bring up iTunes' Get Info window on the newly added movie and add poster art via the Artwork tab. (I find the poster images in Google Images by Googling, for instance, "the searchers" poster.) I add information under other tabs as well — usually, Description, under the Video tab, and Year, under the Info tab.

These informational nuggets I obtain by opening The Searchers.TiVo.txt in TextEdit. The Searchers.TiVo.txt is a file that gets created by kmttg way back in Step 1, by virtue of having that application's Metadata option checked at the time I download The Searchers.TiVo from my TiVo to my Mac. The Searchers.TiVo.txt contains such "metadata" items as title, seriesTitledescriptiontimempaaRatingmovieYear, and so forth and so on, for each movie that the TCM HD channel shows.

I also employ a little trick, while I'm editing the movie's Get Info window in iTunes: I set it's Genre to the first letter of its name! In the case of The Searchers (SS), I set Genre to "S." Doing this lets me, when I'm looking at my movies library on my Apple TV, select the Apple TV's View by Genre tab and then see, in effect, an alphabetical index into my movies library!

Here's what it all looks like in the main iTunes window on my Mac (click on the image to enlarge it):



At this point, I am able to play The Searchers (SS) in iTunes on my Mac, which I can tell to show the "English" subtitles during playback ...



... or not, as the mood strikes me.

I can likewise play The Searchers (SS).m4v in QuickTime Player, or in VLC ... or, via iTunes on my Mac, on my Apple TV. In each of those players, optionally turning on the "English" subtitles lets me view text that originally started out as closed captioning in the TCM HD cablecast stream.

And that's it! There are no more steps ...

... however, I should add that it's OK to delete:

  • The The Searchers.TiVo file that was downloaded by kmttg
  • The The Searchers Trimmed.mpg file that was output by VideoReDo
  • The The Searchers Trimmed.srt file that was output by CCExtractor

The only file you absolutely need to keep is The Searchers Trimmed.m4v. (I also tend to keep The Searchers.TiVo.txt, because it has other uses that I won't detail here.)

You may nevertheless choose to keep both The Searchers Trimmed.mpg and The Searchers Trimmed.srt, if (see Apple's New AirPlay Comes to Air Video) you want to be able to use the Air Video iPad/iPhone/iPod Touch app to send Air Video playback of (in this example) The Searchers Trimmed.mpg from the handheld mobile device to a big TV screen in your home, using Apple's new AirPlay/Home Sharing capability. In this Air Video/AirPlay scenario, your Apple TV is again used as an intermediary device.

If you also save the The Searchers Trimmed.srt file, Air Video will optionally (when doing a "Live Conversion") superimpose subtitles from it over top of the video on the touchscreen of the handheld iPad/iPhone/iPod Touch device ... and also over top of the video on the large HDTV screen to which the video + audio playback is being routed via AirPlay.

Still and all, it's not really necessary to keep The Searchers Trimmed.mpg and The Searchers Trimmed.srt as a means of being able to view subtitles during Air Video/AirPlay playback, since The Searchers Trimmed.m4v can reproduce its soft subtitles during Air Video play as well as during the more direct scenario of play via iTunes.

Thursday, March 3, 2011

TiVo to Mac to Apple TV — Part I, Moving Movies

2nd-Generation
Apple TV
A fun thing: record movies from cable TV on your TiVo, then capture the movies on a Mac so they can be watched on an Apple TV. Meanwhile, delete the original recordings from the TiVo to free up space.

It's a good way to avoid buying DVDs. Unfortunately, there's no really simple way to send movies from a TiVo to an Apple TV. One reason is that programs recorded on a TiVo are in a different digital-video format than the Apple TV can use.

So I have to:

  1. Move each "keeper" movie from my TiVo to my Mac over my home WiFi network. The Mac software I use to do that is kmttg. It makes a file on my Mac that contains a copy of the original TiVo recording. That file has .TiVo as its filename extension. See Archive HDTV Recordings to Your Mac, Then Stream Them Back to Your TiVo! for more about how to use kmttg.
  2. Decode the Mac copy of the recording so that it is no longer encrypted. That makes it into an unencrypted video container/wrapper file in the MPEG-2 format, with an .mpg filename extension.
  3. Edit the MPEG-2 container file to remove any unwanted sections. The movies I record from Turner Classic Movies HD usually have a lot of trimmable material (sorry, Robert Osborne and Ben Mankiewicz) prior to the start of the actual movie, plus more at the end. This step makes what I call a "trimmed" MPEG-2 file. The filename extension again is .mpg.
  4. Convert the trimmed file to MPEG-4. The new MPEG-4 container/wrapper file will have .mp4 as its filename extension. Internally, it needs to contain a copy of the original MPEG-2 video that has been converted to the H.264 encoding format. It also must contain a copy of the original digitally encoded audio converted to the AAC encoding format, so that the file will play properly on the Apple TV. In short, the original video/audio must be recoded.


VideoRedo
TV Suite w/ H.264
Steps 2 to 4 can be done all at once in VideoReDo TV Suite version 4 with H.264. I'll refer to it as VRD. VRD is, at $95.99, admittedly pricey. Unfortunately, though, I know of no other software that will do what it does with anywhere as much flexibility and ease of use. For those who are interested in building a TiVo-to-Mac-to-Apple TV video collection, it's money well spent.

Parallels Desktop 6
For Mac
A problem with using VRD is that it's Windows-only and won't run on a Mac. I use Parallels Desktop 6 for Mac to deal with that. Parallels Desktop ($79.99; but check for discount offers) is commercial software that lets me install Windows XP Professional Edition (or various other versions of Windows) into a so-called "virtual machine" or "VM" on my Mac. I fire up my WinXP VM in Parallels Desktop, and suddenly my Mac is a Windows XP machine. The WinXP VM runs in (you guessed it) a window under Mac OS X, so I can hop back and forth between it and the Mac desktop, as well as use other Mac applications, all while Parallels Desktop is running and executing VRD.

Installing Parallels Desktop takes a while, and then installing Windows in Parallels Desktop takes another long while — plus, you do have to buy a copy of Windows. Then you have to download and install VRD in Windows. Don't expect to rush right into any of this. Don't think it can be done on the cheap, either.

Before I go into more detail on how to do all this, a quick word about so-called "container" files. Here's a picture of one:

The components of a QuickTime container file

This graphic comes from this one-page "Container vs. Codec" PDF, which discusses the geeky question of what the difference is between a container file and the codec or codecs that create its various component parts. In it, "QuickTime file" is being used synonymously with "MPEG-4 container file."

For purists: H.264 and AAC are actually better spoken of as encoding formats or encoding types, not codecs. There are various actual codecs that can produce, say, video output in the H.264 format. One of these codecs is called x264. But x264 is the codec, H.264 the encoding format or type.

That said, just about everybody uses the terms "codec" and "encoding format/type" interchangeably.

Now for more detail about how I do Steps 2 through 4 in the list I gave above:

In my Mac's WinXP VM window — i.e., in Parallels Desktop — I start VRD and click it's big blue Open Video button ...


The Open Video button is huge ...


... to browse to and open any particular TiVo recording, such as Black Orpheus.TiVo ...


Here, I'm selecting the "Black Orpheus.TiVo" input file ...


... that kmttg has transferred to my Mac. (The original recording date has been included by kmttg in the actual filename, but I'll omit it for purposes of this discussion.) This file is, of course, known to my Mac because it's sitting on one of its external hard drives. The WinXP VM can also see it and use it. Accordingly, VRD can do so, too.

VRD is capable of directly reading files such as Black Orpheus.TiVo that have been downloaded from a TiVo to a personal computer. With VRD, those files don't have to be decoded in a separate step, so Step 2 simply goes away!

VRD has flexible, easy-to-use video editing functions. It's easy to trim off unwanted material at the beginning and end of a video:

I've selected (shown in green on the timeline)
just the actual movie itself...



If you look closely at either end of the green part of the timeline, you'll see a red triangle. Those triangles were put there automatically by functions in VRD's Ad-Detective menu. Ad-Detective basically scans your video to find spots where the screen goes fully dark, which is called "video black." When there is a transition between two separate portions of the program-as-a-whole — say, between the actual program and a commercial — there is a brief fade to video black.

Ad-Detective puts a "scene mark" — a red triangle — at each point where the screen goes black. In a typical TCM movie recording, there are no spots in the middle of the movie where I need a scene mark, so I typically do the scan at the start of the recording, manually move the program cursor  to just before the end of the movie, and re-initiate the scan. I can fine tune the result by manually adding or removing scene marks at will. Then I use function keys F5 and F6 to move backward and forward among the scene marks that are generated. I can fine tune the result by manually adding or removing scene marks at will.

Once I have just two scene marks that bracket the actual movie I want to save, I:


  • Press F5 to get to the first of the two scene marks
  • Press F3 to set that point as the start of my actual selection
  • Press F6 to get to the second scene mark
  • Press F4 to set the end point of my actual selection
  • Press the Add Selection button to turn the timeline green between the start and end points


With a little more effort, I would be able remove commercials from the middle of a TiVo recording ... except that TCM shows its movies commercial-free, so I don't need to go to any further trouble in this regard. Step 3 is way easy. Now it's time for Step 4.

Step 4 is hard at first, but much easier after the first time you attempt it. Once I've finished selecting the portion(s) of the original video I want to save, I just click the Save As ...  button that appears in the VRD window, thus bringing up a Save As file dialog. In that dialog I tell VRD what folder to save the output file in, and by what filename:



Here I'm saving my output file to my Desktop as "Black Orpheus" ...



Notice that doing Step 4 right after Step 3 lets me bypass having VRD save the trimmed movie as an MPEG-2 file with filename extension .mpg, which saves me some time. Instead, I'm going to tell VRD to recode it straight away into a different format: the MPEG-4 container format.

But here's where things do get tricky.

They get tricky because I also need to tell VRD what output container and encoding formats to use.

Let's say the input file is Black Orpheus.TiVo. The .TiVo extension means the file is an MPEG-2 container file, but it's TiVo-encoded. (If it weren't TiVo-encoded, the extension would be .mpg.)

I want the output file to be an MPEG-4 container file, because that's what Apple TV needs. The MPEG-4 container/wrapper file will accordingly need to have an .mp4 extension. So I'll want to wind up with an output file called Black Orpheus.mp4.

That Black Orpheus.mp4 file will be playable in QuickTime Player on my Mac (or, for that matter, in QuickTime Player running under Windows in Parallels Desktop). It can be added to and will play in iTunes on either platform. And it can be played (via iTunes running on a Mac or in Windows) on an Apple TV.

To make sure the file works in a cooperative way with Apple-sanctioned software (iTunes, QuickTime) and hardware (Apple TV) requires some special care, however.

Just using an MPEG-4 wrapper file that has .mp4 as its filename extension isn't enough. I also have to make sure that the video and audio encodings that are contained within the wrapper file are of the right sort.

The video portion of the contents of the wrapper file has to use, specifically, the H.264 video encoding format. The audio portion has to use the AAC audio encoding format. Both encoding formats are supported by VRD, but I have to know how to select them and manage them properly. This is the trickiest part of all.

Here I again show my earlier dialog for saving VRD's output file:

That Save As dialog, again ...


Notice the "Save as type:" specification: "Apple TV H.264 MP4 (*.mp4)". It refers to an output profile that I myself created in VRD:

My "Apple TV H.264 MP4" Profile


I created it by clicking on the Options button in the Save As dialog shown above. A form like the one immediately above opened. I filled in the various fields in it, using the values shown, and chose "Save as new profile." That let me fill in the "Apple TV H.264 MP4" profile name at the top of the form, and when I clicked the OK button, my new VRD profile got saved for future use.

From that point on, any time I saved an output file in VRD I could select "Save as type: Apple TV H.264 MP4" in VRD's Save As dialog. I could do so by clicking on the downward-pointing arrow at the right end of the "Save as type:" input field in the dialog to get a menu:




In the menu I could simply select my "Apple TV H.264 MP4" profile whenever I needed to produce an output file that would eventually be sent to an Apple TV.

Notice that (*.mp4) is shown as an indication of the filename extension that will be used by default for my Apple TV output file. That's the extension that goes along with the "MP4 File (Generic)" file type that you can (barely) see in the Edit Output Profile form above. This generic MP4 file type is actually what I referred to earlier as an MPEG-4 "container" or "wrapper" file.

Now, let's go back and take a look at the various settings I made in the "Apple TV H.264 MP4" profile shown earlier in my Edit Output Form screen snapshot:

  • Output mode: Force Recode tells VRD to recode all parts of the input video, not just those that aren't already in the H.264 encoding format (which would be the case with Output mode: Intelligent Recode). In my situation, there is no H.264 material in the input, so this output mode choice would seem to make little difference. However, Force Recode lets me specify Avg Bitrate below, while Intelligent Recode does not.
  • Max resolution: 960 x 544 tells VRD to make a video frame 960 pixels across by 544 pixels vertically. My TCM HD input is 1920x1088, so this involves reducing the output resolution by exactly half in each direction. The Apple TV does not support high-definition resolution at 1920x1088, aka 1080i/1080p video. It will play 720p video (1280x720), but I find I don't need the extra dollop of picture detail, and my assumption is that VRD can do its job faster if the output resolution is a simple fraction of the input resolution.
  • Encoding mode: Single Pass Encoding keeps VRD from taking the extra time to do a 2-pass encoding, which might give me a slightly better picture ... but the picture I get with 1-pass is excellent.
  • Avg Bitrate: 3500 Kbps tells VRD to hold the average rate at which the output video is to be decoded to a modest 3.5 megabits per second.
  • Max bitrate: 5000 Kbps tells VRD to make sure the Apple TV never has to contend with trying to decode more than 5.0 megabits of video information per second. Restrictions on average and maximum bitrate reduce the picture quality somewhat, but they hold the size of the output file down as well and allow for faster streaming of the video across a network.
  • Aspect ratio: No Change tells VRD to retain a 16:9 ratio for the width of the video frame to its height. My source material, at 1920x1080, has a 16:9 aspect ratio. The output is to have this same aspect ratio — which is the proper ratio for a widescreen HDTV.
  • Deinterlace mode: Smart tells VRD what method to use to "deinterlace" the input video, which is originally in the 1080i format. 1080i video is "interlaced" — that's what the "i" stands for — which means each video frame is divided into odd-numbered and even-numbered rows of pixels. Every (approximately) 1/60 second, one of the two groups, called a video "field," is used. Then, in the next 1/60 second, the other field is used. Hence, you can't expect to unite the two fields into a single frame, since the second field is delayed with respect to the first. That means each output frame ought to be "deinterlaced" to get rid of messy picture details known as "interlace artifacts." The Smart method, I have found, works best for me. You can experiment with the other settings for deinterlace mode — None, Auto, BOB, and WEAVE — to see if you like them better.
  • Framerate: No change means VRD will honor the frame rate of the source video — in my case, 29.97 frames per second. This is fractionally less than the 30 fps or 60 fields per second I talked about earlier. The reason for the fractional difference is quite technical ... but it doesn't really matter here. All you need to know is to tell VRD not to change the source video's frame rate in the output video.
  • Audio encoding type: AAC tells VRD to re-encode the source audio to use the AAC encoding format that Apple TV expects.
  • Bitrate: 128 Kbps tells VRD to limit the rate at which the Apple TV's audio decoder has to deal with audio information to 128,000 bits per second.
  • Sample rate: No Change tells VRD that the output audio should provide "samples" at the same rate, measured in KHz, as the input.
  • Compression: None tells VRD not to try to reduce the differences between very loud sounds and very soft ones.
  • Normalization: None tells VRD not to try to turn up or down the overall sound level.

These are the parameters that will control what kind of output VRD will produce when I click on the Save button in the Save As dialog shown earlier.

As far as how long VRD will take to produce this output, this screen snap tells the story:




Yes, it does take some time.

Once the output process is complete, I will have a Black Orpheus.mp4 file sitting in the output folder I specified. This file can then be added to my iTunes Movies list, from which it can be streamed to my Apple TV. Mission accomplished.


* * * * *


There is one slight caveat, however. When I add my .mp4 output file to my iTunes Movies library, I like to go to the trouble to add poster art to it — something which can be easily enough done in iTunes's Get Info dialog, if I use my Web browser to Google to a suitable poster image, copy it to my Clipboard, and paste it into the Artwork pane of Get Info.

When I click Save, the Get Info window should promptly disappear, and the new poster art should promptly show up in cover flow in my Movies library.

Instead, it can take up to five minutes for all that to happen.

The reason has to do with how VRD incorporates into its MPEG-4/H.264 output file a geeky little thing called the "moov atom," which is, according to this discussion, "a self-contained data unit [within the video file itself] that contains information about the video file ... [It] defines the timescale, duration, display characteristics of the movie, as well as subatoms containing information for each track in the movie."

Depending on how the MPEG-4/H.264 output file is destined to be played, the moov atom is expected by the video player to be positioned in different locations within the file.

A frequent scenario is that used by an Adobe Flash Player for streaming video and/or so-called "progressive download" video. In this Flash-oriented scenario, the moov atom needs to be placed at the beginning of the file.

In other situations, the default location of the moov atom — the end of the file — works just fine.

VRD assumes the former scenario, expressly moving the moov atom to the beginning of the file.

Apple's iTunes, on the other hand, wants the moov atom at the end of the file. This appears to be the case even though the file will ultimately be streamed to an Apple TV.

It looks as if iTunes will leave the moov atom alone in a VRD output file that has been added to its Movies library ... until and unless you do something like try to add poster art to the file. In that case, iTunes will take it upon itself to move the moov atom from the beginning of the file to the end. That involves reading and rewriting the entire file, a time-consuming process.

The developers of VRD have hinted they may in some future release give users the ability to position the moov atom at the end of an MPEG-4/H.264 output file. Until that happens, we will have to put up with the irritating behavior of iTunes whenever it tries to move the moov atom on its own.


* * * * *

Further Reading:

For more detail on how to use VRD on a Mac, see my earlier blog post Using VideoReDo TVSuite on a Mac.

You can learn more about the subject of videos that play in iTunes and on iPods, iPhones, iPads, and Apple TVs from The Complete Guide to Managing iTunes Videos at iLounge.com. The article is particularly useful if the TiVo recordings you want to play on Apple TVs or other Apple gear are not movies but TV shows, since the article tells you how to fill in the iTunes Get Info tags properly for TV episodes.

Mac users who, like me, need to convert video files from one digital format to another will also want to read iLounge's The Complete Guide to iPod, iPhone and Apple TV Video Conversion (Mac). (A version of the same article for Windows users is here.)

Users who run into the problem that iTunes and QuickTime will play certain video files without their accompanying audio will want to read iPod plays video but not audio of some exported files.

For geeks only: The Complete Guide to iPod Video Formats and Display Resolutions talks about the various file formats and encoding formats of digital video and audio; the various video resolutions, bitrates, and aspect ratios; and which ones work on which pieces of Apple gear (iPods, iPhones, Apple TVs — but no mention of the iPad, since the article preceded the advent of that device).