PvrWeb: Convert mpg to vdr - PvrWeb

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Convert mpg to vdr

#1 User is offline   Edster

  • Moderator
  • PipPipPip
Group:
Admin
Posts:
1,005
Joined:
04-September 03
Location:
Dublin

Posted 17 June 2009 - 12:52 PM

On my test box I had a great script to convert mpeg / avi files and save them as vdr recordings so you can watch them on vdr without having to go into mPlayer / different keys to learn etc.

I wiped the box to load it again and lost it. It took me a while to find the original again :
http://www.linuxtv.o...ber/014113.html

when I get time I'll put back in the little updates I did for scaling / different screen formats etc.

http://www.linuxtv.o.../attachment.txt
#!/bin/bash

set -x

VIDEODIR="/video0";

if [ $# -lt 1 ];
then
	echo >&2 "`basename $0`: import mpeg file in vdr"
	echo >&2 "Usage: `basename $0` filename.mpg"
	exit 1
fi

if [ ! -d $VIDEODIR ];
then
	echo >&2 "Target video directory does not exist"
	exit 1
fi

echo $1

BASENAME=`echo "$1" |perl -pe  's#^.*/(.*)\..*?$#$1#' | perl -pe 's# #_#g'`
SUFFIX=`echo "$1" | perl -pe 's#^.*\.##'`

DATE=`date '+%F.%H:%M.50.50.rec'`;
TARGETDIR="$VIDEODIR/$2/$BASENAME/$DATE";

mkdir -p "$TARGETDIR"

if [ "$SUFFIX" <> "mpg" ]; then
	nice mencoder -ofps 25 -oac lavc -ovc lavc -of mpeg \
	-mpegopts format=dvd -vf scale=720:576,harddup \
	-srate 48000 -af lavcresample=48000 -lavcopts \
	vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=2:acodec=mp2:abitrate=192:aspect=4/3 \
	-o $TARGETDIR/001.mpg "$1"

	nice genindex -i $TARGETDIR/001.mpg -r -d "$TARGETDIR" -s 400
	rm $TARGETDIR/001.mpg
	else
	nice genindex -i "$*" -r -d "$TARGETDIR" -s 400
	fi
touch $VIDEODIR/.update

0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users