[MPlayer-users] WinTV problems in NetBSD, mencoder stops recording

Kai Puolamaki Kai.Puolamaki at iki.fi
Sun Feb 1 14:07:28 CET 2004


TV viewing and recording with mplayer/mencoder 1.0rc3 and Hauppauge
WinTV Express (Brooktree 878 based card) does not work in NetBSD. With
the help of Google I managed to make the mplayer to show TV programs,
but there is still a mysterious problem with recording. Specifically,
I had three separate problems, two of which I managed to solve:

1. I was unable to view TV programs (solved)
2. Audio recording did not work (solved)
3. Mencoder stops recording after a random interval (unsolved)

Description of the problems and their solutions follow, boring
technical details are attached to the end of this mail:


1. Mplayer only shows one frame when viewing a TV program. The problem
is discussed in FreeBSD Problem Report ports/59946, see:
http://www.freebsd.org/cgi/query-pr.cgi?pr=59946

I applied the following patch against 1.0rc3, based on the FreeBSD PR
and NetBSD pkgsrc patches
(http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/multimedia/mplayer-share/patches/):
http://www.iki.fi/kaip/misc/patch-local-za This allows me to view TV
programs with mplayer without problems. Maybe the patch could be
incorporated into mplayer?


2. There are problems with recording and mencoder. Mencoder is unable
to capture the audio stream. The solution to this turned out to be
simple. Mencoder looks for audio device named /dev/dsp (given in
libmpdemux/tvi_bsdbt848.c). However, the name of the device in NetBSD
is /dev/sound. I solved the problem by making a symlink (ln -s sound
/dev/dsp), but this could also be incorporated into
libmpdemux/tvi_bsdbt848.c.


3. When I try to record a TV program with mencoder it seems to work
fine for a random time period (from 0.1s to couple of minutes). Then
the recording just stops. Sometimes there is a complaint of a "invalid
frame duration value", e.g.:

Pos:   2.0s     49f ( 0%)  25fps Trem:   0min   0mb  A-V:0.000
[1189:63]
Invalid frame duration value (2.059/2.034 => -0.024). Defaulting to
0.055 sec.
^CPos:   2.4s    113f ( 0%)  23fps Trem:   0min   0mb  A-V:0.000
[1046:63]

Initially the time and frame counters run normally. Then the time
counter stops permanently, the output AVI file stops growing and the
frame counter continues running. The resulting AVI file contains the
program only to the point where the time counter stopped. The stopping
seems to correlate with various system activity (saving a file or
loading a web page or something), the longest recording I managed to
make was something between one and two minutes.

The closest thing to this I could find with Google is (I have no idea
whether this relevant or not):
http://zebra.fh-weingarten.de/~maxi/html/mplayer-dev-eng/2002-07/msg00449.html

I would appreciate any pointers for solving the third problem...


Technical details:

Information of my system:

kaip at winnie /tmp % uname -a
NetBSD winnie.localdomain 1.6.1 NetBSD 1.6.1 (WINNIE) #0: Sat Jan 31
12:28:48 EET 2004
root at winnie.localdomain:/usr/src/sys/arch/i386/compile/WINNIE i386
kaip at winnie /tmp % dmesg|grep bktr
bktr0 at pci0 dev 15 function 0
bktr0: interrupting at irq 5
bktr0: Hauppauge Model 44804 D148
bktr0: Warning - Unknown Hauppauge Tuner 0x30
bktr0: Hauppauge WinCast/TV, Philips NTSC tuner.

Trying to record a TV program with Mencoder:

kaip at winnie /tmp % mencoder -tv
driver=bsdbt848:input=1:norm=PAL:chanlist=europe-west:width=352:height=288:channels=E5-TV1,E10-TV2,E7-MTV3,E9-NELONEN,23-SUBTV,27-BBC,E12-SVT,22-INFO,25-EUROSPOR,26-MTV,28-TV5,29-URHEILU,30-TV7,S26-DW,31-TESTI,E11-OSKILLOSK,SE12-KAIKKI
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900 -oac mp3lame -lameopts
cbr:br=64 -vf pp=lb -o out.avi tv://NELONEN
MEncoder 1.0pre3-2.95.3 (C) 2000-2003 MPlayer Team

CPU: Advanced Micro Devices Athlon 4 /Athlon MP/XP Palomino 1533 MHz
(Family: 6, Stepping: 2)
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/kaip/.mplayer/codecs.conf: Can't open
'/home/kaip/.mplayer/codecs.conf': No such file or directory
Reading /usr/pkg/share/mplayer/codecs.conf: 61 audio & 169 video
codecs
File not found: 'frameno.avi'
Failed to open frameno.avi
Reading config file /home/kaip/.mplayer/mencoder: No such file or
directory
font: can't open file: /home/kaip/.mplayer/font/font.desc
Font /usr/pkg/share/mplayer/font/font.desc loaded successfully! (206
chars)
success: format: 9  data: 0x0 - 0x0
TV detected! ;-)
Selected driver: bsdbt848
 name: Brooktree848 Support
 author: Charles Henrich
 comment: in development
audioid:ioctl: Inappropriate ioctl for device
TV channel names detected.
Selected channel: E9 - NELONEN (freq: 203.250)
START
[V] filefmt:9  fourcc:0x59565955  size:352x288  fps:25.00
ftime:=0.0400
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 44100 Hz, 2 ch, 16 bit (0x10), ratio: 176400->176400 (1411.2
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: [pp=lb]
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 352 x 288 (preferred csp: Packed UYVY)
[PP] Using external postprocessing filter, max q = 6.
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Packed UYVY as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 1 -> 1
SwScaler: reducing / aligning filtersize 9 -> 8

SwScaler: BICUBIC scaler, from Packed UYVY to Planar YV12 using MMX2
videocodec: libavcodec (352x288 fourcc=58564944 [DIVX])
Selected video codec: [rawuyvy] vfm:raw (RAW UYVY)
==========================================================================
MP3 audio selected
Building audio filter chain for 44100Hz/2ch/16bit ->
44100Hz/2ch/16bit...
Writing AVI header...
Forcing audio preload to 0, max pts correction to 0
^CPos:   8.6s    311f ( 0%)  25fps Trem:   0min   0mb  A-V:0.000
[1006:63]

CBR audio: 8000 bytes/sec, 209 bytes/block

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

Video stream: 1006.294 kbit/s  (125786 bps)  size: 1086797 bytes
8.640 secs  311 frames

Audio stream:   64.000 kbit/s  (7999 bps)  size: 69172 bytes  8.647
secs
kaip at winnie /tmp %
[The time indicator froze at 8.6s, after which the frame indicator
continued running until I hit control-C. File out.avi had 8.6 seconds
of program in it.]

-- 
Kai Puolamäki  |  Kai.Puolamaki at iki.fi  |  http://www.iki.fi/kaip/
Informaatiotekniikan laboratorio (CIS) | PL 5400, 02015 TKK (huone A339,
T-talo, Konemiehentie 2, Espoo) | PGP key http://www.iki.fi/kaip/pubkey.asc
(09) 451 4482 (työ) | 050 522 8111 (koti) | (09) 451 3277 (faksi, työ)




More information about the MPlayer-users mailing list