Darkland | net

Converting Media-File.extension To FLAC

Published on 20 April 2014 by amj

Use the following sytax: This will convert every WAV file in the current directory to a FLAC using the best compression.


Create an FLAC audio file and add id3v2 tags in a single operation. None of the tag options in the id3v2 command line are mandatory. However, the double quotes around option strings are mandatory for strings with spaces, so I just put quotes around everything. avconv -i ./[FILE NAME].mp4 ./Music/Misc/[DESTINATION FILE].flac && id3v2 -A "[ALBUM TITLE]" -a "[ARTIST NAME]" -y "" -t "[TRACK NAME]" ./Music/Misc/[DESTINATION FILE].flac
Here is a script that downloads a video from youtube and prompts for id3v2 tags and also embeds album cover image, if available.
#!/bin/bash
########################################################
##  Downloads and rips audio from youtube videos.
##  Adds id3v2 tags to audio files.
##
## Added meataflac command to automatically add image ($cover)
## to audio file if it exists.
##
##
##
########################################################
musdir=$HOME/Music/New/
vidir=$HOME/Videos/New/

cd $vidir
    echo "$dlfile"
#		rc=$?
#		if [ $? != 0 ]; then
	if [ $? -ne 0 ]; then
  	   	printf "\nx720p version not found. Downloading best available version\n\n"
	fi

read -p "Artist : " artist
read -p "Album : " album
read -p "Song Title : " song
read -p "Track Number : " track
read -p "Year : " year
read -p "Genre : " genre
read -p "Comment : " comment
read -p "Cover Art : " cover

avconv -i $vidir"$dlfile" $musdir"$artist"\ -\ "$song".flac 2> /dev/null
id3v2 -a "$artist" -A "$album" -t "$song" -y "$year" -g "$genre" -T "$track" -c "$comment" $musdir"$artist"\ -\ "$song".flac

if [ -n "$cover" ]; then
    cd $musdir
    rm ./$cover.jpg
    cd
fi
printf "\n\33[1;33mTrack saved to \33[1;32m$musdir$artist - $song.flac\33[0m\n\n"

rm -i $vidir"$dlfile"
See also: Compiling And Installing Libav 11.x

Back