Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Aug 22, 2006, 08:00 PM   #1
MacFan25863
macrumors 6502a
 
MacFan25863's Avatar
 
Join Date: Jun 2004
Location: Washington DC
Send a message via AIM to MacFan25863
Applescript to automatically encode video

Hi everyone,

I'm in my school's TV Production class. We produce a live 10 min. news show everyday which is broadcast to the school. Right now, we are just about to finish up our website, and would like to be able to post the show onto it everyday.

Right now, we record every show directly to DVD through a set-top DVD Recorder. I want to make an Applescript that will, when the DVD is inserted into our PowerMac, open Handbrake, rip the DVD using certain (web-friendly settings), then upload the newly created file into a special directory on our webserver. I've already written a PHP script that will detect the file on the server and add it to the index of viewable shows.

So, basically, I need something that will be able to do this:

-Open Handbrake
-Select the DVD in Handbrake
-Confirm and/or set Handbrake settings to a web-friendly form
-Rip the DVD
-Take new MOV and upload it to a web server
-(maybe..it would be a nice feature) Eject the DVD

Without any user intervention. I tried making an automator script for this, but I don't know how to integrate automator with Handbrake.

I have no experience using Applescript at all. Anyone have an idea on how I could accomplish this, or point me in the right way to learn the AppleScript I need to do it?

Thank you!
MacFan25863 is offline   0 Reply With Quote
Old Aug 22, 2006, 09:07 PM   #2
live4ever
macrumors 6502a
 
Join Date: Aug 2003
Location: Thunder Bay, ON
Handbrake is not AppleScriptable so unless you want to add that ability to the source it can't be done.

You could use MEncoder through Terminal.app and call it with a shell script.
http://axljab.homelinux.org/Mencoder_DVD_to_MPEG-4
live4ever is offline   0 Reply With Quote
Old Aug 22, 2006, 09:35 PM   #3
MacFan25863
Thread Starter
macrumors 6502a
 
MacFan25863's Avatar
 
Join Date: Jun 2004
Location: Washington DC
Send a message via AIM to MacFan25863
Quote:
Originally Posted by live4ever
Handbrake is not AppleScriptable so unless you want to add that ability to the source it can't be done.

You could use MEncoder through Terminal.app and call it with a shell script.
http://axljab.homelinux.org/Mencoder_DVD_to_MPEG-4
I have no clue how to do any of that...I don't know anything with linux or the terminal..all my experience is in web programming.


Is there a DVD ripping application that I can run applescript through?
MacFan25863 is offline   0 Reply With Quote
Old Aug 22, 2006, 11:21 PM   #4
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
Quote:
Originally Posted by MacFan25863
I have no clue how to do any of that...I don't know anything with linux or the terminal..all my experience is in web programming.
Well get to learnin'!
kainjow is offline   0 Reply With Quote
Old Aug 22, 2006, 11:23 PM   #5
MacFan25863
Thread Starter
macrumors 6502a
 
MacFan25863's Avatar
 
Join Date: Jun 2004
Location: Washington DC
Send a message via AIM to MacFan25863
Quote:
Originally Posted by kainjow
Well get to learnin'!

Thats why I came here...I'm hoping to get pointed in the right direction to write an AppleScript application. The link he posted is helpful to understand how to rip the DVD (though I didn't understand it that much), but I still need help with everything else, and how to incorporate the mplayer into applescript.
MacFan25863 is offline   0 Reply With Quote
Old Aug 22, 2006, 11:49 PM   #6
mduser63
macrumors 68040
 
mduser63's Avatar
 
Join Date: Nov 2004
Location: Salt Lake City, UT
Send a message via AIM to mduser63
You *may* be able to use GUI scripting to script Handbrake. What you're asking for is a lot of work, so I don't think anyone here is going to do it for you. However, if you look into GUI scripting using AppleScript and a program called Prefab UI Browser, that should be a good start.

To be honest, if MEncoder will do what you want, that might be less of a learning curve. I know you don't have any experience with Terminal and shell scripting, but you don't have any experience with AppleScript either, and using GUI scripting to control a non-scriptable app is quite advanced.

Scripting Terminal and/or using the "do shell script" command in AppleScript will let you control MEncoder (or any command-line app) via AppleScript.
mduser63 is offline   0 Reply With Quote
Old Aug 22, 2006, 11:52 PM   #7
MacFan25863
Thread Starter
macrumors 6502a
 
MacFan25863's Avatar
 
Join Date: Jun 2004
Location: Washington DC
Send a message via AIM to MacFan25863
Quote:
Originally Posted by mduser63
You *may* be able to use GUI scripting to script Handbrake. What you're asking for is a lot of work, so I don't think anyone here is going to do it for you. However, if you look into GUI scripting using AppleScript and a program called Prefab UI Browser, that should be a good start.

To be honest, if MEncoder will do what you want, that might be less of a learning curve. I know you don't have any experience with Terminal and shell scripting, but you don't have any experience with AppleScript either, and using GUI scripting to control a non-scriptable app is quite advanced.

