A few weeks ago, I went to add some new songs to my iPod using Rhythmbox (the freeware Linux equivalent of iTunes), and accidentally erased all 1100+ songs that were already on the iPod.
No biggy, I thought. I was planning to cull some poorly made files and others that I didn't care about anyway. I'll simply use WinMX and Bittorrent to download the lost files again.
Easier said than done. WinMX is practically a ghost town these days, and it proved incredibly difficult, if not impossible, to find the songs I wanted on torrent tracker sites. The 80s nostalgia craze in the file sharing community has apparently passed, and users aren't seeding a lot of the old music anymore. I guess they figure that anyone who wants those old songs already has them by now. Moreover, you typically have to download a massive discography archive just to get the few songs by a given artist you want.
What could be done?
I had been using Savido to rip videos from video hosting sites like YouTube for a few weeks, when it dawned on me that nearly everything I wanted could probably be found on YouTube. All I needed was a way to rip the audio tracks from the videos.
I immediately thought of FFmpeg. This is an open source media file manipulation tool that has been around for years and serves as the engine for a lot of those free video and audio manipulation tools you see all over the Web. It's available for all operating systems.
One advantage of this technique is that you're not likely to get busted for piracy, since YouTube is already putting the files on your computer when you stream them.
Here's what you do:
(1) Find the video you want on YouTube.
(2) Copy and paste the URL from the address bar into the URL field on Savido and click "Download."
(3) You'll be presented with (usually) three download links. The last two are usually video only, so choose the first link to get the one that has audio.
(4) You'll either get a "Save File As..." dialog or a Web page with an embedded media player. If you get the media player, right-click the video and click "Save Video As..." In either case, the default filename will be "videoplayback" or something like that. You don't want to save it with that filename if you're downloading multiple videos because each download will overwrite the previous one. Type in an appropriate filename. I recommend one with no spaces, as it will save you some trouble in the following steps.
(5) Install FFmpeg if you haven't already.
(6) You'll need to find out the audio track bitrate for each video. You can usually find it by opening the video in a media player and choosing the video properties from a menu. Be sure to get the audio stream bitrate, not the video bitrate. For YouTube videos, it will almost always be between 95kbps and 97kbps. You could probably assume 96kbps for every YouTube video and call it good, but you'll get better results if you match the actual bitrate as closely as possible.
(7) Open a terminal or console window. At the command prompt, type the following command:
ffmeg -i /home/username/Desktop/video_filename.mp4 -f mp3 -ab 96000 -vn /home/username/Desktop/audio_filename.mp3
This assumes that you've saved the video to your desktop. If you saved it somewhere else, type the path to that location. Change 96000 to the audio bitrate for that particular file. For example, if it's 95kbps, type 95000. As with the video filename, you'll want to choose an audio filename with no spaces to save some hassle. You can rename the file afterwards. The filename isn't really that important because, as we'll see later, it's the embedded tags that get displayed in your media player, not the filename.
(8) Press "Enter." If all goes well, a new MP3 file should appear on your desktop or in the selected folder within 5 seconds.
Now that we have our MP3s, let's load them onto our media player. I keep a special folder of curated files on my computer. These are files that I know are of good quality, and the title, artist, and album name tags are all correct so they look good when displayed on the media player. Keeping a curated folder also helps ensure that you load only the files you want and don't lose any existing files when you import files into iTunes or Rhythmbox and synchronize your media player. Move the new MP3s from wherever you created them into the curated folder.
Go ahead and crack open iTunes or Rhythmbox. For this demonstration, I'll be using the latter.
(1) Above the track list, you'll see four buttons. Click the "Import" button.
(2) Where it says to choose a location to import files from, choose the curated folder.
(3) Click "Import listed tracks," then click "Close."
The new files are now in your library. Next, we'll edit the embedded tags for each of the new songs.
(1) Right-click a track in the track list, then click "Properties." You'll see a dialog box with fields for the title, artist, and album, among other things. Edit these as desired. Remove the ".mp3" from the end of the title because that's not part of the song title. (This will not affect the actual filename on your computer.) If you've downloaded a full album and want to be able to play the songs in album order, be sure to fill in the track number field, as well as the disc number field if appropriate.
(2) When that file looks good, click "Forward" to go to the next track. Edit the tags for that file as in step 1.
(3) When you're done editing tags, click "Close."
(4) Plug your media player into the computer and click "Sync." After synchronization is finished, click "Eject."
Now you're all done. Unplug the media player when it tells you it's safe to do so, and enjoy your free music!
No biggy, I thought. I was planning to cull some poorly made files and others that I didn't care about anyway. I'll simply use WinMX and Bittorrent to download the lost files again.
Easier said than done. WinMX is practically a ghost town these days, and it proved incredibly difficult, if not impossible, to find the songs I wanted on torrent tracker sites. The 80s nostalgia craze in the file sharing community has apparently passed, and users aren't seeding a lot of the old music anymore. I guess they figure that anyone who wants those old songs already has them by now. Moreover, you typically have to download a massive discography archive just to get the few songs by a given artist you want.
What could be done?
I had been using Savido to rip videos from video hosting sites like YouTube for a few weeks, when it dawned on me that nearly everything I wanted could probably be found on YouTube. All I needed was a way to rip the audio tracks from the videos.
I immediately thought of FFmpeg. This is an open source media file manipulation tool that has been around for years and serves as the engine for a lot of those free video and audio manipulation tools you see all over the Web. It's available for all operating systems.
One advantage of this technique is that you're not likely to get busted for piracy, since YouTube is already putting the files on your computer when you stream them.
Here's what you do:
(1) Find the video you want on YouTube.
(2) Copy and paste the URL from the address bar into the URL field on Savido and click "Download."
(3) You'll be presented with (usually) three download links. The last two are usually video only, so choose the first link to get the one that has audio.
(4) You'll either get a "Save File As..." dialog or a Web page with an embedded media player. If you get the media player, right-click the video and click "Save Video As..." In either case, the default filename will be "videoplayback" or something like that. You don't want to save it with that filename if you're downloading multiple videos because each download will overwrite the previous one. Type in an appropriate filename. I recommend one with no spaces, as it will save you some trouble in the following steps.
(5) Install FFmpeg if you haven't already.
(6) You'll need to find out the audio track bitrate for each video. You can usually find it by opening the video in a media player and choosing the video properties from a menu. Be sure to get the audio stream bitrate, not the video bitrate. For YouTube videos, it will almost always be between 95kbps and 97kbps. You could probably assume 96kbps for every YouTube video and call it good, but you'll get better results if you match the actual bitrate as closely as possible.
(7) Open a terminal or console window. At the command prompt, type the following command:
ffmeg -i /home/username/Desktop/video_filename.mp4 -f mp3 -ab 96000 -vn /home/username/Desktop/audio_filename.mp3
This assumes that you've saved the video to your desktop. If you saved it somewhere else, type the path to that location. Change 96000 to the audio bitrate for that particular file. For example, if it's 95kbps, type 95000. As with the video filename, you'll want to choose an audio filename with no spaces to save some hassle. You can rename the file afterwards. The filename isn't really that important because, as we'll see later, it's the embedded tags that get displayed in your media player, not the filename.
(8) Press "Enter." If all goes well, a new MP3 file should appear on your desktop or in the selected folder within 5 seconds.
Now that we have our MP3s, let's load them onto our media player. I keep a special folder of curated files on my computer. These are files that I know are of good quality, and the title, artist, and album name tags are all correct so they look good when displayed on the media player. Keeping a curated folder also helps ensure that you load only the files you want and don't lose any existing files when you import files into iTunes or Rhythmbox and synchronize your media player. Move the new MP3s from wherever you created them into the curated folder.
Go ahead and crack open iTunes or Rhythmbox. For this demonstration, I'll be using the latter.
(1) Above the track list, you'll see four buttons. Click the "Import" button.
(2) Where it says to choose a location to import files from, choose the curated folder.
(3) Click "Import listed tracks," then click "Close."
The new files are now in your library. Next, we'll edit the embedded tags for each of the new songs.
(1) Right-click a track in the track list, then click "Properties." You'll see a dialog box with fields for the title, artist, and album, among other things. Edit these as desired. Remove the ".mp3" from the end of the title because that's not part of the song title. (This will not affect the actual filename on your computer.) If you've downloaded a full album and want to be able to play the songs in album order, be sure to fill in the track number field, as well as the disc number field if appropriate.
(2) When that file looks good, click "Forward" to go to the next track. Edit the tags for that file as in step 1.
(3) When you're done editing tags, click "Close."
(4) Plug your media player into the computer and click "Sync." After synchronization is finished, click "Eject."
Now you're all done. Unplug the media player when it tells you it's safe to do so, and enjoy your free music!