--- /dev/null
+#! /bin/sh
+
+CARD="`cat $HOME/misc/alsa-card`"
+
+echo "
+set Master,0 mute
+set Headphone,0 mute
+set PCM,0 mute
+
+set Master,0 0
+set Headphone,0 0
+set PCM,0 0
+" |
+amixer -c$CARD -s
+
+sleep 1
+
+echo "
+set Master,0 '100%'
+set Headphone,0 '100%'
+set PCM,0 '50%'
+
+set Master,0 unmute
+set Headphone,0 unmute
+set PCM,0 unmute
+" |
+exec amixer -c$CARD -s
--- /dev/null
+#! /bin/sh
+
+CARD="`cat $HOME/misc/alsa-card`"
+
+echo "
+set Master,0 mute
+set Headphone,0 mute
+set PCM,0 mute
+
+set Master,0 0
+set Headphone,0 0
+set PCM,0 0
+" |
+amixer -c$CARD -s
+
+echo "
+set Master,0 '74%'
+set Headphone,0 '74%'
+set PCM,0 '50%'
+
+set Master,0 unmute
+set Headphone,0 unmute
+set PCM,0 unmute
+" |
+exec amixer -c$CARD -s
--- /dev/null
+#! /bin/sh
+
+if amixer -c"`cat $HOME/misc/alsa-card`" cget name="Headphone Playback Switch" |
+ grep -Fq ": values=on"
+then
+ echo "
+ set Master,0 mute
+ set Headphone,0 mute
+ set PCM,0 mute" | exec amixer -c"`cat $HOME/misc/alsa-card`" -s
+else
+ echo "
+ set Master,0 unmute
+ set Headphone,0 unmute
+ set PCM,0 unmute" | exec amixer -c"`cat $HOME/misc/alsa-card`" -s
+fi
--- /dev/null
+#! /bin/sh
+
+cd "$HOME" || exit 1
+
+if [ -f .alsa.save ]; then
+ alsactl restore -f .alsa.save "`cat $HOME/misc/alsa-card`" &&
+ exec rm .alsa.save
+else
+ alsactl store -f .alsa.save "`cat $HOME/misc/alsa-card`" &&
+ echo "
+ set Master,0 0
+ set Headphone,0 0
+ set PCM,0 0" | exec amixer -c"`cat $HOME/misc/alsa-card`" -s
+fi
--- /dev/null
+#! /bin/sh
+
+if [ "$1" = increase ]; then
+ vol="2%+"
+elif [ "$1" = decrease ]; then
+ vol="2%-"
+elif [ "$1" = INCREASE ]; then
+ vol="10%+"
+elif [ "$1" = DECREASE ]; then
+ vol="10%-"
+else
+ echo "Usage: $0 [increase|decrease|INCREASE|DECREASE]" >&2
+ exit 1
+fi
+
+exec amixer -c`cat $HOME/misc/alsa-card` set PCM,0 "$vol"
--- /dev/null
+
+def is_v1(filename):
+ mp3file = file(filename, 'r')
+ try:
+ mp3file.seek(-128, 2)
+ id3tag = mp3file.read(3)
+ except IOError:
+ id3tag = ''
+ mp3file.close()
+ return id3tag == "TAG"
+
+def is_v2(filename):
+ mp3file = file(filename, 'r')
+ try:
+ id3tag = mp3file.read(3)
+ except IOError:
+ id3tag = ''
+ mp3file.close()
+ return id3tag == "ID3"
+
+def is_mp3(filename):
+ import os
+ pipe = os.popen("file -- '%s'" % filename.replace("'", "'\"'\"'"), 'r')
+ result = pipe.read()
+ code = pipe.close()
+ if code <> None: # error
+ raise IOError, "error %s reading file pipe for file `%s'" % (code, filename)
+
+ result = result[len(filename) + 2:] # + ": "
+ test = "MPEG 1.0 layer 3 audio stream data"
+ return result.startswith(test)
+
+
+def is_wav(filename):
+ wavfile = file(filename, 'r')
+ try:
+ riff_wav = wavfile.read(16)
+ except IOError:
+ riff_wav = ''
+ wavfile.close()
+ return riff_wav[:4] == "RIFF" and riff_wav[8:16] == "WAVEfmt "
+
+
+def is_ogg(filename):
+ oggfile = file(filename, 'r')
+ try:
+ ogg_magic = oggfile.read(4)
+ except IOError:
+ ogg_magic = ''
+ oggfile.close()
+ return ogg_magic == "OggS"
+
+
+def is_flac(filename):
+ flacfile = file(filename, 'r')
+ try:
+ flac_magic = flacfile.read(4)
+ except IOError:
+ flac_magic = ''
+ flacfile.close()
+ return flac_magic == "fLaC"
+
+
+def is_ape(filename):
+ apefile = file(filename, 'r')
+ try:
+ ape_magic = apefile.read(4)
+ except IOError:
+ ape_magic = ''
+ apefile.close()
+ return ape_magic == "MAC "
--- /dev/null
+#! /usr/bin/env python
+
+
+import sys, os
+
+if len(sys.argv) == 1:
+ start_dir = '.'
+elif len(sys.argv) == 2:
+ start_dir = sys.argv[1]
+else:
+ sys.exit("Usage: %s [start_dir]" % sys.argv[0])
+
+
+def find_nolist(arg, dirname, names):
+ if dirname == '.': return
+ for filename in ("play.list", "list.m3u", "playlist.m3u", "playlist.pls",
+ "PlayList.m3u"):
+ if filename in names: return
+ print dirname
+
+
+os.path.walk(start_dir, find_nolist, None)
--- /dev/null
+#! /usr/bin/env python
+
+
+import sys, os
+
+if len(sys.argv) == 1:
+ start_dir = '.'
+elif len(sys.argv) == 2:
+ start_dir = sys.argv[1]
+else:
+ sys.exit("Usage: %s [start_dir]" % sys.argv[0])
+
+
+def fix_playlist(arg, dirname, names):
+ if dirname == '.': return
+
+ has_mp3 = 0
+ for filename in names:
+ if filename.endswith(".mp3") or filename.endswith(".MP3"):
+ has_mp3 = 1
+ break
+
+ if not has_mp3:
+ return
+
+ for filename in ("play.list", "list.m3u", "playlist.m3u"):
+ if filename in names:
+ if os.path.exists("PlayList.m3u"):
+ sys.exit("ERROR: PlayList.m3u already exists!")
+
+ fullname = "%s/%s" % (dirname, filename)
+ print "Renaming", fullname
+ os.rename(fullname, "%s/PlayList.m3u" % dirname)
+
+
+os.path.walk(start_dir, fix_playlist, None)
--- /dev/null
+#! /bin/sh
+
+if [ "$1" ]; then
+ device="$1"
+ shift
+else
+ device="/dev/cdrom"
+fi
+
+jack --device "$device" -d "$@" || exit 1
+jdir="`echo jack-*`"
+
+for f in track*.cdda.wav; do
+ newname="`echo $f | sed -e 's/^track//' -e 's/\.cdda\.wav$//'`"
+ mv "$f" "$jdir"/track_"$newname".wav || exit 1
+done
+
+rm "$jdir"/jack.progress || exit 1
+jack --device "$device" --upd-progress "$@" || exit 1
+exec jack --device "$device" -q "$@"
--- /dev/null
+#! /usr/bin/env python
+
+import sys, os
+from filetypes import is_v1, is_v2, is_mp3, is_wav, is_ogg, is_flac, is_ape
+
+import locale
+locale.setlocale(locale.LC_ALL, '')
+
+import glob, re
+mp3_file = re.compile("^([^0-9]*)([0-9]+)(.*)$")
+
+
+dir = glob.glob("*")
+if not dir:
+ sys.exit("Dir is empty")
+
+
+new_list = []
+for entry in dir:
+ if not os.path.isfile(entry):
+ continue
+
+ lower = entry.lower()
+ if not is_v1(entry) and not is_v2(entry) and not is_mp3(entry) and \
+ not is_wav(entry) and not is_ogg(entry) and \
+ not is_flac(entry) and not is_ape(entry) and \
+ not lower.endswith(".mp3") and not lower.endswith(".wav") and \
+ not lower.endswith(".ogg") and not lower.endswith(".flac") and \
+ not lower.endswith(".ape"):
+ continue
+
+ match = mp3_file.match(entry)
+ if match:
+ name = match.group(1)
+ number = match.group(2)
+ suffix = match.group(3)
+
+ new_list.append((int(number), locale.strxfrm(name), name, number, suffix))
+ else:
+ number = ''
+ name, suffix = os.path.splitext(entry)
+ new_list.append((number, locale.strxfrm(name), name, number, suffix))
+
+if not new_list:
+ sys.exit()
+
+new_list.sort()
+
+outfile = open("PlayList.m3u", 'w')
+for i, _xname, name, number, suffix in new_list:
+ outfile.write("%s%s%s\n" % (name, number, suffix))
+outfile.close()
--- /dev/null
+#! /usr/bin/env python
+
+
+import sys, os
+
+if len(sys.argv) == 1:
+ start_dir = '.'
+elif len(sys.argv) == 2:
+ start_dir = sys.argv[1]
+else:
+ sys.exit("Usage: %s [start_dir]" % sys.argv[0])
+
+prog_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
+
+
+def ml_playlist(arg, dirname, names):
+ has_mp3 = 0
+ for filename in names:
+ if filename.endswith(".mp3") or filename.endswith(".MP3"):
+ has_mp3 = 1
+ break
+
+ if not has_mp3:
+ return
+
+ print "Making playlist in", dirname
+ save_dir = os.getcwd()
+ os.chdir(dirname)
+ os.system("%s/mk_list.py" % prog_dir)
+ os.chdir(save_dir)
+
+
+os.path.walk(start_dir, ml_playlist, None)
--- /dev/null
+#! /bin/sh
+
+PATH=$HOME/lib/audio:$PATH
+umask 022
+
+[ "$1" ] && cd "$1" || exit 1 # or just do it in current directory
+start_dir="`pwd`"
+
+find . -type d -print |
+while read dir; do
+ cd "$dir" || exit 1
+ rm -f PlayList.m3u
+ mk_list.py
+ [ -f PlayList.m3u ] && pwd
+ cd "$start_dir" || exit 1
+done
--- /dev/null
+#! /usr/bin/env python
+
+
+import sys, os
+os.chdir(sys.argv[1])
+
+def report(s):
+ sys.stdout.write("\r%s" % s)
+ sys.stdout.flush()
+
+
+infile = open(sys.argv[2], 'r')
+
+for line in infile.readlines():
+ filename = line[:-1] # chop
+ report(filename)
+ os.rename(filename, "../%s" % filename)
+
+infile.close()
+
+
+filename = sys.argv[2]
+os.rename(filename, "../%s" % filename)
+
+report("%s\r" % (' ' * 72))
--- /dev/null
+#! /usr/bin/env python
+
+
+import sys, os
+from filetypes import is_v1, is_v2
+
+if len(sys.argv) == 1:
+ start_dir = '.'
+elif len(sys.argv) == 2:
+ start_dir = sys.argv[1]
+else:
+ sys.exit("Usage: %s [start_dir]" % sys.argv[0])
+
+
+def find_no_v1v2(arg, dirname, names):
+ if dirname == '.': return
+
+ for filename in names:
+ full_path = os.path.join(dirname, filename)
+ if not is_v1(full_path) and not is_v2(full_path):
+ print filename
+
+
+os.path.walk(start_dir, find_no_v1v2, None)
--- /dev/null
+#! /usr/bin/env python
+
+
+import sys, os
+
+if len(sys.argv) == 1:
+ start_dir = '.'
+elif len(sys.argv) == 2:
+ start_dir = sys.argv[1]
+else:
+ sys.exit("Usage: %s [start_dir]" % sys.argv[0])
+
+
+def find_no3(arg, dirname, names):
+ if dirname == '.': return
+
+ has_mp3 = 0
+ for filename in names:
+ if filename.endswith(".mp3"):
+ has_mp3 = 1
+ break
+ if not has_mp3:
+ print dirname
+
+
+os.path.walk(start_dir, find_no3, None)
--- /dev/null
+#! /usr/bin/env python
+
+
+import sys, os
+
+if len(sys.argv) == 1:
+ start_dir = '.'
+elif len(sys.argv) == 2:
+ start_dir = sys.argv[1]
+else:
+ sys.exit("Usage: %s [start_dir]" % sys.argv[0])
+
+
+def find_nolist(arg, dirname, names):
+ if dirname == '.': return
+
+ has_mp3 = 0
+ for filename in names:
+ if filename.endswith(".mp3"):
+ has_mp3 = 1
+ break
+
+ if not has_mp3:
+ return
+
+ for filename in ("play.list", "list.m3u", "playlist.m3u", "PlayList.m3u"):
+ if filename in names: return
+
+ print dirname
+
+
+os.path.walk(start_dir, find_nolist, None)
--- /dev/null
+#! /usr/bin/env python
+
+
+import sys, os
+from filetypes import is_v1
+
+if len(sys.argv) == 1:
+ start_dir = '.'
+elif len(sys.argv) == 2:
+ start_dir = sys.argv[1]
+else:
+ sys.exit("Usage: %s [start_dir]" % sys.argv[0])
+
+
+def find_v1(arg, dirname, names):
+ if dirname == '.': return
+
+ for filename in names:
+ if is_v1(os.path.join(dirname, filename)):
+ print filename
+
+
+os.path.walk(start_dir, find_v1, None)
--- /dev/null
+#! /usr/bin/env python
+
+
+import sys, os
+from filetypes import is_v1, is_v2
+
+if len(sys.argv) == 1:
+ start_dir = '.'
+elif len(sys.argv) == 2:
+ start_dir = sys.argv[1]
+else:
+ sys.exit("Usage: %s [start_dir]" % sys.argv[0])
+
+
+def find_v1v2(arg, dirname, names):
+ if dirname == '.': return
+
+ for filename in names:
+ full_path = os.path.join(dirname, filename)
+ if is_v1(full_path) and is_v2(full_path):
+ print filename
+
+
+os.path.walk(start_dir, find_v1v2, None)
--- /dev/null
+#! /usr/bin/env python
+
+
+import sys, os
+from filetypes import is_v2
+
+if len(sys.argv) == 1:
+ start_dir = '.'
+elif len(sys.argv) == 2:
+ start_dir = sys.argv[1]
+else:
+ sys.exit("Usage: %s [start_dir]" % sys.argv[0])
+
+
+def find_v1(arg, dirname, names):
+ if dirname == '.': return
+
+ for filename in names:
+ if is_v2(os.path.join(dirname, filename)):
+ print filename
+
+
+os.path.walk(start_dir, find_v1, None)
--- /dev/null
+#! /usr/bin/env python
+
+import sys
+args = sys.argv[1:]
+
+import eyeD3
+from eyeD3.tag import Mp3AudioFile
+
+
+def id3tag_recode(value):
+ try:
+ return value.encode(dst_encoding)
+ except UnicodeEncodeError:
+ return value.encode('latin1')
+
+def printFrame(title, frame):
+ if frame:
+ print '%s: %s' % (title, frame)
+
+def printFramesList(title, frames):
+ frames = [frame for frame in frames if frame]
+ if frames:
+ print '%s: %s' % (title, ', '.join(frames))
+
+def printTrack(title, frame):
+ if frame:
+ track, total = frame
+ if total and track:
+ print '%s: %d (of %d)' % (title, track, total)
+ elif track:
+ print '%s: %d' % (title, track)
+ elif total:
+ print '%s: UNKNOWN of %d' % (title, total)
+
+for filename in args:
+ print "File:", filename
+ mp3_file = Mp3AudioFile(filename)
+
+ id3tag = mp3_file.getTag()
+ if not id3tag:
+ sys.exit()
+
+ for version in eyeD3.ID3_V2, eyeD3.ID3_V1:
+ id3tag = eyeD3.Tag()
+ if not id3tag.link(filename, version):
+ continue
+
+ images = id3tag.getImages()
+ if images:
+ for image in images:
+ image.writeFile()
--- /dev/null
+#! /usr/bin/env python
+
+import sys
+from getopt import getopt, GetoptError
+
+import eyeD3
+from eyeD3.tag import Mp3AudioFile
+
+
+def usage(msg):
+ pname = sys.argv[0]
+ sys.stderr.write("%s: %s\n" % (pname, msg))
+ sys.stderr.write("Usage: %s file.mp3...\n" % pname)
+ sys.stderr.write("Usage: %s [-t encoding|--to-encoding=encoding] file.mp3...\n" % pname)
+ sys.exit(1)
+
+try:
+ optlist, args = getopt(sys.argv[1:], "t:", ["to-encoding="])
+except GetoptError:
+ usage("invalid option")
+
+
+dst_encoding = None
+
+for _opt, _arg in optlist:
+ if _opt in ('-t', '--to-encoding'):
+ dst_encoding = _arg
+try:
+ del _opt, _arg
+except NameError:
+ pass
+
+if not args:
+ usage("too few arguments")
+
+if not dst_encoding:
+ from m_lib.defenc import default_encoding
+ dst_encoding = default_encoding
+
+
+def id3tag_recode(value):
+ try:
+ return value.encode(dst_encoding)
+ except UnicodeEncodeError:
+ return value.encode('latin1')
+
+def printFrame(title, frame):
+ if frame:
+ print '%s: %s' % (title, frame)
+
+def printFramesList(title, frames):
+ frames = [frame for frame in frames if frame]
+ if frames:
+ print '%s: %s' % (title, ', '.join(frames))
+
+def printTrack(title, frame):
+ if frame:
+ track, total = frame
+ if total and track:
+ print '%s: %d (of %d)' % (title, track, total)
+ elif track:
+ print '%s: %d' % (title, track)
+ elif total:
+ print '%s: UNKNOWN of %d' % (title, total)
+
+for filename in args:
+ print "File:", filename
+ mp3_file = Mp3AudioFile(filename)
+ print "Bitrate:", mp3_file.getBitRateString()
+ print "Duration:", mp3_file.getPlayTimeString(), 's'
+
+ id3tag = mp3_file.getTag()
+ if not id3tag:
+ sys.exit()
+
+ for version in eyeD3.ID3_V2, eyeD3.ID3_V1:
+ id3tag = eyeD3.Tag()
+ if not id3tag.link(filename, version):
+ continue
+
+ print '-----'
+ printFrame("id3tag version", id3tag.getVersionStr())
+ printFrame("Artist", id3tag_recode(id3tag.getArtist()))
+ printFrame("Album", id3tag_recode(id3tag.getAlbum()))
+ printFrame("Title", id3tag_recode(id3tag.getTitle()))
+ dates = id3tag.getDate()
+ if dates:
+ printFramesList("Date", [date.getDate() for date in dates])
+ try:
+ printFrame("Genre", id3tag.getGenre().getName())
+ except: # Unknown id3tag or no id3tag at all
+ pass
+ printTrack("Track num", id3tag.getTrackNum())
+ printFramesList("Disc num", [str(n) for n in id3tag.getDiscNum() if n])
+ printFramesList("Comments", [id3tag_recode(frame.comment) for frame in id3tag.getComments() if frame])
+ printFramesList("Lyrics", [frame.description for frame in id3tag.getLyrics()])
+ if id3tag.getImages():
+ print "Has images"
+ printFramesList("URLs", [frame.url for frame in id3tag.getURLs()])
--- /dev/null
+#! /usr/bin/env python
+
+import sys
+from os import utime
+from os.path import getmtime
+import eyeD3
+
+for filename in sys.argv[1:]:
+ mtime = getmtime(filename)
+ id3tag = eyeD3.Tag()
+ id3tag.link(filename, eyeD3.ID3_V1)
+
+ id3tag.setVersion(eyeD3.ID3_V2)
+ id3tag.update()
+ utime(filename, (mtime, mtime))
--- /dev/null
+#! /usr/bin/env python
+
+import sys
+from os import utime
+from os.path import getmtime
+import eyeD3
+
+for filename in sys.argv[1:]:
+ mtime = getmtime(filename)
+ id3tag = eyeD3.Tag()
+ id3tag.link(filename, eyeD3.ID3_V2)
+
+ id3tag.setVersion(eyeD3.ID3_V1)
+ id3tag.update()
+ utime(filename, (mtime, mtime))
--- /dev/null
+#! /bin/sh
+
+
+if [ "$1" = "" ]; then
+ echo "Usage: $0 1.wav [2.wav...]"
+ exit 1
+fi
+
+for wav in "$@"; do
+ name=`basename "$wav" .wav`
+ lame --vbr-new -V 0 -b 96 -B 160 "$wav" "$name".mp3
+done
--- /dev/null
+#! /usr/bin/env python
+
+import sys
+import eyeD3
+from eyeD3.frames import id3EncodingToString
+
+import locale
+locale.setlocale(locale.LC_ALL, '')
+
+for file in sys.argv[1:]:
+ print "File:", file
+ tag = eyeD3.Tag()
+ tag.link(file)
+ for frame in tag.frames:
+ print str(frame)
+ if hasattr(frame, "text"):
+ text = frame.text
+ elif hasattr(frame, "comment"):
+ text = frame.comment
+ else:
+ text = ''
+ print text.encode(id3EncodingToString(frame.encoding))
+ print
--- /dev/null
+#! /usr/bin/env python
+
+import sys
+import eyeD3
+from eyeD3.frames import UTF_8_ENCODING
+
+from os import utime
+from os.path import getmtime, splitext, basename
+
+import re
+mp3_file = re.compile("^([0-9]+ *- *)(.+)$")
+
+filenames = sys.argv[1:]
+for filename in filenames:
+ name = splitext(basename(filename))[0]
+ mtime = getmtime(filename)
+
+ id3tag = eyeD3.Tag()
+ id3tag.link(filename)
+
+ match = mp3_file.match(name)
+ if match:
+ name = match.group(2)
+
+ id3tag.setVersion(eyeD3.ID3_V2)
+ id3tag.setTextEncoding(UTF_8_ENCODING)
+
+ id3tag.setTitle(name)
+ print id3tag.getTitle()
+
+ id3tag.update()
+ utime(filename, (mtime, mtime))
--- /dev/null
+#! /bin/sh
+exec find . -type f \
+ \! -name \*.mp3 \! -name PlayList.m3u \! -name *.jpg \! -name *.txt \
+>file.list
--- /dev/null
+#! /usr/bin/env python
+
+import sys
+from os import utime
+from os.path import getmtime
+from getopt import getopt, GetoptError
+
+import eyeD3
+from eyeD3.frames import id3EncodingToString, \
+ LATIN1_ENCODING, UTF_16_ENCODING, UTF_16BE_ENCODING, UTF_8_ENCODING
+from m_lib.opstring import recode
+
+
+def usage(msg):
+ pname = sys.argv[0]
+ sys.stderr.write("%s: %s\n" % (pname, msg))
+ sys.stderr.write("Usage: %s [-f encoding|--from-encoding=encoding|-t encoding|--to-encoding=encoding] file.mp3...\n" % pname)
+ sys.exit(1)
+
+try:
+ optlist, args = getopt(sys.argv[1:], "f:t:",
+ ["from-encoding=", "to-encoding="]
+ )
+except GetoptError:
+ usage("invalid option")
+
+
+src_encoding = None
+dst_encoding = None
+
+for _opt, _arg in optlist:
+ if _opt in ('-f', '--from-encoding'):
+ src_encoding = _arg
+ elif _opt in ('-t', '--to-encoding'):
+ dst_encoding = _arg
+try:
+ del _opt, _arg
+except NameError:
+ pass
+
+if not args:
+ usage("too few arguments")
+
+if not dst_encoding:
+ from m_lib.defenc import default_encoding
+ dst_encoding = default_encoding
+
+
+def id3tag_set(frame, attr, src_encoding, dst_encoding):
+ value = getattr(frame, attr)
+ if frame.encoding == LATIN1_ENCODING:
+ value = value.encode('latin1').decode(src_encoding).encode(dst_encoding).decode('latin1')
+ setattr(frame, attr, value)
+ elif frame.encoding in (UTF_16_ENCODING, UTF_16BE_ENCODING, UTF_8_ENCODING):
+ #value = value.encode(dst_encoding).decode('latin1')
+ #frame.encoding = LATIN1_ENCODING
+ pass
+ else:
+ raise ValueError('Unknown encoding "%s"' % id3EncodingToString(frame.encoding))
+
+for filename in args:
+ mtime = getmtime(filename)
+ for version in eyeD3.ID3_V2, eyeD3.ID3_V1:
+ id3tag = eyeD3.Tag()
+ if not id3tag.link(filename, version):
+ continue
+
+ if not src_encoding:
+ src_encoding = id3EncodingToString(id3tag.encoding)
+
+ for frame in id3tag.frames:
+ if hasattr(frame, "text"):
+ id3tag_set(frame, "text", src_encoding, dst_encoding)
+ elif hasattr(frame, "comment"):
+ id3tag_set(frame, "comment", src_encoding, dst_encoding)
+
+ title_frame = id3tag.getTitle()
+ if title_frame:
+ try:
+ print title_frame
+ except UnicodeEncodeError:
+ print title_frame.encode('latin1')
+ else:
+ print filename
+
+ if id3tag.getVersion() == eyeD3.ID3_V2_2:
+ version = eyeD3.ID3_DEFAULT_VERSION
+ else:
+ version = eyeD3.ID3_CURRENT_VERSION
+ id3tag.update(version=version)
+ utime(filename, (mtime, mtime))
--- /dev/null
+#! /bin/sh
+
+
+if [ "$2" = "koi2win" ]; then
+ direction="$2"
+elif [ "$2" = "win2koi" ]; then
+ direction="$2"
+elif [ "$2" = "koi2utf" ]; then
+ direction="$2"
+elif [ "$2" = "koi2utf8" ]; then
+ direction=koi2utf
+elif [ "$2" = "win2utf" ]; then
+ direction="$2"
+elif [ "$2" = "win2utf8" ]; then
+ direction=win2utf
+else
+ echo "Usage: $0 playlist koi2win|win2koi|koi2utf|win2utf"
+ exit 1
+fi
+
+if [ "`wc -c \"$1\" | awk '{print $1}'`" -ge 10000 ]; then
+ echo "The file \`$1' is too big, probably not a playlist but mp3?"
+ exit 2
+fi
+
+PATH=$HOME/lib/audio/mp3:$PATH
+umask 022
+
+recode-tags.sh . $direction || exit 1
+#if [ "$direction" = "koi2win" ]; then
+# exec towin "$1"
+#elif [ "$direction" = "win2koi" ]; then
+# exec fromwin "$1"
+#fi
--- /dev/null
+#! /bin/sh
+
+if [ "$1" = "koi2win" ]; then
+ direction="$1"
+elif [ "$1" = "win2koi" ]; then
+ direction="$1"
+elif [ "$1" = "koi2utf" ]; then
+ direction="$1"
+elif [ "$1" = "koi2utf8" ]; then
+ direction=koi2utf
+elif [ "$1" = "win2utf" ]; then
+ direction="$1"
+elif [ "$1" = "win2utf8" ]; then
+ direction=win2utf
+else
+ echo "Usage: $0 koi2win|win2koi|koi2utf|win2utf"
+ exit 1
+fi
+
+PATH=$HOME/lib/audio/mp3:$PATH
+umask 022
+
+if [ "$2" ]; then
+ cd "$2" || exit 1 # or just do it in current directory
+fi
+start_dir="`pwd`"
+
+find . -name PlayList.m3u -print |
+while read path; do
+ dir="`dirname \"$path\"`"
+ cd "$dir" || exit 1
+ recode-tags-list.sh PlayList.m3u $direction
+ cd "$start_dir" || exit 1
+done
--- /dev/null
+#! /bin/sh
+
+
+if [ "$2" = "koi2win" ]; then
+ direction="$2"
+elif [ "$2" = "win2koi" ]; then
+ direction="$2"
+elif [ "$2" = "koi2utf" ]; then
+ direction="$2"
+elif [ "$2" = "koi2utf8" ]; then
+ direction=koi2utf
+elif [ "$2" = "win2utf" ]; then
+ direction="$2"
+elif [ "$2" = "win2utf8" ]; then
+ direction=win2utf
+else
+ echo "Usage: $0 playlist koi2win|win2koi|koi2utf|win2utf"
+ exit 1
+fi
+
+cd "$1" || exit 1
+
+PATH=$HOME/lib/audio/mp3:$PATH
+umask 022
+
+if [ "$direction" = "koi2win" ]; then
+ enc_from=koi8-r
+ enc_to=cp1251
+elif [ "$direction" = "win2koi" ]; then
+ enc_from=cp1251
+ enc_to=koi8-r
+elif [ "$direction" = "koi2utf" ]; then
+ enc_from=koi8-r
+ enc_to=utf-8
+elif [ "$direction" = "win2utf" ]; then
+ enc_from=cp1251
+ enc_to=utf-8
+fi
+
+exec xargs -r -d\\n recode-id3.py -f $enc_from -t $enc_to < PlayList.m3u
--- /dev/null
+#! /usr/bin/env python
+
+import sys
+
+def usage(msg):
+ sys.stderr.write("remove-tag.py: %s\n" % msg)
+ sys.stderr.write("Usage: remove-tag.py -[12] filename\n")
+ sys.exit(1)
+
+from getopt import getopt, GetoptError
+try:
+ optlist, args = getopt(sys.argv[1:], "12", ["id3v1", "id3v2"]
+ )
+except GetoptError:
+ usage("invalid option")
+
+write_id3v1 = True
+write_id3v2 = True
+
+for _opt, _arg in optlist:
+ if _opt == "-1":
+ write_id3v1 = False
+ elif _opt == "--id3v1":
+ write_id3v1 = False
+ elif _opt == "-2":
+ write_id3v2 = False
+ elif _opt == "--id3v2":
+ write_id3v2 = False
+try:
+ del _opt, _arg
+except NameError:
+ pass
+
+if args:
+ if len(args) > 1:
+ usage("too many arguments")
+
+ filename = args[0]
+
+else:
+ usage("too few arguments")
+
+
+from os import utime
+from os.path import getmtime
+mtime = getmtime(filename)
+
+import eyeD3
+
+versions = []
+if not write_id3v2:
+ versions.append(eyeD3.ID3_V2)
+if not write_id3v1:
+ versions.append(eyeD3.ID3_V1)
+
+for version in versions:
+ id3tag = eyeD3.Tag()
+ id3tag.link(filename, version)
+ id3tag.setVersion(version)
+
+ id3tag.remove()
+utime(filename, (mtime, mtime))
--- /dev/null
+#! /usr/bin/env python
+
+import sys
+
+def usage(msg):
+ pname = sys.argv[0]
+ sys.stderr.write("%s: %s\n" % (pname, msg))
+ sys.stderr.write("Usage: %s [-[12][-+]] [-a artist] [-l album] [-g genre] [-n track] [-N total_tracks] [-t title] [-y year] filename\n" % pname)
+ sys.exit(1)
+
+from getopt import getopt, GetoptError
+try:
+ optlist, args = getopt(sys.argv[1:], "1:2:a:g:l:n:N:t:y:",
+ ["id3v1=", "id3v2=", "artist=", "album=", "genre=", "track=", "tracks=",
+ "title=", "year="]
+ )
+except GetoptError:
+ usage("invalid option")
+
+write_id3v1 = True
+write_id3v2 = True
+
+artist = None
+album = None
+genre = None
+track = None
+tracks = None
+title = None
+year = None
+
+for _opt, _arg in optlist:
+ if _opt == "-1":
+ if _arg == '-':
+ write_id3v1 = False
+ elif _opt == "--id3v1":
+ if _arg.lower() in ("no", "off"):
+ write_id3v1 = False
+ elif _opt == "-2":
+ if _arg == "-":
+ write_id3v2 = False
+ elif _opt == "--id3v2":
+ if _arg.lower() in ("no", "off"):
+ write_id3v2 = False
+ elif _opt in ("-a", "--artist"):
+ artist = _arg
+ elif _opt in ("-l", "--album"):
+ album = _arg
+ elif _opt in ("-g", "--genre"):
+ genre = _arg
+ elif _opt in ("-n", "--track"):
+ try:
+ track = int(_arg)
+ except ValueError:
+ track = None
+ elif _opt in ("-N", "--tracks"):
+ try:
+ tracks = int(_arg)
+ except ValueError:
+ tracks = None
+ elif _opt in ("-t", "--title"):
+ title = _arg
+ elif _opt in ("-y", "--year"):
+ year = _arg
+try:
+ del _opt, _arg
+except NameError:
+ pass
+
+if args:
+ if len(args) > 1:
+ usage("too many arguments")
+
+ filename = args[0]
+
+else:
+ usage("too few arguments")
+
+
+from os import utime
+from os.path import getmtime
+mtime = getmtime(filename)
+
+import eyeD3
+
+versions = []
+if write_id3v2:
+ versions.append(eyeD3.ID3_V2)
+if write_id3v1:
+ versions.append(eyeD3.ID3_V1)
+
+for version in versions:
+ id3tag = eyeD3.Tag()
+ id3tag.link(filename, version)
+ id3tag.setVersion(version)
+
+ if album: id3tag.setAlbum(unicode(album, "latin1"))
+ if artist: id3tag.setArtist(unicode(artist, "latin1"))
+ if track or tracks: id3tag.setTrackNum((track, tracks))
+ if title: id3tag.setTitle(unicode(title, "latin1"))
+ if genre: id3tag.setGenre(genre)
+ if year: id3tag.setDate(year)
+
+ id3tag.update()
+utime(filename, (mtime, mtime))
--- /dev/null
+#! /usr/bin/env python
+
+import sys, os
+import eyeD3
+from eyeD3.frames import TITLE_FID, id3EncodingToString
+from m_lib.defenc import default_encoding
+
+def id3tag_recode(value):
+ try:
+ return value.encode(default_encoding)
+ except UnicodeEncodeError:
+ return value.encode('latin1')
+
+files = sys.argv[1:]
+for i, filename in enumerate(files):
+ id3tag = eyeD3.Tag()
+ id3tag.link(filename)
+ title = id3tag_recode(id3tag.getTitle())
+ os.rename(filename, '%d - %s.mp3' % (i+1, title))
--- /dev/null
+#! /usr/bin/env python
+
+import sys
+import eyeD3
+from eyeD3.frames import TITLE_FID, id3EncodingToString
+
+from os import utime
+from os.path import getmtime
+
+for filename in sys.argv[1:]:
+ mtime = getmtime(filename)
+ id3tag = eyeD3.Tag()
+ id3tag.link(filename)
+
+ title_frames = id3tag.frames[TITLE_FID]
+ if title_frames:
+ title_frame = title_frames[0]
+ print title_frame.text.encode(id3EncodingToString(title_frame.encoding))
+ else:
+ print filename
+
+ id3tag.setVersion(eyeD3.ID3_V2)
+
+ id3tag.update()
+ utime(filename, (mtime, mtime))
--- /dev/null
+#! /bin/sh
+
+if [ "$1" = "" ]; then
+ echo "Usage: $0 playlist"
+ exit 1
+fi
+
+PATH=$HOME/lib/audio/ogg:$PATH
+umask 022
+
+playlist="$1"
+shift
+
+i=1
+while read line; do
+ filename="`printf 'track_%02d.ogg' $i`"
+ tag.py -t "$line" -n $i "$@" "$filename" || exit 1
+ newid="`printf '%02d' $i`"
+ mv "$filename" "$newid-$line".ogg || exit 1
+ i="`expr $i + 1`"
+done < "$playlist"
--- /dev/null
+#! /usr/bin/env python
+
+import sys
+
+def usage(msg):
+ sys.stderr.write("tag.py: %s\n" % msg)
+ sys.stderr.write("Usage: tag.py [-a artist] [-l album] [-g genre] [-n track] [-t title] [-y year] [-c charset] filename\n")
+ sys.exit(1)
+
+from getopt import getopt, GetoptError
+try:
+ optlist, args = getopt(sys.argv[1:], "a:g:l:n:t:y:c:",
+ ["artist=", "album=", "genre=", "track=", "title=", "year=", "charset="]
+ )
+except GetoptError:
+ usage("iinvalid option")
+
+artist = None
+album = None
+genre = None
+track = None
+title = None
+year = None
+charset = "ascii"
+
+for _opt, _arg in optlist:
+ if _opt in ("-a", "--artist"):
+ artist = _arg
+ elif _opt in ("-l", "--album"):
+ album = _arg
+ elif _opt in ("-g", "--genre"):
+ from ID3 import ID3
+ if _arg in ID3.genres:
+ genre = _arg
+ else:
+ raise ValueError, "unknown genre `%s'" % _arg
+ elif _opt in ("-n", "--track"):
+ try:
+ track = int(_arg)
+ except ValueError:
+ track = None
+ elif _opt in ("-t", "--title"):
+ title = _arg
+ elif _opt in ("-y", "--year"):
+ year = _arg
+ elif _opt in ("-c", "--charset"):
+ charset = _arg
+try:
+ del _opt, _arg
+except NameError:
+ pass
+
+if args:
+ if len(args) > 1:
+ usage("too many arguments")
+
+ filename = args[0]
+
+else:
+ usage("too few arguments")
+
+
+from os import utime
+from os.path import getmtime
+mtime = getmtime(filename)
+
+import ogg.vorbis
+vf = ogg.vorbis.VorbisFile(filename)
+
+tag = vf.comment()
+tag.clear()
+
+if album: tag.add_tag('ALBUM', album.decode(charset).encode('utf-8'))
+if artist: tag.add_tag('ARTIST', artist.decode(charset).encode('utf-8'))
+if track: tag.add_tag('TRACKNUMBER', str(track))
+if title: tag.add_tag('TITLE', title.decode(charset).encode('utf-8'))
+if genre: tag.add_tag('GENRE', genre)
+if year: tag.add_tag('DATE', year)
+
+tag.write_to(filename)
+utime(filename, (mtime, mtime))
--- /dev/null
+#! /bin/sh
+
+"$HOME"/lib/audio/pa-kill
+sleep 1
+pulseaudio -L "module-bluetooth-device address="$1" sink_name=btheadset profile=a2dp" -D &&
+
+echo "\
+set-default-sink btheadset
+set-default-source btheadset.monitor
+set-sink-volume btheadset 45858
+" | pacmd &&
+
+echo 0 > ~/.pulse/mute &&
+echo 45858 > ~/.pulse/volume
--- /dev/null
+#! /bin/sh
+exec "$HOME"/lib/audio/pa-bt 00:23:78:11:D6:4B
--- /dev/null
+#! /bin/sh
+exec "$HOME"/lib/audio/pa-bt 00:1C:EF:7C:81:D6
--- /dev/null
+#! /bin/sh
+
+if pulseaudio --check; then
+ exec pulseaudio -k
+fi
--- /dev/null
+#! /bin/sh
+
+ pactl set-source-mute alsa_input.pci-0000_00_1b.0.analog-stereo 1 &&
+exec pactl set-card-profile 0 output:analog-stereo
--- /dev/null
+#! /bin/sh
+
+ pactl set-card-profile 0 output:analog-stereo+input:analog-stereo &&
+exec pactl set-source-mute alsa_input.pci-0000_00_1b.0.analog-stereo 0
--- /dev/null
+#! /bin/sh
+
+default_sink=`cat "$HOME"/.pulse/default`
+
+"$HOME"/lib/audio/pa-kill
+sleep 1
+pulseaudio -D &&
+echo "\
+set-default-sink "$default_sink"
+set-default-source "`echo $default_sink | sed s/output/input/`"
+set-sink-mute "$default_sink" 0
+set-sink-volume "$default_sink" 32767
+" | pacmd
--- /dev/null
+#! /usr/bin/env bash
+# From http://crunchbanglinux.org/forums/topic/11392/pulseaudio-volume-control-with-media-keys/
+
+MUTE=`cat ~/.pulse/mute`
+test "$MUTE" = "1"
+RETURN=$?
+if [[ $RETURN -eq 0 ]]
+then
+ "$HOME"/lib/audio/pa-volume unmute
+ echo "0" > ~/.pulse/mute
+ exit
+fi
+if [[ $RETURN -eq 1 ]]
+then
+ "$HOME"/lib/audio/pa-volume mute
+ echo "1" > ~/.pulse/mute
+ exit
+fi
--- /dev/null
+#! /usr/bin/env bash
+# From http://crunchbanglinux.org/forums/topic/11392/pulseaudio-volume-control-with-media-keys/
+
+declare -i CURVOL=`cat ~/.pulse/volume` #Reads in the current volume
+default_sink=`cat ~/.pulse/default`
+
+if [[ $1 == "increase" ]]
+then
+ CURVOL=$(($CURVOL + 1310)) #1310 is 2% of the total volume (65535), you can change this to suit your needs.
+fi
+if [[ $1 == "decrease" ]]
+then
+ CURVOL=$(($CURVOL - 1310))
+fi
+if [[ $1 == "mute" ]]
+then
+ pactl set-sink-mute "$default_sink" 1
+ exit
+fi
+if [[ $1 == "unmute" ]]
+then
+ pactl set-sink-mute "$default_sink" 0
+ exit
+fi
+if [[ $CURVOL -ge 0 && $CURVOL -le 65540 ]] # Check to see if the volume is a valid number (65540 was needed in this case because of how I rounded the increment)
+then
+ pactl set-sink-volume "$default_sink" $CURVOL
+ echo $CURVOL > ~/.pulse/volume # Write the new volume to disk to be read the next time the script is run.
+ exit
+fi
--- /dev/null
+#! /bin/sh
+
+action="$1"
+
+if pgrep smplayer >/dev/null; then
+ if [ "$action" = prev ]; then
+ exec smplayer -send-action play_prev
+ elif [ "$action" = next ]; then
+ exec smplayer -send-action play_next
+ elif [ "$action" = pause ]; then
+ exec smplayer -send-action play_or_pause
+ elif [ "$action" = stop ]; then
+ exec smplayer -send-action stop
+ fi
+
+elif pgrep deadbeef >/dev/null; then
+ if [ "$action" = prev ]; then
+ exec deadbeef --prev
+ elif [ "$action" = next ]; then
+ exec deadbeef --next
+ elif [ "$action" = pause ]; then
+ exec deadbeef --toggle-pause
+ elif [ "$action" = stop ]; then
+ exec deadbeef --stop
+ fi
+
+elif pgrep audacious >/dev/null; then
+ if [ "$action" = prev ]; then
+ exec audacious --rew
+ elif [ "$action" = next ]; then
+ exec audacious --fwd
+ elif [ "$action" = pause ]; then
+ exec audacious --play-pause
+ elif [ "$action" = stop ]; then
+ exec audacious --stop
+ fi
+
+else
+ echo "Cannot find an audioplayer" >&2
+ exit 1
+fi
--- /dev/null
+${?title:${title} [}${?artist:${artist}}${?album: - ${album}}${?title:]}${(empty)?title: / ${file-name}}
--- /dev/null
+#! /usr/bin/env python
+
+
+import sys, os
+
+import locale
+locale.setlocale(locale.LC_ALL, '')
+
+playlist = file(sys.argv[1], 'r')
+
+for filename in playlist:
+ filename = filename.strip()
+ if not os.path.exists(filename):
+ filename_lower = filename.lower()
+ if os.path.exists(filename_lower):
+ print "Fixing", filename
+ os.rename(filename_lower, filename)
--- /dev/null
+#! /bin/sh
+
+PATH=$HOME/lib/audio:$PATH
+umask 022
+
+if [ "$1" ]; then
+ cd "$1" || exit 1 # or just do it in current directory
+fi
+start_dir="`pwd`"
+
+find . -type d -print |
+while read dir; do
+ cd "$dir" || exit 1
+ [ -f PlayList.m3u ] && playlist2name.py PlayList.m3u
+ cd "$start_dir" || exit 1
+done
--- /dev/null
+#! /usr/bin/env python
+
+
+import sys, os
+
+play_list = open(sys.argv[1], 'r')
+rename_list = open(sys.argv[2], 'r')
+
+
+for orig_file in play_list:
+ orig_file = orig_file.strip()
+ new_file = rename_list.readline().strip()
+ os.rename(orig_file, "../" + new_file)
--- /dev/null
+#! /bin/sh
+
+from="$1"
+to="$2"
+shift 2
+
+for filename in "$@"; do
+ newname="`echo \"$filename\" | sed s/\"$from\"/\"$to\"/g`"
+ [ "$filename" \!= "$newname" ] && mv "$filename" "$newname"
+done
--- /dev/null
+#! /bin/sh
+
+if [ "$1" ]; then
+ device="$1"
+ shift
+else
+ device="/dev/cdrom"
+fi
+
+mkdir cdrip && cd cdrip || exit 1
+
+cdparanoia -d "$device" -B &&
+exec $HOME/lib/audio/mjack "$device" "$@"
--- /dev/null
+#! /usr/bin/env python
+
+import sys
+import random
+
+infile_name = sys.argv[1]
+outfile_name = sys.argv[2]
+
+infile = open(infile_name, 'rU')
+lines = infile.readlines()
+infile.close()
+
+random.shuffle(lines)
+
+outfile = open(outfile_name, 'w')
+for line in lines:
+ outfile.write(line)
+outfile.close()
--- /dev/null
+#! /bin/sh
+
+if pulseaudio --check; then
+ exec "$HOME"/lib/audio/pa-toggle-mute
+else
+ exec "$HOME"/lib/audio/amixer-toggle-mute
+fi
--- /dev/null
+#! /bin/sh
+
+if pulseaudio --check; then
+ if [ "$1" = increase ]; then
+ vol=increase
+ elif [ "$1" = decrease ]; then
+ vol=decrease
+ elif [ "$1" = INCREASE ]; then
+ vol=increase
+ "$HOME"/lib/audio/pa-volume "$vol"
+ elif [ "$1" = DECREASE ]; then
+ vol=decrease
+ "$HOME"/lib/audio/pa-volume "$vol"
+ else
+ echo "Usage: $0 [increase|decrease|INCREASE|DECREASE]" >&2
+ exit 1
+ fi
+ exec "$HOME"/lib/audio/pa-volume "$vol"
+else
+ exec "$HOME"/lib/audio/amixer-volume "$@"
+fi
--- /dev/null
+if echo "$PATH" | grep -vq "phd/lib/cdr-dvdrw-tools"; then
+ PATH="$HOME/lib/cdr-dvdrw-tools:$PATH"
+fi
+
+cd_image_iso="$HOME/tmp/cd-image.iso"
+source_dir="$HOME/tmp/cdrw"
+work_dir="$HOME/tmp/cdrom"
+
+dev_cdrom=/dev/cdrom
+dev_cdrw=/dev/cdrw
+dev_scsi=/dev/hda
+dev_sg=/dev/hda
+
+fs_cdrom=/media/cdrom0
+fs_cdrw=/media/cdrom0
+fs_mnt=/mnt
+
+eject_cdrom=cdrom
+eject_cdrw=cdrw
+
+cdrw_speed=24
+dvdrw_speed=4
+
+if [ "$CD_IMAGE_ISO" ]; then
+ cd_image_iso="$CD_IMAGE_ISO"
+fi
+
+if [ "$CD_SOURCE_DIR" ]; then
+ source_dir="$CD_SOURCE_DIR"
+fi
+
+if [ "$CD_WORK_DIR" ]; then
+ work_dir="$CD_WORK_DIR"
+fi
+
+if [ "$CDR_SPEED" ]; then
+ cdrw_speed="$CDR_SPEED"
+fi
+
+die() {
+ echo "$@"
+ exit 1
+}
--- /dev/null
+#! /bin/sh
+
+. .config
+exec blank.sh fast -eject
--- /dev/null
+#! /bin/sh
+
+. .config
+blank.sh &&
+exec cdrec-data -tao gracetime=0 -eject
--- /dev/null
+#! /bin/sh
+
+. .config
+
+blank.sh && cdrec-data -tao gracetime=0 &&
+eject "$eject_cdrw" && wait-cdrom &&
+exec diff-cdrom
--- /dev/null
+#! /bin/sh
+
+. .config
+
+blank.sh &&
+cdrec-data -tao gracetime=0 &&
+exec diff-cdrw
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 mp3list"
+ exit 1
+fi
+
+. .config
+
+exec burn-audio "$1" blank
--- /dev/null
+#! /bin/sh
+
+. .config
+blank.sh &&
+exec overburn
--- /dev/null
+#! /bin/sh
+
+. .config
+
+blank.sh && cdrec-data gracetime=0 -overburn -dao &&
+eject "$eject_cdrw" && wait-cdrom &&
+exec diff-cdrom
--- /dev/null
+#! /bin/sh
+
+. .config
+
+blank.sh &&
+cdrec-data gracetime=0 -overburn -dao &&
+exec diff-cdrw
--- /dev/null
+#! /bin/sh
+
+. .config
+exec blank.sh all -eject
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ type=fast
+else
+ type="$1"
+ shift
+fi
+
+. .config
+exec wodim -v speed="$cdrw_speed" "$@" blank="$type" dev="$dev_scsi"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec cdrec-data -tao -eject
--- /dev/null
+#! /bin/sh
+
+. .config
+
+cdrec-data -tao gracetime=8 &&
+eject "$eject_cdrw" && wait-cdrom &&
+exec diff-cdrom
--- /dev/null
+#! /bin/sh
+
+. .config
+
+cdrec-data -tao gracetime=8 &&
+exec diff-cdrw
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 track_list [blank]"
+ exit 1
+fi
+
+track_list="$1"
+
+
+if [ -z "$2" ]; then
+ blank=""
+elif [ "$2" = "blank" ]; then
+ blank="blank=fast"
+else
+ blank="blank=$2"
+fi
+
+
+. .config
+
+eval do-list.py "$track_list" wodim -v speed="$cdrw_speed" -eject $blank dev="$dev_scsi" -pad -dao -audio &&
+exec do-list.py "$track_list" rm "$track_list"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec wodim -v speed="$cdrw_speed" dev="$dev_scsi" -tao -multi -data "$cd_image_iso"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec cdrec-data -dummy -tao -eject
--- /dev/null
+#! /bin/sh
+
+. .config
+
+label=""
+prog=burn+diff
+setattrs=NO
+
+COPY=NO
+MOVE=NO
+DELETE=NO
+
+while getopts l:p:cmrs opt; do
+ case $opt in
+ l) label="$OPTARG" ;;
+ p) prog="$OPTARG" ;;
+ c) COPY=YES ;;
+ m) MOVE=YES ;;
+ r) DELETE=YES ;;
+ s) setattrs=YES ;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+source="$1"
+
+if [ "$2" -o \( "$source" -a $COPY = NO -a $MOVE = NO \) -o \( $COPY = YES -a $MOVE = YES \) ]; then
+ echo "Usage: $0 [-l label] [-p program] [-s] [-c|-m] [source]"
+ exit 1
+fi
+
+if [ "$source" ]; then
+ if [ -f "$source" ]; then
+ mkdir -p "$source_dir" || exit 1
+ elif [ -d "$source" ]; then
+ [ "$label" = "" ] && label="`basename \"$source\"`"
+ else
+ echo "$0 can only write files or directories"
+ exit 1
+ fi
+ if [ $COPY = YES ]; then
+ if [ -f "$source" ]; then
+ cp -p "$source" "$source_dir"
+ else
+ cpdir "$source" "$source_dir"
+ fi
+ elif [ $MOVE = YES ]; then
+ mv "$source" "$source_dir"
+ fi || exit 1
+fi
+
+if [ $setattrs = YES ]; then
+ "$HOME"/lib/audio/setattrs.sh "$source_dir"
+fi
+
+if [ -z "$label" ]; then
+ label="`guess_label.py`"
+fi
+
+if [ "$label" ]; then
+ mk-image "$label"
+else
+ mk-image
+fi && ls-image && $prog && rm "$cd_image_iso" || exit 1
+
+if [ $DELETE = YES ]; then
+ exec rm -r "$source_dir"
+fi
--- /dev/null
+#! /bin/sh
+exec cdr-complete -p overburn+diff "$@"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec wodim -v speed="$cdrw_speed" "$@" dev="$dev_scsi" -data "$cd_image_iso"
--- /dev/null
+#! /bin/sh
+
+# "Usage $0 [label]"
+
+. .config
+
+label="$1"
+shift
+
+if [ -z "$label" ]; then
+ label="`guess_label.py`"
+fi
+
+if [ -z "$label" ]; then
+ echo -n "Enter DVD label: "
+ read label
+fi
+
+cdblocks=`genisoimage -print-size -quiet -allow-leading-dots -allow-lowercase -allow-multidot -relaxed-filenames -r -J -input-charset koi8-r -joliet-long -V "$label" "$source_dir"`
+genisoimage -allow-leading-dots -allow-lowercase -allow-multidot \
+ -relaxed-filenames -r -J -input-charset koi8-r -joliet-long \
+ -V "$label" "$source_dir" |
+wodim -speed="$dvdrw_speed" -sao dev="$dev_cdrw" tsize="$cdblocks"s -data -
--- /dev/null
+#! /bin/sh
+
+. .config
+
+if [ -z "$1" ]; then
+ echo "Usage $0 dvd-image.iso"
+ exit 1
+fi
+
+exec wodim -v -speed="$dvdrw_speed" -eject dev="$dev_cdrw" -data "$1"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec wodim -v -format speed="$dvdrw_speed" dev="$dev_cdrw"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec wodim -v -speed="$dvdrw_speed" -eject dev="$dev_cdrw" tsize=4400m -data /dev/zero
--- /dev/null
+#! /bin/sh
+exec cdr-complete -p blank+burn+diff-rw "$@"
--- /dev/null
+#! /bin/sh
+
+. .config
+
+if [ -z "$1" ]; then
+ echo "Usage $0 cd-image.iso"
+ exit 1
+fi
+
+exec wodim -v speed="$cdrw_speed" -eject dev="$dev_scsi" -data "$1"
--- /dev/null
+#! /bin/sh
+exec cdr-complete -p blank+overburn+diff-rw "$@"
--- /dev/null
+#! /bin/sh
+
+. .config
+
+[ -f "$cd_image_iso" ] && die "$cd_image_iso found, remove it first"
+[ -d "$source_dir" ] && die "$source_dir found, remove it first"
+
+
+while getopts bdl:Ow opt; do
+ case $opt in
+ b ) blank=blank ;;
+ d ) dvd=dvd ;;
+ l ) label="$OPTARG" ;;
+ O ) over=over ;;
+ w ) cdrw=cdrw ;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+
+if [ -z "$cdrw" ]; then
+ device="$dev_cdrom"
+ fs="$fs_cdrom"
+ eject="$eject_cdrom"
+else
+ device="$dev_cdrw"
+ fs="$fs_cdrw"
+ eject="$eject_cdrw"
+fi
+
+wait-cd "$device"
+
+if [ -z "$label" ]; then
+ label="`get_label \"$device\"`"
+ if [ -z "$label" ]; then
+ echo -n "Enter label: "
+ read label
+ fi
+fi
+
+
+echo "Reading source disk, please wait..."
+
+mount "$fs" || die "Cannot mount the source disk"
+cpdir "$fs" "$work_dir" || die "Cannot copy the source disk"
+eject "$eject"
+
+chmod -R u+w "$work_dir"
+mv "$work_dir" "$source_dir"
+
+
+echo ""
+
+if [ -z "$dvd" ]; then
+ mk-image "$label" || die "Cannot make new disk image"
+ ls-image
+fi
+
+echo ""
+
+
+if [ -z "$dvd" ]; then
+ until wodim dev="$dev_scsi" -atip >/dev/null 2>&1; do
+ echo "Insert blank disk into CD/DVD-Burner and press Enter..."
+ read
+ done
+ if [ "$blank" = blank ]; then
+ blank+"$over"burn
+ else
+ "$over"burn
+ fi || die "Error burning disk"
+
+else
+
+ echo "Insert blank disk into CD/DVD-Burner and press Enter..."
+ read
+ dvdrec-data "$label" || die "Error burning disk"
+fi
+
+echo ""
+
+if [ -z "$cdrw" ]; then
+ echo "Insert newly written disk into CD/DVD-ROM and press Enter..."
+ read
+fi
+
+echo "Comparing, please wait..."
+echo ""
+
+
+mount "$fs" || die "Cannot mount the disk"
+cd "$source_dir"
+
+if diff -r --speed-large-files . "$fs"; then
+ echo "The disk has been successfully copied!"
+ echo ""
+else
+ exit 1
+fi
+
+eject "$eject" &
+if [ -z "$dvd" ]; then
+ rm -r "$cd_image_iso"
+fi
+exec rm -r "$source_dir"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec clone-cd -l "$1" -O
--- /dev/null
+#! /bin/sh
+
+. .config
+exec clone-cd -l "$1" -w
--- /dev/null
+#! /bin/sh
+
+. .config
+exec clone-cd -l "$1" -Ow
--- /dev/null
+#! /bin/sh
+
+. .config
+exec clone-cd -l "$1" -b
--- /dev/null
+#! /bin/sh
+
+. .config
+exec clone-cd -l "$1" -bO
--- /dev/null
+#! /bin/sh
+
+. .config
+exec clone-cd -l "$1" -bw
--- /dev/null
+#! /bin/sh
+
+. .config
+exec clone-cd -l "$1" -bOw
--- /dev/null
+#! /bin/sh
+
+. .config
+exec clone-cd -l "$1" -dw
--- /dev/null
+#! /bin/sh
+
+. .config
+
+cd "$source_dir" || die "Cannot chdir to the source directory"
+mount "$1" || die "Cannot mount CD"
+echo Diffing `pwd` and "$1"
+diff -rq --speed-large-files . "$1"
+res=$?
+eject "$2" &
+exit $res
--- /dev/null
+#! /bin/sh
+
+. .config
+exec diff-cd "$fs_cdrom" "$eject_cdrom"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec diff-cd "$fs_cdrw" "$eject_cdrw"
--- /dev/null
+#! /bin/sh
+
+. .config
+
+mount "$fs_cdrom" || die "Cannot mount CD"
+mount-loopback || die "Cannot mount disk image"
+echo Diffing "$fs_mnt" and "$fs_cdrom"
+diff -rq --speed-large-files "$fs_mnt" "$fs_cdrom"
+res=$?
+sudo umount "$fs_mnt" &
+eject "$eject_cdrom" &
+exit $res
--- /dev/null
+#! /bin/sh
+
+# "Usage $0 [label]"
+
+. .config
+
+label="$1"
+shift
+
+if [ -z "$label" ]; then
+ label="`guess_label.py`"
+fi
+
+if [ -z "$label" ]; then
+ echo -n "Enter DVD label: "
+ read label
+fi
+
+exec growisofs -speed="$dvdrw_speed" -Z "$dev_cdrw" \
+ -allow-leading-dots -allow-lowercase -allow-multidot \
+ -relaxed-filenames -r -J -input-charset koi8-r -joliet-long \
+ -V "$label" "$source_dir"
--- /dev/null
+#! /bin/sh
+
+. .config
+
+if [ -z "$1" ]; then
+ echo "Usage $0 dvd-image.iso"
+ exit 1
+fi
+
+exec growisofs -speed="$dvdrw_speed" -Z "$dev_cdrw"="$1"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec dvd+rw-format $@ "$dev_cdrw"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec growisofs -speed="$dvdrw_speed" -Z "$dev_cdrw"=/dev/zero
--- /dev/null
+#! /bin/sh
+
+. .config
+dvdrec-data "$@" &&
+exec diff-cdrom
--- /dev/null
+dvd+rw-tools/dvdrec-data
\ No newline at end of file
--- /dev/null
+#! /bin/sh
+
+. .config
+dvdrec-data "$@" &&
+exec eject "$eject_cdrw"
--- /dev/null
+#! /bin/sh
+
+# "Usage $0 label boot.img..."
+
+if [ -z "$1" ]; then
+ echo -n "Enter CD label: "
+ read label
+else
+ label="$1"
+ shift
+fi
+
+if [ -z "$1" ]; then
+ echo -n "Enter boot image filename: "
+ read boot_img
+else
+ boot_img="$1"
+fi
+shift
+
+alt_boot=''
+if [ "$@" ]; then
+ for b in "$@"; do
+ alt_boot="$alt_boot -eltorito-alt-boot -b $b"
+ done
+fi
+
+. .config
+exec dvdrw "$label" -c _boot -b "$boot_img" $alt_boot
--- /dev/null
+dvd+rw-tools/dvdrw-iso
\ No newline at end of file
--- /dev/null
+dvd+rw-tools/format-dvd
\ No newline at end of file
--- /dev/null
+#! /bin/sh
+
+. .config
+exec get-fs "$fs_cdrom" "$eject_cdrom"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec get-fs "$fs_cdrw" "$eject_cdrw"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec wodim -vv -toc dev="$dev_sg"
--- /dev/null
+#! /bin/sh
+
+. .config
+
+mount "$1" || die "Cannot mount the source CD"
+cp -a "$1" "$work_dir" || die "Cannot copy the source CD"
+eject "$2" &
+
+chmod -R u+w "$work_dir"
+exec mv "$work_dir" "$source_dir"
--- /dev/null
+#! /bin/sh
+
+. .config
+
+exec dd if="$1" of="$cd_image_iso" bs=102400
+#exec readom dev="$1" f="$cd_image_iso"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec get-iso "$dev_cdrom"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec get-iso "$dev_cdrw"
--- /dev/null
+#! /bin/sh
+
+. .config
+isoinfo -i "$1" -d | grep "Volume id: " | cut -c 12-
--- /dev/null
+#! /usr/bin/env python
+
+import sys, os
+
+helper_pipe = os.popen("guess_label.sh", 'r')
+line = helper_pipe.read()
+helper_pipe.close()
+
+source_dir = line.strip()
+os.chdir(source_dir)
+
+entries = os.listdir('.')
+files = filter(os.path.isfile, entries)
+
+if not files:
+ files = filter(os.path.isdir, entries)
+ if len(files) == 0:
+ sys.exit("Cannot find any file in `%s'" % source_dir)
+ if len(files) > 1:
+ sys.exit("Too many directories in `%s'" % source_dir)
+
+if len(files) > 1:
+ sys.exit("Too many files in `%s'" % source_dir)
+
+filename = os.path.basename(files[0])
+filename = os.path.splitext(filename)[0]
+filename = filename.replace('_', ' ')
+
+if len(filename) <= 32:
+ print filename
+else:
+ sys.exit("The label `%s' is too long: %d (max 32)" % (filename, len(filename)))
--- /dev/null
+#! /bin/sh
+. .config
+echo "$source_dir"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec ls-iso "$dev_cdrom"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec ls-iso "$dev_cdrw"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec ls-iso "$cd_image_iso"
--- /dev/null
+#! /bin/sh
+
+. .config
+
+if [ -z "$PAGER" ]; then
+ PAGER=more
+fi
+
+( isoinfo -i "$1" -d &&
+exec isoinfo -i "$1" -R -l) | $PAGER
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 mp3list [blank]"
+ exit 1
+fi
+
+result_list=_result_$$.list
+
+. .config
+
+eval mp3-to-wavs "$1" "$result_list" &&
+eval burn-audio "$result_list" "$2" &&
+exec rm "$1"
--- /dev/null
+#! /bin/sh
+
+. .config
+
+[ -f "$cd_image_iso" ] && die "$cd_image_iso found, remove it first"
+[ -d "$source_dir" ] || die "$source_dir not found, create it first"
+
+
+if [ -z "$1" ]; then
+ echo -n "Enter CD label: "
+ read label
+else
+ label="$1"
+fi
+shift
+
+
+exec genisoimage \
+ -allow-leading-dots -allow-lowercase -allow-multidot \
+ -relaxed-filenames -r -J -input-charset koi8-r -joliet-long \
+ -V "$label" -o "$cd_image_iso" "$source_dir"
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo -n "Enter CD label: "
+ read label
+else
+ label="$1"
+ shift
+fi
+
+if [ -z "$1" ]; then
+ echo -n "Enter boot image filename: "
+ read boot_img
+else
+ boot_img="$1"
+ shift
+fi
+
+alt_boot=''
+if [ "$@" ]; then
+ for b in $@; do
+ alt_boot="$alt_boot -eltorito-alt-boot -b $b"
+ done
+fi
+
+. .config
+
+exec mk-image "$label" -c _boot -b "$boot_img" $alt_boot
--- /dev/null
+#! /bin/sh
+
+. .config
+exec mk-image "$1" -C `wodim dev="$dev_scsi" -msinfo` -M "$dev_cdrw"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec sudo mount -t iso9660 -o ro,loop,nodev,noexec,nosuid,mode=0644 "$cd_image_iso" "$fs_mnt"
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 mp3list [result]"
+ exit 1
+fi
+
+mp3list="$1"
+
+if [ -z "$2" ]; then
+ result_list=_result_$$.list
+else
+ result_list="$2"
+fi
+
+cp /dev/null "$result_list"
+
+. .config
+
+while read f; do
+ mp3base="`basename \"$f\" .mp3`"
+ result_file="$source_dir/$mp3base".wav
+ echo "$result_file" >>"$result_list"
+ mpg321 -s "$f" | sox -t raw -r 44100 -s -w -c 2 - "$result_file"
+done < "$mp3list"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec cdrec-data -overburn -dao -eject
--- /dev/null
+#! /bin/sh
+
+. .config
+
+cdrec-data -overburn -dao &&
+eject "$eject_cdrw" && wait-cdrom &&
+exec diff-cdrom
--- /dev/null
+#! /bin/sh
+
+. .config
+
+cdrec-data -overburn -dao &&
+exec diff-cdrw
--- /dev/null
+#! /bin/sh
+
+. .config
+exec cdrec-data -overburn -dao -dummy -eject
--- /dev/null
+#! /bin/sh
+
+. .config
+exec wodim -scanbus
--- /dev/null
+#! /usr/bin/env python
+
+
+import sys, os, mmap
+
+
+filename = sys.argv[1]
+infile = open(filename, 'r')
+mem = mmap.mmap(infile.fileno(), os.path.getsize(filename), access=mmap.ACCESS_READ)
+
+
+search = "TAG"
+start = 0
+
+
+while True:
+ pos = mem.find(search, start)
+ if pos == -1: break
+
+ print pos
+
+ if pos < 3836029:
+ raise ValueError, "pos %d is too low, must be at least 3836029" % pos
+
+ start = pos + 1
+
+ mem.seek(pos - 3836029)
+ header = mem[:5]
+
+ print repr(header)
+
+
+mem.close()
+infile.close()
--- /dev/null
+#! /bin/sh
+
+. .config
+exec test-disk "$dev_cdrom"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec test-disk "$dev_cdrw"
--- /dev/null
+#! /bin/sh
+dd if="$1" of=/dev/null bs=102400 && echo Ok.
--- /dev/null
+#! /bin/sh
+
+. .config
+
+until isoinfo -i "$1" -d >/dev/null 2>&1; do
+ echo "Insert CD into CD-ROM and press Enter..."
+ read
+done
--- /dev/null
+#! /bin/sh
+
+. .config
+exec wait-cd "$dev_cdrom"
--- /dev/null
+#! /bin/sh
+
+. .config
+exec wait-cd "$dev_cdrw"
--- /dev/null
+dvd+rw-tools/zero-dvd
\ No newline at end of file
--- /dev/null
+A number of scripts that I am writing and using to work with CD/DVD
+writers, audio and video files, tv-tuners. Public domain.
+
+
+Subdirectories:
+
+ audio - scripts for manipulating ogg/mp3 files.
+ cdr-dvdrw-tools - scripts for cdrtools and growisofs.
+ video - scripts for manipulating video files.
+
+
+audio
+-----
+
+ Shell and python scripts for manipulating audio (ogg/mp3) files and tags.
+
+setattrs.sh - set normal attributes (files rw-r--r--, directories
+ rwxr-xr-x) after reading from a CD.
+find-nolist.py - find directories without a playlist.
+find-no3.py - find directories without mp3 files.
+find-nolist-no3.py - ... without both.
+mk_list.py - make a playlist for a directory.
+mk_list_recursive.py - make playlists in all subdirectories.
+mk_list_recursive.sh - make playlists in all subdirectories.
+fix-list-names.py - recursively rename all playlists to PlayList.m3u.
+recode_names.py - recode filenames from one encoding to another.
+recode-names-recursive.py - recode directories and filenames recursively.
+recode-id3v2.py - recode ID3 tags from one encoding to another.
+id3v1-to-v2.py - recode ID3 tags from version 1 to version 2.
+tag2name.py - get an ID3 tag and rename the file according to its tag.
+name2tag.py - make an ID3 tag according to the filename.
+recode-tags.sh - recode ID3 tags for listed files.
+recode-tags-list.sh - recode ID3 tags according to playlist and recode the
+ very playlist.
+recode-tags-recursive.sh - recode ID3 tags playlists recursively.
+find-v1.py - find mp3 files with ID3v1 tags.
+find-v2.py - find mp3 files with ID3v2 tags.
+find-v1v2.py - find mp3 files with ID3v1 and ID3v2 tags.
+find-no-v1v2.py - find mp3 files without ID3 tags.
+playlist2name.py, playlist2name.sh - test (using the playlist) if the
+ filename is in wrong case (copied from DOS partition) and fix the
+ filename according to the playlist.
+
+
+cdr-dvdrw-tools
+---------------
+
+ Here is a number of shell and python scripts to guide cdrtools and
+growisofs CD-R[W] and DVD-/+R[W] recording software - scripts for making
+(bootable) ISO images, burning and cloning disks, and testing the results.
+
+.config - config file
+ls-iso, ls-image, ls-cdrom, ls-cdrw - list files in an ISO image, or on CD
+ in the CD-ROM or CD-RW drive.
+get-iso, get-iso-cd, get-iso-cdrw, get-fs, get-cd, get-cdrw - get an ISO
+ image or files from CD.
+test-disk, test-cdrom, test-cdrw - test the CD by copying its ISO image to
+ /dev/null.
+mk-image - make an ISO image.
+mk-image.py - if there is just one source file (usually AVI) - strip
+ extension to make the label.
+mk-image-boot - make bootable ISO image (El Torito).
+scan - scan the bus to find SCSI drives.
+cdrec-data, burn-test, burn, blank.sh, blank, blank-all, blank+burn,
+ overburn-test, overburn, blank+overburn - burn a CD in all modes.
+clone-cd, clone-cdrw, clone-cd-rw, clone-cdrw-rw - clone a CD/DVD into a
+ CD-R, CD-RW, DVD+RW; clone-cd recognizes options:
+ -b - blank disk
+ -d - burn DVD
+ -l label
+ -O - overburn
+ -w - CD-RW
+diff-image, diff-cd, diff-cdrom, diff-cdrw - compare the CD with source
+ directory.
+mp3-to-wavs - convert a list of mp3 files to wav files.
+burn-audio, blank+burn-audio - burn an audio disk.
+mk-audio - make an ISO image for an audio disk.
+mk-image-multi, burn-multi - burn multisession CD.
+burn+diff, blank+burn+diff, overburn+diff, blank+overburn+diff - burn and
+ diff :)
+cdr-complete, cdrw-complete, cdr-800 - complete run: move file(s) into the
+ source directory, normalize files and directories attributes, make an ISO
+ image and list it, burn, diff and cleanup! Options:
+ -l label - CD label; default is to ask
+ -p prog - program to run; default is burn+diff
+ -s - set normal attributes for files and directories.
+dvdrw, dvdrw-iso, blank-dvd, dvdr-complete, dvdrw-boot - scripts for
+ burning DVD-/+R[W] disks.
+
+ All programs recognize the following environment variables (via .config):
+
+CD_IMAGE_ISO=cd_image_iso
+CD_SOURCE_DIR=source_dir
+CD_WORK_DIR=work_dir
+CDR_SPEED=speed
+
+ Thus you may override parameters in .config.
+
+
+video
+-----
+
+Using mplayer/mencoder:
+m_catvideo - concatenate few video files into one.
+m_encode - 1 and 2-pass encoding using different codecs.
+m_fix-avi-index - fix an AVI index.
+m_recode2mp3 - recode an audio stream to mp3, leaving video stream intact.
+m_split-avi - split an AVI file in two.
+
+Using transcode:
+tc_calc_bitrate - estimate bitrate and audio volume scaling.
+tc_detectclipping - detect clipping.
+tc_encode - 1 and 2-pass encoding using different codecs;
+ the input is supposed to be a file or a directory with ripped VOB files.
+tc_extract_a1 - extract an additional audio track and merge it into the output.
+tc_encode_x264 - 1, 2, 3-pass encoding using x264 binary;
+ audio is converted to Ogg Vorbis; the resulting file is Matroska Video (.mkv).
--- /dev/null
+# INFO
+#
+# The AVI file format supports so-called tomb-stone data. It can be
+# used to write annotations into the AVI file.
+#
+# You can use this file as the argument to the transcode option
+# --avi_comments. When the file is read, empty lines and lines
+# starting with '#' are ignored.
+# The syntax is: "TAG<space>STRING". The order of the tags does not
+# matter. If a tag has no string following it, it is ignored. That
+# means, you can use this file as input and only fill out the fields
+# you want.
+#
+# A very simple example is:
+# ----------------snip----------------
+# INAM My 1st Birthday
+# ISBJ My first steps!
+# IART My proud family
+# ----------------snip----------------
+#
+# Keep in mind that there is no endless space in the AVI header,
+# most likely its around 1000 bytes.
+
+
+# INAM - Stores the title of the subject of the file, such as
+# "Seattle from Above."
+INAM
+
+# ISBJ - Describes the contents of the file, such as
+# "Aerial view of Seattle."
+ISBJ
+
+# Lists the artist of the original subject of the file;
+# for example, "Michaelangelo."
+IART
+
+# Records the copyright information for the file; for example,
+# "Copyright Encyclopedia International 1991." If there are multiple
+# copyrights, separate them by semicolon followed by a space.
+ICOP
+
+# Lists the name of the person or organization that commissioned
+# the subject of the file; for example "Pope Julian II."
+ICMS
+
+# Provides general comments about the file or the subject
+# of the file. If the comment is several sentences long, end each
+# sentence with a period. Do not include new-line characters.
+ICMT Codec: FFmpeg (DivX5)
+
+# Indicates where the subject of the file is archived
+IARL
+
+# Creation date. Specifies the date the subject of the file was created. List
+# dates in year-month-day format, padding one-digit months and days with
+# a zero on the left; for example, "1553-05-03" for May 3, 1553.
+ICRD
+
+# Describes whether an image has been cropped and, if so, how it
+# was cropped; for example, "lower-right corner."
+ICRP
+
+# Specifies the size of the original subject of the file; for
+# example, "8.5 in h, 11 in w."
+IDIM
+
+# Stores dots per inch setting of the digitizer used to
+# produce the file, such as "300."
+IDPI
+
+# Stores the of the engineer who worked on the file. If there are
+# multiple engineers, separate the names by a semicolon and a blank;
+# for example, "Smith, John; Adams, Joe."
+IENG
+
+# Describes the original work, such as "landscape,", "portrait,"
+# "still liefe," etc.
+IGNR
+
+# Provides a list of keywords that refer to the file or subject of the
+# file. Separate multiple keywords with a semicolon and a blank;
+# for example, "Seattle, aerial view; scenery."
+IKEY
+
+# ILGT - Describes the changes in the lightness settings on the digitizer
+# required to produce the file. Note that the format of this information
+# depends on the hardware used.
+ILGT
+
+# IMED - Decribes the original subject of the file, such as
+# "computer image," "drawing," "lithograph," and so on.
+IMED
+
+# IPLT - Specifies the number of colors requested when digitizing
+# an image, such as "256."
+IPLT
+
+# IPRD - Specifies the name of title the file was originally intended
+# for, such as "Encyclopedia of Pacific Northwest Geography."
+IPRD
+
+# ISHP - Identifies the change in sharpness for the digitizer
+# required to produce the file (the format depends on the hardware used).
+ISHP
+
+# ISRC - Identifies the name of the person or organization who
+# suplied the original subject of the file; for example, "Try Research."
+ISRC
+
+# ISRF - Identifies the original form of the material that was digitized,
+# such as "slide," "paper," "map," and so on. This is not necessarily
+# the same as IMED
+ISRF
+
+# ITCH - Identifies the technician who digitized the subject file;
+# for example, "Smith, John."
+ITCH
--- /dev/null
+#! /bin/sh
+
+if [ -z "$2" ]; then
+ echo "Usage: $0 width height [fps [bpp]]"
+ exit 1
+fi
+
+width="$1"
+height="$2"
+if [ -z "$3" ]; then
+ fps=25
+else
+ fps="$3"
+fi
+if [ -z "$4" ]; then
+ bpp=0.15
+else
+ bpp="$4"
+fi
+
+echo bitrate = "$width * $height * $fps * $bpp / 1000" = `python -c "print $width * $height * $fps * $bpp / 1000"`
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 1.avi..."
+ exit 1
+fi
+
+mencoder -idx -ovc copy -oac copy -o output.avi "$@"
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 input.avi..."
+ exit 1
+fi
+
+exec mplayer -vf cropdetect -vo null -nosound "$@"
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: [vcodec=s] [vbitrate=n] [vscale=s] [aid=n] [acodec=s] [abitrate=n] [ascale=s] [pass=n] $0 [-mencoder_options] input.avi..."
+ exit 1
+fi
+
+if [ -z "$vcodec" ]; then
+ vcodec=lavc
+else
+ vcodec="$vcodec"
+fi
+
+if [ -z "$vbitrate" ]; then
+ vbitrate=1600
+else
+ vbitrate="$vbitrate"
+fi
+
+if [ -n "$vscale" ]; then
+ vscale="-vf scale=$vscale"
+fi
+
+if [ -z "$acodec" ]; then
+ acodec=mp3lame
+else
+ acodec="$acodec"
+fi
+
+if [ -z "$abitrate" ]; then
+ abitrate=256
+else
+ abitrate="$abitrate"
+fi
+
+if [ -n "$ascale" ]; then
+ ascale="-af volume=$ascale"
+fi
+
+if [ "$vcodec" = lavc ]; then
+ vopts="-lavcopts vcodec=mpeg4:vbitrate=$vbitrate:autoaspect"
+
+elif [ "$vcodec" = lavc-hq ]; then
+ vcodec=lavc
+ vopts="-lavcopts vcodec=mpeg4:vbitrate=$vbitrate:autoaspect:mbd=2:trell:v4mv:last_pred=2:dia=-1:vmax_b_frames=2:vb_strategy=1:cmp=3:subcmp=3:precmp=0:vqcomp=0.6:turbo"
+
+elif [ "$vcodec" = lavc-vhq ]; then
+ vcodec=lavc
+ vopts="-lavcopts vcodec=mpeg4:vbitrate=$vbitrate:autoaspect:mbd=2:trell:v4mv:last_pred=3:dia=2:vmax_b_frames=2:vb_strategy=1:cmp=2:subcmp=2:precmp=2:mv0:cbp:predia=2:preme=2:qns=2"
+
+elif [ "$vcodec" = x264 ]; then
+ vopts="-x264encopts bitrate=$vbitrate"
+
+elif [ "$vcodec" = x264-hq ]; then
+ vcodec=x264
+ vopts="-x264encopts bitrate=$vbitrate:subq=5:8x8dct:frameref=2:bframes=3:b_pyramid:weight_b"
+
+elif [ "$vcodec" = x264-vhq ]; then
+ vcodec=x264
+ vopts="-x264encopts bitrate=$vbitrate:subq=6:8x8dct:frameref=5:bframes=3:b_pyramid:weight_b:partitions=all:me=umh"
+
+elif [ "$vcodec" = xvid ]; then
+ vopts="-xvidencopts bitrate=$vbitrate"
+
+elif [ "$vcodec" = xvid-hq ]; then
+ vcodec=xvid
+ vopts="-xvidencopts bitrate=$vbitrate:chroma_opt:vhq=2:bvhq=1:quant_type=mpeg"
+
+elif [ "$vcodec" = xvid-vhq ]; then
+ vcodec=xvid
+ vopts="-xvidencopts bitrate=$vbitrate:chroma_opt:vhq=4:bvhq=1:quant_type=mpeg"
+
+elif [ "$vcodec" = copy ]; then
+ vopts=""
+
+else
+ echo "Unknown video codec $vcodec; known codecs are {lavc,x264,xvid}[-[v]hq], copy" >&2
+ exit 1
+fi
+
+if [ "$acodec" = mp3lame ]; then
+ aopts="-lameopts cbr:br=$abitrate:q=0"
+elif [ "$acodec" = copy ]; then
+ aopts=""
+else
+ echo "Unknown audio codec $acodec; known codecs are mp3lame and copy" >&2
+ exit 1
+fi
+
+if [ "$aid" ]; then
+ aopts="$aopts -aid $aid"
+fi
+
+if [ -z "$pass" ]; then
+ pass=1
+else
+ pass="$pass"
+fi
+
+if [ "$vcodec" = lavc ]; then
+ vpass=vpass
+elif [ "$vcodec" = x264 ]; then
+ vpass=pass
+elif [ "$vcodec" = xvid ]; then
+ vpass=pass
+fi
+
+if [ "$pass" -eq 1 ]; then
+ exec mencoder -ovc "$vcodec" $vopts $vscale -oac "$acodec" $aopts $ascale -o output.avi "$@"
+
+elif [ "$pass" -eq 2 ]; then
+
+ mencoder -ovc "$vcodec" $vopts:$vpass=1 $vscale -nosound -o /dev/null "$@" &&
+ exec mencoder -ovc "$vcodec" $vopts:$vpass=2 $vscale -oac "$acodec" $aopts $ascale -o output.avi "$@"
+
+elif [ "$pass" -eq 3 ]; then
+
+ mencoder -ovc "$vcodec" $vopts:$vpass=1 $vscale -nosound -o /dev/null "$@" &&
+ mencoder -ovc "$vcodec" $vopts:$vpass=3 $vscale -nosound -o /dev/null "$@" &&
+ exec mencoder -ovc "$vcodec" $vopts:$vpass=3 $vscale -oac "$acodec" $aopts $ascale -o output.avi "$@"
+ # pass=3 is not a typo!
+
+else
+ echo "Can only do 1, 2 or 3 passes." >&2
+ exit 1
+fi
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 title [mencoder options]" >&2
+ exit 1
+fi
+
+title="$1"
+shift
+
+echo "$title" | iconv -f koi8-r -t utf-8 >avi_name.txt
+echo "Codec FFmpeg (DivX5)" >avi_comment.txt
+
+m_encode -info "name=$(cat avi_name.txt):comment=$(cat avi_comment.txt)" "$@" &&
+mv output.avi "$title".avi &&
+exec rm avi_name.txt avi_comment.txt divx2pass.log
--- /dev/null
+#! /bin/sh
+
+if [ -z "$7" ]; then
+ echo "Usage: $0 title aid1 bitrate1 scale1 aid2 bitrate2 scale2 [menoder options]" >&2
+ exit 1
+fi
+
+title="$1"
+aid1="$2"
+bitrate1="$3"
+scale1="$4"
+aid2="$5"
+bitrate2="$6"
+scale2="$7"
+shift 7
+
+echo "INAM $title" | iconv -f koi8-r -t utf-8 >avi_comments.txt
+echo "ICMT Codec: FFmpeg (DivX5)" >>avi_comments.txt
+
+aid="$aid1" abitrate="$bitrate1" ascale="$scale1" m_encode "$@" &&
+m_extract_a1_comments "$aid2" -lameopts cbr:br=$bitrate2:q=0 -af volume="$scale2" "$@" &&
+mv output2.avi "$title".avi &&
+exec rm avi_comments.txt divx2pass.log a"$aid2".mp3 output.avi
--- /dev/null
+#! /bin/sh
+
+if [ -z "$4" ]; then
+ echo "Usage: $0 aid1 aid2 scale1 scale2 [options]"
+ exit 1
+fi
+
+aid1="$1"
+aid2="$2"
+scale1="$3"
+scale2="$4"
+shift 4
+
+aid="$aid1" ascale="$scale1" m_encode "$@" &&
+m_extract_a1 "$aid2" -af volume="$scale2" "$@" &&
+exec rm divx2pass.log output.avi
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 aid [options]"
+ exit 1
+fi
+
+aid="$1"
+shift
+
+mencoder -ovc copy -oac mp3lame -aid "$aid" -o _tmp.avi "$@" &&
+mplayer -dumpaudio -dumpfile a"$aid".mp3 _tmp.avi && rm _tmp.avi &&
+exec avimerge -o output2.avi -i output.avi -p a"$aid".mp3
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 aid [options]"
+ exit 1
+fi
+
+aid="$1"
+shift
+
+mencoder -ovc copy -oac mp3lame -aid "$aid" -o _tmp.avi "$@" &&
+mplayer -dumpaudio -dumpfile a"$aid".mp3 _tmp.avi && rm _tmp.avi &&
+exec avimerge -o output2.avi -i output.avi -p a"$aid".mp3 -f avi_comments.txt
--- /dev/null
+#! /bin/sh
+
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 input.avi"
+ exit 1
+fi
+
+
+# mencoder only copies ONE audiostream from the input;
+# I don't know how to overcome this.
+
+mencoder -idx "$1" -ovc copy -oac copy -o output.avi &&
+exec mv output.avi "$1"
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 track"
+ exit 1
+fi
+
+exec mencoder -ovc copy -oac copy -o track"$1".mpeg vcd://"$1"
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 input.avi [output.avi]"
+ exit 1
+fi
+
+if [ -z "$2" ]; then
+ output="`basename $1`"
+else
+ output="$2"
+fi
+
+exec mencoder -ovc copy -oac mp3lame "$1" -o "$output"
--- /dev/null
+#! /bin/sh
+
+if [ -z "$3" ]; then
+ echo "Usage: $0 input.avi time1 time2"
+ exit 1
+fi
+
+mencoder -endpos "$2" -ovc copy -oac copy -o 1.avi "$1" &&
+exec mencoder -ss "$3" -ovc copy -oac copy -o 2.avi "$1"
--- /dev/null
+#! /bin/sh
+
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 input.avi"
+ exit 1
+fi
+
+
+# This call of transcode only copies ONE audiostream from the input;
+# if there are more - you need to extract them separately and merge
+# into the output. See tc_extract_a1 for an example.
+
+transcode -i "$1" -P3 -u 50 -o output.avi &&
+exec mv output.avi "$1"
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 input.avi [title]"
+ exit 1
+fi
+
+input="$1"
+title="$2"
+
+if [ "$title" ]; then
+ echo "INAM $title" | iconv -f koi8-r -t utf-8 >avi_comments.txt
+ echo "ICMT Codec: FFmpeg (DivX5)" >>avi_comments.txt
+fi
+
+avimerge -i "$input" -f avi_comments.txt -o output.avi &&
+exec mv output.avi "$input"
--- /dev/null
+#! /bin/sh
+
+TRACK=""
+
+while getopts a: opt; do
+ case $opt in
+ a) TRACK="-a $OPTARG" ;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 input_dir [type [codec]]"
+ exit 1
+elif [ -z "$2" ]; then
+ type=vob
+ codec=ac3
+elif [ -z "$3" ]; then
+ type="$2"
+ codec=ac3
+elif [ -z "$4" ]; then
+ type="$2"
+ codec="$3"
+else
+ echo "Usage: $0 input_dir type codec"
+ exit 1
+fi
+
+tccat -i "$1" | tcextract -t "$type" -x "$codec" $TRACK | tcdecode -x "$codec" | tcscan -x pcm
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 input_dir"
+ exit 1
+fi
+
+exec transcode -i "$1" -y null,null -o /dev/null -J detectclipping
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: [vcodec=s] [vbitrate=n] [vscale=s] [acodec=s] [abitrate=n] [ascale=s] [pass=n] $0 input.avi [-transcode_options]"
+ exit 1
+fi
+
+if [ -z "$vcodec" ]; then
+ vcodec=ffmpeg
+else
+ vcodec="$vcodec"
+fi
+
+if [ -z "$vbitrate" ]; then
+ vbitrate=1600
+else
+ vbitrate="$vbitrate"
+fi
+
+if [ -n "$vscale" ]; then
+ vscale="-Z $vscale"
+fi
+
+if [ -z "$acodec" ]; then
+ acodec=mp3
+else
+ acodec="$acodec"
+fi
+
+if [ -z "$abitrate" ]; then
+ abitrate=256
+else
+ abitrate="$abitrate"
+fi
+
+if [ -n "$ascale" ]; then
+ ascale="-s $ascale"
+fi
+
+if [ "$vcodec" = ffmpeg ]; then
+ tc_vcodec=ffmpeg
+ vopts="-F mpeg4"
+elif [ "$vcodec" = h264 ]; then
+ tc_vcodec=ffmpeg
+ vopts="-F h264"
+elif [ "$vcodec" = xvid ]; then
+ tc_vcodec=xvid
+ vopts=""
+elif [ "$vcodec" = copy ]; then
+ tc_vcodec=copy
+ vopts=""
+else
+ echo "Unknown video codec $vcodec; known codecs are ffmpeg, h264, xvid, copy" >&2
+ exit 1
+fi
+
+if [ "$acodec" = mp3 ]; then
+ aopts=""
+elif [ "$acodec" = copy ]; then
+ aopts=""
+else
+ echo "Unknown audio codec $acodec; known codecs are mp3 and copy" >&2
+ exit 1
+fi
+
+if [ -z "$pass" ]; then
+ pass=1
+else
+ pass="$pass"
+fi
+
+input="$1"
+shift
+
+if [ "$pass" -eq 1 ]; then
+ exec transcode -i "$input" -y $tc_vcodec $vopts -u 50 -w "$vbitrate" -b "$abitrate" $vscale $ascale -o output.avi "$@"
+
+elif [ "$pass" -eq 2 ]; then
+
+ transcode -i "$input" -y $tc_vcodec,null $vopts -u 50 -w "$vbitrate" -b "$abitrate" -R1 -x auto,null $vscale -o /dev/null "$@" &&
+ exec transcode -i "$input" -y $tc_vcodec $vopts -u 50 -w "$vbitrate" -b "$abitrate" -R2 $vscale $ascale -o output.avi "$@"
+
+else
+ echo "Can only do 1 or 2 pass." >&2
+ exit 1
+fi
--- /dev/null
+#! /bin/sh
+
+if [ -z "$2" ]; then
+ echo "Usage: $0 input title [transcode options]" >&2
+ exit 1
+fi
+
+input="$1"
+title="$2"
+shift 2
+
+echo "INAM $title" | iconv -f koi8-r -t utf-8 >avi_comments.txt
+echo "ICMT Codec: FFmpeg (DivX5)" >>avi_comments.txt
+
+tc_encode "$input" --avi_comments=avi_comments.txt "$@" &&
+mv output.avi "$title".avi &&
+exec rm avi_comments.txt divx4.log
--- /dev/null
+#! /bin/sh
+
+if [ -z "$8" ]; then
+ echo "Usage: $0 input title aid1 bitrate1 scale1 aid2 bitrate2 scale2 [transcode options]" >&2
+ exit 1
+fi
+
+input="$1"
+title="$2"
+aid1="$3"
+bitrate1="$4"
+scale1="$5"
+aid2="$6"
+bitrate2="$7"
+scale2="$8"
+shift 8
+
+echo "INAM $title" | iconv -f koi8-r -t utf-8 >avi_comments.txt
+echo "ICMT Codec: FFmpeg (DivX5)" >>avi_comments.txt
+
+abitrate="$bitrate1" ascale="$scale1" tc_encode "$input" -a "$aid1" "$@" &&
+tc_extract_a1_comments "$input" "$aid2" -b "$bitrate2" -s "$scale2" &&
+mv output2.avi "$title".avi &&
+exec rm avi_comments.txt divx4.log a"$aid2".mp3 output.avi
--- /dev/null
+#! /bin/sh
+
+if [ -z "$4" ]; then
+ echo "Usage: $0 input_dir aid scale1 scale2 [options]"
+ exit 1
+fi
+
+input="$1"
+aid="$2"
+scale1="$3"
+scale2="$4"
+shift 4
+
+ascale="$scale1" tc_encode "$input" -a 0 "$@" &&
+tc_extract_a1 "$input" "$aid" -s "$scale2" &&
+rm a1.avi divx4.log output.avi &&
+exec mv output2.avi "$input".avi
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: [vcodec=s] [vbitrate=n] [vscale=s] [abitrate=n] [ascale=s] $0 input.avi"
+ exit 1
+fi
+
+if [ -z "$vcodec" ]; then
+ vcodec=x264
+else
+ vcodec="$vcodec"
+fi
+
+if [ -z "$vbitrate" ]; then
+ vbitrate=2200
+else
+ vbitrate="$vbitrate"
+fi
+
+if [ -n "$vscale" ]; then
+ vscale="-Z $vscale"
+fi
+
+if [ -z "$abitrate" ]; then
+ abitrate=320
+else
+ abitrate="$abitrate"
+fi
+
+if [ -n "$ascale" ]; then
+ ascale="-s $ascale"
+fi
+
+if [ "$vcodec" = x264 ]; then
+ vopts="--bitrate=$vbitrate"
+
+elif [ "$vcodec" = x264-hq ]; then
+ vopts="--bitrate=$vbitrate --8x8dct --ref=2 --bframes=3 --b-pyramid --weightb"
+
+elif [ "$vcodec" = x264-vhq ]; then
+ vopts="--bitrate=$vbitrate --8x8dct --ref=5 --bframes=3 --b-pyramid --weightb --partitions=all --me=umh"
+
+else
+ echo "Unknown video codec $vcodec; known codecs are x264[-[v]hq]" >&2
+ exit 1
+fi
+
+if [ -z "$pass" ]; then
+ pass=1
+else
+ pass="$pass"
+fi
+
+# Video
+transcode -i "$1" -x auto,null -y yuv4mpeg,null -k -u 50 $vscale $ascale -o _tmp.y4m || exit 1
+
+if [ "$pass" -eq 1 ]; then
+ x264 $vopts --progress -o _tmp.mkv _tmp.y4m || exit 1
+
+elif [ "$pass" -eq 2 ]; then
+ x264 $vopts --progress -o /dev/null --pass=1 _tmp.y4m &&
+ x264 $vopts --progress -o _tmp.mkv --pass=2 _tmp.y4m || exit 1
+
+elif [ "$pass" -eq 3 ]; then
+ x264 $vopts --progress -o /dev/null --pass=1 _tmp.y4m &&
+ x264 $vopts --progress -o /dev/null --pass=3 _tmp.y4m &&
+ x264 $vopts --progress -o _tmp.mkv --pass=3 _tmp.y4m || exit 1
+ # pass=3 is not a typo!
+
+else
+ echo "Can only do 1, 2 or 3 passes." >&2
+ exit 1
+fi
+
+# Audio
+transcode -i "$1" -x null,auto -y null,ogg -g 0x0 -b "$abitrate" -m _tmp.ogg &&
+
+exec mkvmerge -o output.mkv -A _tmp.mkv _tmp.ogg
--- /dev/null
+#! /bin/sh
+
+if [ -z "$2" ]; then
+ echo "Usage: $0 input_dir aid [options]"
+ exit 1
+fi
+
+input="$1"
+aid="$2"
+shift 2
+
+transcode -i "$input" -x null,auto -g 0x0 -y null,ffmpeg -a "$aid" -m a"$aid".mp3 "$@" &&
+exec avimerge -o output2.avi -i output.avi -p a"$aid".mp3
--- /dev/null
+#! /bin/sh
+
+if [ -z "$2" ]; then
+ echo "Usage: $0 input_dir aid [options]"
+ exit 1
+fi
+
+input="$1"
+aid="$2"
+shift 2
+
+transcode -i "$input" -x null,auto -g 0x0 -y null,ffmpeg -a "$aid" -m a"$aid".mp3 "$@" &&
+exec avimerge -o output2.avi -i output.avi -p a"$aid".mp3 -f avi_comments.txt
--- /dev/null
+#! /bin/sh
+
+if [ -z "$2" ]; then
+ echo "Usage: $0 input.avi size [comments]"
+ exit 1
+fi
+
+avisplit -i "$1" -s "$2" || exit 1
+
+if [ "$3" ]; then
+ comments_file="$3"
+fi
+
+i=0
+part="`printf '%04d' $i`"
+while [ -r "$1"-$part ]; do
+ i="`expr $i + 1`"
+ if [ "$comments_file" ]; then
+ avimerge -i "$1"-$part -f $comments_file -o CD$i.avi || exit 1
+ rm "$1"-"$part"
+ else
+ mv "$1"-$part CD$i.avi || exit 1
+ fi
+ part="`printf '%04d' $i`"
+done
--- /dev/null
+#! /bin/sh
+
+if [ -z "$1" ]; then
+ echo "Usage: $0 input.avi [size]"
+ exit 1
+fi
+
+if [ -z "$2" ]; then
+ size=700
+else
+ size="$2"
+fi
+
+exec avisplit -i "$1" -s "$size"
--- /dev/null
+#! /bin/sh
+
+if [ -z "$2" ]; then
+ echo "Usage: $0 input.avi time..."
+ exit 1
+fi
+
+input="$1"
+shift
+
+time=""
+start=0
+
+for t in "$@"; do
+ if [ "$start" = 0 ]; then
+ time="0-$t"
+ else
+ time="$time,$start-$t"
+ fi
+ start="$t"
+done
+
+exec avisplit -i "$input" -t "$time"
--- /dev/null
+if echo "$PATH" | grep -vq "video"; then
+ PATH=$HOME/lib/video:$PATH
+
+else
+
+ echo "video config has already been installed"
+fi