Talk:How to get iTunes to sync other video formats to Apple TV

From AwkwardTV

Jump to: navigation, search

Contents

[edit] News & Info

• Organized & cleaned up the discussion area a bit. --jamsoft 17:44, 12 July 2007 (CEST)


[edit] Q & A

Q: Is there an applescript available to automate the conversion?
A: Yes, however it's far from ideal (see the Apple TV Fooler discussion below)


Q: Is this process entirely lossless? (i.e. no loss of video/audio quality)
A: Using the Apple TV Fooler script yes, Using VisualHub no
Q: Is it possible to fool Itunes on a windows PC? It seems that QuicktimePro can't read DivX files on winodws.

[edit] VisualHub

  • I've requested that the methods given on the main page of this article be added to the program VisualHub to easily automate the entire process. Make sure to post your thoughts in this thread if you'd like see this feature added as well.


Description
VisualHub bridges the gap between numerous complicated video formatting standards, and people that just want to get the job done - just what you would expect from the Mac. If you're looking for something a little more flexible, VisualHub's up for that challenge too. An extensive Advanced panel lets you change all pre-set aspects of encoding...and then some.


Automation Tech Preview
Starting with VisualHub 1.24, a Tech Preview of the automation support in VisualHub 2.0 was offered. This allows VisualHub users to create their own automated workflows (or “scripts” as the kids are calling them nowadays) that can do anything from convert a video to another format with a single click, or watch a server for a set of files and launch a distributed Xgrid workflow, burning a disc when complete (and more. People can go absolutely nuts with scripts. I should know...). VisualHub is automatable via the AppleScript language - simple, concise, yet powerful.
Automation Guide
Script Dictionary


External Links
Techspansion Website
Techspansion Support Forums
General Discussion
Knowledge Base
Support
Demands
Automation


[edit] Random Talk

• This is perhaps the most interesting development on ATV so far. An automated way of altering and getting the media into itunes would be great.


Quote:
iTunes sends the Apple TV a list of all the video files in its library and the Apple TV copies those it believes it can play. ATV then returns a list of files it can't play to iTunes
  • Instead of mucking with each and every video file, why not spoof this check? Has anyone looked into, say, making iTunes think ATV returns the full list of files as eligible?
-Grinningcat 05:04, 7 July 2007 (CEST)


[edit] Apple TV Fooler.zip

Hello all
I've modified one of Apple's demo applescripts, that originally allowed conversion of movies/pictures into .mov format, to do what is described in this how to. It functions as a droplet, so you just drag stuff onto the icon and it does it's stuff. The only thing I can't make it do is re-scale nothing.mov to the proportions of the new file, but this doesn't seem to cause any problems, as on appleTV you can't play the movie in anything other than fullscreen anyway - so if anything it'll only look ugly in iTunes.
This can batch convert items as well as do one at a time, and uses the extensions listed as working on this site to filter what it can convert. Of course you'll need to make sure you've got the relevant codecs and stuff installed before you run it, as currently it doesn't check.
I'd like to make it add converted files to iTunes automatically after processing them, but I can't seem to make it work; it tells me "iTunes got an error: Can't make some data into the expected type." I don't know if this is because the methods I'm using to try to add the files to iTunes are reserved for audio files.. I've left my current iTunes code in the version I've updated commented out, so feel free to take a look.
It puts a temp folder on the desktop as part of the process. I had the folder hidden for a while, but then realised that the various failed attempts at running before I got it sorted left loads of hidden folders lurking when it crashed before deleting them. Theres probably a smoother way to do this but this will do for now.
This needs TESTING really. I've not hacked my apple tv as of yet, so I've only tried it with a couple of mpeg files that apparently AppleTV can handle without hacking. I've also not tried it with batches.
Anyway, check it out: Apple TV Fooler.zip
--MNiT 11:40, 12 June 2007 (CEST)
Oh, should mention: Currently this deletes the file you're processing after it's done. YOu can stop it doing that by commenting out the two lines in the script. I've put a comment in highlighting where they are so they should be easily found.
--MNiT 12:41, 12 June 2007 (CEST)

It doesn't seem to do anything with files that have already been saved to .movs, otherwise it seems to work - good job!

There is a list of properties at the very begining of the script that defines which file formats it should accept. I've added .mov to the list and updated the links.--MNiT 21:06, 19 June 2007 (CEST)
Good Job!, working perfectly

Matroska? Using Perian 1.0b4 and all formats I've tried work except .mkv (added .mkv to allowed file formats in script). Great otherwise! Thanks. -pwbset (6.27.07)

Hi. Quicktime takes its time loading matroska files, so the process needs to wait till the file is entirely loaded before it can work correctly as far as I can see. I'm not sure how to implement this with applescript, or if its even possible to implement it.. I'd stick to doing matroska files manually for now. mnit PS, matroska 720p and above files are too much (for some reason) for the apple tv to deal with.. a very annoying problem I'm currently trying to work my way around.
Getting a script error during any batch conversion that crashes QT and ATV Fooler after the final copy process. Appears randomly, but happens very often. Since the final "wrapped" file is copied it's not a big deal, but stops batches, which is annoying. - pwbset (6.28.07) Image
Upon updating Quicktime Player to 7.2 via Software Update Apple TV Fooler no longer works. The new Quicktime Player application quits with NSInternalScript error just after the "paste" action, but before "flattening". Tested with multiple .avi files. Any ideas? -pwbset (7.13.07)
Seems to be on the "save self contained document 1 in file new_file" line, document 1 seems to be right, new_file seems to be right... -pftqg (7.14.07)
I had a lot of bugs along these lines when scripting this originally, I'm not too well versed on applescript so I've got to admit to being clueless... mnit


