Post subject: BizHawk Source: Extract Visuals and Audio
Joined: 10/23/2017
Posts: 3
Greetings! I'm looking to extract the visuals and audio of BizHawk at every frame of a game for an A.I. project. I'm currently working code directly into BizHawk's source because the built-in Lua isn't flexible enough, to avoid taking screenshots, and to inject controller inputs back in. Unfortunately, I'm not familiar enough with application design to understand the flow of data. Can anyone familiar with the source material suggest the locations of the final visual and audio buffers at each frame (assuming they exist)? Thanks in advance.
Post subject: Re: BizHawk Source: Extract Visuals and Audio
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
Look at the movie recording code?
Site Admin, Skilled player (1254)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
creaothceann meant to say avi dumping code I think, which is what you should check.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Joined: 10/23/2017
Posts: 3
I probably should have been a little more specific. I'm performing calculations on this information on a per-frame basis and will use it to decide what actions to perform on the next frame. In other words, I'm not trying to take a video of a script I've already made, I'm trying to use the current frame to automatically generate a script. I'm writing it directly into the source to avoid taking thousands of one-frame videos, which could be extremely inefficient. My goal is to take the information straight from memory.
Site Admin, Skilled player (1254)
Joined: 4/17/2010
Posts: 11475
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
The answer does apply. AVI writer is where you find which buffer you need to grab. It's at native res by default. You can hash the contents of the buffer and store the hashes, then only compare them instead of the whole framebuffer.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Joined: 10/23/2017
Posts: 3
I saw. I misread the post. I couldn't delete it before you replied =). I'll look into it, thanks.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
feos wrote:
creaothceann meant to say avi dumping code I think
Yeah.