quinta-feira, abril 16, 2015

Converting Video for use in iTunes, AppleTV and iPad

Do you have files in Matroska Video (.mkv) and want to be able to use them without reconverting everything (many hours of processing time and quality loss) on your Mac, iPad or AppleTV?
Do you want to have true 5.1 Surround Sound  (Dolby Digital) on your AppleTV and it just seems not to work?
Do you want subtitles and/or dual audio and nice covers and chapters displayed on iTunes, AppleTV or iPad?

This is a small Tutorial to do all of these things using freely available tools.

We won't be reencoding de video (the audio maybe) so this will be a fast conversion process with no video quality loss and minimal loss in audio quality.
All we will do is reencapsulate the video in a format that iTunes ecosystem understands (and reencode the audio if necessary).

1 - To follow this tutorial you will need Subler and for some portions Remux.

So you have a file in .mkv (or mp4 or avi) and Quicktime/iTunes/AppleTV/iPad doesn't play it or there is no audio or not the audio you want.
There are different paths depending on what is inside your mkv file.
The .mkv file is a container inside it has among others a Video track and a Audio track, for your Apple TV to understand the file you have to change it's container but not necessarly the contents.
The AppleTV understands among others H.264 for video, AAC for stereo and AC3 for surround, 3GPP for subtitles, so if your file has DTS or AAC 6channel or no subtitles there is a few steps to do...

So let's go:

Most my files have:
1 - Video track 720p or 1080p encoded with H.264
2 - Audio track AAC 6 channel (5.1 surround)
3 - Audio track AAC 2 channel (Stereo ProLogic II)

But apple tv and my receiver don't understand 6 channel AAC so it uses the 2 channel track with prologic II
If yout file already has a AC3 6 channel track you can skip this step. You can also skip it if you don't wan't dolby digital.

So my final files should have
1 - Video track 720p or 1080p encoded with H.264
2 - Audio track AC3 6 channel (5.1 surround) - this is optional if you want Dolby Digital on the Apple TV)
3 - Audio track AAC 2 channel (Stereo ProLogic II) mandatory if you are viewing the movies on the ipad optional if you only want to watch movies on the AppleTV with Dolby Digital
4 - optional Audio tracks in a different language in DD AC3 and/or AAC
5 - optional subtitles
6 - optional chapters track

What can we do to fix this:

If your movie does not have a AC3 6 channel track you need to put one in and convert the movie to m4v, if it does have a AC3 track skip to the next section.
1 - Launch Remux
2 - Open you mkv (or mp4)
3 - On your aac 6 channel select "Transcode to AC3 384kbps"
4 -  on the dropdown menu select m4v
5 - choose a name for your file(ex "movie.m4v")
6 - hit GO

It takes aproximatly 4 minutes to do this on my Macbook 3,1 (time depends on number of tracks, lenght of movie and other things)
Success... This file is alredy set for iTunes/iPad/AppleTV but extra "work" can be done to make things even better

Next let's create the right audio tracks, add subtitles, metadata, cover art and chapters

1 - Launch Subler
2 - Create a new file
3 - hit the "+" to add new tracks to the file
4 - find and add your movie file (ex: "movie.m4v")
5 - select the tracks you wan't to import you will wan't the video track and the ac3 track.
6 - On the AC3 track select AC3+AAC (this will import the AC3 and create a Stereo dolby prologic II version AAC wich wil be playable on the iPad) then click ADD
7 - Click on the "enable" button on the AC3 track and then on the pulldown menu select the AAC track as the fallback audio
8 - Save as "video MPEG4" or add more audio tracks (different languages or audio comentaries) and then save

Subtitles:
1 - Get the subtitles for your video (opensubtitles.org is a good place to search)
2 - Click the + on subler select the subtitles file and add (you can add multiple subtitles).
3 - Change the language to the correct language of the subtitles on the dropdown menu
4 - Save (you can repeat the process to add more subtitles)

Chapters:
1 - The process is similar to the subtitles. Get the chapter (Chapterdb.org)
2 - Click the + on subler select the chapter file and add (only add one file)
3 - Save

Metadata and cover art
1 - Subler go to file -> import -> search metadata online (or if you have a file add this)
2 - If you search online subler will prompt you to select the correct metadata and then it will prompt you to select the cover art
3 - Save

To finish
Add to iTunes by dragging to the itunes icon.
If you have home sharing enabled you will be able to view this file on the networked macs (maybe also pc with itunes), Apple TV and iPads (iphones and ipod touch maybe also).
On the apple tv you can select the language and if dolby digital is selected in the settings it will pass the DD track to your receiver, otherwise it will use the AAC prologic II
On the iPad it will playback the Stereo AAC prologic but if you airplay the file it will use DD





