Announcement

Collapse
No announcement yet.

how to play a video clip in control or dialog

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to play a video clip in control or dialog

    Looking through the forums on this topic has not diminished my bafflement. Can anyone direct me to a simple method of doing this?

  • #2
    The easiest way is to use MCI!

    What you want is the MCISendString API function. This function allows you to send MCI command strings to Windows to handle all sorts of multimedia needs.

    You can play:

    MIDI (music)
    wave
    AVI (video)
    MPEG (video)

    and can play audio CD's too.

    MCI is very powerful/
    Chris Boss
    Computer Workshop
    Developer of "EZGUI"
    http://cwsof.com
    http://twitter.com/EZGUIProGuy

    Comment


    • #3
      I agree

      If you can not find any here, or under POFFS then I would do a google for VB6 for the same and port to PB

      If you need some help let me and others know, and I am sure we can help (personally something like this has been on "My back burner" since switching to PB, so maybe this is a push I need to just do it)
      Engineer's Motto: If it aint broke take it apart and fix it

      "If at 1st you don't succeed... call it version 1.0"

      "Half of Programming is coding"....."The other 90% is DEBUGGING"

      "Document my code????" .... "WHYYY??? do you think they call it CODE? "

      Comment


      • #4
        Thanks Chris & Cliff for for the guidance. Patience has been restored and progress is being made.

        Comment


        • #5
          If you want to go the MCI road, then search for:
          MMengine.dll (MultiMedia MCI encapsulation)
          I did wrote this one 8 years ago and posted it there in 2001.

          http://www.powerbasic.com/support/pb...light=mmengine

          Note: The mixer API won't work on VISTA.

          Now if you want to use DirectX then search for ActiveMovie (translated to PB by José Roca). He posted an example in the new "contest" forum.
          Patrice Terrier
          www.zapsolution.com
          www.objreader.com
          Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

          Comment


          • #6
            Originally posted by Patrice Terrier View Post
            MCI...Vista...DirectX
            Thanks!

            I suppose I should be forward-looking and do it in a way that is compatible with Vista (which it seems will be the future for a high proportion of Windows XP users, however much it is denounced and reviled). My reading is that MCI itself is supported in Vista, so it is the technique used by your API which is not supported? Are there any known forward compatibility issues with the code of Jose Roca? If I use mcisendstring will that work on Vista? Win32API.inc looks like it does a direct mapping of the mci calls.

            More questions than answers, sorry!

            Comment


            • #7
              The Mixer API, not mine, but the Microsoft's one, has changed in VISTA, meaning Microsoft VISTA Mixer API and Microsoft previous Mixer API are not compatible.

              I was using MCI ten years ago, until i found that it was very limited when compared to what could be done with ActiveMovie / ActiveAudio (DirectX / DirectSound).

              None of the wellknown multimedia player than can be found around are using MCI, and i am not using it myself anymore.

              The code posted by Jose Roca is not based on MCI, but use the methods of the DirectX ActiveMovie interface. The same that is being used by PowerDVD or any of the DVD players floating around, that are based on the Quartz.dll.

              ...
              Patrice Terrier
              www.zapsolution.com
              www.objreader.com
              Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

              Comment


              • #8
                Originally posted by Patrice Terrier View Post
                The Mixer API, not mine, but the Microsoft's one, has changed in VISTA, meaning Microsoft VISTA Mixer API and Microsoft previous Mixer API are not compatible.
                So if an application is developed with PB Win using mcisendstring and works OK on XP it will fail on Vista?

                Comment


                • #9
                  MCI basically works on all versions of Windows, as long as the MCI drivers are installed, which is usually the case.

                  MCISendString API info:

                  http://msdn2.microsoft.com/en-us/library/ms709492.aspx

                  MCI command strings list:

                  http://msdn2.microsoft.com/en-us/lib...87(VS.85).aspx

                  Here is an interesting post on MSDN forums:

                  https://forums.microsoft.com/MSDN/Sh...77697&SiteID=1

                  It appears the MS considered dropping MCI on XP 64 bit, but changed their mind because it really needed to be supported.

                  It is not a matter of whether MCI is supported or not, but whether specific MCI command strings are supported (or a specific syntax).

                  Just check the API docs for the MCI commands you use, to see if there are any warnings about specific syntaxes not being supported for the commands you use.

                  MCI is a very easy way to do multimedia and it works very well and is very well supported.

                  One little trick that is important is always pass filenames with quotes around them. This prevents problems with long format filenames (which can contain spaces).
                  Chris Boss
                  Computer Workshop
                  Developer of "EZGUI"
                  http://cwsof.com
                  http://twitter.com/EZGUIProGuy

                  Comment


                  • #10
                    So if an application is developed with PB Win using mcisendstring and works OK on XP it will fail on Vista
                    No problem, VISTA still supports MCI.
                    It is the Mixer API that has changed, but the Mixer API and MCI are two distincts animals.

                    Using MCI you can even play old DAT movies (Video CD), but you may encounter problems playing mpeg4 movies.
                    Patrice Terrier
                    www.zapsolution.com
                    www.objreader.com
                    Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

                    Comment


                    • #11
                      MCI basically works on all versions of Windows, as long as the MCI drivers are installed, which is usually the case.
                      I don't know for now, but i have found many times in the past that some of the MCI drivers were not installed, but this could also happen with DirectX, isn't it
                      Patrice Terrier
                      www.zapsolution.com
                      www.objreader.com
                      Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

                      Comment


                      • #12
                        The core MCI drivers are usually always installed on any system which is multimedia ready. Thats not usually a problem.

                        What the problem is whether specific codecs have MCI drivers or how they are accessed.

                        For example, in EZGUI 3.0 I accessed MCI using specific commands for AVI and specific commands for MPEG. I found that when working on 4.0 that the MPEG commands didn't always work.

                        The work around was to simply open the movies using the generic open command without the TYPE command (ie. MPEGVideo) and let Windows figure out the type. This worked great! While there was no direct MPEG MCI driver, Windows could handle it simply as a file and then load the correct codec itself.

                        Some trial an error on different systems will help one find the best solution so that it will work on most, if not all, systems.

                        EZGUI 3.0's MCI control was developed on Windows 95. 4.0's was developed on XP so it works on all of them (and vista).

                        MCI is pretty smart if you let it do most of the work. It can tell what a file is simply by its file extension and then use the proper codec for it.
                        Chris Boss
                        Computer Workshop
                        Developer of "EZGUI"
                        http://cwsof.com
                        http://twitter.com/EZGUIProGuy

                        Comment


                        • #13
                          Originally posted by Chris Boss View Post
                          EZGUI 3.0's MCI control was developed on Windows 95. 4.0's was developed on XP so it works on all of them (and vista).
                          So, MCI for the masses and DirectX for the intelligentsia. Good job I know my place ;->

                          Thanks Chris & Patrice for clarification.

                          Comment


                          • #14
                            I shall post soon a "poor man" video player based on my MCI MMengine.

                            :wavey:
                            Patrice Terrier
                            www.zapsolution.com
                            www.objreader.com
                            Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

                            Comment


                            • #15
                              Originally posted by Patrice Terrier View Post
                              I shall post soon a "poor man" video player
                              Poor men everywhere will be in your debt.

                              Comment


                              • #16
                                Poor men everywhere will be in your debt.
                                Done, see it there:
                                http://www.powerbasic.com/support/pb...670#post277670
                                Patrice Terrier
                                www.zapsolution.com
                                www.objreader.com
                                Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

                                Comment


                                • #17
                                  moved to new thread.
                                  Last edited by Chris Holbrook; 29 Feb 2008, 07:33 AM. Reason: new thread created

                                  Comment

                                  Working...
                                  X