Embed Video Stream in Ncurses - user-interface

I really like the look and idea of ncurses, and I was wondering if there was a way to include a video stream embedded in a ncurses gui. If not, is there any other gui method I can use that I can make look like ncurses available for python or C++?

Although I doubt you would find it useful for any practical purpose, you can embed a video stream in an ncurses window using libcaca (a short, basic tutorial is available, although it doesn't discuss video).

Related

Playing audio file with golang

How one would play audio file in go language?
I have function and want sound to be played as notification when event happens.
I could not find anything about playing sound file in go lang just some web browser based music players but it wasnt helpful too much.
You could use the PortAudio Go bindings (go get github.com/gordonklaus/portaudio) for this.
You will have to build or install PortAudio on your system. Consult http://portaudio.com/docs/v19-doxydocs/tutorial_start.html for this.
A complete example for playing back a sound file is located at https://github.com/gordonklaus/portaudio/blob/master/examples/play.go
If it's an MP3 file, you can use go-mp3 Library. go-mp3 is popular library to play MP3; MP3 decoder is in pure Go.
Or this one, https://github.com/faiface/beep. Beep uses go-mp3 under the hood

Playing video in Qt (on a Mac)

This question arises out of a combination of this being my first time working with video and unfamiliarity with Macs. Basically I'm finding it difficult to figure out how to play a video (within a QWidget, or otherwise) using any standard format, e.g. avi, mpeg, mov, etc. In particular,
QMovie::supportedFormats() gives me only .gif and .mng, but I need to use standard formats. Is there a way to increase the number of supported formats?
Phonon requires the presence of a 'backend' which the user has to implement himself. I looked to see if I could somehow do this with Quicktime, but I couldn't get the application to launch--and anyway I didn't really see how to do that. Also, Phonon looks pretty heavyweight, I'd like to avoid it if I could.
While there are plenty of avi (et al.) players floating around on the web, I think it's probably unlikely I'd be able to use them--I need to start, stop, and change the playback speed of videos programmatically i.e. through my C++ program.
I'm not sure why this should be so hard--working with images in Qt is a snap by comparison. So: What's a good way to play videos from within a C++/Qt program?
Stop what you are doing right now: Phonon is the past, Qt Mobility is the future.
After you download, compile and install Qt Mobility, check the examples: videowidget and videographicsitem, located at: qt-mobility-opensource-src-1.2.0/examples/
They pretty much answer all your questions.

Play a video using gtk+

Any suggestion regarding how to play videos using GTK+?
Regards,
Lancy Norbert Fernandes
For Playing Videos on GTK+ and other GTK Bindings you have a lot of options.
Option: Use A Third-Party Library
1- Try using ogmrip-gtk , A set of Gtk Interface, which allows you to use the open-source OGMRip library as a Gtk-Widget.
2- You may use another library, gstreamer. Also can be used easily with Gtk.
3- You may use LibVLC - gtk. A GTK wrapper for LibVLC (ever used the VLC Media Player?). Personally , I like this a lot.
Option: Using Code from Open-Source Software
1- The Banshee media player is open-source and although it uses Gtk#, you may have no trouble converting the code to GTK+.
2- See the MPlayer or Totem Player Source Code. (or any other for that matter, here is a list )
Option: Use A Process
1- I've heard the MPlayer Command Line is pretty simple. Here's a guide. http://www.mplayerhq.hu/DOCS/HTML/en/commandline.html
With GTK+ there are always a lot of new and innovative (not to mention open-source) ways to do stuff. So always keep looking for better ways. I am personally a great fan of the GTK+ toolkit and have found that there is nothing you cannot do with it.
GStreamer integrates well with GTK+.

Capture sound output on mac

I am trying to port my screensaver from windows to mac and one of its features was reacting on system sound output. On windows it was easy using Direct Sound, but I can't find any example of capturing sound output on mac. Is it possible even possible without writing something like kernel extension? Using flash it is also very easy — it even gives computeSpectrum method to get raw data or even fft transformed data.
All programs that I have already found use Soundflower or their own kernel extension. But I don't think that asking to install separate program or using kernel extension is a good way.
One thing you can do, considering that Soundflower is open source, is take a look at how they did it. You can't copy & paste GPL code, but you can surely study the techniques used and create your own solution (point you in the right direction).
You won't find Apple being very helpful here. Sound capturing, in this manner, can be used for all kinds of nefarious purposes. I'm not even sure if Core Audio lets you do this without hacks. In any case, you have a working implementation of what you're trying to accomplish. I'd take advantage of it.
I'm not on my Mac right now, but I'm pretty sure that Quartz Composer has a patch for just this thing. Depending on what language you're writing your screen saver in, it may be fairly easy for you to port your code into a QC patch. Well... it probably won't be easy, but it may be doable.

Ruby sound playback

This is 2009, back in 2001 or so, there used to be no good bindings for sound playback in ruby.
Has there been a change? I am looking for something to control playback of either raw sound or mp3, ogg and flac. My Googling has turned up dry.
Edit: Linux, OSX and if possible Windows.
You don't mention a platform. This page describes the win32-sound library, which seems to support at least WAV playback.
For a more platform-neutral way, Ruby/SDL provides bindings for the ever-popular SDL library.

Resources