PDA

View Full Version : Fastest audio encoder???


sbp
12th September 2004, 18:47
Hi
I'm capturing TV-shows from my TV-card - using XVID for realtime capture, and have been experimenting with the audio compression as well - with mixed results.

The XVID caupture is fine, no lost frames ect. But if I try to do real-time mp3 encoding as well, it starts to disintegrate, the sound and video comes out of sync, the video sort of starts to jump.

Therefore, I would like to know, what is the fastest encoder?

Should I go for MP3, the Nero-encoder og OggVobis or something completely different.

I still would like to do realtime encoding - as we only use it like a sort of VHS, and often delete the show after we have watched it once.

Steen

sbp
12th September 2004, 19:54
Hi
I just tried XING MP3, it is fast, however, I have a problem with this one:
In my capture program, there is a drop-down list with all the installed codecs, (where I can configure the mp3 codec), BUT this Xing MP3 does not show in the drop down list - WHY?

Steen

Brother John
13th September 2004, 11:10
Try installing LAME 3.96 (http://www.rarewares.org/mp3.html) and use CBR. Should be one of the fastest setups.

Additionally you may get speed gains with "faster" XviD settings.

Edit:
I don't use Xing (because its quality is inferior to LAME) so I don't know for sure.
What type of encoder is it: ACM, DirectShow oder a simple exe file? If your capture program only supports ACM and you have a DShow encoder, it won't show up in the list.

sbp
13th September 2004, 14:45
Thanks, I just downloaded it but I have some problems when trying to configure the encoder. The settings doesn't stick.

I us this route (is that correct?):
My computer - properties - device manager - sound, video and game - codecs for sound - right click - properties - finding the lame ACM MP3 codec - click on settings -

and here I can choose different things:
Stereo mode: (stereo)
Smart encode: (enabled)
Average BitRate: (disabled)
Bits:
Copyright
Checksum
Original
Private

But no matter what I change and I remember to click on OK, it won't stick, the next time I look here it is all back to default - PLEASE HELP

Steen

Brother John
13th September 2004, 15:22
You're right: Settings do not stick in the device manager and also not when configured via Vdub.

I tested around a little and found that c:\win\system32\lame_acm.xml (where lame acm settings are stored) was write protected. No wonder lame didn't remember its settings. Disabled the write protection via the file's properties and it works.

P.S.: You should also be able to edit the settings from within your capture program. Some »advanced« or »settings« button when you choose the lame acm codec, I guess. Depending on the application you use. Btw: Which one is it?

sbp
13th September 2004, 16:06
Thanks, That did the trick. Now I'm ready for some testing.

Inside my capture program I'm not able to do this kind of configuration: here I can choose (from a dropdown list) different compression formats like:
2 channels 44 khz 0 bit 320 kbs
2 channels 44 khz 0 bit 256 kbs
ect

I use myHTPC as frontend and GOTTV (an old version) as capture program - using a Medion TV-card (phillips 7134 chip), AMD 2500 Barton, 120 GB harddisk, and DDR-ram 512.

PS do you think MP3 encoding is faster than other audio compression formats (I get slightly better results with my old set-up using some kind of windows audio encoding?)

Steen

sbp
13th September 2004, 16:51
Hi again.

Now I'm in trouble, my capture program reports an error everytime I try to record using the new lame encoder. Then it closes.

I'm not sure that lame is installed properly, I have no lame_enc.dll in system32 dir. If I try to use RegSvr32 on this file I get this error: "indgangspunktet=(danish I don't know the english term maybe entry point?) DllRegisterServer not found. This file could not be registered.

What to do now?
Steen

Brother John
13th September 2004, 17:50
How did you install Lame ACM? Right click on »LameACM.inf«, then »Install«? Yes? So Lame should be installed correctly.
Regsvr32.exe is for registering DirectShow filters. lame_enc.dll is not a DShow filter, that’s why the error occors. The dll is for usage in programs that can handle external encoder dlls, e.g. Exact Audio Copy when encoding Audio-CDs.

What is the name of your capture program? Maybe someone else uses the same and knows a solution.
What exactly do you do in that program until it crashes. Does »Lame MP3« show up in its audio codec list?

sbp
13th September 2004, 18:10
Thanks for your reply.

Yes I used right click on the inf-file - and chose install.

I have also tried to manually copy the dll to win\system32 dir - but the program still crashes.

