User Tools

Site Tools


computers:media:encoding:start

This is an old revision of the document!


Audio

flac to mp3

Conversion of flac files to mp3 files in linux can be done with this shell script I found here online: http://lglinux.blogspot.com/2007/09/convert-flac-to-mp3.html

Example Usage:

cd /to/where/you/have/flac/files
nice -n 19 flac2mp3.sh /tmp/mp3 standard

Requires: lame, flac, id3v2

flac2mp3.sh:
 
#!/bin/bash
 
DESTDIR=$1
PRESET=$2
 
if test "x$PRESET" = "x"; then
PRESET=standard
fi
 
if test "x$DESTDIR" = "x"; then
DESTDIR=.
else
mkdir -p "$DESTDIR"
fi
 
echo
echo "Preset=$PRESET Destination=$DESTDIR Source=`pwd`"
echo
 
for a in *.flac
do
OUTF=`echo "$a" | sed s/\.flac/.mp3/g`
 
echo
echo "Source=`pwd`/$a Destination=$DESTDIR/$OUTF"
echo
 
ARTIST=`metaflac "$a" --show-tag=ARTIST | sed s/.*=//g`
TITLE=`metaflac "$a" --show-tag=TITLE | sed s/.*=//g`
ALBUM=`metaflac "$a" --show-tag=ALBUM | sed s/.*=//g`
GENRE=`metaflac "$a" --show-tag=GENRE | sed s/.*=//g`
TRACKNUMBER=`metaflac "$a" --show-tag=TRACKNUMBER | sed s/.*=//g`
YEAR=`metaflac "$a" --show-tag=DATE | sed s/.*=//g | cut -b -4`
 
echo
echo "Launching: flac -c -d $a | lame --preset $PRESET - $DESTDIR/$OUTF"
echo
 
flac -c -d "$a" | lame --preset $PRESET - "$DESTDIR/$OUTF"
 
echo
echo "Setting id3 ($TITLE, $TRACKNUMBER, $ARTIST, $ALBUM, $GENRE, $YEAR)"
echo
 
if test "x$TITLE" != "x"; then
id3v2 -t "$TITLE" "$DESTDIR/$OUTF" > /dev/null
fi
 
if test "x$TRACKNUMBER" != "x"; then
id3v2 -T "$TRACKNUMBER" "$DESTDIR/$OUTF" > /dev/null
fi
 
if test "x$ARTIST" != "x"; then
id3v2 -a "$ARTIST" "$DESTDIR/$OUTF" > /dev/null
fi
 
if test "x$ALBUM" != "x"; then
id3v2 -A "$ALBUM" "$DESTDIR/$OUTF" > /dev/null
fi
 
if test "x$GENRE" != "x"; then
id3v2 -g "$GENRE" "$DESTDIR/$OUTF"
fi
 
if test "x$YEAR" != "x"; then
id3v2 -y "$YEAR" "$DESTDIR/$OUTF"
fi
done

Video

h264

h264 seems to be the new kid on the block. Here is a GUI for a command line encoder you're probably going to end up using (-8

http://www.videohelp.com/tools/MeGUI

Guide to pull your DVD to mkv/h264 file:

http://kitty.110mb.com/dvd2avc/dvd2avc.html

Popcorn Hour, they recommend a bunch of software. Here is the forum link, and the one at the bottom will do DVD→mkv directly:

AutoMKV - Recommended for BluRay/HD-DVD/DVD → MKV conversions

Mythtv to AVI

Well, I've not had too much success with Mythtv's built in transcoding, probably due to a bad setup on my part. I have found that if I use the “Super” encoder on the raw .MPG file recordings, it does a very nice job of crunching down (especially cartoons for the kids) the files from their original HD size to something manageable for archive.

  • First thing to do is make symbolic links to the recordings so I can copy them all properly named in human readable format. I am using these two things for that:
    1. Mythname.pl (which I put in ~/bin/mythname.pl) to give us a command line program that can interogate the data base to find the name of the recording.
    2. This little bash script that will make symbolic links right where you are
      #!/bin/bash
      for filename in /var/lib/mythtv/recordings/*.mpg
      do
        fname=`mythname.pl --rep=. --subtitle $filename`
        echo "Linking $filename to $fname"
        ln -s $filename $fname
      done
      exit 0

Mythtv to DVD

Looks like avidemux2 might be the program you want to try.

nsv

Russ emailed me a set of instructions on how to encode video for the mst3k stream, so I posted it: MST3k encoding for 128k stream

computers/media/encoding/start.1299954528.txt.gz · Last modified: 2011/03/12 18:28 by david