Announcement

Collapse
No announcement yet.

AVI/MPG to EXE - is it possible?

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

  • AVI/MPG to EXE - is it possible?

    Is there any software that will convert an AVI or MPG video file to an executable file?
    The idea is that the video plays when you run the exe file.

    Rod

  • #2
    I don't know of any way to include a player into the file, it sounds like you need to compile it together with the AVI. And that is not very easy..

    What you can do, if you are using windows, is simply to associate the extention to a player, this is done by default by many players including Windows media player.

    If you are thinking of burning a CD you can use the autostart function, either by writing a autorun.inf file yourself, you can let your CD writing program do it for you or you can use RalfoDivX's DivX CD-Launcherprogram. This is highly recommended. Download it from <A HREF="http://www.digital-digest.com/dvd/downloads/index.html">www.digital-digest.com/dvd/downloads/index.html</A> Go to encoding tools.

    Comment


    • #3
      I can't remember the symptoms exactly, but just specifying <font size="3"><kbd>open=myfile.mpg</kbd></font> in autorun.inf won't work. Thus, I wrote a program for the occasion-- it goes like this:

      <font size="3"><pre>#include &lt;windows.h&gt;
      #include &lt;shellapi.h&gt;

      int APIENTRY WinMain(HINSTANCE hInstance,
      HINSTANCE hPrevInstance,
      LPSTR lpCmdLine,
      int nCmdShow)
      {
      ShellExecute( NULL, "open", "myfile.mpg", NULL, NULL, SW_SHOWNORMAL );

      return 0;
      }</pre></font>

      This calls on the user's preference of player for .MPG files to open it. 24KB compiled, but I'm sure it could be a LOT smaller... where'd I put the article on that?

      Anyhow, I'd recommend you do it this way. HOWEVER... Internet Explorer is familiar with a little-known protocol known as res:. You would, in this case, open Media Player (programmatically) and specify as its movie:

      res://myprog.exe/#rrr/#nnn

      ...where "rrr" would be the number identifying the type of resource in your .exe file, and "nnn" would be the number representing the actual movie in your .exe file. This one's a might testy, though, so I recommend you do it the first way.

      If you're not a programmer... DOH!! I just wasted a bunch of typing. I don't know what program does it. Graphics Workshop used to be able to put images in .exe files... perhaps it has been upgraded to do the same for movies? Dunno.


      [This message has been edited by fluggo99 (edited 10 July 2000).]

      Comment


      • #4
        fluggo99:
        What do you save the program as?
        autorun.inf? myfile.exe? myfile.c?

        Rod: I just got a Logitech Quickcam express and it came with a program that would allow you to record video and save it as an EXE so it could be sent via email to a person who does not have a player....
        hope this helps..

        Comment


        • #5
          In theory, it's all possible. The idea would be to concat an avi or mpeg file to the end of a working exe. The program would open itself and seek the start code for the AVI or MPEG and have a built-in AVI/MPEG decoder engine.. Needless to say, while it's possible, it's a royal pain.
          As for the code, save it as anything.c and compile it.

          Comment


          • #6
            http://www.radgametools.com/

            Get Bink tools. They can compile to EXE, but I warn you ... you will need a lot of time to mess about with all the parameters to get satisfactory results!!

            Comment


            • #7
              Howdy,

              Okay, I'm no programmer -- NO programmer -- but I figured out how to create a very simple autorun file that will work with most Windows PCs, as long as Media Player is where it should be. I stick this autorun file in the root directory of my Video CDs. Ahhm, it goes like this:


              [autorun]
              open=C:\Program Files\Windows Media Player\Mplayer2.exe /play /fullscreen /close \Mpegav\Avseq01.dat


              where Avseq01.dat is the target video file. I don't know if it makes any difference but from open to dat is all one line (there's a space between close and \Mpegav. You hit enter/return at the end of the line (that IS important).

              Basically, this just adds the path to Mplayer2.exe, instructs it to play the video at fullscreen and then closes the application when video gets to the end. The last bit of course is the path to the file that is to be played.

              Okay, don't laugh guys.

              It works except when the host system has Active Movie instead of Media Player, or where Media Player has been moved to a different directory for whatever reason, or when the system drive isn't C:/ or when...

              Now if only I can find out how to make an autoplay file for Mac users I'd be set.

              Anyway, I hope this helps.

              BTW, for those who've never made an autorun file (like me before this) use Notepad and save the file as Autorun.inf and the little yellow cog magically appears on the Notepad file icon like it's something really special

              [This message has been edited by Frank Marshall (edited 10 July 2000).]
              Intel TuC3 1.4 | 512MB SDRAM | AOpen AX6BC BX/ZX440 | Matrox Marvel G200 | SoundBlaster Live! Value | 12G/40G | Pioneer DVR-108 | 2 x 17" CRTs

              Comment


              • #8
                It's a whie since I last played with autorun files,but I recall the start command can be used to open a file using its associated application. For example

                [autorun]
                open = start moviefile.avi

                Comment


                • #9
                  HWAA!! That's an incredibly nifty trick!! I'll have to remember that one.

                  Well, Intomisery, it was a .c file, but it would appear that SteveR has your solution. The only reason you would go with my prog is to be able to control whether the window is maximized or not.

                  Comment


                  • #10
                    Hey SteveR,

                    Would this work for Video CDs? What I've found is that since MPEG files are saved with a .dat extension for 'white book' spec VCDs, host systems don't know what to do with them. I've seen a computer try to launch Corel to play the video! Hehehe... Anyway, that's why I had to include the path to Mplayer.exe in my Autorun files.

                    Over'n'out
                    Intel TuC3 1.4 | 512MB SDRAM | AOpen AX6BC BX/ZX440 | Matrox Marvel G200 | SoundBlaster Live! Value | 12G/40G | Pioneer DVR-108 | 2 x 17" CRTs

                    Comment


                    • #11
                      I had to do a similar thing just the other day - I used the 'start' command. But try it on NT - your CD doesn't autorun...

                      What you need to do is get START.EXE from a (I used a win98SE) PC and copy that to the CD, then in the autorun.inf put OPEN=START xxx.MPG then it works a treat, as start.exe is run off the CD.

                      NT Doesn't have a START.EXE to run, that's why it doesn't work. The START command in NT is built into the Command Prompt and only works from there.

                      (Again - this works for any file which already has an associated application. So, it won't work for .DATs if the PC doesn't know what to do with them. - what about sticking on a free movie player on the CD?)
                      ------------------
                      Cheers,
                      Steve

                      "Life is what we make of it, yet most of us just fake"

                      [This message has been edited by SteveC (edited 12 July 2000).]

                      Comment


                      • #12
                        Yes, the start command won't work with a VCD unless the DAT extension is associated with mediaplayer (pretty unlikely).

                        A while back I came across a free Sony VCD player which you could put on a VCD, but I can't remember where to track this down. Maybe someone else has seen this?

                        One way to get round the problem of mplayer2.exe not being where you expect (in the c program example) woould be check the registry key for the installation path.

                        Comment


                        • #13
                          Aw, heck. I got bored. Here's my new-and-improved generic autorun.exe, along with its source code.

                          <a href="http://www.fluggo.com/pub/autorun/autorun.exe">autorun.exe</a>
                          <a href="http://www.fluggo.com/pub/autorun/autorun.cpp">autorun.cpp</a>

                          Here's how to use it: <font size="3"><pre>autorun [/f] [/m] myfile.mpg</pre></font>

                          Autorun will try to hunt down Mplayer2 using the registry and play the specified file using it. If Mplayer2 isn't found, Autorun will try to open the file using its associated program, unless you tell it not to.

                          The /f flag instructs Autorun to stop trying if it doesn't find Mplayer2. Thought that might be useful for those of you making VCD's. The /m flag maximizes whatever player Autorun finds. The flags have to be given in that order.

                          Note that anything specified after the flags is passed on to Mplayer2, so you can use Media Player's /close or /fullscreen flags if you fancy. Just be sure to put them after the filename, or Autorun will get confused. If there's spaces in the path or filename, it's usually a good idea to put it in quotes. Ex: <font size="3"><pre>autorun "My File.mpg"</pre></font>

                          [This message has been edited by fluggo99 (edited 13 July 2000).]

                          Comment


                          • #14
                            Thanks fluggo99,

                            I for one will give this solution a go. Had a wee look at your website too...

                            Keep the faith brother,

                            Frank.
                            Intel TuC3 1.4 | 512MB SDRAM | AOpen AX6BC BX/ZX440 | Matrox Marvel G200 | SoundBlaster Live! Value | 12G/40G | Pioneer DVR-108 | 2 x 17" CRTs

                            Comment


                            • #15
                              Fluggo

                              Thanks for autorun.exe!

                              Are there any other switches that you can use in the command line to exit when finished and select the minimal view. I want to use it as a 'flash' screen before running other programs.

                              intomisery: Can you download that program (the one that came with the Logitech Quickcam) from anywhere on the web?

                              Rod

                              Comment

                              Working...
                              X