From owner-freebsd-multimedia Wed Feb 5 2:32: 6 2003 Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7414937B401 for ; Wed, 5 Feb 2003 02:32:01 -0800 (PST) Received: from fuego.fadesa.es (fuego.fadesa.es [195.55.55.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id D7AF243F85 for ; Wed, 5 Feb 2003 02:31:59 -0800 (PST) (envelope-from freebsd@fadesa.es) Received: (from mail@fadesa.es) by fuego.fadesa.es (8.9.3/8.8.8) id LAA22443 for ; Wed, 5 Feb 2003 11:32:41 +0100 Message-ID: <3E3F96A1.8F0B8AF@fadesa.es> Date: Tue, 04 Feb 2003 11:32:01 +0100 From: "=?iso-8859-15?Q?Jos=E9?= M. =?iso-8859-15?Q?Fandi=F1o?=" Reply-To: freebsd@fadesa.es Organization: Inmobiliaria FADESA X-Mailer: Mozilla 4.8 [en] (X11; U; Linux 2.4.20-grsec i686) X-Accept-Language: gl, en, es MIME-Version: 1.0 To: multimedia@freebsd.org Subject: ffmpeg issues with audio Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Logged: Logged by tierra.fadesa.es as LAA15585 at Wed Feb 5 11:19:15 2003 Sender: owner-freebsd-multimedia@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hello, I apologize for this long message, but it's necesary in order to explain my problem. Thanks to the advice of Steve I can record from a bktr device, but the success in recording isn't as good as it could be. When I record with sound (don't mind that video/audio codec I use mpeg1, msmpeg4, mpeg4) the cpu spends alot of time in system context as you can see below in the first example. Now in the second example when I use the "-an" parameter (disable audio) the cpu has a more moderate (read: normal) consumption. I'm curious about this, why audio does encoding drop my framerate from 25fps and about 35% of cpu time to 19fps with 100% of cpu time usage? Is there any other info that I can provide to help to debug this? Perhaps an execution profile report. Thanks all of you. > ffmpeg -vcodec mpeg1video -b 7200 -s 384x288 -y -t 5.0 test1.mpg Input #0, video_grab_device, from '/dev/bktr0': Stream #0.0: Video: rawvideo, yuv420p, 384x288, 25.00 fps, 800 kb/s Input #1, audio_device, from '/dev/dsp': Stream #1.0: Audio: pcm_s16le, 44100 Hz, mono, 705 kb/s Output #0, mpeg, to 'test1.mpg': Stream #0.0: Video: mpeg1video, 384x288, 25.00 fps, q=2-31, 7200 kb/s Stream #0.1: Audio: mp2, 44100 Hz, mono, 64 kb/s Stream mapping: Stream #0.0 -> #0.0 Stream #1.0 -> #0.1 Press [q] to stop encoding frame= 125 q=3.0 size= 4542kB time=5.0 bitrate=7441.6kbits/s ffmpeg in free(): warning: page is already free procs memory page disks faults cpu r b w avm fre flt re pi po fr sr ad0 ad2 in sy cs us sy id 0 0 0 88560 514360 7 0 0 0 0 0 0 0 291 1531 269 5 0 95 0 0 0 88560 514360 3 0 0 0 0 0 0 0 236 1081 199 2 0 98 1 0 0 92932 515932 837 0 0 0 1613 0 3 0 252 26938 186 8 8 85 2 0 0 93144 514628 56 0 0 0 0 0 0 8 358 203007 219 44 56 0 1 0 0 92780 513764 3 0 0 0 0 0 0 7 356 203172 202 42 58 0 1 0 0 92780 512868 6 0 0 0 0 0 0 7 357 205271 198 47 53 0 1 0 0 92780 512004 3 0 0 0 0 0 0 7 357 203537 195 45 55 0 0 0 0 88196 514312 3 0 0 0 841 0 0 6 340 178599 201 41 46 13 1 0 0 88616 514312 6 0 0 0 0 0 0 0 275 1378 232 1 0 99 0 0 0 88616 514312 3 0 0 0 0 0 0 0 246 1096 184 0 1 99 > ffmpeg -vcodec mpeg1video -b 7200 -s 384x288 -y -t 5.0 -an test1.mpg Input #0, video_grab_device, from '/dev/bktr0': Stream #0.0: Video: rawvideo, yuv420p, 384x288, 25.00 fps, 800 kb/s Output #0, mpeg, to 'test1.mpg': Stream #0.0: Video: mpeg1video, 384x288, 25.00 fps, q=2-31, 7200 kb/s Stream mapping: Stream #0.0 -> #0.0 Press [q] to stop encoding frame= 125 q=4.0 size= 4520kB time=5.0 bitrate=7405.6kbits/s ffmpeg in free(): warning: page is already free procs memory page disks faults cpu r b w avm fre flt re pi po fr sr ad0 ad2 in sy cs us sy id 0 0 0 136000 514336 7 0 0 0 0 0 0 0 296 1897 358 4 2 95 0 0 0 136000 514336 3 0 0 0 0 0 0 0 230 785 135 1 2 97 1 0 0 140500 515552 865 0 0 0 1237 0 0 2 261 1303 192 9 4 87 1 0 0 140500 514576 3 0 0 0 0 0 3 8 319 1453 207 35 2 63 0 0 0 140136 513736 3 0 0 0 2 0 0 6 312 1385 206 32 3 65 1 0 0 140136 512856 6 0 0 0 0 0 0 7 314 1399 201 32 3 65 0 0 0 140136 511960 3 0 0 0 0 0 0 7 315 1414 205 31 5 65 1 0 0 136056 514360 3 0 0 0 752 0 0 5 286 1293 202 23 5 72 0 0 0 136056 514360 3 0 0 0 0 0 0 0 254 1078 191 5 2 94 0 0 0 136056 514360 3 0 0 0 0 0 0 0 257 947 155 1 2 98 FreeBSD Audio Driver (newpcm) Installed devices: pcm0: at io 0xa800 irq 11 (1p/1r/0v channels duplex) [pcm0:play:0]: spd 44100, fmt 0x10000010, flags 00000000 interrupts 0, underruns 0, ready 0 {userland} -> feeder_root(0x10000010) -> {hardware} [pcm0:record:0]: spd 44100, fmt 0x00000010, flags 00000000 interrupts 0, overruns 0, hfree 4096, sfree 131072 {hardware} -> feeder_root(0x00000010) -> {userland} Copyright (c) 1992-2002 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD 4.7-RELEASE #2: Sun Jan 5 00:03:36 CET 2003 root@damocles.olimpus:/usr/src/sys/compile/NUCLEO Timecounter "i8254" frequency 1193182 Hz CPU: AMD Athlon(tm) Processor (1410.21-MHz 686-class CPU) Origin = "AuthenticAMD" Id = 0x644 Stepping = 4 Features=0x183f9ff AMD Features=0xc0440000<,AMIE,DSP,3DNow!> real memory = 805224448 (786352K bytes) config> q avail memory = 779366400 (761100K bytes) Preloaded elf kernel "kernel" at 0xc03e9000. Preloaded userconfig_script "/boot/kernel.conf" at 0xc03e909c. Preloaded elf module "vesa.ko" at 0xc03e90ec. Preloaded elf module "agp.ko" at 0xc03e9188. netsmb_dev: loaded VESA: v2.0, 32768k memory, flags:0x1, mode table:0xc03db362 (1000022) VESA: ATI RAGE128 Pentium Pro MTRR support enabled md0: Malloc disk Using $PIR table, 9 entries at 0xc00f1750 apm0: on motherboard apm: found APM BIOS v1.2, connected at v1.2 npx0: on motherboard npx0: INT 16 interface pcib0: on motherboard pci0: on pcib0 agp0: mem 0xe4000000-0xe7ffffff at device 0.0 on pci0 pcib1: at device 1.0 on pci0 pci1: on pcib1 pci1: at 0.0 irq 9 isab0: at device 4.0 on pci0 isa0: on isab0 atapci0: port 0xb800-0xb80f at device 4.1 on pci0 ata0: at 0x1f0 irq 14 on atapci0 ata1: at 0x170 irq 15 on atapci0 uhci0: port 0xb400-0xb41f irq 10 at device 4.2 on pci0 usb0: on uhci0 usb0: USB revision 1.0 uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub0: 2 ports with 2 removable, self powered uhci1: port 0xb000-0xb01f irq 10 at device 4.3 on pci0 usb1: on uhci1 usb1: USB revision 1.0 uhub1: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub1: 2 ports with 2 removable, self powered viapropm0: SMBus I/O base at 0xe800 viapropm0: port 0xe800-0xe80f at device 4.4 on pci0 viapropm0: SMBus revision code 0x40 smb0: on smbus0 pcm0: port 0xa000-0xa003,0xa400-0xa403,0xa800-0xa8ff irq 11 at device 4.5 on pci0 ed0: port 0x9400-0x941f irq 10 at device 9.0 on pci0 ed0: address 00:02:44:17:3a:fa, type NE2000 (16 bit) pci0: at 10.0 irq 11 bktr0: mem 0xde000000-0xde000fff irq 10 at device 13.0 on pci0 iicbb0: on bti2c0 iicbus0: on iicbb0 master-only iicsmb0: on iicbus0 smbus1: on iicsmb0 smb1: on smbus1 iic0: on iicbus0 iicbus1: on iicbb0 master-only iicsmb1: on iicbus1 smbus2: on iicsmb1 smb2: on smbus2 iic1: on iicbus1 smbus3: on bti2c0 smb3: on smbus3 bktr0: AVer Media TV/FM, Philips PAL tuner. pci0: (vendor=0x109e, dev=0x0878) at 13.1 irq 10 atapci1: port 0x7800-0x783f,0x8000-0x8003,0x8400-0x8407,0x8800-0x8803,0x9000-0x9007 mem 0xdb800000-0xdb81ffff irq 3 at device 17.0 on pci0 ata2: at 0x9000 on atapci1 ata3: at 0x8400 on atapci1 orm0: