[MPlayer-users] Mencoder dropping frames from composite but not from TV

Matthias Wieser mwieser at gmx.de
Tue Sep 9 14:50:50 CEST 2003


Hi,

I have a strange problem: If I record from TV everything goes well. If
I record from composite, around one frame per minute gets dropped:
----------------------
Pos: 171,2s   4277f ( 0%)  25fps Trem:   0min   0mb  A-V:0,000 [2001:127] A/Vms 3/18 D/B/S 3/1/1
-----------------------

I use the following command to record from my saa7134 card:

mencoder tv:// -tv driver=v4l2:width=720:height=576:input=2:alsa:contrast=-5:saturation=0 \
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=2000:vhq:psnr \
-oac mp3lame -lameopts cbr:br=128 \
-vf crop=688:544:16:16,pp=fd,scale=576:432  -sws 2 \
-o Video-`date +%d.%m.-%H%MUhr`.avi -v


If I change input=2 to input=0 (TV) I get zero dropped frames. 

CPU utilization is around 50%.

What can I do to suppress framedrops and to ensure audio-video synchronization?

Board is a nforce2; Alsa 0.96, kernel 2.4.20

############################################################
MEncoder dev-CVS-030830-12:37-3.3 (C) 2000-2003 MPlayer Team

CPU: Advanced Micro Devices  (Family: 6, Stepping: 0)
Detected cache-line size is 64 bytes
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE

Reading /home/mw/.mplayer/codecs.conf: Can't open '/home/mw/.mplayer/codecs.conf': Datei oder Verzeichnis nicht gefunden
Reading /etc/mplayer/codecs.conf: 60 audio & 151 video codecs
File not found: 'frameno.avi'
Failed to open frameno.avi
Reading config file /home/mw/.mplayer/mencoder: Datei oder Verzeichnis nicht gefunden
init_freetype
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
STREAM: [null] tv://
STREAM: Description: Null stream
STREAM: Author: Albeu
STREAM: Comment:
success: format: 9  data: 0x0 - 0x0
TV detected! ;-)
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschewski at zpr.uni-koeln.de>
 comment: first try, more to come ;-)
Selected device: KNC One TV-Station RDS
 Tuner cap: STEREO LANG1 LANG2
 Tuner rxs: MONO
 Capabilites:  video capture  video overlay  VBI capture device  tuner  read/write  streaming
 supported norms: 0 = PAL; 1 = NTSC; 2 = SECAM;
 inputs: 0 = Television; 1 = Composite1; 2 = Composite2;
 Current input: 2
 Format GREY   ( 8 bits, 8 bpp gray): Planar Y800
 Format RGB555 (16 bits, 15 bpp RGB, le): RGB 15-bit
 Format RGB555X (16 bits, 15 bpp RGB, be): Unknown
 Format RGB565 (16 bits, 16 bpp RGB, le): RGB 16-bit
 Format RGB565X (16 bits, 16 bpp RGB, be): Unknown
 Format BGR24  (24 bits, 24 bpp RGB, le): BGR 24-bit
 Format BGR32  (32 bits, 32 bpp RGB, le): BGR 32-bit
 Format RGB32  (32 bits, 32 bpp RGB, be): RGB 32-bit
 Format YUYV   (16 bits, 4:2:2 packed, YUYV): Packed YUY2
 Format UYVY   (16 bits, 4:2:2 packed, UYVY): Packed UYVY
 Format YUV422P (16 bits, 4:2:2 planar, Y-Cb-Cr): Planar 422P
 Format YUV420 (12 bits, 4:2:0 planar, Y-Cb-Cr): Planar I420
 Current format: BGR24
