Hi Dmitry I found what the problem is. Using my code and the example voice_recorder, there are 417 zero bytes at the beginning of the file before the header. Thus the software doesn't find the header. Snipping these off fixes the problem
Regards David Dmitry Borisov wrote: > Hi David, > Right now muxer object for most of the formats is not doing anything besides > simple muxing. There are simple headers created for mp3 but not with the > XING info or something. Just standard ID3 info. > For mp3 it is not required in oppose to the avi, asf or similar so I do not > understand why some progs are looking for the info in mp3 file... > Dmitry/ David Fraser wrote: > Hi > > I've been trying to use pymedia to generate MP3 files (for screencasting > with pyvnc2swf). > Unfortunately I can't get the example code to produce valid MP3 files. > pymedia itself can read them back, but they don't seem to have valid > headers. > MP2 files generated are fine. > > This is from looking at the files with mpginfo: > > [EMAIL PROTECTED] data]$ mpginfo test-pymedia-input.mp3 > Skipped 415 zeroes at start of file > mmm, this file does not start with a pack, offset: 415 > use the desperate_mode switch as the first option -X to search for a > header in the whole file! > if you want to force the operation. May yield to an endless loop if no > valid header is found! > Does not even begin with a 00 00 01 xx sequence! > > No success at all. > test-pymedia-input.mp3 is not a valid mpeg file > > Whereas .mp2 files work fine: > [EMAIL PROTECTED] data]$ mpginfo test-mp2-input.mp2 > test-mp2-input.mp2 > Audio : Mpeg 1 layer 2 > Estimated Duration: 16.67s > 128 kbps 44100 Hz > Frame size: 417 bytes > Mono, No emphasis, original > > Lame can then successfully recode the file (lame test-mp2-input.mp2 > test-mp2-input.mp3) and that gives a valid mp3 file: > [EMAIL PROTECTED] data]$ mpginfo test-mp2-input.mp3 > test-mp2-input.mp3 > Audio : Mpeg 1 layer 3 > Estimated Duration: 16.74s > 64 kbps 44100 Hz > Frame size: 208 bytes > Mono, No emphasis, original > > Lame can actually recover the mp3 file that pymedia produces in a > similar way (lame test-pymedia-input.mp3 recoded.mp3), and seems to add > header information > > I tried adding muxer encoding to the sample but it doesn't produce > anything on start() or end() > Attached is the record_sound program I am using (modified to use > threads, pick up keyboard interrupts, and do muxing). > This may be helpful as a sample anyway, but can anyone see what I am > doing wrong? Or is this a library error? > > I'm running on Fedora Core 4 with the following versions: > python-2.4.1-2 > pymedia-1.3.5.0-1 (built from source) > lame-3.96.1-2.2.fc4 > > Any help appreciated > > Regards > David > _______________________________________________ Pymedia-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pymedia-users
