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

Z-wave Smart Switch options

Here are some of the things I found to consider when looking at purchasing Z-wave Smart Switches. What it ships with : Check what the switch comes with.  Some come with different color face plates, but more importantly, some do NOT come with a bit of wire to connect to your neutral. Protocol : Some are Z-wave, and some are Z-wave Plus.  Z-wave plus seems to mean that the switch is faster, has longer range for connectivity and usually has more features such as central scene control (means you can program double/triple tap behavior. )  Look and feel : Some look like a normal paddle switch, while others have LED lights to tell you their setting level.   Normal looking paddle switch in white with only an on/off indicator LED Paddle switch in light almond with LED dimmer level indicator LEDs Things to note :  Some switches don't support LED lights.  Check the description to avoid these.   Note the supported wattage of the switch - they...

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 ...

Salsa!

Here is THE salsa recipe 1 tomato (medium to large).  cut out stem area. 1 slice of red onion - 1/8" thick 3" circumference  1/2 green onion sliced long way with stem 1/2 lime juice squeezed fresh but not too hard 1/2 Serrano pepper - no seeds 1 Jalapeno - no seeds 1 small clump of cilantro - cut bottom of stems 2 garlic cloves Step 1. Put all in the ninja. Step 2. Add fresh cracked sea salt & pepper to taste Step 3. Yummmmm  :)