Air to perform window recording as in OBS

Hello fellow coders,
I need to add a functionality to an Air App that lets me display the window content of some app (Windows) within the Air app, only what the window is showing. Is there another way than to do it with NativeProcess/FFMPEG? Some shortcut? Maybe someone already had a similar task and can help.

Thanks in advance.

1 Like

hello, maybe give some more details ?

is it on the same machine?
on which desktop you try to do that? Windows? macOS? both?

now, that said, OBS is open source and so you can look at how they do it
github.com/obsproject/obs-studio/tree/master/plugins/win-capture
github.com/obsproject/obs-studio/tree/master/plugins/mac-capture

that would be quite a heavy/hard ANE to produce

but then the problem is you say “I want to do like OBS”
and so I’m asking “are you sure you need the capturing/streaming like OBS?”

capturing (as a bitmap screenshot) the content of a specific window or screen rectangle, or even dealing with multiple monitors and other virtual desktops, just that, is already quite some work, but if you need the “video stream capture” then that become something much bigger

not impossible but not something you can YOLO over a a couple of week-ends

I don’t see some shortcuts to do that but again I’m not completely sure of what you’re trying to do
so there in the spirit of building software with ActionScript and AIR I would advice: have you a functional spec of what kind of features you need ?

thanks for your reply zwetan,
i need the air app to render the content of another window on the desktop, e.g. the browser or some other app. not the sound from that source, just the display data. it is exactly the same functionality as in OBS when you add a source and select it as “window recording”. i dont need any of the streaming functionality to some streaming app, e.g. twitch/youtube… i just want to show what is happening in the specified window like i would show a video in the air app. i hope this is clear enough?

cheers,
kai

so a window recording is that: a video stream
look at the sources in OBS, that’s the level of support you would have to implement in an ANE

if you target only Windows 10 you might get away with something “simpler”
see New Ways to do Screen Capture

but still, you will have to generate a video stream of the recorded rectangle,
and so generate a format that AIR can understand (MP4 for ex)

see for ex How to convert captured bitmaps to video stream or file?

and after that you read this video stream the same way you would display a video in AIR