Best Language for cross-platform screen recording and streaming? - windows

So I'm looking to build an application that will be able to record the users screen and stream it at the same time. I would like the application to run on both Windows and OSX. I don't have a high level of programming experience in any language, just basic understanding in C, C++, JS, (funny how each class you take in college wants a different language). I'm also pretty well versed in HTML and CSS but that is kind of irrelevant for this topic.
I've been looking around and it looks like the best solution is going to be writing the core of the program in one language, and then developing the Interface side for each platform differently, using appropriate languages and bindings for the different platforms (Objective-C and Cocoa for OSX and so forth).
I'm open to all suggestions, this project doesn't have a deadline or anything, I'm really just intending it as a learning experience. I've never done anything with video capture and streaming before, so I'm looking for suggestions as to which road to go down language-wise for this project.
Thanks in advance :)

the simplest solution that comes to my mind is to use VLC.
this is obviously not a "language" but an application, but it supports screen-capture and streaming on all of your target platforms (and more).
if this is not an option (e.g. because you don't want a separate application), you could use VLC's C-api for acquiring screen capture and use whatever you like for streaming.
if you want to only rely on native functionality, i would use C/C++ for the application and write the OSX part in ObjC/ObjC++ and Cocoa.

Related

Is there a way to create a GUI in Lua?

I am working on a Genetic Algorithm solution to TSP in Lua, and have reached a point where I need a better method of troubleshooting and checking results. The best way to do this would be with a GUI, but I can't seem to find anything about GUIs in Lua.
I've done some searching around Google, and haven't found anything built in to the language. I have found Toolkits such as the one found here:
http://lua-users.org/wiki/GraphicalUserInterfaceToolkits
However, I am new enough to Lua that I do not know how to properly use these. Any help on the matter would be greatly appreciated.
A few ideas:
But first, what platform are you on?
Are you constrained by platform? If not, I've done very exciting things directly on an iPad, in Codea. Pure Lua, built on OpenGL, so built-in API for graphics support.
Beyond that, you could probably use Love2d. It's meant for game dev, but you could probably adapt it to your needs. It's a Lua API, has graphics support, and is cross-platform. I don't know much about it (yet), so others could pipe in with their thoughts/opinions.
If you are still shaky in Lua, I suggest to stick to the console for a while. GUI, whatever the language, is usually messy and unsatisfying for beginners.
If you already know some HTML and Javascript, consider using Lua with a web framework, and using the browser to control your program through a REST API:
Awesome-Lua#Web/Networking Platforms
Apart from that, I have yet to find a GUI framework that feels right for Lua. Almost everything is a thin wrapper around a C or C++ API and handles exactly like that. On the other hand, with the web and Electron on the rise there seems little need for it.

Is it possible to view the source of a mac app?

Would be usefull to see how things work but not sure on the legality of it
Most Mac apps are written using Cocoa in Objective-C; which, while it is a compiled language, means that there is a fair bit of information left over that could be used by a decompiler.
I'm not sure if there are a lot of decompilers out there that leverages this information, at least I haven't heard of any.
However, there are also another option; F-Script.
F-Script can be used to attach to an executable and explore its interfaces, while not as good as source, it can give you a pretty clear idea of how the executable is built, and how it operates.
As for the legality issue:
IANAL, but as far as I know, reverse-engineering for the purposes of compatibility is legal in many jurisdictions, and I can't imagine that decompiling an executable to look at its code is illegal, unless the specific EULA specifically prohibits it.
Edit: WRT Steam specifically, it is probably NOT written in Cocoa, but C# with some manner of .NET compatibility layer; and it's probably not a good place to start if you want to learn how to make applications for Mac OS X.
By far, the best Mac OS X disassembler I've used is Hopper available here:
http://www.hopperapp.com/
It will also convert the assembly to C pseudo code as best it can. It will generate code flow diagrams with blue lines (true blue, love it) for true and red for false paths.
It's The Mac OS reverse engineering tool. There are even Youtube videos that will show you how to use it.
If it's an open-source app, yes. Otherwise it's possible through decompilation but the output will be a real pain in the ass to look at. If you just want the protocols and the interfaces of categories and classes, have a look at class-dump.
I'm not aware of a nib decompiler.
Whether decompilation is legal: ask a lawyer. This may (and probably does) differ per jurisdiction.
Is it possible to view the source of a mac app?
Realistically, no. Sure, you might be a able to use a decompiler to get a peek, but the kind of output you'll get won't be easy to read. If you're asking this question, this route probably isn't going to be helpful to you.
Specifically interested in GUI and how the steam app for mac works
It's a good bet that it works about the same way that most other applications work. It might use custom controls to look different from a typical application that mostly uses the standard Cocoa controls. But underneath, just about any GUI application written for MacOS X will use the run loops, responder chain, and view hierarchy that Cocoa provide. The main exceptions would be applications that are built mostly using an alternate framework like OpenGL or WebKit.
Figure out what, specifically, the Steam application does that you'd like to do. Take a look at the tools that Cocoa provides to see if you can figure it out yourself; if not, ask about it here.

Doing native GUI with Ruby

I'd like to develop a desktop app with Ruby. However, I'd like to have a native GUI on every platform (as opposed to a cross-platform GUI Toolkit that looks consistently awful across all platforms).
I expect to have to do different GUIs for each platform (as it's not just looks but also behaviors and idioms that are different), but I wonder what my options are? Especially wondering if there is a clean way to separate front and backend and bind the data properly?
Target Platforms are Windows (Vista & 7, XP is a Bonus), Mac OS X (Cocoa) and Linux (GTK? Qt? No idea).
The Ruby language has excellent Qt library bindings and your scripts will be cross-platform.
Two Kinds of Cross-Platform
It turns out there are two kinds of cross-platform UI toolkits.
One kind draws its own controls, and, like you said, looks equally bad on all platforms. Even worse: it looks out-of-place on all except one.
But there is another kind that just provides a harmonized interface to the native widgets. The best of example of this kind of toolkit is SWT1.. It looks, it is, approximately fully native on each platform, yet it has but a single API.
So you shouldn't simply rule-out all cross-platform toolkits, just rule out the ones that fake the native UI.
Develop the Wrapper Interface
There is a second way. If your program's interface with the user can be directed through a relatively narrow interface, you can simply develop to that interface and then implement the bottom part of it for each platform you want to support. Yes, you have to rewrite one module, but all the other modules stay exactly the same and you get native widgets. You also get the smallest possible executable without lots of bloat.
Perhaps most importantly, you don't have a complex and opaque software layer between your code and the native windowing system. You will probably save as much time debugging as you spend writing the extra module for your first port.
1. I know my Java examples won't help you much unless you are using jRuby, but SWT vs Swing is a really pure example of the right-vs-wrong (IMHO) UI toolkit divide.
The WxWidgets interface claims to use the native interface on Windows, OS X, Linux and UNIX through one API.
Coworkers who have used it in the past enjoyed it well enough, but I've not used it myself.

What GUI toolkit does Valve use for Steam?

What GUI toolkit does Valve use for Steam? Is it Qt? I am interested in using the same toolkit for a project.
According to Valve itself:
"VGUI is Valve's proprietary Graphical User Interface. All Source and Steam applications use VGUI to draw windows, dialogs and menus. It also handles localization: the displaying of text in the user's preferred language. "
That's interesting, maybe if you guys do some research you can have it working in your programming language. I'll download the SDK to see if I can make it work with Java :)
http://developer.valvesoftware.com/wiki/VGUI_Documentation
Having had experience with the Source engine I know that Valve have an library called VGUI which they use for all their games and many of their tools (when in game the library sits on top of the Source renderer, when in tools it sits on top of the Windows API I believe). Although I can’t answer the question with 100% certainty I suspect that this is what they use for Steam as well (I seem to recall some Steam updates that mentioned VGUI) – I would be surprised if the new beta uses a different library.
Even if it is not using VGUI, given what I know of Valve I would think they will have written something else entirely in-house.
So, it is (almost certainly) proprietary and highly unlikely to ever be available for third party use (unless you have the funds to buy a Source engine license).
Steam only runs on Windows and predates QT for Windows, so I'd have to guess something else.
Since Steam has had the same GUI since 2003, chances are it uses some variant of MFC. It also uses an embedded Internet Explorer web browser for its Store and Community sections.
However, I can't give any guarantees about what the version currently in Beta uses. It looks quite a bit different and includs the Webkit rendering engine instead of using IE. It may use Webkit for everything rather than drawing their own GUIs.
Does this answer the question?
http://games.slashdot.org/story/10/02/25/0640233/Steam-UI-Update-Beta-Drops-IE-Rendering-For-WebKit

osx & windows development -- for newbies

my background: i've been developing web applications using php and javascript for the past ten years. before that, i've developed applications using turbo pascal for DOS. in my opinion application and web application development are two different kinds of development (at least it's what i think when i remember back the old days of DOS application development).
now i am in the need to go back to "normal" application development for various reasons. the application i want to build needs a GUI and it has to run on osx and windows. as mac os user it would be very nice for me to get an application as result, that really feels like an osx application. i don't need any special UI components: an explorer/finder like tree, a datagrid and some form-elements would be enough for my needs.
now the problem is, that i don't know where to start: i would classify me as newbie, because it's that long time since i last developed anything other than a web application. are there any recommendations of programming languages and gui toolkits with a not to steep learning curve? or can you recommend any book i should read for getting into cross-plattform osx/windows app development?
many thanks!
thanks everyone! i think i'll have a look at realbasic!
Edit Nov 2011 - a retraction
Most of what I say below is still true however I have now got serious reservations about recommending REALbasic for anyone trying to release commercial-quality applications. To save me remembering to edit this post later, see if RealSoftware have managed to release a robust version of their IDE using the Cocoa version of their frameworks. If not, be very cautious.
It's with a heavy heart that I write this because I still really like the language and think the framework and IDE are well-done. The problem is apparently one of under-capitalization and possibly a software development culture inside the company that consistently fails to deal with a bug regression problem. Many bugs are fixed each release but there appears to be a huge tax on the developers in the number of introduced bugs. They have a very small team for the complexity of the product, especially considering the newly released Web Edition which is effectively an entirely new platform.
It's still theoretically a great product but take advantage of the trial period, test it thoroughly on each of the platforms you plan to target and decide if you can live with any bugs you find because they may be there for a while.
REALbasic.
The language is a powerful, modern OO language that won't be hard for you to adapt to from your vaguely remembered Pascal or current JavaScript. It has most of the power of C++ without the dangerous bits that make debugging a nightmare. You will also find the IDE simpler and easier to deal with than say Visual Studio.
The IDE makes it very easy to throw together a GUI and have it just work on multiple platforms. The Pro version has one of the best cross-platform debuggers I've used and it is easy to just work (say) on a Mac and develop for Windows and Linux, compiling and testing with one click.
There is also a thriving community including many people at your level of expertise so you won't be mocked for being a newbie.
I am a professional software developer with over 25 years experience and currently mainly working in REALbasic, C++, C#, Objective-C and a bit of Ruby. For apps such as you mention, REALbasic is my tool of choice.
edit: I can't believe someone downvoted this but didn't have the guts to add a comment explaining why. I'd heard about prejudice against REALbasic but this is the first time I've encountered it. In what way was my answer inappropriate for this question?
Just to add to my cred, I've implemented cross-platform frameworks used by systems deployed to tens of thousands of end users - I have the C++ cross-platform experience to applaud someone else doing a good job and the REALbasic frameworks are very nice.
The best cross-platform tool I've dabbled in with a relatively small learning curve...especially if you're familiar with Visual Basic...is REALbasic. With REALbasic Pro you can compile a program to target Win32, Linux, and OS X from the same codebase, as long as you're not using OS-specific calls and features (which you can do with plugins or direct calls). Their support has been pretty responsive to my questions, the personal edition (which compiles to only the single target platform you'd downloaded the IDE for) is free for Linux and inexpensive for other platforms, but really you might want to download and try it out. One IDE, relatively inexpensive, and can compile native applications on OS X, Windows, and Linux...it's less hassle, and for me that's important when you want to get a job done.
I'd advise against C and Qt and would also recommend REALbasic.
With your background in Pascal and probably JavaScript you'll feel much more comfortable with REALbasic. I've done a lot of coding in Pascal and C/C++ - where Pascal guides you to avoid programming mistakes, C lets you step right in, even invites you, and then you'll have a hard time figuring out why it went wrong. Qt is a very abstract framework and requires you to learn a lot before you can get something working, just like with C. When compared to the easyness we used to have with TP back then.
RB is much more like Pascal in this regard. And its IDE is quite modern in regards to supporting your programming, with an easy-to-use GUI designer, straight-forward editor to fill in the gaps for handling UI events, code completion, etc.
Only when you get into huge program sizes, RB loses some of its appeal because it is missing tools to give you a good overview of complex class interactions etc.
Another thing is that Qt is more likely to cause ugly-looking Mac apps than RB would. RB visually guides you to get it all aligned nicely - in Qt you have to work with numbers, offsets, etc. to position your objects (at least it was that way when I used Qt 2 years ago).
I've written quite a few x-platform apps in RB and am pretty happy with the results.
You won't probably write those super-nice looking apps that compete with the best on the open small business market, but if you just want to get some solid code working, with an easy-to-design UI that's acceptable to the average user, give RB a try.
It's not free, though. But its rather small community is on your side - they're eager to help, instead of bashing everyone who's trying to talk sense :)
I'm new here but picked up on this thread through the REALbasic User Group. I think my position was similar to yours. I did website design for my work, using mostly javascript (with a little php, not much). I had a Pascal and BASIC background. I'd dabbled it C but didn't like the level of detail you needed to monitor it. It reminded me too much of assembly (which I still have nightmares about from my high-school/college days).
I was looking for a cross-platform language, with a familiar feel to it, but initially started with VB because it was free. I prefer programming in MacOS however, so I tried REALbasic. I found that REALbasic's UI builder was much easier to use than VB's. I'd echo other comments that the community is the most responsive of any user groups I've been involved with. I've since used REALbasic and my Mac to make several programs that over 100 users use every day at my work (on PCs, mostly XP and 2000). I've received compliments on the polish and ease of use of these programs. You DO have to remember to adjust the 'little' things to make it look right cross platform (ie: default button placement is opposite on PC vs. Mac, button sizes are different on Linux, etc). Many people have donated custom classes that do this stuff for you though.
People seem to assume that a "BASIC" language cannot be powerful enough for their purposes. While it is BASIC at it's core (with For..Next, Do..While, and If..Then commands), it ain't your daddy's BASIC. It's much more OOP than anything else I've used, based upon an event-driven structure, which for me was easy to pick up. They have a free trial, so grab a demo and run through the tutorial. If you get stuck, ask for questions on the NUG or Forums at the website and you'll likely get an answer quickly.
You may be interested in the following questions and answers:
Cross-platform development - Go with a cross-platform UI toolkit or native on multiple platforms?
Easiest cross platform widget toolkit?
Should I use a cross-platform GUI-toolkit or rely on the native ones?
Using a Mac for cross platform development?
and many others suggested in the Related sidebar of these questions.
Some answers suggest gtk (which is used by cross-platform gimp). Others suggest native approaches. Some suggest that a Mac is a nice platform for developing for Mac OS X, Windows, Unix and Linux.
I wholeheartedly recommend RealBasic too. I have been using RB for about 8 years now and find it to be a perfect tool for my Companies development needs, from small apps, to large multi-user systems.
It is perfect for beginners and those that are getting back into programming, and also for professional developers.
Highly recommended.
As Andy Dent and others here have indicated, for a newbie to create cross-platform applications it is hard to beat REALbasic (now Xojo).
Sure, there are plenty of other cross platform solutions such as QT (C++), Java, .NET (to some extent) and wxWidgets but they are not something a beginner would be able to use effectively.
I have many years of professional development experience in a wide variety of languages and technologies and I prefer to use REALbasic most of the time.
With that said, you might also consider Runtime Revolution or Adobe Air.
Whilst it might seem tempting to use a language thats platform independent and allow you to write the app once and use anywhere, you will undoubtably be sacrificing something on each, particularly in the UI and user experience.
If you can your best creating something using a native API that lets you take full advantage of the features of the OS to make your application shine.
I would definitely go for C++ and Qt, the code you write once will compile and run without problems on Windows, Mac and Linux. The new IDE that comes with Qt - Qt Creator is brilliant, works and looks the same on Windows, Mac and Linux, you don't need to anything else to start writing cross-platform applications.
I tried WxWidgets but didn't find good IDE, the best one was Code Blocks but GUI Designer is not perfect and has different problems on different systems and the IDE itself is still under heavy development.
Other options are Java and C# but those are not cross-platform languages, those are platforms themselves. Although you wouldn't need to compile code for each platform there will a lot of different issues on the way...
If your GUI's simple enough, why not just create a generic GUI layer, then program to that? Compile a version for each OS using native widgets. That's the best way to ensure native L&F on multiple platforms.
Both the Qt and REALbasic suggestions are good, although they tie you to that particular technology (which I can't imagine would be an issue in this particular case).
Personally, I'd go with Java, because it's worked for me before (I had an app that ran on my PDA, my phone and my desktop), but it doesn't use native widgets.
Adding a late comment here:
Take a look at Revolution. It's sort of like a modern Hyper-card on roids. And it's cross platform (Mac, Linux and Windows). This is a serious competitor to RealBasic and is coming on strong. Though I still use RB (and like it) I'm giving Revolution a serious look at.
I would also look into either Realbasic or Revolution. They both create cross platform native apps. Personally I think Realbasic would be a better choice as it is very similar, language wise, to VB. You can learn some valuable skills with RB and it can grow with your experience. I have been using VB and RB for more then 10 years combined and I think you will be happy.
If you need your code to be cross platform, you would have to go with something like QT.
Although, I would recommend using native API for each one (Cocoa for Mac OS X, .NET or the Win32 API for Windows). User experience will be much better. But of course, that will cost you more money in terms of developers hours.

Resources