Autor Tema: mod_vlc  (Leído 15363 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado josebita

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 4038
  • Karma: 257
  • Sexo: Masculino
    • Ver Perfil
    • BennuGD Mobile Worklog
Re: mod_vlc
« Respuesta #15 en: Mayo 31, 2010, 08:51:36 am »
I've created a page hosting the latest code and packs containing only the minimum set of libraries for playing some popular codecs for windows.
Right now, the I've got codec packs for:
  - WebM (3.4MiB).
  - Ogg Theora+Vorbis (1.4MiB).
  - Dirac (1.4MiB).
In the next few days I'll upload packs for non-free but popular codecs (flv, xvid, h264...).

http://code.google.com/p/bennugd-vlc/

Desconectado josebita

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 4038
  • Karma: 257
  • Sexo: Masculino
    • Ver Perfil
    • BennuGD Mobile Worklog
Re: mod_vlc
« Respuesta #16 en: Junio 02, 2010, 05:53:34 am »
Support for MPEG4 video encapsulated as AVI. MPEG & AC3 surround audio support.

Conectado panreyes

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 1999
  • Karma: 63
  • Sexo: Masculino
    • Ver Perfil
    • panreyes.com
Re: mod_vlc
« Respuesta #17 en: Junio 11, 2010, 01:49:39 pm »
Hi Josebita,
I finally tried to put video in Bennu, and I used the mod_vlc's WebM package.
It works flawlessly the first time a video is played, but the second play_video would return -1.
May it be a bug?
« última modificación: Junio 12, 2010, 02:38:49 am por PiXeL »

Desconectado josebita

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 4038
  • Karma: 257
  • Sexo: Masculino
    • Ver Perfil
    • BennuGD Mobile Worklog
Re: mod_vlc
« Respuesta #18 en: Junio 11, 2010, 02:05:25 pm »
You're posting in the English forum!

I'll have a look at it, but do you stop the video? Also, please post your code so I can have a look at it, but I think I know where the problem might be coming from.

Conectado panreyes

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 1999
  • Karma: 63
  • Sexo: Masculino
    • Ver Perfil
    • panreyes.com
Re: mod_vlc
« Respuesta #19 en: Junio 12, 2010, 02:40:06 am »
This is all the code about video:
Código: [Seleccionar]
graph = video_play("quizz/"+fichero+"/"+nombre_video+".webm",1024,768);
    while(! video_is_playing() && ! key(_esc)) // Wait for the video to actually start
        FRAME;
    end
while(! key(_esc) and video_is_playing())
        FRAME;
end
if(video_is_playing()) video_stop(); end
graph=0;
BTW, I had 2 options: moving the post or writing in again in english. I preferred the second XD Ups sorry, I meant LOL

Conectado panreyes

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 1999
  • Karma: 63
  • Sexo: Masculino
    • Ver Perfil
    • panreyes.com
Re: mod_vlc
« Respuesta #20 en: Junio 12, 2010, 03:53:50 am »
Also, the error only occurs when I'm not stopping the video with stop_video() before it ends.

Little patch:
timer=0;
duration_in_ms=video_get_length()-100;
while(timer<duration_in_ms)
« última modificación: Junio 12, 2010, 06:39:31 am por PiXeL »

Desconectado josebita

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 4038
  • Karma: 257
  • Sexo: Masculino
    • Ver Perfil
    • BennuGD Mobile Worklog
Re: mod_vlc
« Respuesta #21 en: Junio 12, 2010, 08:30:36 am »
Yes, I believe you should do stop_video() even if the video has actually finished playing. because stop_video also does some unloading.

Conectado panreyes

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 1999
  • Karma: 63
  • Sexo: Masculino
    • Ver Perfil
    • panreyes.com
Re: mod_vlc
« Respuesta #22 en: Junio 12, 2010, 08:37:54 am »
If the video is stopped on his own because it has ended, if you use stop_video after that, the game will hang.

Desconectado josebita

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 4038
  • Karma: 257
  • Sexo: Masculino
    • Ver Perfil
    • BennuGD Mobile Worklog
Re: mod_vlc
« Respuesta #23 en: Junio 12, 2010, 09:18:42 am »
I see... I'll fix it as soon as possible to make things a bit more "intelligent".

Desconectado Windgate

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
  • Sexo: Masculino
    • Ver Perfil
    • TRINIT Asociación de Informáticos de Zaragoza
Re: mod_vlc
« Respuesta #24 en: Junio 13, 2010, 12:48:33 am »
There are many "play video" projects now, there is any (very) simple demo at which we could play the oficial Prg BennuGD intro (mpg, divx...)?

It could be very very very useful for the current Great BennuGD Game Project.

¿Direct download, please?

Thanks ;)
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

Conectado panreyes

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 1999
  • Karma: 63
  • Sexo: Masculino
    • Ver Perfil
    • panreyes.com
Re: mod_vlc
« Respuesta #25 en: Junio 17, 2010, 12:31:45 pm »
I would also change the way mod_vlc searches the files on ./vlc

I use Bennu from %PATH%, and this module makes me have half module in c:\bennugd and the other in c:\proyecto\vlc