v4l2: current audio mode is : MONO
v4l2: set Volume: 17985 [-15, 15]
Plug PCM: Route conversion PCM (sformat=S16_LE)
Transformation table:
0 <- 0*0,5 + 1*0,5
Its setup is:
stream       : CAPTURE
access       : RW_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 1
rate         : 44100
exact rate   : 44100 (44100/1)
msbits       : 16
buffer_size  : 16384
period_size  : 4096
period_time  : 92879
tick_time    : 10000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 4096
xfer_align   : 4096
start_threshold  : 0
stop_threshold   : 16384
silence_threshold: 0
silence_size : 0
boundary     : 1073741824
Slave: Hardware PCM card 0 'NVidia NForce2' device 0 subdevice 0

Its setup is:
stream       : CAPTURE
access       : MMAP_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 2
rate         : 44100
exact rate   : 44100 (44100/1)
msbits       : 16
buffer_size  : 16384
period_size  : 4096
period_time  : 92879
tick_time    : 10000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 4096
xfer_align   : 4096
start_threshold  : 0
stop_threshold   : 16384
silence_threshold: 0
silence_size : 0
boundary     : 1073741824
v4l2: set format: YUV420
v4l2: set input: 2
v4l2: set width: 720
v4l2: set height: 576
Selected channel list: europe-east (including 133 channels)
Current frequency: 884 (55,250)
==> Found video stream: 0
v4l2: get format: YUV420
v4l2: get fps: 25,000000
v4l2: get width: 720
v4l2: get height: 576
v4l2: set audio samplerate: 44100
Plug PCM: Route conversion PCM (sformat=S16_LE)
Transformation table:
0 <- 0*0,5 + 1*0,5
Its setup is:
stream       : CAPTURE
access       : RW_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 1
rate         : 44100
exact rate   : 44100 (44100/1)
msbits       : 16
buffer_size  : 16384
period_size  : 4096
period_time  : 92879
tick_time    : 10000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 4096
xfer_align   : 4096
start_threshold  : 0
stop_threshold   : 16384
silence_threshold: 0
silence_size : 0
boundary     : 1073741824
Slave: Hardware PCM card 0 'NVidia NForce2' device 0 subdevice 0

Its setup is:
stream       : CAPTURE
access       : MMAP_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 2
rate         : 44100
exact rate   : 44100 (44100/1)
msbits       : 16
buffer_size  : 16384
period_size  : 4096
period_time  : 92879
tick_time    : 10000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 4096
xfer_align   : 4096
start_threshold  : 0
stop_threshold   : 16384
silence_threshold: 0
silence_size : 0
boundary     : 1073741824
v4l2: get audio format: 16
==> Found audio stream: 0
v4l2: get audio samplerate: 44100
v4l2: get audio samplesize: 2
v4l2: get audio channels: 1
  TV audio: 1 channels, 16 bits, 44100 Hz
Audio capture - buffer 256 blocks of 8192 bytes, skew average from 16 meas.
Using a ring buffer for maximum 423 frames, 250 MB total size.
v4l2: set Brightness: 128 [0, 255]
v4l2: set Hue: 0 [-128, 127]
v4l2: set Saturation: 64 [0, 127]
v4l2: set Contrast: 65 [0, 127]
[V] filefmt:9  fourcc:0x32315659  size:720x576  fps:25,00  ftime:=0,0400
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
dec_audio: Allocating 2048 + 65536 = 67584 bytes for output buffer
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 osd=1]
Expand: -1 x -1, -1 ; -1  (-1=autodetect) osd: 1
Opening video filter: [scale w=576 h=432]
SwScale params: 576 x 432 (-1=no scaling)
Opening video filter: [pp=fd]
[scale] query(Planar YV12) -> 1
[scale] query(Planar I420) -> 1
[scale] query(Planar IYUV) -> 1
[scale] query(Planar 444P) -> 1
[scale] query(Planar 422P) -> 1
[scale] query(Planar 411P) -> 1
Opening video filter: [crop w=688 h=544 x=16 y=16]
Crop: 688 x 544, 16 ; 16
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 720 x 576 (preferred csp: Planar YV12)
[PP] Using external postprocessing filter, max q = 6.
Trying filter chain: crop pp scale expand lavc
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO Config (720x576->720x576,flags=0,'MPlayer',0x32315659)
REQ: flags=0xC41  req=0x400
REQ: flags=0x441  req=0x0
SwScaler: reducing / aligning filtersize 6 -> 8
SwScaler: reducing / aligning filtersize 6 -> 8
SwScaler: reducing / aligning filtersize 7 -> 5
SwScaler: reducing / aligning filtersize 7 -> 5