The program is GOTTV, a plug in for myHTPC. It have never crashed like this before.
Yes, within the GOTTV I can see the Lame MP3 in the different audio codecs I can choose between. Then I choose Lame MP3, chose a compression (ie 2 channels 44 khz 320 kbs ect (and I have tried many different - in order to check if this was the problem - but no matter which I choose - it crashes).
After having chosen Lame MP3 and a compression, I click on record, then it starts recording (lots of activity on the harddisk), but within a few 2-5 sec. It crashes.

Now I think I will try to go back to my previous mp3 encoder - but any idea is greatly appreciated.

Steen

EDIT: PS the codecs listet in the drop down menu are they all *.ACM files or are there also *.dll based codecs listet in these drop down menu??

Brother John
13th September 2004, 21:28
I don’t know GOTTV, so I can’t give you any specific advice. Maybe try different LAME versions or test capturing with VDub to narrow down the real reason for the crashes.

Is the list inside the program similar to the one in the device manager? Then it’s only ACM codecs.

Any other ideas, hm. Like I said above: audio is only one half of tuning possibilities. I suggest posting your XviD settings. Maybe there is room for tweaking.

sbp
14th September 2004, 10:41
Hi, I don't know what is wrong, but GotTv still crashes.
But then I decided to try to install lame 3.96.1 by the K-lite codec pack - and now I can record without any crash - strange!!!

BUT my problem is that I can't hear any sound from my recorded shows. Using Avi_tags there seems to be mp3 sound in the avi - but I can't hear it. I have even tried on another computer - still no sound.

Is it possible that somebody can help me with this, maybe I could send this file to you - so you could check if you can hear any sound.

PS I have no problems with ordinary MP3 files - so I must have a MP3 decoder installed.
Thanks
Steen

This is the information provided from Avi_tags:
[RIFF AVI 2516472]: Audio/Video Interleaved File
[LIST hdrl 65084]: Format Definition Chunk
[avih 56]: Main AVI Header
[dwMicroSecPerFrame]: Microseconds Per Frame: 40000
[dwMaxBytesPerSec]: Maximum Bytes Per Second: 167765
[dwPaddingGranularity]: Padding Granularity (bytes): 512
[dwFlags]: Flags 0x00000810
[AVIF_HASINDEX]: AVI file has 'idx1' chunk
[AVIF_TRUSTCKTYPE]: use chunk type to find key frames
[dwTotalFrames]: Number Of Frames: 398
[dwInitialFrames]: Numer Of Initial Frames: 0
[dwStreams]: Number Of Streams: 2
[dwSuggestedBufferSize]: Suggested Buffer Size (bytes): 18154
[dwWidth]: Image Width (pixels): 640
[dwHeight]: Image Height (pixels): 480
[LIST strl 32372]: Stream Format Definition Chunk
[strh 56]: Stream Header
[fccType]: Type: vids (Video Data)
[fccHandler]: Handler: XVID (XviD MPEG-4 codec 'XVID' <0x44495658>)
[dwFlags]: Flags 0x00000000
[wPriority]: Stream Priority: 0
[wLanguage]: Language: 0 (Undefined)
[dwInitialFrames]: Numer Of Initial Frames: 0
[dwScale]: Stream Scale: 400000
[dwRate]: Stream Rate: 10000000
[dwStart]: Stream Start: 1
[dwLength]: Stream Length: 398
[dwSuggestedBufferSize]: Suggested Buffer Size (bytes): 18154
[dwQuality]: Stream Quality (1-10000): 0
[dwSampleSize]: Sample Size: 0
[rcFrame]: Frame Size Of Stream
[wX1]: Top: 0
[wY1]: Bottom: 0
[wX2]: Left: 0
[wY2]: Right: 0
[strf 40]: Video Stream Format
: Header Size (bytes): 40
[biWidth]: Image Width (pixels): 640
[biHeight]: Image Height (pixels): 480
[biPlanes]: Number Of Planes: 1
[biBitCount]: Number Of Bits Per Pixel: 16
[biCompression]: Compression Algorithm: XVID (XviD MPEG-4 codec 'XVID' <0x44495658>)
[biSizeImage]: Image Size (bytes, 0 = uncompressed): 1843200
[biXPelsPerMeter]: Horizontal resolution of target device: 1
[biYPelsPerMeter]: Vertical resolution of target device: 1
[biClrUsed]: Number of colors used (0 = maximum): 0
[biClrImportant]: Number of important colors (0 = all): 0
[indx 32248]: AVI2 (OpenDML) Super Index Chunk
[LIST strl 32360]: Stream Format Definition Chunk
[strh 56]: Stream Header
[fccType]: Type: auds (Audio Data)
[fccHandler]: Handler: 0x00000000 (No Compression <0x00000000>)
[dwFlags]: Flags 0x00000000
[wPriority]: Stream Priority: 0
[wLanguage]: Language: 0 (Undefined)
[dwInitialFrames]: Numer Of Initial Frames: 0
[dwScale]: Stream Scale: 4
[dwRate]: Stream Rate: 16000
[dwStart]: Stream Start: 9
[dwLength]: Stream Length: 0
[dwSuggestedBufferSize]: Suggested Buffer Size (bytes): 8
[dwQuality]: Stream Quality (1-10000): 0
[dwSampleSize]: Sample Size: 4
[rcFrame]: Frame Size Of Stream
[wX1]: Top: 0
[wY1]: Bottom: 0
[wX2]: Left: 0
[wY2]: Right: 0
[B][strf 18]: Audio Stream Format
[wFormatTag]: Audio Format: 0x0055 (MPEG-1 Layer 3 (MP3) <0x0055>)
[nChannels]: Number of channels: 2
[nSamplesPerSec]: Frequency of the sample rate (Hz): 44100
[nAvgBytesPerSec]: Average data rate (byte/s): 16000
[nBlockAlign]: Block alignment of the data (bytes): 4
[wBitsPerSample]: Number of bits per sample (0 = undefined): 16
[cbSize]: Size of extra information (bytes): 0
[fwFlags]: Flags: 0x0000 (ISO Padding)
[nBlockSize]: Block size (bytes): 16000
[nFramesPerBlock]: Number of frames per block: 0
[nCodecDelay]: Codec delay (ms): 9
[JUNK 2]: Padding
[indx 32248]: AVI2 (OpenDML) Super Index Chunk
[LIST odml 260]: AVI2 (OpenDML) Format Definition Chunk
[dmlh 248]: Total Number Of Frames AVI2 (OpenDML) 398
[JUNK 412]: Padding
[LIST movi 2444292]: Audio/Video Data
Skipped
[idx1 6648]: AVI Index Chunk


EDIT:
Using Gspot I can see that my new recordings which I can't hear but see, the audio codec was 0x0055(MP3, ISO), and trying to render the audio graphs (in Gspot 2.55) all failed.
Whereas, my older recordings (which I could both see and hear) was done using 0x0055(MP3, ISO) MPEG-2 Layer 3.

darkpepe
14th September 2004, 17:57
You wont get sync audio compressing and capturing at the same time. Use PCM and compress the audio afterwards.

sbp
15th September 2004, 18:14
If I use windows media audio V2, then I get perfectly synced video and audio, which plays very smooth.

But I would rather try MP3 - but still I can't get any sound from my recorded file, which seems to contain video as well as audio (Using Gspot).

Please, are there anybody willing to test my file - to see if they play the file without problem (then I must have a missing codec or something)

Steen

darkpepe
15th September 2004, 18:24
There's nothing that VLC can't play
www.videolan.org

sbp
15th September 2004, 20:35
Even videolan doesn't play any sound. But still videolan reports these information on the audio stream:
Type: Audio
Codec mpga
Channels: 2
Sample rate: 44100 Hz
Bits per sample: 16
Bitrate: 128000 bps

But no sound?
Steen

darkpepe
15th September 2004, 21:05
I would suggest to extract the audio with VirtualDub if possible, and mux it again after compressed to mp3 or whatever

sbp
26th September 2004, 09:59
Hi after done some readings at different places, I have come to the conclusion that it is the lame acm that is faulty.
If I in device manager chose not to use the lame encoder, everything is working nicely - but if I use the lame encoder, either the encoding freeses after 65 sec, or the resulting AVI (XVID with mp3 sound) is playing without any sound.

I have tried lame 3.96.1 and 3.97 (alpha) - no luck.

Any suggestions?
Steen


PS: I have another question:
What is most processor intensive to encode at 44khz 320b/s, or 44 khz at 128 b/s.
And would it be better (faster) to encode at 24 khz 320 or 128 b/s???

Brother John
27th September 2004, 19:30
Did a quick & dirty speed test on my Centrino 1.6 GHz with Lame 3.96.1

44100 Hz
128 kbit cbr: 14.5 times realtime
320 kbit cbr: 15.1

24000 Hz
128 kbit cbr: 23.9
320 kbit cbr: bitrate/samplerate combination not allowed in lame

128/320 is not much of a difference but lowering the samplerate definitely reduces cpu load.
Note: Source for the test was an existing wave file.

Afaik lame ACM isn't developed extensively. You can only try different versions (3.90.3 is the "officially hydrogenaudio recommended" version anyway) or switch to another encoder.

P.S.: If you want to keep your captures don't use lame alphas. They're for testing only and may be seriously flawed.

WhosAsking
30th November 2004, 09:20
I would like to figure this out as well. To this day, I have yet to locate a suitable ACM codec that allows me to record realtime satisfactorily.

I also use GotTV. It's a compact TV recorder. It was designed for use with the myhtPC suite (and now an integrated part of GotAllMedia), but I keep using an old version alone because it's tight, can be pushed out of the way quickly, and doesn't hog the CPU time.

Anyway, I am under space constraints so cannot rely on PCM encoding (I record half-hour shows mostly, and with PCM, the audio data becomes as big as the video). Most MP3 ACM codecs I found are either too demanding, too limited, or too buggy. Most of the other codec classes are meant for Videophone operations, and the ATRAC3 codec is too lossy and limited.

I'm just about tempted to fall back on old-fasioned ADPCM, which would give me a 4:1 ratio, but as I have a 2GHz CPU and am using my video encoder under relatively loose settings, I have some room to maneuver. Is there any good ACM codec out there that can deliver a tight size at a good speed (at minimum, tighter than ADPCM)?