[mythtv-users] Transcode script for pillar boxed SDTV broadcasts on HDTV

Eric Pheatt eric.pheatt at gmail.com
Tue May 29 18:56:05 UTC 2007


On 5/29/07, Steve Greene <sgreene59 at verizon.net> wrote:
> Everyone has probably seen pillarbox broadcasts on HDTV.  Because of the
> upsampling, they are still better than the analog broadcasts.  Does
> anyone have a script to eliminate the pillar box and create DVD-ready
> files?  Are the developers working on a solution for MythDVD?
>
> Yours pillarboxed in Beltsville,
>
> Steve

I use the following as a user job when I know a recording will be
pillar boxed and like the results so far. It is using mplayer to
identify and ffmpeg to transcode, and it even crops for Stargate
syndication that is pillar and letterboxed. I would muck a little bit
with the final sizes for dvd compliance but I use this to make
recordings playable on my pmp.

#!/bin/bash
VFILE="${1}"
VTITLE="${2}"
IDENTIFY=`mplayer -identify -frames 60 -vo null -ao null\
        "/myth/tv/${VFILE}" 2>/dev/null | grep ^ID_`
eval "$IDENTIFY";
echo "ID_VIDEO_WIDTH=$ID_VIDEO_WIDTH"
echo "ID_VIDEO_HEIGHT=$ID_VIDEO_HEIGHT"
if [ "${ID_VIDEO_WIDTH}" -gt 640 ]; then
echo "cp -f /myth/tv/${VFILE} /myth/tv/${VFILE}.ts"
cp -f "/myth/tv/${VFILE}" "/myth/tv/${VFILE}.ts"
if [ "${ID_VIDEO_WIDTH}" -eq 1920 ]; then
echo "1080i crop"
        rm -f "/myth/tv/${VFILE}.tmp.mpg"
        nice ffmpeg -i "/myth/tv/${VFILE}.ts" -cropleft 240 -cropright 240\
                -target ntsc-dvd -acodec copy -s 640x480 -aspect 4:3\
                "/myth/tv/${VFILE}.tmp.mpg"
elif [ "${ID_VIDEO_WIDTH}" -eq 1280 ]; then
        if [ "${VTITLE}" == "Stargate" ]; then
echo "720p Stargate crop"
                rm -f "/myth/tv/${VFILE}.tmp.mpg"
                nice ffmpeg -i "/myth/tv/${VFILE}.ts" -cropleft 160
-cropright 160\
                        -croptop 90 -cropbottom 80 -target ntsc-dvd\
                        -acodec copy -s 640x366 -aspect 16:9\
                        "/myth/tv/${VFILE}.tmp.mpg"
        else
echo "720p crop"
                rm -f "/myth/tv/${VFILE}.tmp.mpg"
                nice ffmpeg -i "/myth/tv/${VFILE}.ts" -cropleft 160
-cropright 160\
                        -target ntsc-dvd -acodec copy -s 640x480 -aspect 4:3\
                        "/myth/tv/${VFILE}.tmp.mpg"
        fi
fi
FILESIZE=$(stat -c%s "/myth/tv/${VFILE}.tmp.mpg")
echo "filesize = $FILESIZE"
mysql -hkurohg -umythtv -pmythtv -Dmythconverg\
        -e "UPDATE recorded SET filesize = '$FILESIZE' WHERE basename
= '${VFILE}'"
cp -f "/myth/tv/${VFILE}.tmp.mpg" "/myth/tv/${VFILE}"\
        && rm -f "/myth/tv/${VFILE}.ts" "/myth/tv/${VFILE}.tmp.mpg"
fi
/usr/local/bin/mythrename.pl --live --link /myth/pretty --format
'\%T/\%S %- %Y-%m-%d, %g-%i %A'
exit 0

Cheers!
-Eric


More information about the mythtv-users mailing list