Etiquetas: , , , , , , , , , , , ,

quarta-feira, dezembro 30, 2009

Snow Leopard 64 bit on unsupported Macbook

According to almost everyone there is no specific advantage in running a 64 bit kernel, but if you wan't to try it on your Macbook this is the way to do it.

This was tested on a Macbook3,1 (Late 2007) 2,0 Ghz 4Gb ram.

First of all kudos for Amit Singh, Netkas and Petr.

If you read Amit´s post and Netkas you will find out that it is possible to hack Snow Leopard to run in 64bit mode on machines unsupported by Apple. Petr gave the final piece of info to enable the hack on my Macbook 3,1. (See post 99 on Netkas Blog).

Why, the need for a hack?
Apple, in their everpresent care for the users decided that for compatibility reasons it was better to disable 64 bit mode on older machines.
The reason for this is that drivers (kernel extensions) for some hardware where not ported to 64 bit so some functions would not work (namely video in my macbook). Also apple and third party software developers needed time to port 64 bit versions of their kexts.
For the normal user running the kernel in 32bit mode is not an issue sice apps will still run on 64 bit mode.

This is an hack so there might be problems. In my case sleep doesn't work yet. But if you wanna try, do it knowing that it is on your own risk.

So what do you need?
A Macbook3,1 with Snow Leopard 10.6.2 installed (10.6.2 includes 64 bit intel video driver)
A hex editor (I used HexEditor 1.4)
Some knowlege of how to input commands on terminal.app

How to do it?

Fire up Terminal.app
Backup you boot.efi sudo cp /System/Library/CoreServices/boot.efi ./boot64.efi
If boot64.efi is locked, unlock it
Fire up you hex editor open boot64.efi and go to offset 0x266e0 there should be:

0x266E0: 38 47 01 00 00 00 00 00 00 00 00 00 00 00 00 00

you will change to

0x266E0:38 47 01 00 00 00 00 00 01 00 00 00 00 00 00 00

this means that Macbook1,x or higher is allowed to boot into 64 bit mode

Enter the followin commands in terminal

sudo cp boot64.efi /System/Library/CoreServices/

cd /System/Library/CoreServices/

sudo chown root:wheel boot64.efi

sudo chflags uchg boot64.efi

sudo bless −−folder /System/Library/CoreServices/ −−file /System/Library/CoreServices/boot64.efi

Dont forget enter after each cammand and the password if asked for it

You should be able to reboot into 64 bit mode holding the "6" and "4" keys at boot time

If you wan't to make it permanent

in terminal enter sudo systemsetup -setkernelbootarchitecture x86_64

Good luck

domingo, abril 16, 2006

Jigdo Solved

What is jigdo? Take a peek at http://atterer.net/jigdo/ to see what
i'm talking about.
There is also a binary distribution for Mac OS X at http://
jigdoosx.berlios.de/
The aquajigdo app worked fine for me on tiger but the command line
itself that the app relies on doesn't work so it was back to square one.
First of all I neaded jigdo because it's hard to find iso images of
the debian distribution and also because my ISP limit's my
"international" traffic to 2Gb per month, so I had to find a way to
download the iso's from a local server.
jigdo doe's just that. It takes all the files from a template a
recreates the cd or dvd images for your burning pleasure. The big
problem was that I always got a missing library with the binaries
found on the web. And compiling from source, I tought.
So I put my hands to work and after trial and error this is what I
found.

This tested on Tiger with the developer tools included on the dvd


1 - Install the developer tools
2 - Install fink
3 - Using fink install db42 and gettext
4 - Download the jigdo source and unpack it somewhere
5 - Find a way for configure to find db.h and libintl.h What I did
was using terminal created synbolic links to these 2 libraries in /
usr/include (caution there is an existing db.h). These libraries are originaly in /sw/include/db4 and /sw/
include respectively
6 - Also symbolic link /usr/lib/libdb-4.2.dylib to /sw/lib/libdb-4.2.dylib
7 - Symbolic link /usr/lib/libintl.dylib to /sw/libintl[VERSION].dylib
8 - Using terminal again cd into the jigdo directory and do ./
configure
9 - When configure finishes do make
10 - when make finishes do sudo make install type your password and
you have jigdo.

Now you can use it to download Debian CD's or DVD's

Have fun making images

Current Projects.
Linux on a PowerBook 540c PPC with help from http://nubus-pmac.sourceforge.net/
jigdo from Mac OS X 10.4 Tiger

Development on this soon