4 September 2007 @ 17:45Make an mp3 out of your video

Have you ever wanted to make mp3’s out of your videos (e.g. music videos) so you can load the audio onto your iPod or listen to it in your favorite music player?

This simple Applescript droplet will do just that. Drop your video onto the Video to mp3.app icon, type in the desired bitrate, and it will immediately start converting the first audio track to a mp3. Give it a try. It works with many different video formats including VOB.

Video to mp3.app (video_to_mp3.zip)

Here is the Applescript source:

property bitrate : "160"

on open these_files

repeat with this_file in these_files
set ffmpeg_binary to ((path to me) as string)
set ffmpeg_binary to (ffmpeg_binary & "Contents:Resources:ffmpeg")
set ffmpeg_binary to (POSIX path of ffmpeg_binary)
set theuser to (do shell script "echo $USER")
set ginfo to (get info for this_file)
set disp_name to text 1 thru -((length of name extension of ginfo) + 2) of name of ginfo
set disp_name2 to name of ginfo
set POSIX_file to POSIX path of this_file
display dialog "Set the bitrate in kbit/s" default answer bitrate
set the bitrate to text returned of result

with timeout of 30000 seconds
tell application "Terminal"
--do shell script "\"" & ffmpeg_binary & "\" -y -i \"" & POSIX_file & "\""
do script ("\"" & ffmpeg_binary & "\" -y -i \"" & POSIX_file & "\" -vn -acodec mp3 -ab " & bitrate & " -ac 2 -ar 44100 \"" & POSIX_file & ".mp3\"")
end tell
end timeout
end repeat
end open

Note: the above example code requires ffmpeg binary if you are going to compile your own Applescript.

Share this:
  • E-mail this story to a friend!
  • Print this article!
  • Wists
  • del.icio.us
  • Reddit
  • Digg
  • StumbleUpon
  • Slashdot
  • Technorati
  • SphereIt
  • Sphinn
  • Google
  • Facebook
  • NewsVine
  • Furl
  • YahooMyWeb
  • TwitThis
  • Shop Apple
  • Shop Dell

 

Related posts

by Jon | Posted in applescript, dvd, ffmpeg, itunes, music

Link to this post

HTML
BBCode

Comments:

  1. Ted | 11 Dec 2007 @ 22:41 #

    For those (few) of us that aren’t tech savvy enough to work with Applescript . . . a very big thank you for this amazing droplet!!!

  2. Jon | 11 Dec 2007 @ 22:58 #

    You’re welcome, Ted.

  3. gerard | 08 Nov 2008 @ 2:01 #

    This is really a good solution! I tried different other programs but if the .FLV contains only music and no video it doesn’t work. But yours works! Thanks!

  4. Jon | 08 Nov 2008 @ 8:18 #

    Glad it could help, gerard.

Add a Comment

Show who you are with a Gravatar.

 

Sign up for PayPal and start accepting credit card payments instantly.

Get fed!

rss icon subscribe to Geek stuff

rss icon Geek stuff in your inbox

Add the "Geek stuff" Google Gadget to your homepage

Add the "Daily Deals" Google Gadget to your homepage

Featured Tee

UneeTee.com

One Day, One Artist, One cool T-shirt

$3000 Kick Off by Uneetee
Guys - $13
Girls - $13

Apparel

Search Amazon

Search Amazon.com
Search Amazon.co.uk

Advert

Web hosting by ICDSoft