gorecord

Aus Mikiwiki
Wechseln zu: Navigation, Suche

Der Shell-Befehl gorecord unterstützt die Programmierschnittstelle Video4linux. Er erfasst Video- und Audiodaten von einem WIS GO7007-Videoencoder und schreibt sie in eine AVI-Datei. Das Erfassen dauert so lange, bis ein angegebene Frame-Grenze erreicht wurde oder die maximale AVI-Dateigrösse erreicht ist.

Optionen

Syntax:

gorecord [OPTION]... -frames <zahl> [<AVI-Dateiname>]
Option Beschreibung
Steuerungsoptionen
-verbose Ausführliche Beschreibung sämtlicher Operationen.
-duration zahl Anhalten der Aufzeichnung nach der angegebenen Anzahl Sekunden.
-frames zahl Anhalten der Aufzeichnung nach der angegebenen Anzahl Videoframes.
-maxsize zahl Anhalten der Aufzeichnung nach der angegebenen Anzahl Megabyte (2^20 Byte).
-noaudio Es werden keine Audio-, sondern nur Videodaten aufgezeichnet.
-nowrite Die aufgezeichneten Audio- und Videodaten werden nicht in eine Datei geschrieben.
-vdevice V4L2-Gerätepfad Ausdrückliche Bezeichnung des zu verwendenden Video4linux 2-Geräts.
-adevice OSS-Gerätepfad Ausdrückliche Bezeichnung des zu verwendenden OSS-Geräts.
Videoeingang
-input zahl Aufnahme von Eingangsport zahl (Standard: 0). Mögliche Werte sind:
  • 0 für Composite (NTSC, PAL/SECAM)
  • 1 für S-Video (NTSC, PAL/SECAM)
-mode wert Auswahl des Modus für den Videoeingang (Standard: ntsc). Mögliche Werte sind:
  • Basisbandmodi: ntsc, pal, secam
  • Fernsehmodi: pal-bg, pal-i, pal-dk, secam-l, ntsc, ntsc-j
-tvchan frequenzbereich:kanal Einstellung auf Fernsehkanal kanal in Frequenzbereich frequenzbereich. Mögliche Werte sind:
  • Frequenzbereiche: ntsc-bcast, ntsc-cable, ntsc-hrc, ntsc-bcast-jp, ntsc-cable-jp, europe, france, russia
-tvaudio modus Auswahl des Fernseh-Audiomodus (Standard: stereo). Mögliche Werte sind:
  • Fernseh-Audiomodi: mono, stereo, lang1, lang2
Aufnahmeregler
-brightness zahl Helligkeit zwischen 0 und 255, Standardwert ist 128.
-contrast zahl Kontrast zwischen 0 und 127, Standardwert ist 64.
-saturation zahl Sättigung zwischen 0 und 127, Standardwert ist 64.
-hue zahl Farbton zwischen -128 und 127, Standardwert ist 0.
Output stream options:
  -width <n>                    Specify encoded image width (default: 640)
  -height <n>                   Specify encoded image height (default: 480)
  -fpsdrop <n>                  Specify encoded frame rate downscale ratio
  -bitrate <n>                  Specify a video bitrate (default: 1500 kbps)
  -format <format>              Encode video in <format> (default: mpeg4)
                                  Formats: mpeg1, mpeg2, mpeg2-dvd,
                                           mpeg4, mjpeg
Other Options:
  Use "%d" in the filename in conjunction with the -maxsize option to
  create a new file every <n> Megabytes. eg. gorecord filename-"%d".avi


  Making long recordings

Note: This shouldn't be needed anymore when using the new version of gorecord because there is no longer is a filesize limit. The "%d" option is still provided but must be used with the -maxsize option to have any effect.

Because of the filesize limitation by the old gorecord program, you can't make really long recordings that are stored in one big avi file. The workaround is to use gorecord's %d option to continue recording to a new file after hitting the limit. We can then put the files back together again into one big avi using mencoder.

gorecord [options] filename-"%d".avi
mencoder -oac copy -ovc copy filename-*.avi -o final_video.avi

    * Note: The individual files might not be playable until you string them back together with mencoder. 

Verwendung

Erfasst MJPEG-Videodaten und PCM-Audiodaten in der Datei "capture.avi".

$ gorecord -duration 60 -format mjpeg capture.avi

Erfasst MPEG4-Videodaten und PCM-Audiodaten bei 800 kbps, schreibt sie aber nicht auf die Festplatte.

$ gorecord -frames 3000 -bitrate 800 -nowrite

Testaufnahmen

An den Standardwerten für Helligkeit, Kontrast, Farbton und Sättigung wird nichts verändert - das sieht dann auf dem Rechnerbildschirm zwar etwas farbig aus, entspricht aber genau dem, was bei Abspielen des originalen VHS-Bandes auf dem Fernseher zu sehen ist.

gorecord -input 0 -duration 10 -mode pal-bg -width 720 -height 576 -format mpeg2-dvd testvideo01.avi

Entspricht:

gorecord -input 0 -duration 60 -mode pal-bg -width 720 -height 576 -format mpeg2-dvd -brightness 128 -contrast 64 -saturation 64 -hue 0 testvideo01.avi

Testweise wurden jeweils 60 Sekunden mit verschiedenen Formaten und Bitraten aufgenommen.

Format Bitrate Dateigrösse
gorecord -input 0 -duration 60 -mode pal-bg -width 720 -height 576 -bitrate 1500 -format mpeg2 test-1500-mpeg2.avi
MPEG-2 1'500 kbps 22'572'660 Byte
gorecord -input 0 -duration 60 -mode pal-bg -width 720 -height 576 -bitrate 3000 -format mpeg2 test-3000-mpeg2.avi
MPEG-2 3'000 kbps 35'020'712 Byte
gorecord -input 0 -duration 60 -mode pal-bg -width 720 -height 576 -bitrate 6000 -format mpeg2 test-6000-mpeg2.avi
MPEG-2 6'000 kbps 55'969'592 Byte
gorecord -input 0 -duration 60 -mode pal-bg -width 720 -height 576 -bitrate 1500 -format mpeg2-dvd test-1500-mpeg2dvd.avi
MPEG-2-DVD 1'500 kbps 23'251'760 Byte
gorecord -input 0 -duration 60 -mode pal-bg -width 720 -height 576 -bitrate 3000 -format mpeg2-dvd test-3000-mpeg2dvd.avi
MPEG-2 3'000 kbps 35'244'578 Byte
gorecord -input 0 -duration 60 -mode pal-bg -width 720 -height 576 -bitrate 6000 -format mpeg2-dvd test-6000-mpeg2dvd.avi
MPEG-2 6'000 kbps 55'812'048 Byte
gorecord -input 0 -duration 60 -mode pal-bg -width 720 -height 576 -bitrate 1500 -format mpeg4 test-1500-mpeg4.avi
MPEG-2 1'500 kbps 22'696'128 Byte
gorecord -input 0 -duration 60 -mode pal-bg -width 720 -height 576 -bitrate 3000 -format mpeg4 test-3000-mpeg4.avi
MPEG-2 3'000 kbps 35'101'944 Byte
gorecord -input 0 -duration 60 -mode pal-bg -width 720 -height 576 -bitrate 6000 -format mpeg4 test-6000-mpeg4.avi
MPEG-2 6'000 kbps 55'854'022 Byte

Skript.

$ vi record.sh
#!/bin/bash
# Name    record.sh
# Description   $1 = Aufnahmedauer in Minuten
#               $2 = Name der AVI-Ausgabedatei

mode=pal-bg               # PAL-BG
width=720
height=576
bitrate=7000              # 7000 kbit/s
format=mpeg2-dvd          # DVD-kompatibles MPEG-2
input=0                   # Composite

##### MAIN #####

gorecord -input $input              \
         -duration $(expr $1 \* 60) \
         -mode $mode                \
         -width $width              \
         -height $height            \
         -bitrate $bitrate          \
         -format $format            \
         $2.avi