Giter VIP home page Giter VIP logo

flac2m4a's Introduction

FLAC2M4A

Hi! This script has been created to convert lossless files (FLAC format) in lossy files (M4A format with codec aac). By default it looks for flac files in $PWD path, and it saves converted m4a files (default 320kbps for a good quality) to output directory that it will create if it doesn't exists.

Dependencies

To use this script you need some dependencies. It uses avconv for convertion.

On Debian based distros you should install these packages:

sudo apt-get update
sudo apt-get install libav-tools

On Gentoo:
After setting appropriate USE flags, run the next command:

root # emerge --ask media-video/libav

On other distros use Download section of Libav to download tarball files or download the package from GitHub - libav/libav. Once you have downloaded it, follow the internal instructions.

Hint

Can you use flac2m4a everywhere in your system if you insert the path of this script in your $PATH. My advice is to follow the next commands:

user@linuxmachine ~ $ ls
flac2m4a
user@linuxmachine ~ $ mkdir bin
user@linuxmachine ~ $ mv flac2m4a bin/
user@linuxmachine ~ $ ln -s flac2m4a/flac2m4a bin/flac2m4a
user@linuxmachine ~ $ export PATH=/home/user/bin/:$PATH

Now run flac2m4a everywhere!

How it work

Preview video

Default settings:

  • pathname : is the work directory from you launch this program ($PWD)
  • output: script creates a new directory called output if it doesn't exists
  • bitrates: It's setted to 320kbps

Directories' structure:
I supponed that you've called <name_of_link> (previous created) as flac2m4a

user@linuxmachine ~/bin/$ tree
.
├── flac2m4a -> flac2m4a/flac2m4a
├── flac2m4a
│   ├── doc
│   │   └── help
│   ├── flac2m4a
│   └── README.md
user@linuxmachine ~/Music $ tree
.
├── other_music
│   ├── Mayito Rivera - Necesito una amiga (Live).flac
│   └── Mayito Rivera - Negrito bailador.flac
├── Ray Barretto - Amor artificial.flac
├── Ray Barretto - Arrepientete.flac
└── Ray Barretto - Indestructible.flac

Examples:
Simple run of flac2m4a: it will create output folder with converted files inside it

user@linuxmachine ~/Music $ flac2m4a
I'll convert all FLAC files inside ./
I've found 3 FLAC files to convert
	.
	.
	.
	.
	.
Done!
user@linuxmachine ~/Music $ tree
.
├── other_music
│   ├── Mayito Rivera - Necesito una amiga (Live).flac
│   └── Mayito Rivera - Negrito bailador.flac
├── output
│   ├── Ray Barretto - Amor artificial.m4a
│   ├── Ray Barretto - Arrepientete.m4a
│   └── Ray Barretto - Indestructible.m4a
├── Ray Barretto - Amor artificial.flac
├── Ray Barretto - Arrepientete.flac
└── Ray Barretto - Indestructible.flac

Using -o or --output-directory <directory_name>: It will create all folders with converted files indise it

user@linuxmachine ~/Music $ flac2m4a -o conversion/Barretto
I'll convert all FLAC files inside ./
I've found 3 FLAC files to convert
	.
	.
	.
	.
	.
Done!
user@linuxmachine ~/Music $ tree
.
├── conversion
│   └── Barretto
│       ├── Ray Barretto - Amor artificial.m4a
│       ├── Ray Barretto - Arrepientete.m4a
│       └── Ray Barretto - Indestructible.m4a
├── other_music
│   ├── Mayito Rivera - Necesito una amiga (Live).flac
│   └── Mayito Rivera - Negrito bailador.flac
├── Ray Barretto - Amor artificial.flac
├── Ray Barretto - Arrepientete.flac
└── Ray Barretto - Indestructible.flac

Using -p or --path <directory_name>: It will search FLAC files in <directory_name>, then they will be converted in output folder

user@linuxmachine ~/Music $ flac2m4a -p other_music
I'll convert all FLAC files inside other_music
I've found 2 FLAC files to convert
	.
	.
	.
	.
	.
Done!
user@linuxmachine ~/Music $ tree
.
├── conversion
│   └── Barretto
│       ├── Ray Barretto - Amor artificial.m4a
│       ├── Ray Barretto - Arrepientete.m4a
│       └── Ray Barretto - Indestructible.m4a
├── other_music
│   ├── Mayito Rivera - Necesito una amiga (Live).flac
│   └── Mayito Rivera - Negrito bailador.flac
├── output
│   ├── Mayito Rivera - Necesito una amiga (Live).m4a
│   └── Mayito Rivera - Negrito bailador.m4a
├── Ray Barretto - Amor artificial.flac
├── Ray Barretto - Arrepientete.flac
└── Ray Barretto - Indestructible.flac

Use -b or --bitrates to set bitrates for output files

user@linuxmachine ~/Music $ flac2m4a --bitrates 192

Use -f or --file <file_name> to convert just <file_name>

user@linuxmachine ~/Music $ flac2m4a -f Ray\ Barretto\ -\ Amor\ artificial.flac

NB: Obviously, all options can be used together.

Thanks :)

flac2m4a's People

Contributors

denny-v90 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.