View previous topic :: View next topic |
Author |
Message |
LocalH
Joined: 30 Oct 2006 Posts: 1400 Location: MiloHax
|
Posted: Sun Apr 06, 2008 6:59 am Post subject: PSS file information |
|
|
Ok, I've been doing some reading around. Apparently people are under the impression that PSS files are some weird, funky format - they're not. PSS files are standard MPEG-2 Program streams, but since the audio is not standard MPEG-2 Layer II audio it's generally stored in a Private Stream. My main goal with this is to find a way to make a sort of "ripkit" that is legal and mostly used for custom purposes - if we can find a muxer that allows arbitrary data in a private stream, I can determine the length of all the song videos, make extremely low bitrate M2Vs of the same lengths using nothing but a black screen, and put together a guide explaining how to demux the videos and remux using my M2Vs. Then, once we rebuild the ARK we'll likely be well under the single-layer capacity limit.
I found a commandline program called bbdmux which can (de)mux MPEG-2 program streams (another term for "System" stream, which is the terminology TMPGEnc uses):
Code: | C:\Documents and Settings\LocalH\My Documents\rockband\ark\Ark File Contents\songs\missqueen>bbdmux missqueen.pss
bbDMUX - version 1.9, by Brent Beyeler (beyeler@home.com)
speed increases by, Apachez and Christian Vogelgsang
Scanning for stream id's, press control-c to quit ...
File missqueen.pss is an MPEG-2 Program Stream
Found stream id 0xE0 = Video Stream 0
Found stream id 0xBD = Private Stream 1
Found stream id 0xBE = Padding Stream
Summary:
MPEG Packs = 4344
System headers = 2
Private Stream 1 packets = 6384, total bytes = 26004688
Padding Stream packets = 3, total bytes = 6816
Video stream 0 packets = 10991, total bytes = 44769603
|
Going to see what results I get from actually demuxing it (this was just to get info and see that it would demux a PSS file).
Edit2: Ok, I was able to demux it, however the "Private Stream" as bbdmux output it contained some extra bytes as compared to the VGS I got by using PSS Demux - around every $1000 bytes (slightly less, between $FCC and $FE9), the bytes FF900001 are present. I don't know how this will affect anything ATM but it may mean more work is needed before remuxing is possible with anything other than VGS files demuxed using bbdmux. I am now going to take the demuxed files from bbdmux and remux them using bbMPEG, then compare the generated file to the original PSS.
Scratch that, it appears that I had forgotten bbMPEG was an encoder and not a multiplexer. Off to find an MPEG-2 muxer now...
Edit3: Damnit, I can't find one that can handle arbitrary data in a private stream. I found one called mplex.exe but it puked when it found that the VGS was not a standard audio format...
Edit4: Shit, it's been so long since I used bbMPEG that I forgot that it CAN multiplex, now to see if it can mux arbitrary data as a private stream. ... Fuck, when I try to open the dialog to load the M2V and VGS files bbMPEG just disappears, no error or anything. Back to the drawing board. _________________
|
|
Back to top |
|
|
pksage
Joined: 20 Dec 2006 Posts: 890 Location: Midwest, USA
|
Posted: Sun Apr 06, 2008 4:18 pm Post subject: |
|
|
Re: getting it down to single-layer capacity - if you manage to get it going but can't compress things down to that size, can we get a release anyway? I say this because I'm fairly sure HDLoader and similar solutions are able to boot dual-layers. |
|
Back to top |
|
|
LocalH
Joined: 30 Oct 2006 Posts: 1400 Location: MiloHax
|
Posted: Sun Apr 06, 2008 4:31 pm Post subject: |
|
|
Yeah, but I'm thinking we'll easily be able to get it down to single-layer - the existing ripkit uses 900kbps (I think) and deleted a bunch of videos including the intro, I'll be removing the extras but not the intro, and with solid black I should be able to go way below 900kbps. _________________
|
|
Back to top |
|
|
xorloser
Joined: 06 Mar 2008 Posts: 68
|
Posted: Sun Apr 06, 2008 11:47 pm Post subject: |
|
|
The pss files contain encrypted vgs files. I am still looking into it but i assume that since they are encrypted, they will not get parsed correctly by tools such as a demuxer.
I am also assuming that the pss files just contain audio and not video, although since i have never played ps2 rockband I cannot say for sure. Is there any streaming video shown when playing songs on ps2 rockband? or is it just like the other games where you have streaming music and band members playing on a stage? |
|
Back to top |
|
|
kevnin
Joined: 14 Jul 2007 Posts: 511 Location: 202 / 904 on occasion
|
Posted: Mon Apr 07, 2008 12:34 am Post subject: |
|
|
yes, it is all streaming video.
it does not work the same way as xbox360 or ps3 where the background on the track is rendered in real time - they are pre-recorded videos from the ps3/xbox version of the game. |
|
Back to top |
|
|
xorloser
Joined: 06 Mar 2008 Posts: 68
|
Posted: Mon Apr 07, 2008 1:12 pm Post subject: |
|
|
I had a play with the pss files since i need to be able to access the audio part of them in order to decrypt it. Here is the little tool I made as a test while working out their format.
Staff Edit: Removed. Read more here.
This will demux a pss file from ps2 rockband into its video and audio parts. The video part plays for me in windows media player, and the vgs looks like the other encrypted vgs files in the ark.
Source is included so you can see what its doing and alter it to play with it yourself. |
|
Back to top |
|
|
LocalH
Joined: 30 Oct 2006 Posts: 1400 Location: MiloHax
|
Posted: Mon Apr 07, 2008 6:04 pm Post subject: |
|
|
Couldn't whip up a quick muxer could you? I want to see how low the video's bitrate can go in terms of the PS2 hardware, and so I don't really need to parse the VGS at the moment, but I do need to be able to mux it with video of my choosing. _________________
|
|
Back to top |
|
|
xorloser
Joined: 06 Mar 2008 Posts: 68
|
Posted: Mon Apr 07, 2008 11:15 pm Post subject: |
|
|
a muxer requires working out more info such as the time offsets in each header, i dont know at this stage what they mean since for my purposes (decrypting the audio) i only need to be able to to work out where the audio is, which is what wriiting the demuxer helped me work out.
and btw these vgs files are indeed encrypted. from what i can see it would appear that the ps2 version of rockband supports v3 and v4 vgs files (hopefully in addition to normal unencypted v2 ones). encryption starts at offset 0x80 in the file. encryption has to be after the initial header since it needs to know what the vgs vesrion number is to know what decryption algorithm to use.
v3 vgs uses the same encryption algo as on xbox360 rockband (with a different key), v4 vgs uses a totally different but simpler algo that is on ps2 only. my guess is that the ps2 does not handle well the overhead that the v3 encryption requires to decrypt on the fly. |
|
Back to top |
|
|
kevnin
Joined: 14 Jul 2007 Posts: 511 Location: 202 / 904 on occasion
|
Posted: Tue Apr 08, 2008 12:20 am Post subject: |
|
|
and am i correct to assume that you have figured out the algorithms and therefore have decrypted both types?
you're the greatest. |
|
Back to top |
|
|
LocalH
Joined: 30 Oct 2006 Posts: 1400 Location: MiloHax
|
Posted: Tue Apr 08, 2008 6:23 am Post subject: |
|
|
xorloser wrote: | a muxer requires working out more info such as the time offsets in each header, i dont know at this stage what they mean since for my purposes (decrypting the audio) i only need to be able to to work out where the audio is, which is what wriiting the demuxer helped me work out. |
The PSS files are standard MPEG-2 program streams, although when I used an MPEG-2 demuxer (bbdmux, from bbtools) on one of them (missqueen.pss) it gave me a file that was a little bigger than what both PSS Demux and your tool gave me. In front of each private stream packet, the demuxer kept FF900001 which I'm thinking is something that's part of Sony's specific implementation, as it's obviously not part of the real payload as far as we're concerned (and PSS Demux, which is five years old, doesn't include this data in the demuxed payload). Any ideas on that? I've not tried looking at "standard" PSS files using PCM or VAG so I don't know if they also have extra data in the payload.
As for muxing, as I said the VGS is a standard private stream in terms of the PES header for each packet (except for that extra long after the normal PES header), so perhaps that might help you in developing a muxer. In the files I've looked at so far each of the VGS's packet payloads seemed to be just under 4k in size - I'm not so sure the exact size matters as long as the PES headers are written properly (other than making sure there isn't too much video or audio data to be read before the drive gets to the next packet), but I can't vouch for that as I myself am just learning about MPEG-2 program stream internals in trying to work with this stuff. For your reference, here is information on what a PES header contains.
Also, just out of curiousity - in the VGS files, is the entire payload encrypted as a unit, or is each VAG encrypted separately and then muxed into the VGS? Or do you know that yet? _________________
|
|
Back to top |
|
|
GameZelda
Joined: 30 Mar 2007 Posts: 1705
|
Posted: Tue Apr 08, 2008 3:56 pm Post subject: |
|
|
LocalH wrote: | Also, just out of curiousity - in the VGS files, is the entire payload encrypted as a unit, or is each VAG encrypted separately and then muxed into the VGS? Or do you know that yet? |
VGS files are not multiple VAG files. The only thing that they share is that they have the audio in XA ADPCM (Sony audio format). But VGS is not a container of VAG, it's a container of XA ADPCM samples. _________________
(Ok, I failed to do it in 24 hours... ).
GH:WT-PS2 Customization Progress
[ 100%] Make it work (w/songs loading) in a DVD5 (thanks psychospacefish!)
[ 100%] Modify audio (Finally done 25/11/2008)
[ 100%] Modify charts (Done 26/11/2008! Customs finally ) |
|
Back to top |
|
|
xorloser
Joined: 06 Mar 2008 Posts: 68
|
Posted: Wed Apr 09, 2008 6:48 am Post subject: |
|
|
not that it really matters but...
internally the game refers to vgs files as having vag content, so my guess is vgs stands for "vags".
also encryption over vgs files is over the file contents as a whole, not individual tracks/channels. |
|
Back to top |
|
|
LocalH
Joined: 30 Oct 2006 Posts: 1400 Location: MiloHax
|
Posted: Wed Apr 09, 2008 8:14 am Post subject: |
|
|
GameZelda wrote: | LocalH wrote: | Also, just out of curiousity - in the VGS files, is the entire payload encrypted as a unit, or is each VAG encrypted separately and then muxed into the VGS? Or do you know that yet? |
VGS files are not multiple VAG files. The only thing that they share is that they have the audio in XA ADPCM (Sony audio format). But VGS is not a container of VAG, it's a container of XA ADPCM samples. |
What I meant by that was that each stream is the same type of data that you'd see in a VAG file (and in fact I'm certain you can take each channel, extract it, and turn it directly into a VAG file, but I'm not sure if you'd have to add a header or not as I don't know any other details of the VAG format), just interleaved so that the system can read all channels without having to seek back and forth in the file. _________________
|
|
Back to top |
|
|
xorloser
Joined: 06 Mar 2008 Posts: 68
|
|
Back to top |
|
|
kevnin
Joined: 14 Jul 2007 Posts: 511 Location: 202 / 904 on occasion
|
Posted: Wed Apr 09, 2008 11:50 pm Post subject: |
|
|
so, wait.
this new version of arktool does not include a muxer, and therefore doesn't quite allow for insertion of custom songs for ps2?
poop. |
|
Back to top |
|
|
|