[mythtv-users] Myth setup for hdtv - config help

John Taylor john at vetsurgeon.org.uk
Wed Apr 29 11:13:53 UTC 2009


I use ffmpeg to convert BBC HD recordings to MPEG-2 files I store in
mythvideo. I can then use my woefully underpowered epia M10000 running
minimyth to offload the bulk of the cpu intensive stuff to the CLE
chipset and watch HD via mythvideo at 1024 scaled to 1280 x 720 25fps
deinterlaced

The M10k can just about handle 10Mbps bitrate at 25fps, 6Mbps may give
smoother scrolling. You'll need to drop the bitrate for 50fps (sport
etc.)

Command to launch mplayer in minimyth for extension mpghq (gives it
high priority for smoother playback)
su root -c "nice -n -19 su minimyth -c 'mplayer -vo xvmc -fs %s'"

FFmpeg version SVN-r18660
configuration: --enable-gpl --enable-pthreads --enable-libvorbis
--enable-libtheora --disable-debug --enable-libmp3lame
--enable-libfaadbin --enable-libfaad --enable-libfaac --enable-libxvid
--enable-libx264 --enable-libamr-nb --enable-libamr-wb --enable-shared
--enable-nonfree


[convertbbchd.sh] The user job script: CAUTION THIS WILL DELETE THE
ORIGINAL HD FILE- remove last 2 lines to keep file

#!/usr/bin/php -q
<?
$link=mysql_connect('localhost', 'mythtv', 'xxx');
mysql_select_db("mythconverg",$link);
$file=basename($argv[1]);
$fn=mysql_fetch_array(mysql_query("select concat(title,'-',subtitle)
as tit,date_format(starttime,'%Y%m%d_%H%i') from recorded where
basename = '$file'"));

//your location of ffmpeg may be different- I use a max 1024
resolution as that's the max for the CLE266 chipset- change
destination as required
exec("nice -19 /usr/local/bin/ffmpeg -y -i \"$argv[1]\" -vcodec
mpeg2video -b 10000k -s 1024x720 -aspect 16:9 -r 25 -acodec copy
-deinterlace \"/home/john/recordings/1000gbdisk/video/hd/".$fn[tit].".mpg\"");

//give custom extension for frontend to recognise as hd file
exec("mv \"/home/john/recordings/1000gbdisk/video/hd/".$fn[tit].".mpg\"
\"/home/john/recordings/1000gbdisk/video/hd/".$fn[tit].".mpghq\"");

//delete lines to keep original file
mysql_query("delete from recorded where basename = '$file' LIMIT 1");
exec("rm $argv[1]");
?>

Cron job to process every recording from a channel who's callsign ends in 'hd':
#!/usr/bin/php
<?
$link=mysql_connect('localhost', 'mythtv', 'xxx');
mysql_select_db("mythconverg",$link);
$res=mysql_query("SELECT title,subtitle,basename,callsign FROM
recorded,channel WHERE recorded.chanid=channel.chanid AND callsign
LIKE '%hd'");
$stres=mysql_query("SELECT * from storagegroup");

while ($row=mysql_fetch_array($res)){
	while ($strow=mysql_fetch_array($stres)){ //find location of recording
		if (file_exists($strow[dirname].$row[basename])) break;
		}
	exec("/home/john/convertbbchd.sh ".$strow[dirname].$row[basename]);
//your location of convertbbchd.sh may vary
	}

?>


More information about the mythtv-users mailing list