It should look for c:\bennugd\vlc instead of c:\proyecto\vlc. I mean, it should look into bgdi's folder, not project's folder :)

Desconectado josebita

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 4038
  • Karma: 257
  • Sexo: Masculino
    • Ver Perfil
    • BennuGD Mobile Worklog
Re: mod_vlc
« Respuesta #26 en: Junio 17, 2010, 02:36:45 pm »
I've been trying to find why the code crashes without any luck, yet. Sorry. I'll try to find a cause for the crash and make it play more than one video asap. :(

As of the thing with the paths... It's not that easy. The path to look for the vlc plugins is not hardcoded but is relative to the current working dir. I believe this is the best solution for distributing your game.
As for your development needs, I'm not sure but I believe that adding the path to the vlc modules dir to your global PATH variable should help.

Desconectado josebita

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 4038
  • Karma: 257
  • Sexo: Masculino
    • Ver Perfil
    • BennuGD Mobile Worklog
Re: mod_vlc
« Respuesta #27 en: Junio 17, 2010, 05:21:35 pm »
I believe the attached library should fix the bug that didn't allow more than one video to be played (only one video can be played at a time).

The interpreter will probably crash when quitting, however...

The following example (which is a slightly modified version of the bundled example player) will allow you to play more than one video. When you press the escape key the video playback will stop. If you press "q" the app will quit but if you press the space bar, video playback will restart.
[code language="bennu"]import "mod_key"
import "mod_vlc"
import "mod_video"
import "mod_mouse"
import "mod_say"
import "mod_map"
import "mod_file"
import "mod_proc"
import "mod_timers"

#define SCR_WIDTH  640
#define SCR_HEIGHT 480

/* Player main window */
Process main()
Private
    string fname="";
    int time=0, delay=30, track=1;

Begin
    // Handle the command line
    if(argc != 2)
        say("Must be given file to play, quitting.");
        exit();
    end;

    // Try to find the file that the user wants us to play, or die
    fname = argv[1];
    if(! fexists(fname))
        say("Couldn't find "+fname+" to be played, quitting.");
        exit();
    end

    /* Start the graphics subsystem */
    set_mode(SCR_WIDTH, SCR_HEIGHT, 16);

    /* Finally play the video and place it in the middle of the screen */
    graph = video_play(fname, SCR_WIDTH, SCR_HEIGHT);
    x = SCR_WIDTH/2; y = SCR_HEIGHT/2;
    while(! video_is_playing()) // Wait for the video to actually start
        FRAME;
    end;
    while(! key(_esc))
        if(timer[0] > time+delay)
            if(key(_space))
                video_pause();
                time = timer[0];
            end;
            if(key(_right))
                video_set_time(video_get_time()+100);
                time = timer[0];
            end;
            if(key(_left))
                video_set_time(video_get_time()-100);
                time = timer[0];
            end;
            if(key(_m))
                video_mute();
                time = timer[0];
            end;
            if(key(_up))
                video_set_volume(video_get_volume()+5);
                time = timer[0];
            end;
            if(key(_down))
                video_set_volume(video_get_volume()-5);
                time = timer[0];
            end;
            if(key(_enter))
                track = video_get_track()+1;
                if(track > video_get_tracks()-1)
                    track = 0;
                end;
                video_set_track(track);
                say("Audio track "+video_get_track()+" of "+video_get_tracks());
                say("            "+video_get_track_description());
                time = timer[0];
            end;
        end;
        FRAME;
    end;

    video_stop();
    while(! key(_q))
        // If you press space bar, we start over
        if(key(_space))
            main();
            return;
        end;
        FRAME;
    end;
End;[/code]

Desconectado Windgate

  • Hero Member
  • *****
  • Mensajes: 2930
  • Karma: 124
  • Sexo: Masculino
    • Ver Perfil
    • TRINIT Asociación de Informáticos de Zaragoza
Re: mod_vlc
« Respuesta #28 en: Junio 20, 2010, 10:31:15 am »
Im waiting for a .zip with a full working sample, with the .prg, the .dll and a sample video... Everything is separated now: Here a .prg sample, here the .dll, here other versions of the same .dll :-[, here an old working sample with a .mpg that doesn't work with the current BennuGD dlls...

Just download, compile and run, for stupid users like me... And you ;)

http://code.google.com/p/bennugd-vlc/

Google Code has 2Gb accounts, why not a FULL working sample? :(
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

Desconectado josebita

  • Administrator
  • Hero Member
  • *****
  • Mensajes: 4038
  • Karma: 257
  • Sexo: Masculino
    • Ver Perfil
    • BennuGD Mobile Worklog
Re: mod_vlc
« Respuesta #29 en: Junio 20, 2010, 03:41:24 pm »
The packs there contain fully working examples. The idea of the packs is to include the bare minimum you need.
For example, download the webm pack & this video and from the folder with the prg file do:

bgdc mod_vlc.prg
bgdi mod_vlc sunflower.webm

I find it pretty straightforward. The code and dll posted here are not definitive and will be updated on the packs once I have time to do it.