encoding streams

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 30, 2005 at 10:43:57AM +0100, Simon Baxter wrote:
> Hi.
> I want to set VDR to encode edited streams into .avi or .mpeg.
> 
> Can someone recommend an encoding type and method?

I would strongly advice to try mencoder with something like :

#!/bin/bash
Q=800
q=96
MENCODER="nice -n 19 mencoder"

if [ $# == 0 ]; then
	echo "usage: $0 source"
	exit
fi
if [ $# == 1 ]; then
	mplayer -xineramascreen 1 -vo x11 -vf cropdetect $1
	echo "usage: add w:h:x:y for cropping and 4/3 or 16/9"
	exit
fi
if [ $# == 2 ]; then
	echo "usage: one should have added w:h:x:y for cropping and 4/3 or 16/9..."
	exit
fi
if [ $# == 3 ]; then
	w=`echo $2|awk -F ":" '{ print $1 }'`
	h=`echo $2|awk -F ":" '{ print $2 }'`
	calcbpp.pl "$w""x""$h" $3 $Q 25
	echo "usage: add x:y for scaling or -1:-1 for not scaling"
	exit
fi
if [ $# == 4 ]; then
	mplayer -xineramascreen 1 -vo x11 -vf crop=$2,scale=$4 $1
	echo "usage: add file name destination"
	exit
fi
if [ $# == 5 ]; then
	rm -f frameno.avi divx2pass.log
	$MENCODER -ovc frameno -o frameno.avi -oac faac -faacopts br=$q $1
	if [ $4 == "-1:-1" ]; then
		$MENCODER -vf crop=$2 -oac copy -ovc x264 -x264encopts bitrate=$Q:pass=1 -o /dev/null $1
		$MENCODER -vf crop=$2 -oac copy -ovc x264 -x264encopts bitrate=$Q:pass=2 -o /dev/null $1
		$MENCODER -vf crop=$2 -oac copy -ovc x264 -x264encopts bitrate=$Q:pass=3 -o $5 $1
	else
		$MENCODER -vf crop=$2,scale=$4 -ovc x264 -x264encopts bitrate=$Q:pass=1 -o /dev/null $1
		$MENCODER -vf crop=$2,scale=$4 -ovc x264 -x264encopts bitrate=$Q:pass=2 -o /dev/null $1
		$MENCODER -vf crop=$2,scale=$4 -ovc x264 -x264encopts bitrate=$Q:pass=3 -o $5 $1
	fi
fi
txt=`dirname $1`/`basename $1 .mpg`.txt
if [ -e $txt ];then
	mv $txt `dirname $5`/`basename $5 .avi`.txt
fi
rm -f frameno.avi divx2pass.log

AUDIO=`mplayer -identify -vo null -ao null -frames 0 $1 2>/dev/null|grep ID_AUDIO_ID=1`
if [ ! -z $AUDIO ]; then
	$MENCODER -aid 1 -ovc frameno -o frameno.avi -oac mp3lame -lameopts cbr:br=$q $1
	nice -n 19 ogmmerge -o `dirname $1`/`basename $5 .avi`.ogm $5 -D frameno.avi
	if [-e `dirname $5`/`basename $5 .avi`.txt ];then
		mv `dirname $5`/`basename $5 .avi`.txt `dirname $1`/
	fi
	echo rm $1 $5
else
	echo rm $1
fi


> I have used mplayer's mencode, but never found a good setting for video and 
> audio streams which plays well under WMP.

Well, no idea what WMP is, so...

> For good file size and quality (for about 700MB per hour) what should I use?
> 
> mp3 audio?  or just pcm?  divx?

Bouah... no : aac for audio... and x264 for video :-)
-- 
	Gr?goire Favre


[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux