[MPlayer-users] -quiet for mencoder

Oswald Buddenhagen ossi at kde.org
Thu Jun 12 04:00:11 CEST 2003


[cc: me on replies!]

moin,

i requested this several months ago, but as nobody bothered to implement
it (or even comment on it), i created a patch myself. i'm not sure the
patch is "good style", as it duplicates the option declaration instead
of putting it in the shared option list, but who cares. also, i didn't
bother to update the doc.
the sole effect of -quiet is to disable the progress info/statistics
during encoding. you can imagine, that such info is not exactly useful
when the output is redirected to a file (like in my videorecorder script
- i attached it (including supplementary files) in case somebody is 
interested).

greetings

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.
-------------- next part --------------
Index: cfg-mencoder.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mencoder.h,v
retrieving revision 1.66
diff -u -r1.66 cfg-mencoder.h
--- cfg-mencoder.h	3 Mar 2003 11:03:17 -0000	1.66
+++ cfg-mencoder.h	12 Jun 2003 01:47:05 -0000
@@ -217,7 +217,8 @@
 #include "cfg-common.h"
 #undef MAIN_CONF
 
-//	{"quiet", &quiet, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+	{"quiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
+	{"noquiet", &quiet, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL},
 	{"verbose", &verbose, CONF_TYPE_INT, CONF_RANGE|CONF_GLOBAL, 0, 100, NULL},
 	{"v", cfg_inc_verbose, CONF_TYPE_FUNC, CONF_GLOBAL, 0, 0, NULL},
 //	{"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
Index: mencoder.c
===================================================================
RCS file: /cvsroot/mplayer/main/mencoder.c,v
retrieving revision 1.215
diff -u -r1.215 mencoder.c
--- mencoder.c	9 Jun 2003 12:15:40 -0000	1.215
+++ mencoder.c	12 Jun 2003 01:47:09 -0000
@@ -119,6 +119,7 @@
 //void resync_audio_stream(sh_audio_t *sh_audio){}
 
 int verbose=0; // must be global!
+int quiet=0;
 double video_time_usage=0;
 double vout_time_usage=0;
 double max_video_time_usage=0;
@@ -1198,6 +1199,7 @@
 	    (int)demuxer->filepos,
 	    (int)demuxer->movi_end);
 #else
+      if(!quiet) {
 	if(verbose>0) {
 		mp_msg(MSGT_AVSYNC,MSGL_STATUS,"Pos:%6.1fs %6df (%2d%%) %3dfps Trem:%4dmin %3dmb  A-V:%5.3f [%d:%d] A/Vms %d/%d D/B/S %d/%d/%d \r",
 	    	mux_v->timer, decoded_frameno, (int)(p*100),
@@ -1220,6 +1222,7 @@
 	    (mux_v->timer>1) ? (int)(mux_v->size/mux_v->timer/125) : 0,
 	    (mux_a && mux_a->timer>1) ? (int)(mux_a->size/mux_a->timer/125) : 0
 	);
+      }
 #endif
     }
         fflush(stdout);
-------------- next part --------------
#! /bin/bash
shopt -s extglob
lst=$HOME/.vcrrc
pid=$HOME/tmp/vcr.pid
log=$HOME/tmp/vcr.log

touch $lst

if [ -n "$1" ]; then

  if test "x$1" = x-h; then
    cat <<EOF
usage: $0 station start end title [bw]
 end is either a date or "+[hours:]mins"
EOF
    exit
  fi

  # get start and end
  strt=$(date '+%s' -d "$2")
  [ $strt -lt $(date '+%s') ] && strt=$((strt+86400))
  if [ "x${3:0:1}" = x+ ]; then
    tim=${3:1}
    min=${tim#*:}
    hr=${min%"$min"?(:)}
    len=$(((${hr:-0}*60+min)*60))
  else
    len=$(($(date '+%s' -d "$3")-strt))
    [ $len -lt 0 ] && len=$((len+86400))
  fi
  end=$((strt+len))

  # check for collisions
  exec < $lst
  IFS=:
  while read s l p n b; do
    e=$((s+l))
    if [ $s -lt $end -a $e -gt $strt ]; then
      echo "Collision! $(date '+%R' -d "$s sec 1 jan 1970 gmt") - $(date '+%R' -d "$e sec 1 jan 1970 gmt") on $p: $n"
      exit 1
    fi
  done

  # get station
  prog=$(grep -i "\[$1\]" $HOME/.xawtv | sed 's,^\[\([^]]\+\)\].*$,\1,')	#'
  if [ -z "$prog" ]; then
    echo "Station '$1' not found!"
    exit 1
  fi

  echo "$strt:$len:$prog:$4:$5" >> $lst
  sort $lst > $lst.new && mv $lst.new $lst

fi

# wake up running daemon if any
pd=$(cat $pid 2>/dev/null)
[ -n "$pd" ] && [ x$(ps ho comm -p $pd) = xsleep ] && [ $(ps ho ppid -p $pd) != 1 ] && kill $pd && exit

(
  echo "*** vcr daemonized at $(date -R) ***"
  fp=0
  while :; do
    now=$(date '+%s')
    while :; do
      exec < $lst
      IFS=:
      while read s l p n b; do
        e=$((s+l))
        [ $e = $fp ] && continue
        [ $now -lt $e ] && break 2
      done
      echo "Nothing left to do. Exiting ..."
      exit
    done
    if [ $now -lt $s ]; then
      echo "Sleeping till $(date '+%R' -d "$s sec 1 jan 1970 gmt") ..."
      trap 'kill $(<$pid); rm $pid; echo "Killed; exiting ..."; exit 1' EXIT
      sleep $((s-now)) & echo $! > $pid
      wait $! 2>/dev/null && rsc= || rsc=1
      rm $pid
      trap - EXIT
      [ -n "$rsc" ] && { echo "Rescanning config ..."; continue; }
      now=$(date '+%s')
    fi
    cnt=
    while :; do
      fn=$([[ "x$n" = x/* ]] || echo /var/hdb/vcr/)$n${cnt:+-$cnt}.avi
      test -f "$fn" || break
      ((cnt++))
    done
    echo "Recording ${fn##*/} on $p ..."
    v4lctl setstation "$p" || exit
    if ! hpmencoder tv:// \
     -tv driver=v4l:width=384:height=288:volume=65535:amode=0:forcechan=1 \
     -ovc lavc -lavcopts vcodec=mpeg4:vqscale=4:keyint=300${b:+:gray} \
     -oac mp3lame -lameopts fast:vbr=4:q=4 \
     -o "$fn" -endpos $((e-now)) -quiet
    then
      [ $(($(date '+%s')-now)) -lt 30 ] && fp=$e && echo "Something is wrong; skipping rest of recording."
    fi
    aumix -d /dev/mixer1 -v 100
  done
) >> $log 2>&1 &
exit

cat <<EOF

other -lavcopts
  vhq:v4mv:trell  - better qual
  vlelim=-2:vcelim=6  - save bits
  lumi_mask=0.05:dark_mask=0.01  - save bits
  crop!
  read encoding-tips.txt

EOF
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hpmencoder.c
Type: text/x-csrc
Size: 273 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20030612/27d47d8c/attachment.c>
-------------- next part --------------
[global]
fullscreen = 768 x 576
freqtab = europe-west
pixsize = 128 x 96
jpeg-quality = 75

[defaults]
norm = pal
capture = overlay
source = Television
contrast = 50

[ARD]
channel = E10

[ZDF]
channel = E8

[arte / KiKa] # [arte] [kika]
channel = SE4

[VOX]
channel = SE11

[Sat.1] # [sat1] [sat 1]
channel = E9

[RTL]
channel = E11

[Pro7] # [pro 7]
channel = SE20

[RTL2] # [rtl 2] [rtl ii]
channel = SE13
fine = -8

[Kabel1] # [kabel 1] [k1] [k 1]
channel = SE6

[SuperRTL]
channel = S21

[9LIVE] # [9 live]
channel = S24

[NBC]
channel = 28

[XXP]
channel = S35

[OC3]
channel = SE8


[VIVA]
channel = 26

[VIVA+] # [viva plus]
channel = 24

[MTV]
channel = 21


[RBB Berlin] # [B1] [sfb1]
channel = E6

[RBB Brandenburg] # [ORB]
channel = E7

[3SAT]
channel = SE9

[WDR]
channel = S22

[NDR]
channel = SE17

[MDR]
channel = SE18

[BR] # [b3]
channel = SE15


[TV.Berlin] # [tvb]
channel = SE7

[FAB]
channel = SE16


[PHOENIX]
channel = SE19

[n.tv] # [ntv]
channel = SE5

[N24]
channel = S25

[EuroNews]
channel = 33

[EuroNews]
channel = SE10

[CNN]
channel = SE12

[BBC]
channel = SE14

[DSF]
channel = S23

[EUROSPORT]
channel = 22


[TV POLONIA]
channel = 31

[TV5]
channel = 32

[TD1]
channel = 23

[TRT]
channel = 30

[<.tr>]
channel = 29


[HSE]
channel = E5

[QVC]
channel = E12

[ONYX.TV] # [onyx]
channel = 25

[eventmap]
lirc-key-RADIO = quit
lirc-key-VOL+ = volume inc
lirc-key-VOL- = volume dec
lirc-key-CH+ = setstation next
lirc-key-CH- = setstation prev
lirc-key-SOURCE = setstation back
lirc-key-FULL_SCREEN = fullscreen
lirc-key-MINIMIZE = fullscreen\nvolume mute
lirc-key-1 = setstation 0
lirc-key-2 = setstation 1
lirc-key-3 = setstation 2
lirc-key-4 = setstation 3
lirc-key-5 = setstation 4
lirc-key-6 = setstation 5
lirc-key-7 = setstation 6
lirc-key-8 = setstation 7
lirc-key-9 = setstation 8
lirc-key-0 = setstation 9



More information about the MPlayer-users mailing list