Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Problem detecting MP2/MP1 with variable bit rate (Read 13890 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Problem detecting MP2/MP1 with variable bit rate

Greetings!

I was wondering how to check if an MP2 file is VBR or CBR. MP3s have that Xing or VBRI tag which is used to hold some enhanced information and to tell the decoder that the played file is VBR.
The only way I can think of doing that would be to scan the frames of an MP2 file until I detect a bitrate change in the frame's header, but that could take a long time if the MP2 is big and CBR (as the program will go through all frames hoping to find a different bitrate).

Thank you in advance!

PS: I know that MP2 files can be VBR, but what about MP1?

Problem detecting MP2/MP1 with variable bit rate

Reply #1
Quote
MP3s have that Xing or VBRI tag which is used to hold some enhanced information and to tell the decoder that the played file is VBR.
Not always, this tags are not needed and are not in the specs. But many players assume it´s CBR if this tag is not present and show the length not correctly.
Quote
The only way I can think of doing that would be to scan the frames of an MP2 file until I detect a bitrate change in the frame's header, but that could take a long time if the MP2 is big and CBR (as the program will go through all frames hoping to find a different bitrate).
Yes, this is the only way, but it shouldn´t take that long, you open a file, scan first bitrate, calculate next header position, jump there and scan it... For a normal file (~5MB) it should take not more than a second I think. Also you don´t need to scan all frames, if you don´t find a bitrate change in the first 100 frames, it´s most likely CBR (except there is a lot of digital silence at the beginning).
Quote
PS: I know that MP2 files can be VBR, but what about MP1?

Theoretically it could be possible, but if there is any mpeg-layer1 encoder able to encode VBR, I don´t know. I know mp2 decoders don´t need to support VBR, but it is allowed, but I don´t know for layer1, but most likely decoders don´t need to support it.

Problem detecting MP2/MP1 with variable bit rate

Reply #2
OK, thanks for the information. :-)

One more thing: Do you know how to detect a MP3pro file? Someone told me that I have to look at the ancillary data, but I don't know how to do that. Isn't there an easier way of doing that?

Problem detecting MP2/MP1 with variable bit rate

Reply #3
Quote
One more thing: Do you know how to detect a MP3pro file? Someone told me that I have to look at the ancillary data, but I don't know how to do that. Isn't there an easier way of doing that?

No, I don´t think so. Because ATM the matroska team has the same problem, how to detect HE-AAC (AAC+SBR). There is no easy way to detect it, too.

Problem detecting MP2/MP1 with variable bit rate

Reply #4
Hi,
  I know this thread is ancient but I wondered if anyone had source code of the MP1 video codec. Ideally the VBR version but right now, ANY would be a big help.

With thanks,
Sean
Thanks for the help!

Problem detecting MP2/MP1 with variable bit rate

Reply #5
Just check out ffmpeg sources?
"I hear it when I see it."

Problem detecting MP2/MP1 with variable bit rate

Reply #6
I know this thread is ancient but I wondered if anyone had source code of the MP1 video codec. Ideally the VBR version but right now, ANY would be a big help.


Are you still looking for information on video decoding on the SA-1110?  If so, you might be interested in the Rockbox mpegplayer plugin:

http://www.rockbox.org/wiki/PluginMpegplayer

It is heavily optimized for ARM processors and does mpeg audio/video decoder at about 24 fps for an ARM9 core, which is fairly similar to your strongarm processor.  You can find the source here:

http://git.rockbox.org/?p=rockbox.git;a=tr...560fc37;hb=HEAD