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
26
Location
New York, USA
Website
www.youtube.com
XP
499
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
1
XP
3,117
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
26
Location
New York, USA
Website
www.youtube.com
XP
499
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
1
XP
3,117
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
26
Location
New York, USA
Website
www.youtube.com
XP
499
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
1
XP
3,117
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,933
Trophies
1
XP
2,653
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
24
Location
Como, Lombardia
Website
github.com
XP
288
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
26
Location
New York, USA
Website
www.youtube.com
XP
499
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.
 
General chit-chat
Help Users
  • K3N1 @ K3N1:
    Ask @x65943 he's trained for that stuff
  • JuanMena @ JuanMena:
    Kissing random dudes choking in celery? Really? Need to study for that?
  • K3N1 @ K3N1:
    Yes it requires a degree
  • K3N1 @ K3N1:
    I could also yank out the rest of my teeth but theirs professionals for that
  • x65943 @ x65943:
    If your throat closes, putting oxygen in your mouth will not solve anything - as you will be introducing oxygen prior to the area of obstruction
  • JuanMena @ JuanMena:
    Just kiss me Kyle.
  • x65943 @ x65943:
    You either need to be intubated to bypass obstruction or create a stoma inferior to the the area of obstruction to survive
  • x65943 @ x65943:
    "Just kiss me Kyle." And I thought all the godreborn gay stuff was a smear campaign
  • JuanMena @ JuanMena:
    If I die, tell my momma I won't be carrying Baby Jesus this christmas :sad::cry:
  • K3N1 @ K3N1:
    Smear campaigns are in The political section now?
  • JuanMena @ JuanMena:
    Chary! Chary! Chary, Chary, Chary!
  • Sonic Angel Knight @ Sonic Angel Knight:
    Pork Provolone :P
  • Psionic Roshambo @ Psionic Roshambo:
    Sounds yummy
  • K3N1 @ K3N1:
    Sweet found my Wii u PSU right after I ordered a new one :tpi:
  • JuanMena @ JuanMena:
    It was waiting for you to order another one.
    Seems like, your PSU was waiting for a partner.
  • JuanMena @ JuanMena:
    Keep them both
    separated or you'll have more PSUs each year.
  • K3N1 @ K3N1:
    Well one you insert one PSU into the other one you get power
  • JuanMena @ JuanMena:
    It literally turns it on.
  • K3N1 @ K3N1:
    Yeah power supplies are filthy perverts
  • K3N1 @ K3N1:
    @Psionic Roshambo has a new friend
    +1
  • JuanMena @ JuanMena:
    It's Kyle, the guy that went to school to be a Certified man Kisser.
  • Psionic Roshambo @ Psionic Roshambo:
    Cartmans hand has taco flavored kisses
  • A @ abraarukuk:
    hi guys
    I @ Iron_Masuku: Hello