[Mplayer-felhasznalok] mencoder + v4l + hang

Balázs Bárány balazs at tud.at
Mon Apr 14 20:18:31 CEST 2003


Helló,

* Robert L. RAKSI <lobz at t-sys.hu> [2003-04-14 11:55]:
> Erdeklodnek hogy mi a helyzet a subject-beli harmassal? A video4linux
Nálam tökéletesen megy, ezt a szkriptet használom: (Vigyázat, elég erős
gépre van méretezve.)

--------------------------------------------------------------------------

#! /bin/bash

# Records something from TV in the current directory, starts now

# Parameters:
# $1 seconds
# $2 basename
# $3 (optional) set station name
# $4 (optional) "hi" for high quality or "lo" for very low

# recording over the loop cable, in mono
ALTDSP=" -d /dev/dsp1 -m"

seconds=$1
basename="$2.rec.avi"
ori_basename="$2"
station="$3"
quality="$4"

#Calculate the frame count for the seconds (-125 frames = 5 sec so 
#we stop right for the next recording)
frames=`expr 25 \* $seconds \- 125`
minutes=`expr $seconds \/ 60`

if [ X"$station" != X ]; then
        v4lctl setstation "$station"
fi

tvopts="on:driver=v4l:buffersize=32"

# input: 0=television, 1=composite
videoopts="input=0:fps=25"
audioopts="audiorate=44100:amode=0:alsa:adevice=hw.1,0"

volume="-af volume=11"

if [ X"$quality" == Xxhi ]; then
# extra high quality
        picsize="width=640:height=480"
        crop="632:472:4:4"
        fixedquality=3
        videobitrate=3600
        audiobitrate=128
elif [ X"$quality" == Xhi ]; then
# high quality
        picsize="width=576:height=432"
        crop="568:424:4:4"
        fixedquality=3
        videobitrate=3000
        audiobitrate=128
elif [ X"$quality" == Xlo ]; then
# low quality
        picsize="width=448:height=336"
        crop="440:332:4:3"
        fixedquality=4
        videobitrate=1800
        #audiobitrate=96
        audiobitrate=80
elif [ X"$quality" == Xxlo ]; then
# extra low quality
        picsize="width=384:height=288"
        crop="376:284:4:3"
        fixedquality=5
        videobitrate=1100
        audiobitrate=76
elif [ X"$quality" == Xmax ]; then
# Max available quality
        picsize="width=768:height=576"
        crop="760:568:4:4"
        fixedquality=2
        videobitrate=4000
        audiobitrate=128
else
# normal quality
        picsize="width=480:height=352"
        crop="472:348:4:3"
        fixedquality=3
        videobitrate=2300
        audiobitrate=80
        quality="normal"
fi

lameopts="-lameopts cbr:br=$audiobitrate:vol=0"
oacopts="-oac mp3lame $lameopts"

lavcopts="-lavcopts vcodec=mpeg4:vqscale=$fixedquality:keyint=200:vrc_buf_size=8000"
ovcopts="-ovc lavc $lavcopts"

time /usr/bin/mencoder -tv "$tvopts:$videoopts:$audioopts:$picsize" \
        -info "name=$ori_basename:srcform=TV ($station):comment=Recorded on `date -I` with $quality quality" \
        -frames $frames \
        -cache 32000 \
        $oacopts $ovcopts $vop $volume \
        -o "$basename"

--------------------------------------------------------------------------

-- 
_________________________________________________________________________
Balázs Bárány       balazs at tud.at        http://tud.at       ICQ 10747763

A good engineer will make considerable effort to avoid additional effort.



More information about the MPlayer-felhasznalok mailing list