SwScaler: BICUBIC scaler, from Planar YV12 to Planar YV12 using MMX2
SwScaler: using 8-tap MMX scaler for horizontal luminance scaling
SwScaler: using 8-tap MMX scaler for horizontal chrominance scaling
SwScaler: using n-tap MMX scaler for vertical scaling (YV12 like)
SwScaler: 688x544 -> 576x432
REQ: flags=0x401  req=0x0
REQ: flags=0x401  req=0x0
videocodec: libavcodec (576x432 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...
[libaf] Adding filter dummy
[dummy] Was reinitialized, rate=44100Hz, nch = 1, format = 0x00000001 and bps = 2
[dummy] Was reinitialized, rate=44100Hz, nch = 1, format = 0x00000001 and bps = 2
Writing AVI header...
LAME version 3.93  (http://www.mp3dev.org/)
Using polyphase lowpass  filter, transition band: 20094 Hz - 20627 Hz

misc:

        scaling: 0,000000
        ch0 (left) scaling: 0,000000
        ch1 (right) scaling: 0,000000
        filter type: 0
        quantization: ISO
        huffman search: normal
        experimental X=0 Y=0 Z=0
        ...

stream format:

        MPEG-1 Layer 3
        1 channel - mono
        padding: auto
        constant bitrate - CBR
        ...

psychoacoustic:

        tonality estimation limit: 8871,700195 Hz
        using short blocks: allowed
        adjust masking: 0,000000 dB
        psymodel: 1
        noise shaping: 1
         ^ amplification: 0
         ^ stopping: 0
        ATH: using
         ^ type: 2
         ^ adjust type: 0
         ^ adapt threshold type: 2
        using temporal masking effect: yes
        interchannel masking ratio: 0,000000
        ...

Forcing audio preload to 0, max pts correction to 0
v4l2: going to capture
*** [crop] Exporting mp_image_t, 720x576x12bpp YUV planar, 622080 bytes
*** [pp] Exporting mp_image_t, 688x544x12bpp YUV planar, 561408 bytes
*** [scale] Allocating mp_image_t, 688x544x12bpp YUV planar, 561408 bytes
*** [lavc] Allocating mp_image_t, 576x432x12bpp YUV planar, 373248 bytes
*** [expand] Direct Rendering mp_image_t, 576x432x12bpp YUV planar, 373248 bytes
get_path('subfont.ttf') -> '/home/mw/.mplayer/subfont.ttf'
New_Face failed. Maybe the font path is wrong.
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.

Pos: 171,2s   4277f ( 0%)  25fps Trem:   0min   0mb  A-V:0,000 [2001:127] A/Vms 3/18 D/B/S 3/1/1

<CTRL C>

CBR audio: 16000 bytes/sec, 418 bytes/block

Writing AVI index...
Fixing AVI header...

Video stream: 2001,834 kbit/s  (250229 bps)  size: 42829238 bytes  171,160 secs  4277 frames

Audio stream:  128,000 kbit/s  (15999 bps)  size: 2738050 bytes  171,128 secs
uninit video: raw
PSNR: Y:37,53, Cb:43,23, Cr:43,79, All:38,77
DEMUXER: freeing demuxer at 0x846ddc8
v4l2: 4280 frames successfully processed, 3 frames dropped.
v4l2: up to 4 video frames buffered.
DEMUXER: freeing sh_audio at 0x8476ef0
DEMUXER: freeing sh_video at 0x8476e58
mw at K6:~/TV/video>



More information about the MPlayer-users mailing list