Thread: [Toolame-devel] Mp2 in a .wav file format and parallel encoding
Status: Alpha
Brought to you by:
mikecheng
|
From: Jesse S. <sc...@gm...> - 2004-07-29 22:50:53
|
Firstly, I have very little C programming experience, and very little
experience with audio. I do have a good background in java, *nix, and
perl, so please forgive me if these questions are obvious and please
let me know if there is a better forum in which to ask.
I have a requirement to do some encoding from .wav file that is
encoded in a .wav format to several outputs:
.mp2 (mpeg audio layer 2 256Kbit/s CBR)
.wav (mpeg 2 same CBR and bitrate)
.mp3 (I can use lame for this).
Xdelta shows that there is only a very small difference between the
.wav and .mp2 files, I assume only the frame headers. and the id3 tag
The source file is from a proprietary format (Prophet Systems) which
has the .wav file, a ASCII .dat file containing track information, and
a binary .vid file. I have no clue what the .vid file is, and I'd
very much like to know. Our current process uses 3rd party software
that takes the .wav and serialy processes the different outputs.
What I'd like to know is
1. How can I figure out what format the source file is. Is there a
header reader out there I can download and compile? I've read the
specs on the MPEG frame header, but I don't have much experience
dealing with binary file formats.
2. Can I process 1 frame of the input file and output the 3 different
format framse to my 3 output files in parallel (threaded). I realize
that this only saves me the overhead of the initial read but I'd have
to guess it would improve my transcoding time.
Any help/feedback is appreciated
|
|
From: Fred G. <fr...@sa...> - 2004-07-30 00:46:57
|
On Thursday 29 July 2004 17:50, Jesse Schoch wrote: > Xdelta shows that there is only a very small difference between the > .wav and .mp2 files, I assume only the frame headers. and the id3 tag > > The source file is from a proprietary format (Prophet Systems) which > has the .wav file, a ASCII .dat file containing track information, and > a binary .vid file. I have no clue what the .vid file is, and I'd > very much like to know. Our current process uses 3rd party software > that takes the .wav and serialy processes the different outputs. I posted a patch against toolame-02l about a year that adds what I suspect is precisely the capability you're talking about here --i.e. generate an MP2-encoded .WAV file with the proper BWF-compliant header chunks that Prophet requires. You can get it at: ftp://ftp.salemradiolabs.com/pub/srlabs/toolame-02l-patch-fredg01.gz This was in order to support use with the Rivendell Project: http://www.salemradiolabs.com/rivendell/ BTW, the MP2-encoded WAV file isn't a proprietary format, but follows an EBU (European Broadcasting Union) standard known as 'Broadcast Wave File', or 'BWF' for short. You can find the full spec at: http://www.sr.se/utveckling/tu/bwf/ Cheers! |-------------------------------------------------------------------------| | Frederick F. Gleason, Jr. | Director of Broadcast Software Development | | | Salem Radio Labs | |-------------------------------------------------------------------------| | Never worry about theory as long as the machinery does what it's | | supposed to do. | | -- Robert A. Heinlein | |-------------------------------------------------------------------------| |
|
From: Jesse S. <sc...@gm...> - 2004-07-30 16:14:43
|
I've been having lots of problems with noise in my output. see below. Snip, snip > > Batch converting is trivially simple on Linux -- it just takes a little shell > scripting. Something like: > > #!/bin/bash > for i in /some_dir/*.wav; > do toolame -m s -b 256 "$i"; > done I did quite a bit of expirimentation last night (I actualy got past research and started building ) but I could not output an acceptable quality file. I grabbed libmad (a high quality decoder ???) and libmad-dev with my friendly apt-get, I also grabbed madllb which should output pcm from a .wav file. The problem was that though I could create an acceptable sounding .aiff file with madlld and sox, I could not do the same with toolame and your patch (didnt' try without your patch). Generating the .aiff file with madlld ./madlld < This_land_is_your_land.mp2 |sox -r 44100 -t cdr - test.aiff madlld: 256000 kb/s audio MPEG layer II stream without CRC, normal LR stereo with no emphasis at 44100 Hz sample rate madlld: end of input stream madlld: 7299 frames decoded (3:10.667). Various toolame attempts ./madlld <This_land_is_your_land.mp2| toolame -t 2 -p 2 -v 10 -s 44.1 -e -b 256 -W - out.mp2 -------------------------------------------- Input File : 'stdin' 44.1 kHz Output File: 'out.mp2' 256 kbps MPEG-1 Layer II stereo Psycho model=2 (Mode_Extension=0) [De-emph:Off Copyright:No Original:No CRC:On] [Padding:Off Byte-swap:Off Chanswap:Off DAB:Off] VBR Enabled. Using MNR boost of 10.000000 ATH adjustment 0.000000 -------------------------------------------- encode_init: using tablenum 1 with sblimit 30 madlld: 256000 kb/s audio MPEG layer II stream without CRC, normal LR stereo with no emphasis at 44100 Hz sample rate absthr[][] sampling frequency index: 1 madlld: end of input stream madlld: 7299 frames decoded (3:10.667). Hit end of audio data VBR stats: 32 48 56 64 80 96 112 128 160 192 224 256 320 384 0 0 0 0 0 0 0 0 0 52 116 67 7064 0 Avg slots/frame = 1034.129; b/smp = 7.18; bitrate = 316.702 kbps Done toolame -b 256 test.aiff outMP2.mp2 >>> Using Audio IFF sound file headers Parsing AIFF audio file >>> 44100.000000 Hz sampling frequency selected -------------------------------------------- Input File : 'test.aiff' 44.1 kHz Output File: 'outMP2.mp2' 256 kbps MPEG-1 Layer II j-stereo Psy model 1 [De-emph:Off Copyright:No Original:No CRC:Off] [Padding:Normal Byte-swap:Off Chanswap:Off DAB:Off] ATH adjustment 0.000000 -------------------------------------------- encode_init: using tablenum 1 with sblimit 30 [2200]] Hit end of audio data Avg slots/frame = 835.918; b/smp = 5.80; bitrate = 256.000 kbps Done |
|
From: Jesse S. <sc...@gm...> - 2004-07-31 03:26:32
|
Update, turns out after much banging of my head into a brick wall, I finaly figured out that even though the test.aiff file sounded like it was ok, other encoders produced the same noise after converting. Now my question is simply what is the best way to convert *input* to PCM, I may have Prophet Systems formated .wav files, .mp3, or .wav in pcm format. On Fri, 30 Jul 2004 12:14:41 -0400, Jesse Schoch <sc...@gm...> wrote: > I've been having lots of problems with noise in my output. see below. > > Snip, snip > > > > > > Batch converting is trivially simple on Linux -- it just takes a little shell > > scripting. Something like: > > > > #!/bin/bash > > for i in /some_dir/*.wav; > > do toolame -m s -b 256 "$i"; > > done > > I did quite a bit of expirimentation last night (I actualy got past > research and started building ) but I could not output an acceptable > quality file. > > I grabbed libmad (a high quality decoder ???) and libmad-dev with my > friendly apt-get, I also grabbed madllb which should output pcm from > a .wav file. The problem was that though I could create an acceptable > sounding .aiff file with madlld and sox, I could not do the same with > toolame and your patch (didnt' try without your patch). > > Generating the .aiff file with madlld > ./madlld < This_land_is_your_land.mp2 |sox -r 44100 -t cdr - test.aiff > madlld: 256000 kb/s audio MPEG layer II stream without CRC, normal LR > stereo with no emphasis at 44100 Hz sample rate > madlld: end of input stream > madlld: 7299 frames decoded (3:10.667). > > Various toolame attempts > > ./madlld <This_land_is_your_land.mp2| toolame -t 2 -p 2 -v 10 -s 44.1 > -e -b 256 -W - out.mp2 > -------------------------------------------- > Input File : 'stdin' 44.1 kHz > Output File: 'out.mp2' > 256 kbps MPEG-1 Layer II stereo Psycho model=2 (Mode_Extension=0) > [De-emph:Off Copyright:No Original:No CRC:On] > [Padding:Off Byte-swap:Off Chanswap:Off DAB:Off] > VBR Enabled. Using MNR boost of 10.000000 > ATH adjustment 0.000000 > -------------------------------------------- > encode_init: using tablenum 1 with sblimit 30 > madlld: 256000 kb/s audio MPEG layer II stream without CRC, normal LR > stereo with no emphasis at 44100 Hz sample rate > absthr[][] sampling frequency index: 1 > madlld: end of input stream > madlld: 7299 frames decoded (3:10.667). > Hit end of audio data > VBR stats: > 32 48 56 64 80 96 112 128 160 192 224 256 320 384 > 0 0 0 0 0 0 0 0 0 52 116 67 7064 0 > Avg slots/frame = 1034.129; b/smp = 7.18; bitrate = 316.702 kbps > > Done > > toolame -b 256 test.aiff outMP2.mp2 > >>> Using Audio IFF sound file headers > Parsing AIFF audio file > >>> 44100.000000 Hz sampling frequency selected > -------------------------------------------- > Input File : 'test.aiff' 44.1 kHz > Output File: 'outMP2.mp2' > 256 kbps MPEG-1 Layer II j-stereo Psy model 1 > [De-emph:Off Copyright:No Original:No CRC:Off] > [Padding:Normal Byte-swap:Off Chanswap:Off DAB:Off] > ATH adjustment 0.000000 > -------------------------------------------- > encode_init: using tablenum 1 with sblimit 30 > [2200]] > Hit end of audio data > Avg slots/frame = 835.918; b/smp = 5.80; bitrate = 256.000 kbps > > Done > |
|
From: Fred G. <fr...@sa...> - 2004-07-30 21:43:43
|
On Friday 30 July 2004 16:19, you wrote: > Update, turns out after much banging of my head into a brick wall, I > finaly figured out that even though the test.aiff file sounded like it > was ok, other encoders produced the same noise after converting. Now > my question is simply what is the best way to convert *input* to PCM, > I may have Prophet Systems formated .wav files, .mp3, or .wav in pcm > format. Have you tried mpg321? Cheers! |-------------------------------------------------------------------------| | Frederick F. Gleason, Jr. | Director of Broadcast Software Development | | | Salem Radio Labs | |-------------------------------------------------------------------------| | All progress is based upon a universal innate desire of every organism | | to live beyond its income. | | -- Samuel Butler | | "Notebooks" | |-------------------------------------------------------------------------| |
|
From: Jesse S. <sc...@gm...> - 2004-07-31 02:32:17
|
I'm using madplayer which works great for BWF and raw MP2 encoding, but the mp3 encoding with lame is not working. I would imagine that it would be fairly easy to write both BWF and MP2 output at the same time as the frame data is the same. Is that assumption correct? On Fri, 30 Jul 2004 17:39:11 -0400, Fred Gleason <fr...@sa...> wrote: > On Friday 30 July 2004 16:19, you wrote: > > Update, turns out after much banging of my head into a brick wall, I > > finaly figured out that even though the test.aiff file sounded like it > > was ok, other encoders produced the same noise after converting. Now > > my question is simply what is the best way to convert *input* to PCM, > > I may have Prophet Systems formated .wav files, .mp3, or .wav in pcm > > format. > > Have you tried mpg321? > > Cheers! > > |-------------------------------------------------------------------------| > | Frederick F. Gleason, Jr. | Director of Broadcast Software Development | > | | Salem Radio Labs | > |-------------------------------------------------------------------------| > | All progress is based upon a universal innate desire of every organism | > | to live beyond its income. | > | -- Samuel Butler | > | "Notebooks" | > |-------------------------------------------------------------------------| > > |
|
From: Jesse S. <sc...@gm...> - 2004-07-30 19:39:46
|
To answer my own question, and scold myself, www.cartchunk.org has a nice little app called waveview that can view .wav file header information from prophet system's output. I found this in a thread in this very mailing list, imagine that!!!. I'm still slogging through to find info on parallel output, and mp2 input however. On Thu, 29 Jul 2004 17:50:47 -0400, Jesse Schoch <sc...@gm...> wrote: > Firstly, I have very little C programming experience, and very little > experience with audio. I do have a good background in java, *nix, and > perl, so please forgive me if these questions are obvious and please > let me know if there is a better forum in which to ask. > > I have a requirement to do some encoding from .wav file that is > encoded in a .wav format to several outputs: > .mp2 (mpeg audio layer 2 256Kbit/s CBR) > .wav (mpeg 2 same CBR and bitrate) > .mp3 (I can use lame for this). > > Xdelta shows that there is only a very small difference between the > .wav and .mp2 files, I assume only the frame headers. and the id3 tag > > The source file is from a proprietary format (Prophet Systems) which > has the .wav file, a ASCII .dat file containing track information, and > a binary .vid file. I have no clue what the .vid file is, and I'd > very much like to know. Our current process uses 3rd party software > that takes the .wav and serialy processes the different outputs. > > What I'd like to know is > > 1. How can I figure out what format the source file is. Is there a > header reader out there I can download and compile? I've read the > specs on the MPEG frame header, but I don't have much experience > dealing with binary file formats. > > 2. Can I process 1 frame of the input file and output the 3 different > format framse to my 3 output files in parallel (threaded). I realize > that this only saves me the overhead of the initial read but I'd have > to guess it would improve my transcoding time. > > Any help/feedback is appreciated > |