Mailing List archive

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

[vdr] PAL- and NTSC-Resolution




Hi there

Soory for posting this message again ... here it's with my modified 
mplayer.sh

After 12 years my tv-set died. So i bought a new one with NTSC- and
PAL-Support and 16:9 screen.

For watching Mpeg- and DivX-Files with Mplayer, i modified the
mplayer.sh (see below) Therefore my question:
Which XY-Resolutions are supported by the Siemens DVB-Card?
And which resolutions are scaled by hardware to fullscreen?

Thx

Regards
    Dieter

--- mplayer.sh ---

#!/bin/bash
#
# This script is called from VDR to start MPlayer
#
# argument 1: the file to play

# where to find mplayer
MPLAYER="/usr/local/bin/mplayer"

# mplayer global options
OPTS="-vo mpegpes -ao mpegpes -framedrop -cache 4096 -lircconf 
/video/lircrc.conf"

# Read filename from parameter
FILE=$1
echo Filename: $FILE

# ----------------------------
# Function: getvideodata
# Results in Global-Variables:
# X: X-Resolution
# Y: Y-Resolution
# FPS: Frames per Second
# ----------------------------
function getvideodata () {
   # local variables
   local -a aVIDEO[0]
   local sXY
   local -a aXY[0]
   local -i iANZAHL

   # start mplayer to read one frame.
   # extract from mplayer output line with text "VIDEO:"
   # and save it in variable sVIDEO
   sVIDEO=`$MPLAYER -frames 0 "$FILE" 2>&1 | grep -i -e "VIDEO:"`
   echo MPlayeroutput:$sVIDEO

   # split sVIDEO to array aVIDEO
   aVIDEO=($sVIDEO)
   echo Parameter-Array:${aVIDEO[*]}

   # get No of array-fields
   iANZAHL=${#aVIDEO[*]}
   echo Parameter-Anzahl:$iANZAHL

   # Get Frames per Second (PAL=25, NTSC=29,97 or 30)
   # Avi-Files got 10 fields
   if test $iANZAHL -eq 10
     then FPS=${aVIDEO[4]}
   fi
   # Mpeg-Files got 10 fields
   if test $iANZAHL -eq 11
     then FPS=${aVIDEO[5]}
   fi
   echo Frames per Second:$FPS

   # Get XY-Resolution
   sXY=${aVIDEO[2]}
   echo XY-String:$sXY
    # IFS (Internal Field Seperator default: space,tab,newline)
   IFS="x"
   aXY=($sXY)
    # Set IFS to default values
   unset IFS
   iANZAHL=${#aXY[*]}
   echo Parameter-Anzahl:$iANZAHL
   if test $iANZAHL -eq 2
   then
     X=${aXY[0]}
     Y=${aXY[1]}
   fi
   echo X-Resolution:$X
   echo Y-Resolution:$Y
   return;
}

# --------------------------------------------------
# Function: setscale
# Results in Global-Variable:
# SCALE: Sub-Parameter scale for mplayer-option -vop
# --------------------------------------------------
function setscale () {
   # PAL with 25fps
   if test $FPS == "25.00"
   then
     case "$Y" in
       576)
	SCALE=""
       ;;
       *)
         SCALE=",scale=352:576"
#        SCALE=",scale=$X:576"
         ;;
     esac
     echo PAL Scale:$SCALE

   # NTSC with 29,97 or 30fps
   else
     case "$Y" in
       240)
         SCALE=""
         if test $X -le "320"; then SCALE=",scale=640:480"; fi
         ;;
       480)
         SCALE=""
         ;;
       *)
#        SCALE="640:480"
         SCALE=",scale=$X:480"
         ;;
     esac
     echo NTSC Scale:$SCALE
   fi
   return;
}

# Get file-type (mpeg,avi,...)
type=`file "$FILE"`
echo Filetype: $type

# Check if filetype supported
case "$type" in
*AVI*)
# Additional options for Avi-files
   ;;
*MPEG*)
# Additional options for Mpeg-files
   ;;
*)
# Type not supported
   echo "Unknown video file format $type"
   echo "Edit mplayer.sh to support this file type"
   exit 1
   ;;
esac

# Call function getvideodata
getvideodata

# Call Function setscale
setscale

VOP="-vop lavc$SCALE"
echo VOP:$VOP

exec $MPLAYER $OPTS $VOP "$FILE"




-- No attachments (even text) are allowed --
-- Type: application/x-sh
-- File: mplayer-0.2.sh





Home | Main Index | Thread Index