Main Menu

mod_vlc

Started by josebita, March 17, 2010, 05:58:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

josebita

As the title says, I've created a BennuGD module which wraps around libvlc, so it's now possible to use basically any video format in BennuGD.
Windows download (much bigger, but contains everything you need).
Linux download (very small, but you need to have a recent version of VLC installed through your system's native package management software. Also, rename the .zip file to .tar.bz2).

The module will play videos with subtitles, if available.

Both contain a sample video player app. The hotkeys for the app are:


  • Space bar: Pauses/unpauses the video.
  • Right: Seek the video to the right.
  • Left: Seek left.
  • m: Mute/Unmute the video.
  • up: Volume Up.
  • down: Volume down.
  • enter: Switch audio track.
  • escape: Stop+quit.

And the list of functions this module includes is:
[code language="bennu"]
/* Plays a video file with the given width/height
* Will play the video with subtitles, if found */
int video_play(string filename, int width, int height);

/* Stop a currently playing video.*/
int video_stop();

/* Pause/unpause the currently playing video*/
int video_pause();

/* Check if the video is currently playing */
int video_is_playing();

/* Get total length of the currentyl playing video, in centisecs */
int video_get_length();

/* Get current seeking position in the video, in centiseconds */
int video_get_time();

/* Seek through the video, must be given a time
* in centiseconds (what the bennu timer's use) */
int video_set_time(int time);

/* Get the width of the currently playing video */
int video_get_width();

/* Get the height of the currently playing video */
int video_get_height();

/* Get the muted/unmuted status */
int video_get_mute();

/* Mute/unmute the currently being played video */
int video_mute();

/* Get the volume of the currently playing video
* Will be 0<=volume<=200 */
int video_get_volume();

/* Set the volume of the currently playing video
* Must be 0<=volume<=200 */
int video_set_volume(int volume);

/* Get the number of available tracks in the video
* The first track (track number 0) is used for disabling audio */
int video_get_tracks();

/* Get the number of the currently being played track */
int video_get_track();

/* Set the audio track for a currently being played video */
int video_set_track(int track);

/* Get the description for an audio track.
* Not sure if it works correctly, must test it. */
string video_get_track_description();
[/code]

Hope you find it useful :)

josebita

PS: the aspect ratio in the sample player will most probably be wrong. To know a video's aspect ratio you must use video_get_width() and video_get_height() once the video is playing.

The module will play just one video at a time right now. That might change in the future, depending on feedback.

Imerion

Nice! This could sure be useful. The built-in .flv player is quite limited.
Try my games : Neotron Games

Windgate

It sounds good, so we can play any video format like divx???

Im downloading now, karma up and thanks a lot!
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

josebita

Yeah, you can play anything vlc can (basically every format).
I've not tested it but it should even support webcams, dvds, internet live streams...

Windgate

Quote from: josebita on March 22, 2010, 02:35:25 PM
Yeah, you can play anything vlc can (basically every format).
I've not tested it but it should even support webcams, dvds, internet live streams...

lol then it could play from Youtube with the URL or something? Without the needing of have the video on disk? :O
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

josebita

You should be able to. For some reason, Bennu crashes when you try to open an url not corresponding to a local file, I'll have to look deeper into that.

Windgate

Ouch... Bennu and sockets again... I have to work with it...

Welll, I hope you can solve it :D

I owe you a karma xD
Iván García Subero. Programador, profesor de informática, monitor de actividades culturales y presidente de TRINIT Asociación de Informáticos de Zaragoza. http://trinit.es

FreeYourMind

It's posible a Wiz Port ?

josebita

It's certainly possible, given it's a linux system.
The "only" thing I need is a working VLC port for the Wiz.

DCelso

Only. As if this task was easy.
Monstruos Diabólicos

"A PAck of classic GAMEs For BennuGD" en desarrollo
http://code.google.com/p/apagame4be/

josebita

Well, you asked if such a port was possible, not easy :)
I'll try to have a look at it, though.

Still, as the Wiz is a low power device, videos would have to be downscaled in order to be able to play them in the console smoothly.

josebita

Aquí hay un port para maemo (linux sobre un ARM desarrollado por Nokia, creo que el kernel es parecido) de VLC. Quizás con eso se pueda implementarl.

FreeYourMind

Let's start the port friends!  ;D

josebita

Sorry, my mind exploded and I wrote in Spanish/without the link. I'll have a look at those files.