mp4 Video to mp3 Audio

To convert mp4 videos to mp3 audio

ffmpeg -i video.mp4 -vn -acodec libmp3lame -ac 2 -ab 160k -ar 48000 audio.mp3

Channels(ac), Bit Rate(ab) and Sampling Rate(ar) can be changed as seen above.

Advertisements

My Defaults

What are my defaults?

Listed below are some of my defaults. Some details are purposely left out.

Phone: Samsung, Android
Laptop: Acer
Router: D-Link
OS: Fedora 23
Linux desktop environment: Mate
Shell: Bash
Language: Python, Octave/MATLAB
Text editor: Atom
IDE: None
Browser: Chrome
Pdf: Okular
Documents and Spreadsheets: WPS Office or Google Docs
Reports: Latex
Slides: Latex – Beamer
Notetaking: Markdown on Atom
Image Editing: Gimp
Image Manipulations (batch): Image Magick
Media player: Vlc
Audio player: Banshee
Audio Manipulations: Sox
Email Client: None
Preferred mode of communication: e-Mail

LF, CR, CRLF – Pressing Enter

Story (Skip it if you don’t have time)

I had a tough time once when i was processing text. I usually work on linux machines. I got this text file that was made on a windows machine and I was going to process it. The process involved adding a few characters at the start of every line. To do this. The usual thing to do is to replace ‘\n’ with ‘\nabc’ assuming abc are those characters to be placed at the beginning of every line.  This just did not work on this particular file that i received. It was only after i used a tool that displays every single character on the file that i realized that text made on windows machines add something called a carriage return ‘\r’, along with the line feed character ‘\n’. Thus the need for a post.

TL;DR Start reading from here..

So all this goes long back to the age of the typewriter. LF stands for Line Feed. It would just move the paper up by a line space and keep the same horizontal position. CR on the other hand stands for Carriage Return and moves to the start of the line on the same line.

So intuitively it seems that the windows people have got this right. Because CR and LF would move the pointer to the start of the next line. But is it necessary in the current age? That is another question. On linux, only the line feed character is used. On Mac, only the carriage return character is used.

The ASCII codes are given below,
CR = \r = ASCII code 13
LF = \n = ASCII code 10
CRLF = \r\n = ASCII code 13 and then ASCII code 10

Keep this in mind when you are processing text files originating from these operating systems.

Thanks for reading.