summaryrefslogtreecommitdiffstats
path: root/TOOLS/aconvert
blob: bbaef5523e8edf9196cee7303d01f2b4c508124f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

# Author: Jonas Jermann
# Description: A hack to allow mencoder to encode from an audio only file

if [[ $1 == "" ]]; then
    echo "Usage: $0 <\"input file\"> <\"output file\"> <\"options\">"
    exit 0
fi

if [[ $3 == "" ]]; then
    options="-oac lavc -lavcopts acodec=mp3:abitrate=192"
else
    options=$3
fi
 
mencoder -demuxer rawvideo -rawvideo w=1:h=1 -ovc copy -of rawaudio -endpos `mplayer -identify $1 -frames 0 2>&1 | grep ID_LENGTH | cut -d "=" -f 2` -audiofile $1 -o $2 $options $1