Skip to main content

ffmpeg , separating the audio from a video


If you ever wanted to grab the audio from any kind of video file, ffmpeg seems to be easiest way.  

If you aren't familiar with ffmpeg, it is a free software project that produces libraries and programs for handling multimedia data - on just about every operating system you can think of.  Amazingly powerful Swiss Army knife - this is just one of many things it can do.

Below are some examples of extracting audio out of a video file.  (ffmpeg runs from the command line)

In this example 

  • i indicates the input
  • ab indicates the bit rate (in this example 160kb/sec)
  • vn means no video ouput
  • ac 2 means 2 channels
  • ar 44100 indicates the sampling frequency. 
  • "video.m4v" is the full path to the video file 
  • audio.mp3 is the audio file that gets created as an output


ffmpeg -i "video.m4v" -ab 160k -ac 2 -ar 44100 -vn audio.mp3
In this example the -vn switch extracts the audio portion from a video and we are using the -ab switch to save the audio as a 256kbps MP3 audio file.

 ffmpeg -i "video.mp4" -vn -ab 256 audio.mp3

After you have the audio file I recommend using Audacity to manipulate it if needed.




Comments

Popular posts from this blog

Dan's espresso martini recipe

This is my espresso martini recipe. 1 oz cold espresso 1 1/2 oz vodka 1 1/2 oz Kahlua 1 oz creme de cacao I make the espresso fresh and let it cool for about 15 minutes.   After mixing, I pour it into a martini glass with crushed ice.   For ease, sometimes, I do one part of each ingredient and that works well too.

The hot toddy

  2 tbsp of lemon juice (fresh squeezed  if possible) 2 tbsp oz of honey 4 tbsp of whiskey stir well add slice of lime or lemon or orange with cloves sprinkle cinnamon let is sit while you boil water add boiling water to fill cup

How to install smart switches

I replaced some old dumb light switches with new smart light switches.  Note 1 :Before I go through the steps, here is a little bit of important information to know.  There may be several wires required to make the new switch connect - here is the definition of what you should see available in the housing for the switch. Smart light Switch = In my case, this is a wall light switch that has a radio that can be connected ted to a Hub for remote control or for programming on/off/dimmer based upon triggers. The protocol of the radio is z-wave in my case. Line = always hot wire - this is the source of current to the switch. Load =wire that goes to light out the other side of the switch and is only hot when the switch is turned on. Neutral =  White wire (in my house) that carries a current back to the source for the unbalanced portion of the load Ground wire = the wire that grounds the circuit. Note 2: I've only installed z-wave switches with a neutral ...