View Full Version : OGMuxer detects SRT file as MP3
Pesho
13th October 2002, 15:08
There is a bug in OGMuxer, present at least in versions 0.9b6 and 1.0a2. It detects the type of the attached bg.srt file as MP3. This can be verified by the command "ogmuxer -p bg.srt"
P.S. I have renamed the attachment to bg.txt, otherwise the forum rejects it. This should have no impact, however.
P.P.S. I have also uploaded the problematic SRT file here: http://piettropro.tripod.com/temp/bg.srt
Suiryc
13th October 2002, 18:01
Just a question : what is the language of your OS ?
Your characters are not european ones (this is the reason OGMuxer find what it thought as the beginning of a MP3 stream, whereas it is just "normal" text).
I should be able to fix this by changing the order in which OGMuxer test the formats (i.e. by testing SRT format first).
PS : what version of OGMuxer do you use ?
Pesho
13th October 2002, 18:12
Originally posted by Suiryc
Just a question : what is the language of your OS ?
Your characters are not european ones (this is the reason OGMuxer find what it thought as the beginning of a MP3 stream, whereas it is just "normal" text).
The language of my OS is English, but the subtitles are for Bulgarian language. Therefore they contain cyrillic characters, not latin. But it is still European.
I should be able to fix this by changing the order in which OGMuxer test the formats (i.e. by testing SRT format first).
Yes, but anyway it's not correct that MP3Reader::probe_file() returns true for a SRT file.
PS : what version of OGMuxer do you use ?
Currently - version 1.0a2. It was the same with version 0.9a6, though (I already mentioned that).
Btw, thanks for the tools, made my life much easier :)
Suiryc
13th October 2002, 18:26
Originally posted by Pesho
Yes, but anyway it's not correct that MP3Reader::probe_file() returns true for a SRT file.
Well when you know it is a SRT file it's normal ;), but OGMuxer don't know that in advance. So it tests the file to see what it contains.
For MP3 and AC3 file I search the first audio frame (each frame starts with the same bytes : 0x0B77 for AC3), and verify the information that follow are correct (I verify bitrate, frequency, version numbers, ...). If information are correct OGMuxer assume it found the correct format.
This means of course there are two bad cases :
1. OGMuxer can think a file is of another format (it's your case)
2. OGMuxer can think a file is not of the format it is in reality (for exemple it found the correct bytes as if a new audio frame where to begin, but it is was not the beginning of an audio frame in reality).
Case 1 should be very rare, because there are few chances a file you use contains somehow correct headers for a MP3 or AC3 stream whereas it is not the case.
Case 2 should be very rare too, and generally happens when your audio file is corrupted and do not begin on a frame, but in the middle of a frame (in other words, some tools made a bad cutting on this stream).
Will see if I can improve a little the things (maybe let you specify the format of the file ... if I have time :) )
Pesho
13th October 2002, 18:37
Originally posted by Suiryc
...I search the first audio frame (each frame starts with the same bytes : 0x0B77 for AC3), and verify the information that follow are correct (I verify bitrate, frequency, version numbers, ...). If information are correct OGMuxer assume it found the correct format.
This means of course there are two bad cases :
1. OGMuxer can think a file is of another format (it's your case)...
I just tried playing my subtitles file in Winamp. Of course, it didn't play, but Winamp recognized it as a 16kbit, 22050Hz, Mono, 1200 frames, MPEG 2.0 Layer 3 file. So, nothing against your probe_file() routine :)
Will see if I can improve a little the things (maybe let you specify the format of the file ... if I have time :) )
That would be great. In the meantime, you could just reverse the order of probing for MP3 and SRT files, as you already suggested.
Suiryc
13th October 2002, 19:19
Originally posted by Pesho
That would be great. In the meantime, you could just reverse the order of probing for MP3 and SRT files, as you already suggested.
You will find OGMuxer v1.0a3 on my site :)
Please let me know if the subtitles are correctly shown when playing the resulting file (don't know how my tool will behave with the kind of characters your subtitle file contains).
Thanks :)
Pesho
13th October 2002, 21:21
It works. Muxing is successful and the subtitles are shown correctly. Thanks a lot :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.