Scripting Terminal and/or using the "do shell script" command in AppleScript will let you control MEncoder (or any command-line app) via AppleScript.

Of course I don't want anyone to do it for me! I'm just hoping to find an easy way to accomplish this.

Another option I have is importing it directly into iMovie using a dv cam as a bridge. Can applescript control iMovie, so that when we finish recording onto the computer, it automatically exports it and uploads it?

We also have Final Cut Pro, but I'm guessing iMovie is eaiser to script for.
MacFan25863 is offline   0 Reply With Quote
Old Aug 23, 2006, 12:36 AM   #8
mduser63
macrumors 68040
 
mduser63's Avatar
 
Join Date: Nov 2004
Location: Salt Lake City, UT
Send a message via AIM to mduser63
Quote:
Originally Posted by MacFan25863
Of course I don't want anyone to do it for me! I'm just hoping to find an easy way to accomplish this.

Another option I have is importing it directly into iMovie using a dv cam as a bridge. Can applescript control iMovie, so that when we finish recording onto the computer, it automatically exports it and uploads it?

We also have Final Cut Pro, but I'm guessing iMovie is eaiser to script for.
Final Cut Pro is not scriptable via AppleScript IIRC (shame), and I don't think iMovie is scriptable either. QuickTime on the other hand is scriptable, and assuming you have QuickTime Pro (you should, it comes with FCP) it should be able to do everything you want. It can capture video and export it in all the same formats as iMovie/FCP. I'm pretty sure AppleScript itself is capable of doing uploads to servers, but you could also use a scriptable FTP application like Fetch or Transmit.

AppleScript, like any programming language, has a learning-curve associated with it, but it's very rewarding and useful. You might be well-served by buying a book on the subject. AppleScript: The Missing Manual is a good, easily-read introduction, and there are other more comprehensive, technical books available.
mduser63 is offline   0 Reply With Quote
Old Aug 25, 2006, 11:13 AM   #9
live4ever
macrumors 6502a
 
Join Date: Aug 2003
Location: Thunder Bay, ON
I forgot there's a CLI to Handbrake - there's also a great forum to help out - also once you get a script written you can use it over and over again, if you post exactly the specs of the video you want to encode a script shouldn't take more than 5-10 to write if you need help.

http://handbrake.m0k.org/forum/viewforum.php?f=7
live4ever is offline   0 Reply With Quote
Old Aug 25, 2006, 06:18 PM   #10
MacFan25863
Thread Starter
macrumors 6502a
 
MacFan25863's Avatar
 
Join Date: Jun 2004
Location: Washington DC
Send a message via AIM to MacFan25863
Awesome! Thanks for all the help guys.

We ended up training a student service from the next class to take the video, import it into iMovie, export from iMovie with "web settings" and upload it to the site. Maybe I'll look into scripting it when I learn more programming.
MacFan25863 is offline   0 Reply With Quote
Old Aug 26, 2006, 09:17 AM   #11
Mr. Mister
Banned
 
Join Date: Feb 2006
My school does the same thing, and the video production class ended up using Youtube or Google video, which was good because it loaded quickly with the streaming flash content, offloaded all the loading to YouTube or Google's servers instead of the school ones, and also let you rate them if you were a YouTube/Google Video user that stumbled upon them.

Then you can either watch them from the Directors' page on YouTube or have them embedded in a simple HTML page on the website.
Mr. Mister is offline   0 Reply With Quote
Old Aug 26, 2006, 02:34 PM   #12
MacFan25863
Thread Starter
macrumors 6502a
 
MacFan25863's Avatar
 
Join Date: Jun 2004
Location: Washington DC
Send a message via AIM to MacFan25863
Quote:
Originally Posted by Mr. Mister
My school does the same thing, and the video production class ended up using Youtube or Google video, which was good because it loaded quickly with the streaming flash content, offloaded all the loading to YouTube or Google's servers instead of the school ones, and also let you rate them if you were a YouTube/Google Video user that stumbled upon them.

Then you can either watch them from the Directors' page on YouTube or have them embedded in a simple HTML page on the website.

We thought about that, too, but our school blocks both of them.
MacFan25863 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
OSX Crash with Video Encode dfuerpo OS X 3 Feb 13, 2014 12:24 PM
automatically change to the priority of to do list based on due date applescript wild4life2013 Mac Programming 0 Sep 8, 2013 09:30 AM
Handbrake Prematurely Ends Encode and Video is Scrambled El Maestro Apple TV and Home Theater 4 Feb 25, 2013 01:04 PM
Applescript to make terminal close automatically? Ri-dog Mac Programming 1 Jan 18, 2013 12:53 PM
Automatically connect to strongest open network? (possibly AppleScript?) GavWhite OS X 0 Aug 2, 2012 03:53 PM

Forum Jump

All times are GMT -5. The time now is 05:48 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC