Homebrew [Q] How to take a screenshot (i.e, in the app code itself)?

LeifEricson

Coming Soon™
OP
Member
Joined
Jun 22, 2012
Messages
234
Trophies
0
Age
27
Location
New York, USA
Website
www.youtube.com
XP
534
Country
United States
I'm wondering how HANS manages to take screenshots of the game, like is there some way to do this in my own app?

I only ask because I'm looking into the plausibility of creating a "video" recorder -- one that simply takes frame by frame screenshots of the game which can then later be compiled into a video. This way, when the 3DS inevitably slows to a crawl, it wouldn't matter, because the app will simply be taking screenshots at its own pace.

Anyways, long story short just wanted to know if anyone knows how it's done yet.
 

TheCruel

Developer
Banned
Joined
Dec 6, 2013
Messages
1,350
Trophies
2
XP
3,130
Country
United States
It dumps the framebuffer to a file. It's in a raw (.bmp-like) file until you run the screenshot tool app that converts to png.

These raw images aren't compressed and SD card writing is slow. Recording would easily be around 3MB per second. Unless the game is very simple (not requiring much CPU), it not feasible to encode in real-time. Even then, I'm guessing the SD card writing would be the bottleneck.

I mean, I haven't used it, but doesn't HANS cause a momentary pause in the game when capturing screenshot? Now imagine doing that 30 times per second...
 

LeifEricson

Coming Soon™
OP
Member
Joined
Jun 22, 2012
Messages
234
Trophies
0
Age
27
Location
New York, USA
Website
www.youtube.com
XP
534
Country
United States
It dumps the framebuffer to a file. It's in a raw (.bmp-like) file until you run the screenshot tool app that converts to png.

These raw images aren't compressed and SD card writing is slow. Recording would easily be around 3MB per second. Unless the game is very simple (not requiring much CPU), it not feasible to encode in real-time. Even then, I'm guessing the SD card writing would be the bottleneck.

I mean, I haven't used it, but doesn't HANS cause a momentary pause in the game when capturing screenshot? Now imagine doing that 30 times per second...

Yes, HANS pauses to write a screenshot, and yes, real time gameplay would be impossible, but imagine having the ability to record Pokemon battle videos/Sm4sh replays without having to have a capture card installed. Dunno about you, but there are a couple great battles/replays that I wouldn't mind letting my 3DS record overnight for. In those types of situations, time is not important (well, to an extent, it's how long would you mind waiting for it).

Plus, even if it can't encode in real time, it could always just save the screenshots as screenshots and the encoding can be done on a PC.

Having these limitations in mind, do you think it would be possible?
 

TheCruel

Developer
Banned
Joined
Dec 6, 2013
Messages
1,350
Trophies
2
XP
3,130
Country
United States
Having these limitations in mind, do you think it would be possible?
Yeah, with several GBs available on SD card and a post-processing app to encode them into a video.

imo, it would likely be more trouble than it's worth, being so slow. And I can't think of a decent way to capture audio.
 

LeifEricson

Coming Soon™
OP
Member
Joined
Jun 22, 2012
Messages
234
Trophies
0
Age
27
Location
New York, USA
Website
www.youtube.com
XP
534
Country
United States
Yeah, with several GBs available on SD card and a post-processing app to encode them into a video.

imo, it would likely be more trouble than it's worth, being so slow. And I can't think of a decent way to capture audio.

I'll make a POC and see what I can make of it. One last thing, how would I go about "running" the game in the card slot? I've dabbled in homebrew, just nothing dealing with actual games.
 
  • Like
Reactions: Deleted-236924

TheCruel

Developer
Banned
Joined
Dec 6, 2013
Messages
1,350
Trophies
2
XP
3,130
Country
United States
I'll make a POC and see what I can make of it. One last thing, how would I go about "running" the game in the card slot? I've dabbled in homebrew, just nothing dealing with actual games.
I don't know anything about that, and HANS isn't yet open source. Perhaps look at the title launching software already made (FBI, SunShell, etc), but I'm not sure if the cart is different than running any other title (e.g. installed CIA).
 

thekarter104

Well-Known Member
Member
Joined
Mar 28, 2013
Messages
1,980
Trophies
1
XP
2,994
Country
United States
What about making it like, when you press X+Y for example, it will take screenshots in 30 FPS, but does not write to the SD card yet, but when you press HOME for example, it will write to the SD card. It will look like the 3DS is frozen, but ofcourse it's actually not because it writes to SD. Is that possible that way then?
 

Ermelber

Well-Known Member
Member
Joined
Sep 21, 2012
Messages
133
Trophies
1
Age
25
Location
Italy
Website
github.com
XP
299
Country
Italy
What about making it like, when you press X+Y for example, it will take screenshots in 30 FPS, but does not write to the SD card yet, but when you press HOME for example, it will write to the SD card. It will look like the 3DS is frozen, but ofcourse it's actually not because it writes to SD. Is that possible that way then?
You'd always have to save these 30 frames per second somewhere, that's why it'd be totally impossible.
 

LeifEricson

Coming Soon™
OP
Member
Joined
Jun 22, 2012
Messages
234
Trophies
0
Age
27
Location
New York, USA
Website
www.youtube.com
XP
534
Country
United States
My plan is to write it frame by frame. There's not enough ram to store large amounts of screenshots, especially with a game running. The lag will be pretty intense, but again this tool will be used for pre-recorded events such as battle videos or replays in Sm4sh. Audio might not be possible unless I could read from the buffer, but it seems unlikely.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: Why am I always late to the party?