File: mencoder.sh

package info (click to toggle)
kino 0.75-7
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,896 kB
  • ctags: 3,400
  • sloc: cpp: 26,587; sh: 6,028; ansic: 4,878; makefile: 310; perl: 125
file content (42 lines) | stat: -rwxr-xr-x 1,394 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh
# By Ruda Matousek, October 5th 2004
# matousek(AT)utia.cas.cz

usage()
{
	# Title
	echo "Title: DivX using MEncoder"

	# Usable?
	command -v mencoder 1> /dev/null 2>&1
	[ $? -eq 0 ] && echo Status: Active || echo Status: Inactive

	# Type
	echo Flags: single-pass file-producer

	# Profiles
	echo "Profile: 384x288 DivX 4/5 700bps, mp3 128bps"
	echo "Profile: 640x480 DivX 4/5 2000bps, mp3 128bps"
	echo "Profile: 640x480 DivX 4/5 7000bps, mp3 224bps"
}

execute()
{
	# Arguments
	normalisation="$1"
	length="$2"
	profile="$3"
	file="$4"
	[ "x$file" = "x" ] && file="kino_export_"`date +%Y-%m-%d_%H.%M.%S`

	# Run the command
	# Note that the -cache 8192 parameter is required to force mencoder
	# to recognize the DV stream on STDIN.
	case "$profile" in 
		"0" ) 	mencoder - -quiet -cache 8192 -aspect 4:3 -vf harddup,scale=384:288 -ovc lavc -oac lavc -lavcopts vcodec=mpeg4:acodec=mp3:vhq:vbitrate=700:abitrate=128 -o "$file".avi ;;
		"1" ) 	mencoder - -quiet -cache 8192 -aspect 4:3 -vf harddup,pp=ci,scale=640:480 -ovc lavc -oac lavc -lavcopts vcodec=mpeg4:acodec=mp3:vhq:vbitrate=2000:abitrate=128 -o "$file".avi ;;
		"2" )   mencoder - -quiet -cache 8192 -aspect 4:3 -vf harddup,pp=ci,scale=640:480 -ovc lavc -oac lavc -lavcopts vcodec=mpeg4:acodec=mp3:vhq:vbitrate=7000:abitrate=224 -o "$file".avi ;;
	esac
}

[ "$1" = "--usage" ] || [ -z "$1" ] && usage "$@" || execute "$@"