PDA

View Full Version : MPA Bitrate


GZZ
18th November 2004, 22:40
I'm parsing the mpa (mpeg) bitrate from a vob file...But I got a few questions...

1: Does DVD allow variable bitrate in mpa stream ?

2: Are mpa (mpeg-1) streams allways Layer 2 in the DVD specification ?


The reason I ask is because if the bitrate ALLWAYS are constant, then I just need to read the first frame in a mpa stream and don't have the calculate the next frame start...


GZZ

fccHandler
19th November 2004, 17:12
1. No
2. Yes

GZZ
29th November 2004, 18:29
I´m having some problem with my demuxed MPA stream. Its playing fine in Winamp and I change the bit, so CRC error are ON in the first frame. Then Scenarist don't complain about it. My problem is when its imported into scenarist it says my stream start length are 00:00:00;00 and if I compile are project with it, it don't play any sound...


Anyone know why ?


GZZ

fccHandler
1st December 2004, 02:02
I'm not sure I understand, because I don't have Scenarist. What exactly is it complaining about?

I can tell you this, though... You can't just toggle the crc bit and expect the resulting MPA to work. The crc bit is important to the decoding process. If you change it then you are corrupting the first frame, and (depending on the decoder) the rest of the audio stream may be unreadable too.

GZZ
1st December 2004, 17:00
I read somewhere on this forum that scenarist only check the first frame header of a mpa file and see if the CRC check bit are on or off...DVD spec. says it have to be ON, but in must mpa files from DVDs it set to off and then scenarist complains...So I have set it to ON in the first frame header and then scenarist import it...BUT:

When it is importet, you can press the audio file and see info like bitrate, channels and audio length. But the audio lenght are 00:00:00;00 which means scenarist can't work with it, because 00:00:00;00 says taht it 0 frame long, so if you compile it, you will only get video and NO sound...So something must go wrong in my demux code...

:/

GZZ

fccHandler
2nd December 2004, 02:00
Originally posted by GZZ
I read somewhere on this forum that scenarist only check the first frame header of a mpa file and see if the CRC check bit are on
Very likely.

DVD spec. says it have to be ON
Also very likely.

but in must mpa files from DVDs it set to off
That sounds very unlikely.

So something must go wrong in my demux code...
That should be easy to test. Try some other demuxing software (not your code), then see if that demuxed MPA has the CRC bit set.

GZZ
2nd December 2004, 08:03
That should be easy to test. Try some other demuxing software (not your code), then see if that demuxed MPA has the CRC bit set.

Been there, done that...I tested with the newest DVD2AVI (DGIndex) and If I import a mpa file demuxed with that program I get this error in scenarist:


Error DVD specification error.
Error CRC off error.
Info 0 file(s) accepted, 1 file(s) rejected


I also made a byte compare with the demux file from DVD2AVI and the one I got my self and they are 100% the same (if they ofcourse are demuxed from the same stream).


So as you can see, CRC are OFF in the org stream or else DGindex and my own code demux the stream, the wrong way. I used this site to read about mpeg1 (mpa files), you can read alot about the frame header and what byte represent information or not

http://www.dv.co.yu/mpgscript/mpeghdr.htm


You got any ide what could be wrong ?

GZZ

GZZ
2nd December 2004, 17:07
I found my Error. The total mpa time in ms have to be divided by 24 (frame length in ms)


So what I had to do, was cutting 12 ms around just after the frameheader, so the total time (in ms) divided 24 are a equel number


Like my time was 00:05:31.836 (331836 ms) = 13826,5 this number have be rounded up or down, so we have a equel number.

So I removed 12 frames (331836 - 12 = 331824 ms) div 24 = 13826 frames

then scenarist report the correct time and import it nicely...


don't know if I´m doing it the right way, but it sure does work.

GZZ

fccHandler
2nd December 2004, 19:53
Originally posted by fccHandler
You can't just toggle the crc bit and expect the resulting MPA to work.
I apologize, the above statement is wrong. I looked into it some more and found that the CRC bit doesn't affect the total frame size (though it does affect the decoding of that frame). So toggling the CRC bit on the first frame will not trash the resulting MPA. At worst, perhaps one or two frames at the beginning may sound bad. In fact, I tried it myself on an MP3 and I couldn't hear any difference, and no players complained. Sorry to have given you wrong information.

It's still strange that the demuxed MPA from your DVDs has no CRC. Isn't that a violation of the DVD spec?

Anyway, glad you got it working. :)

GZZ
2nd December 2004, 23:10
It's still strange that the demuxed MPA from your DVDs has no CRC. Isn't that a violation of the DVD spec?

I think its a violation, but 'maybe' the authoring program the studios use don't live up to the standard 100%...Just like 99% of all pal movies a interlaced according to the bit in the vob stream, even so they are actuelly true progressiv pal movies...But nevertheless scenarist live up to the standard in most cases.


GZZ