Welcome
Ladies and Gents:

These forums are now closed and registration disabled.

Please join us at our new forum on Proboards. Our hope is that these new forums are more stable, provide more and better features, and allow continuation of the project forums in a safer, more secure, long term environment.

me3explorer.proboards.com

--The ME3Explorer Team

CR: Manipulating bink video and voice timing

Semi-technical area to discuss content modding research and discoveries. Technical information necessary for coding tools should be posted in Technical Research on the Coders board.

CR: Manipulating bink video and voice timing

Postby The Fob » 10 Oct 2012, 05:29

Hi there, I just wanted to quickly post what I found out about bink video timing and control in the last 2 days while mucking around with the ME3 files. I hope this is the right section for this.

The length of any bink video that is played in game is stored within it's corresponding .pcc file. It is an "InterpData" object, that you are looking for. Unfortunately, the names don't always match up between the actual bik files and the InterpData objects. Therefore, I usually look up the length of the movie I want to replace, then go through all the InterpData objects and see which one matches most closely in length (there is probably a better way to do this but haven"t fount it yet and this is very reliable). If you have several candidates, you might also want to search for SFXInterpTrackmovieBink objects and have a look at the property m_SoundEvent and see if the name of the sound file makes sense for your video. In any case, it should be really easy to find the correct InterpDataObject.
Note down the original InterpLength property value and then simply overwrite it with the proper length for the video you want to import (as a float).
Ok, now you'll have to check if there are other objects that determine the length of this scene in the script. ME3 is a bit inconsistent here, some movies don't have an additional object (in which case you are done by now) but most have an SFXSceneGroup object, that also stores the exact same length as the InterpData object. I even found some very rare cases where the length was also stored in various other objects. Your safest bet is to load the whole .pcc up in HEX editor and search for the proper value throughout the file. Check if it in fact is an InterpLength property value, associated with your movie and if so, replace it with your new one.

And that's it, oh, don't forget to update you PCConsoleTOC.bin for the longer movie files.
And one more thing, if you want to get rid of all the sound that is playing during movies (e.g. if you want to use your own sound that is within the .bik, check the m_SoundEvent property in the SFXInterpTrackMovieBink file. It should be something like Play_XYZ. Now look toward the end of you .pcc file and you will find a couple of Wwise objects. There should be one that is named Wwise_CHAPTER.XYZ_wav (CHAPTER being some abbreviation for which section you are in in ME3, should be similar to the name of you .pcc file). That object stores the location of the sound file. The Filename is stored in the property Filename (big surprise) and the correct offset is stored in the last 4 bytes of the object. Alternatively, use the Asset Explorer to replace the sound with silence.
Music: Check the Wwise objects for something like Wwise_CHAPTER_Streaming.ZYX_wav where ZYX should be name that somehow relates to your movie (most times it is cineanim_ and then the same name as your sound file). In very rare instances, the music is triggered directly in matinee, which means you will not find a Wwise object for it. In that case, you just have to find it manually. BioSnd_*.pcc files are always a good place to look. Once you found it, use the same method as with the ambient sound.
Dialogue: If there is dialogue in your bink video that you want to get rid of, you'll find the Sound objects in the corresponding Loc_INT.pcc files. Use the same procedure as above.

Ok, hope that helps. This method is rather crude but it can lead to some rather spectacular results if I may say so myself.
You can see examples here and here
Cheers!

The Fob has been thanked by:
User avatar
The Fob
Modder
 
Posts: 702
Joined: 08 Oct 2012, 04:37
Has thanked: 242 time
Have thanks: 212 time

Re: Manipulating bink video and voice timing

Postby The Fob » 10 Oct 2012, 05:43

Ok, dialogue and sound durations. This is still very much ongoing and I am afraid I only have very preliminary and largely untested results but I'll have a go at it anyway.
Dialogue and sounds usually have two objects associated with them:
The first is a Wwise stream object (like the ones I had you modify in the post above): This stores the actual information, where to find the sound (which file and which offset in that file) as well as the data size of that sound (i.e. wwise knose how many bytes to read in that file). It should match up with the data size in the RIFF header of your sound file within the .afc.
The file name is in the property Filename (yeah, there I go again, I know :)).
The offset is stored in the last 4 bytes of the object
The data size is stored twice (as int32s) right before the offset.

The second is a WwiseSoundEvent, which is usually called Play_XYZ. This object stores the duration of the sound in the game (as a float in milliseconds) in the property DurationMilliseconds. If you cange that, you can play a longer sound file but I haven't tested yet what happens if it collides with another SoundEvent. Also, obviously, if you do that to dialogue, you'll screw up the synch one way or another.
It seems that for dialogue sounds, it doesn't really matter if the data size and the duration match up but for some reason, for music and ambient streams it seems to matter (most of the time) and if you they don't match, no sound/music will play in game. I haven't figured that part out yet. Maybe there is yet another object that is referenced somehow (like the SFXSceneGroups for scenes).

Anyway, that's as far as I've gotten for now. I hope it is helpful to some of you out there.

The Fob has been thanked by:
User avatar
The Fob
Modder
 
Posts: 702
Joined: 08 Oct 2012, 04:37
Has thanked: 242 time
Have thanks: 212 time

Re: CR: Manipulating bink video and voice timing

Postby user2929 » 05 Jan 2013, 04:29

Hey, Fob!, Please, make a mod or tutorial For Shortening "Mass Relay loading" movie or creating a 1 second loop while loading. I am tired of watching one movie every time i need to travel to system. Honestly, only because I cant skip it with console commands to save time.
user2929 - one man army against legion of console commands. Windows XP 32bit SP3
User avatar
user2929
User
 
Posts: 127
Joined: 25 Aug 2012, 18:10
Has thanked: 27 time
Have thanks: 26 time

Re: CR: Manipulating bink video and voice timing

Postby The Fob » 09 Jan 2013, 12:01

I'll try it when I am back with my equipment in February. Shouldn't be too difficult as soon as we find the pcc file where the vid is referenced. If anyone already knows that, please post, it would give us a head start.
User avatar
The Fob
Modder
 
Posts: 702
Joined: 08 Oct 2012, 04:37
Has thanked: 242 time
Have thanks: 212 time

Re: CR: Manipulating bink video and voice timing

Postby user2929 » 09 Jan 2013, 13:46

Thanks, Ill look for pcc file.

try this
GameFramework.pcc
GameTypes.LOADING_MOVIE
user2929 - one man army against legion of console commands. Windows XP 32bit SP3
User avatar
user2929
User
 
Posts: 127
Joined: 25 Aug 2012, 18:10
Has thanked: 27 time
Have thanks: 26 time

Re: CR: Manipulating bink video and voice timing

Postby Mimi » 23 Jan 2013, 23:51

Hi all!

I did find a SFXSceneGroup object for the movie I want to replace. But no InterpData object with the same value :(
It says 66,41333 for the length property.

Changed it to 120 (I guess it's seconds?), the movie played but doesn't stop.

Any idea on this?

Thank youuuuu

EDIT> oh, I bet it's because it's the wrong format. I just tried with 80 ssometing and it worked...
Mmmmh, anything I should know about how you input length?
Thank uuuu
User avatar
Mimi
Modder
 
Posts: 69
Joined: 11 Dec 2012, 19:05
Has thanked: 28 time
Have thanks: 3 time

Re: CR: Manipulating bink video and voice timing

Postby The Fob » 24 Jan 2013, 09:27

The format for any length should be a floating point variable. Here is an online float2hex and back converter:
http://gregstoll.dyndns.org/~gregstoll/floattohex/
I'd try and get it as close to the original length as possible. Maybe substract a frame ro two to prevent weird glitches at the end. Good luck!

The Fob has been thanked by:
User avatar
The Fob
Modder
 
Posts: 702
Joined: 08 Oct 2012, 04:37
Has thanked: 242 time
Have thanks: 212 time

Re: CR: Manipulating bink video and voice timing

Postby Mimi » 24 Jan 2013, 10:07

The Fob wrote:The format for any length should be a floating point variable. Here is an online float2hex and back converter:
http://gregstoll.dyndns.org/~gregstoll/floattohex/
I'd try and get it as close to the original length as possible. Maybe substract a frame ro two to prevent weird glitches at the end. Good luck!


Hey thanks for the help!!

I'd try and get it as close to the original length as possible.


Mmmmh, sorry, not sure I understood there?
Do you mean it's safer not to make movies much longer than the original ones??

Also... no idea what a floating point variable is :D
But I'll try to figure it out...
User avatar
Mimi
Modder
 
Posts: 69
Joined: 11 Dec 2012, 19:05
Has thanked: 28 time
Have thanks: 3 time

Re: CR: Manipulating bink video and voice timing

Postby The Fob » 24 Jan 2013, 10:40

Nono, you can make your videos as long as you want, just when you adjust the length in the files (like described in the OP), try to fit the new number to the length of your new video as close as possible.
For example:
Original video in the game: length: 66,41333 s
You self made video length: 120.3453 s
the number you might want to put into the length variable in the SFXSceneGroup object: 120.3153 (or similar
That way, the game will cancel the video 0.03 seconds before the video finishes (0.03 s is about the length of 1 frame).
It's just because when I tried it, if I put in the exact length, sometimes I get a graphical glitch of a fraction of a second once the video finishes. This way you ensure that it fits in smoothly.

Also, floating point number are just a different format of numbers.
For example f you convert the integer number 120.0 to a HEX value it'll be 00 00 00 78 (little endian)
if you convert the floating point number 120.0 to HEX it'll be 00 00 0f 42
So just be sure you always use the right format.

Oh and one more thing, If you want to import sound together with you video, it s important that you get the sampling frquency right when you convert your video to a .bik file with rad tools. Check the audio conversion settings at the bottom of the settings window before converting. IIRC ME#s audio engine uses a sampling rate of 48kHz so you want to use the same samplng frequency for you video. Otherwise you'll get bad audio quality in the game (like you can hear in my irst trials which are linked in the OP.

The Fob has been thanked by:
User avatar
The Fob
Modder
 
Posts: 702
Joined: 08 Oct 2012, 04:37
Has thanked: 242 time
Have thanks: 212 time

Re: CR: Manipulating bink video and voice timing

Postby Mimi » 24 Jan 2013, 11:01

Hey thanks so much!

Thanks for the sound tip too, still trying to figure out how to properly render in Vegas :P

Mmmmh, currently, the length is well accepted even though I changed it only in one object.
The movie I'm trying to replace is LondonOutro in pre-EC files.

I think the problem is that it's the last vid of the last sequence in that RED.pcc, after that, we switch to Epilogue.pcc.

So for instance, the whole sequence starts when you shoot the tube, the music triggers, and then we have several animations, bik, animation, bik, animation, bik, bik, bik.

So probably, the length I need to find and change is rather the length of the whole sequence, not only LondonOutro.

Because currrently, the new vid plays and stops exactly where I want it to stop, but then the game stays forever on a black screen, it doesn't switch to the next sequence (first sequence of epilogue.pcc, i.e. Jungle Planet). What do you say, did you experience something of the kind?
User avatar
Mimi
Modder
 
Posts: 69
Joined: 11 Dec 2012, 19:05
Has thanked: 28 time
Have thanks: 3 time

Next

Return to Modders' Research

Who is online

Users browsing this forum: No registered users and 1 guest

suspicion-preferred