2012年8月21日星期二

Convert FLV's from YouTube into audio-only mp3 files


Took me awhile to figure out how to make VLC do this right due to its clunky UI, but whatever.

You'll find this useful if, like me, you want to take a particularly long YouTube file with you on the go but you need it to play on your mp3 player as audio only (space concerns, the video on your media player sucks, whatever).

For your enjoyment:

You'll need:

VLC Media Player
Some way to grab FLV files -- I recommend VideoDownloader since that's the easiest way to get the FLV from a site like YouTube -- what's up with the VideoDownloader URL? I don't really know.
Download, and install VLC Media Player, and make sure it doesn't mess with your file associations.

Now, by default, VLC Media Player will attempt to always encode the video of an FLV and there's no way to change this behavior via the GUI, which is stupid, so we have to work around it using the command line -- don't worry, its really easy.

Make a new short-cut to the VLC Media Player by copying the short-cut on your desktop or if you're savvy navigating to %Program Files%\VideoLan\VLC\vlc.exe and right clicking + 'create new shortcut.'
Next, edit the short-cut. In the "Target" field, outside -- OUTSIDE -- of the quotations that contain the path to the VLC Media Player, type in "--no-video" (no quotation marks), save the short-cut, then rename the short-cut to "VLC Media Player -- No Audio" so you don't get it confused with the fully functional version.

Download a FLV and open it in VLC Media Player to make sure that everything's working. You should hear audio but see no video -- if so, you're a winner. If not, start over from step 1 and try again.

Now, open your FLV in VLC Media Player once you're ready to rock and roll -- either drag and drop it onto the VLC Player or open it via File --> Quick Open.

Click File --> "Wizard"

Select "Transcode / Save File" then click Next.

Select an Existing Playlist Item, select the FLV you just started playing, and click Next.

Check "Transcode Audio" and from the drop down list select "MP3" -- don't mess with the "bit-rate" option, even though I'm sure you want to. Click Next.

Select "RAW" on this screen and select "Next" again.

Click browse, enter a file name -- don't forget the .mp3 extension, that is IMPORTANT because VLC Media Player won't do this for you -- and click "Finish."

The VLC GUI will seem like its playing a file called "Streaming...", that's the transcoding process, don't touch the player at all until its finished. Yeah, I know it looks stupid. But, it works.

Your new mp3 file has been created. Congrats!

More about: How to Convert FLV File to MP4 Format on Mac (or vice reverse) Flawlessly

Convert MTS/M2TS(AVCHD) Files to AVI Format

Yesterday, I used a Sony camera to record  some our video demos.  Unfortunately, output videos are in AHCHD format. So, I have to find a way to export them to avi or other format before putting to our R&D press.
Actually, there are many commercial softwares to do this. However, I don't like them. He he, I love things  free and open source. FFMPEG is the best one in the open source world for conversion video/audio format. Anyway, I found some bad things with FFMPEG:
+ Difficult for compilation in Windows. It was developed for best use in Linux world. To compile it in Windows, we need Cygwin or MSYS.

+ Loss documentation in practice. It takes me more than 1 hour to find the best command to convert MTS file to avi.


Finally, I compile FFMPEG successfully in Windows and my Ubuntu. I also run it successfully for my conversion need. However, let me show you some shortest ways to work with FFMPEG for conversion from MTS to AVI.

INSTALL FFMPEG

In Ubuntu, it's very easy. Just open Synaptic package manager to find and install ffmpeg.
In windows, you need to compile ffmpeg before using. However, there a site contains some distribution binary package. You can download the final package to use in http://ffmpeg.arrozcru.org/builds/

COMMAND TO CONVERT YOUR MTS FILE TO AVI


ffmpeg -i your-mts-file.MTS -vcodec libxvid -b 18000k -acodec libmp3lame -ac 2 -ab 320k -ar 44100 -deinterlace -s 1440x1080 your-output.avi


If you run this in Ubuntu and found the error: Unknown encoder 'libxvid', please install libavcodec-unstripped (you can find this in synaptic package manager).

To understand more about above command, you should read the ffmpeg documentation here

Related Post:

How to Convert MTS/M2TS to MOV on Mac (Lion included)