Results 1 to 3 of 3
  1. #1
    Need help with applescript to convert audio files using ffmpeg

    Member Since
    Feb 24, 2007
    Posts
    100
    Need help with applescript to convert audio files using ffmpeg
    Hi

    I have installed ffmpeg using MacPorts and am trying to work out a script that will convert audio files in a specified folder to mp3 files, outputting the converted files as mp3 files in another folder.

    So far the script looks like this:

    Code:
    set convertPath to "Macintosh HD:opt:local:bin:ffmpeg"
    set convertCommand to quoted form of POSIX path of convertPath & " -i {infile} -f mp3 -ar 44100 -ab 128 -acodec mp3 - "
    
    tell application "Finder"
    	set inPath to "Macintosh HD:Users:nick:Desktop:new:"
    	set outPath to "Macintosh HD:Users:nick:Desktop:new2:"
    	set myFiles to (files of entire contents of inPath whose name ends with ".m4a") as alias list
    	
    	repeat with i from 1 to count of myFiles
    		do shell script convertCommand
    	end repeat
    	
    end tell
    With this script I am getting the error : "Can’t make every file of «class ects» of "Macintosh HD:Users:nick:Desktop:new:" whose name ends with ".m4a" into type alias list."

    Another issue is that I am not sure how to define the do shell script command so that it outputs an MP3 file in the output directory.

    Could someone help me get this working?

    Thanks

    Nick
    OS X 10.5.7
    Mac Pro
    2 x 3 GHz Dual-Core Intel Xeon
    8 GB RAM

  2. #2
    Need help with applescript to convert audio files using ffmpeg
    louishen's Avatar
    Member Since
    Oct 22, 2007
    Location
    London
    Posts
    8,968
    Specs:
    Mac Mini Core i7 2012 | White 2009 MacBook 2 Ghz | 733 Mhz G4 Quicksilver
    might be easier to use this, or at least look at these Apple Scripts
    Doug's AppleScripts for iTunes ♫ Doug's Actions for iTunes Volume 1 v1.0
    Member of the Month September 2008 & August 2012 | Found advice useful? – use the rep system

  3. #3
    Need help with applescript to convert audio files using ffmpeg

    Member Since
    Feb 24, 2007
    Posts
    100
    thanks, but i'd rather stick to AppleScript if possible as the conversion will be part of a larger script performing a few functions, and I'd also like to use ffmpeg for precise control of bitrate, etc. within the script
    OS X 10.5.7
    Mac Pro
    2 x 3 GHz Dual-Core Intel Xeon
    8 GB RAM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Program to convert audio files.
    By 35g700 in forum Music, Audio, and Podcasting
    Replies: 2
    Last Post: 09-06-2010, 03:26 PM
  2. Replies: 0
    Last Post: 09-08-2008, 03:54 AM
  3. Convert RAM files to wav or cd audio
    By rtsallie in forum iPod Hardware and Accessories
    Replies: 4
    Last Post: 12-16-2004, 05:41 PM
  4. Convert RAM files to wav or cd audio
    By rtsallie in forum Music, Audio, and Podcasting
    Replies: 0
    Last Post: 12-15-2004, 07:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •