小弟在mplayer的document中找出了以下的方法來錄影電視:
mencoder -tv on:driver=v4l:width=768:height=576 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=350:vhq:vqmax=31:keyint=300 -oac mp3lame -lameopts cbr:br=48 -vop scale=384:288,pp=tn/lb,crop=720:540:24:18 -sws 1 -o output.avi
制成的output.avi雖沒有上文的影像倒轉的情況,但卻沒有聲音.
錄影電視時mplayer的message:
pooh@debian:~$ mencoder -tv on:driver=v4l:width=768:height=576 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=350:vhq:vqmax=31:keyint=300 -oac mp3lame -lameopts cbr:br=48 -vop scale=384:288,pp=tn/lb,crop=720:540:24:18 -sws 1 -o output.avi
Using GNU internationalization
Original domain: messages
Original dirname: /usr/share/locale
Current domain: mplayer
Current dirname: /usr/share/locale
MEncoder 0.90rc4-3.2.2 (C) 2000-2003 Arpad Gereoffy (see DOCS)
CPU: Advanced Micro Devices Duron SF Spitfire (Family: 6, Stepping: 1)
Detected cache-line size is 64 bytes
MMX2 supported but disabled
3DNow supported but disabled
3DNowExt supported but disabled
CPUflags: Type: 6 MMX: 1 MMX2: 0 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Reading /home/pooh/.mplayer/mencoder_codecs.conf: can't open '/home/pooh/.mplayer/mencoder_codecs.conf': 沒有此一檔案或目錄
Reading /etc/mplayer/mencoder_codecs.conf: 50 audio & 135 video codecs
File not found: 'frameno.avi'
Reading config file /home/pooh/.mplayer/mencoder: 沒有此一檔案或目錄
success: format: 0 data: 0x0 - 0x0
TV detected!
Selected driver: v4l
name: Video 4 Linux input
author: Alex Beregszaszi <alex@naxine.org>
comment: under development
Selected device: BT878(ProVideo PV951)
Capabilites: capture tuner overlay clipping frameram scales
Device type: 235
Supported sizes: 48x32 => 924x576
Inputs: 3
0: Television: tuner audio tv camera (tuner:1, norm:pal)
1: Composite1: audio camera (tuner:0, norm:pal)
2: S-Video: audio camera (tuner:0, norm:pal)
Using input 'Television'
[V] filefmt:9 fourcc:0x32315659 size:768x576 fps:25.00 ftime:=0.0400
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 44100 Hz, 1 ch, 16 bit (0x10), ratio: 88200->88200 (705.6 kbit)
Selected audio codec: [pcm] afm:pcm (Uncompressed PCM)
==========================================================================
Opening video filter: [expand=-1:-1:-1:-1:1]
Expand: -1 x -1, -1 ; -1 (-1=autodetect) osd: 1
Opening video filter: [scale=384:288]
Opening video filter: [pp=tn/lb]
Opening video filter: [crop=720:540:24:18]
Crop: 720 x 540, 24 ; 18
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 768 x 576 (preferred csp: Planar YV12)
[PP] Using external postprocessing filter, max q = 6.
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: BILINEAR scaler, from Planar YV12 to Planar YV12 using MMX
videocodec: libavcodec (384x288 fourcc=58564944 [DIVX])
High quality encoding selected (non real time)!
Selected video codec: [rawyv12] vfm:raw (RAW YV12)
==========================================================================
MP3 audio selected
Building audio filter chain for 44100Hz/1ch/16bit -> 44100Hz/1ch/16bit...
Writing AVI header...
Forcing audio preload to 0, max pts correction to 0
New_Face failed. Maybe the font path is wrong. 0mb A-V:0.000 [0:0]
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
Pos: 2.2s 37f ( 0%) 13fps Trem: 0min 0mb A-V:0.000 [341:47]
CBR audio: 6000 bytes/sec, 157 bytes/block
Writing AVI index...
Fixing AVI header...
Video stream: 341.349 kbit/s (42668 bps) size: 93871 bytes 2.200 secs 37 frames
Audio stream: 47.999 kbit/s (5999 bps) size: 12852 bytes 2.142 secs
而重播output.avi時的message:
Playing /home/pooh/output.avi
Cache fill: 10.70% (112162 bytes) AVI file format detected.
Forced NON-INTERLEAVED AVI file format.
VIDEO: [DIVX] 384x288 24bpp 25.00 fps 341.3 kbps (41.7 kbyte/s)
Clip info:
Software: MEncoder 0.90rc4-3.2.2
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
MP3lib: init layer2&3 finished, tables done
AUDIO: 44100 Hz, 2 ch, 16 bit (0x10), ratio: 6000->176400 (48.0 kbit)
Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm:ffmpeg (FFmpeg MPEG-4)
==========================================================================
Checking audio filter chain for 44100Hz/2ch/16bit -> 44100Hz/2ch/16bit...
AF_pre: af format: 2 bps, 2 ch, 44100 hz, little endian signed int
AF_pre: 44100Hz 2ch Signed 16-bit (Little-Endian)
[pl_eq] Equalizer in use.
SDL: Samplerate: 44100Hz Channels: Stereo Format Signed 16-bit (Little-Endian)
AO: [plugin] 48000Hz 2ch Signed 16-bit (Little-Endian) (2 bps)
Building audio filter chain for 44100Hz/2ch/16bit -> 48000Hz/2ch/16bit...
Starting playback...
This file was encoded with libavcodec build 4655
VDec: vo config request - 384 x 288 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [xv] 384x288 => 384x288 Planar YV12 [vm] [zoom]
A: 2.1 V: 2.2 A-V: -0.046 ct: -0.522 55/ 55 7% 2% 3.0% 0 0 0%%
Exiting... (Exit)
兩個message都沒有error.
此外,如將output.avi改為output.mpg,則制成的mpg的聲音的速度比正常慢十多倍(影像正常).