--Sorry, but this is not working for me. I can watch the resulting video in iTunes just fine, but ATV just plays black screen with no sound. Could it be the 5000 kbps bitrate limit Apple says the ATV has for h.264 files? The file I am trying to play is a raw dvd uncompressed file that weighs in at about 5,600 kbps. Since we are sticking an h.264 tidbit on the front of the file, I wonder if iTunes is choking on it? If so, that would make this entire process mostly useless since most new dvd's are going to be over 5,000 kbps...

To clarify, I HOPE there is just something wrong with my setup. Anyone else having problems watching streamed movies produced this way? --Stuka 21:31, 14 July 2007 (CEST)

silly question perhaps but, have you got perian installed on the ATV? Otherwise I'm not sure what could be happening. mnit Oh, are these matroska files? Apple tv can't really deal with matroska at all for some reason - its highly annoying.

-- Would it be possible to integrate the *auto add to itunes* feature of Movie2iTunes? I'm in no way connected with them, but this would be really useful. That specific droplet doesn't work I think because of the Apple TV's detection methods. I.e. needs to be h264 at the start. Thanks! --Sembdes 22:07, 24 July 2007 (CEST)

I had a good long fiddle trying to get the very same script integrated with this but failed every time. Again I'm not really very good with applescript... ATVFooler is about the limit of my expertise, and most of that is harvested from an Apple example script...
--I added this code adapted from a Doug's Applescript tutorial in place of the original commented out section and it worked perfectly:
--adds converted file to itunes
tell application "iTunes"
launch
add new_file
end tell


--Josephbphillips 05:34, 14 November 2007 (CET)


-- I have just tested the script on Leopard and it now works with no issues. -- agreen91 21:03 CEST 28/10/2007

-- I tried this on Leopard and it mostly works, but it errors out after deleting the original and coping the mov to the original directory. It leaves the temp folder with a copy of the mov in it on the desktop. The error says "Can't make (Path:to:my:desktop:tempfoldernumber) in to type reference". Any ideas?
-- I am also seeing the "can't make alias into type reference" error on Leopard. Any apple scripters out there? -- pwbset 29/11/07
--I fixed it, on my machine anyway. Under the heading "--this sub-routine processes files", one of the last lines is "delete temp_folder". Either delete that line or comment it out by adding -- in front of the line. This worked for me. I also added a line immediately above that to close quicktime when finished. Logically enough, it simply says "quit".--Josephbphillips 05:16, 7 December 2007 (CET)
Awesome project, though! Much easier, faster, and better quality than converting with VH. The only issue I have (other than the error listed above) is that I would like to also automate the process of adding meta data. I have tried to understand how something like Doug's Applescript for "Set Video Kind of Selected" works so that I could either build a stand alone droplet or build it in to this droplet, but rather than prompting the user for values, add predefined values. For example, every file processed by the droplet would have video kind set to "TV show" and show name set to "Some Show". Any ideas?
Here is some advice from http://forums.macrumors.com/showthread.php?t=165185&page=2


Create a short (5-second) MPEG-4 video that can be tagged as described. Tag this 5-second clip with the episode information (show, season, episode #, etc.)
Once the iTunes database stores the information for your 5-second clip, locate the actual 5-second video file in your finder (or explorer), and delete it. Click get info in iTunes and an exclamation point appears next to your TV episode, because you just deleted it.
iTunes will ask if you want to manually locate the missing file. When it does, point it to your referenced .mov file. Your TV episode information will be retained and you can organize your files that way (at least this works in Windoze).


I am just learning, and just trying to be helpful with my limited understanding, but it seems like we could combine this idea with the atv fooler. What if we used an MP4/M4v format reference clip instead of a mov? Would that work? How do I go about testing that? --Josephbphillips 00:59, 12 November 2007 (CET)

--I don't know how to proceed with the above idea, but instead I cobbled together a script that will add metadata to all of the files in a user-created smart playlist. I set up folder rules to monitor my download folder and open video files with the "fooler" script, and then use a separate script to add the resulting file to iTunes. Lastly, i run an instance of this script for each show I regularly download. I know there is a better way to roll this in to a single script with if statements, but baby steps. I hope it is helpful to someone- I'd love to be able to give back a little of what I have gained from this site!


--Before running, create a smart playlist using the "name contains" variable to select the appropriate files. This example presumes you have set a smart folder named "Sample Show Name". It will edit all of the metadata for the shows in this smart playlist as set below. Thanks to allenhuffman on macosxhints.com for the script that I modified to achieve this.
tell application "iTunes"
set smartPlaylists to (get every user playlist whose smart is true and name contains "Sample Show Name")
repeat with thisPlaylist in smartPlaylists
set allTracks to every track of thisPlaylist
repeat with this_track in allTracks
try
set video kind of this_track to TV show
set show of this_track to "Sample Show Name"
set season number of this_track to "1"
on error
display dialog "Failed to add Metadata"
end try
end repeat
end repeat
end tell


--Josephbphillips 02:49, 12 November 2007 (CET)

Personal tools