Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Feb 2003 09:41:48 -0800
From:      Nicholas Esborn <nick@netdot.net>
To:        "Jos? M. Fandi?o" <freebsd@fadesa.es>
Cc:        multimedia@FreeBSD.ORG
Subject:   Re: ffmpeg issues with audio
Message-ID:  <20030205174148.GC76909@carbon.berkeley.netdot.net>
In-Reply-To: <3E3F96A1.8F0B8AF@fadesa.es>
References:  <3E3F96A1.8F0B8AF@fadesa.es>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello.

What version of ffmpeg are you using?  I heard that there were speed issues
with at least the first port revision of ffmpeg-0.4.6.  I'm using 0.4.5a
from a recent port, and it works well.  I have a 1200MHz AMD Duron, an SB
Live, and I record using NTSC variants of the same arguments you use.

-nick

On Tue, Feb 04, 2003 at 11:32:01AM +0100, Jos? M. Fandi?o wrote:
> 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: <VIA VT82C686A> 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<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR>
>   AMD Features=0xc0440000<<b18>,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: <APM BIOS> on motherboard
> apm: found APM BIOS v1.2, connected at v1.2
> npx0: <math processor> on motherboard
> npx0: INT 16 interface
> pcib0: <Host to PCI bridge> on motherboard
> pci0: <PCI bus> on pcib0
> agp0: <VIA 82C8363 (Apollo KT133A) host to PCI bridge> mem 0xe4000000-0xe7ffffff at device 0.0 on pci0
> pcib1: <VIA 8363 (Apollo KT133) PCI-PCI (AGP) bridge> at device 1.0 on pci0
> pci1: <PCI bus> on pcib1
> pci1: <ATI model 5046 graphics accelerator> at 0.0 irq 9
> isab0: <VIA 82C686 PCI-ISA bridge> at device 4.0 on pci0
> isa0: <ISA bus> on isab0
> atapci0: <VIA 82C686 ATA100 controller> port 0xb800-0xb80f at device 4.1 on pci0
> ata0: at 0x1f0 irq 14 on atapci0
> ata1: at 0x170 irq 15 on atapci0
> uhci0: <VIA 83C572 USB controller> port 0xb400-0xb41f irq 10 at device 4.2 on pci0
> usb0: <VIA 83C572 USB controller> 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: <VIA 83C572 USB controller> port 0xb000-0xb01f irq 10 at device 4.3 on pci0
> usb1: <VIA 83C572 USB controller> 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: <VIA VT82C686A Power Management Unit> port 0xe800-0xe80f at device 4.4 on pci0
> viapropm0: SMBus revision code 0x40
> smb0: <SMBus general purpose I/O> on smbus0
> pcm0: <VIA VT82C686A> port 0xa000-0xa003,0xa400-0xa403,0xa800-0xa8ff irq 11 at device 4.5 on pci0
> ed0: <NE2000 PCI Ethernet (RealTek 8029)> port 0x9400-0x941f irq 10 at device 9.0 on pci0
> ed0: address 00:02:44:17:3a:fa, type NE2000 (16 bit) 
> pci0: <Matrox MGA Millennium 2064W graphics accelerator> at 10.0 irq 11
> bktr0: <BrookTree 878> mem 0xde000000-0xde000fff irq 10 at device 13.0 on pci0
> iicbb0: <I2C bit-banging driver> on bti2c0
> iicbus0: <Philips I2C bus> on iicbb0 master-only
> iicsmb0: <I2C to SMB bridge> on iicbus0
> smbus1: <System Management Bus> on iicsmb0
> smb1: <SMBus general purpose I/O> on smbus1
> iic0: <I2C general purpose I/O> on iicbus0
> iicbus1: <Philips I2C bus> on iicbb0 master-only
> iicsmb1: <I2C to SMB bridge> on iicbus1
> smbus2: <System Management Bus> on iicsmb1
> smb2: <SMBus general purpose I/O> on smbus2
> iic1: <I2C general purpose I/O> on iicbus1
> smbus3: <System Management Bus> on bti2c0
> smb3: <SMBus general purpose I/O> on smbus3
> bktr0: AVer Media TV/FM, Philips PAL tuner.
> pci0: <unknown card> (vendor=0x109e, dev=0x0878) at 13.1 irq 10
> atapci1: <Promise ATA100 controller> 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: <Option ROM> at iomem 0xc0000-0xcbfff on isa0
> fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
> fdc0: FIFO enabled, 8 bytes threshold
> fd0: <1440-KB 3.5" drive> on fdc0 drive 0
> atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
> atkbd0: <AT Keyboard> flags 0x1 irq 1 on atkbdc0
> kbd0 at atkbd0
> psm0: <PS/2 Mouse> irq 12 on atkbdc0
> psm0: model MouseMan+, device ID 0
> vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
> sc0: <System console> at flags 0x100 on isa0
> sc0: VGA <16 virtual consoles, flags=0x300>
> sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
> sio0: type 16550A
> sio1: configured irq 3 not in bitmap of probed irqs 0
> ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
> ppc0: Generic chipset (EPP/NIBBLE) in COMPATIBLE mode
> lpt0: <Printer> on ppbus0
> lpt0: Interrupt-driven port
> pca0 at port 0x40 on isa0
> ad0: 4112MB <SAMSUNG SV0432A 010> [8912/15/63] at ata0-master UDMA33
> ad2: 38166MB <ST340823A> [77545/16/63] at ata1-master UDMA100
> ad6: 38166MB <ST340810A> [77545/16/63] at ata3-master UDMA100
> acd0: CDROM <CD-52X ATAPI> at ata0-slave UDMA33
> acd1: DVD-ROM <TOSHIBA DVD-ROM SD-M1612> at ata1-slave UDMA33
> acd2: CD-RW <Hewlett-Packard CD-Writer Plus 8100> at ata2-slave PIO3
> Mounting root from ufs:/dev/ad0s2a
> -- 
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.1
> GCS/IT d- s+:+() a- C+++ UBL+++$ P+ L+++ E--- W++ N+ o++ K- w---
> O+ M+ V- PS+ PE+ Y++ PGP+>+++ t+ 5 X+$ R- tv-- b+++ DI D++>+++
> G++ e- h+(++) !r !z
> ------END GEEK CODE BLOCK------
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-multimedia" in the body of the message

-- 
Nicholas Esborn
Unix Systems Administrator
Berkeley, California

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-multimedia" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030205174148.GC76909>