Play Mpegmovies with Delphi

I'm writing an mutimedial CD-Rom and want to play some movies. Instead of the standard avi-format I want to use mpeg movies. Is there a free component to manage this?
redforceAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Phoenix_sCommented:
use the TMediaPlayer component in Delphi (depends which version of delphi you use)  that should play most of the mpegs. Mind you... another gentleman here is having difficulties playing some mpeg formats with delphi 3's TMediaPlayer and that may be an incompatability issue. Other than that, I recommend combing the free component sections of several popular delphi pages... OR... use OLE automation to launch the Windows Media Player with the file you want played.  Windows media player should be the most accurate player of mpegs around, and it will auto download new codecs if needed.
0
xpherCommented:
I had same problem. I solved it by putting the setup program for Active Movie on the CD. When the CD  is started I have a small test file to attempt to open (which is not shown) if this is not there then I launch a setup option for Active Movie. I have this in my project source, this is just a snippet as there is allsorts of other things going on.

 try
      Application.ShowMainForm := False;
      with MainForm.MediaPlayer1 do
        begin
          FileName := 'video\test.mpg';
          Open;
        end;
      //my other stuff
      Application.Run;

      except on EMCIDeviceError do
      begin
      s := MessageDlg('You do not appear to have the correct drivers installed'
                + ' for viewing the videos in this software. '
                +'Would you like to install them now?',
                 mtError,[mbOK, mbCancel],MB_TASKMODAL);
        case s of
          1:begin
              Command := 'amov\amov4ie.exe' + #0;
              if WinExec(@command[1], SW_SHOWNORMAL) < 32 then
              MessageDlg('Failed to execute', mtError, [mbOK], 0);
              Application.Terminate;
            end;
          2: Application.Terminate;
      end;

end
  else
  begin
   Application.ShowMainForm := True;
   MainForm.Visible := True;
  end;
  end;
  end;  
Application.Run;  

As I say this isn't a complete piece but hope it gives an idea of what I mean.

cheers
chris
0
bryan7Commented:
listenning..

0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

redforceAuthor Commented:
My code should check like xpher wrote, if the computer could play mpeg files. The best thing would be if it add the code automatic from my programm if needed, so that the user don't see it.
0
xpherCommented:
I don't think this can be done without user knowing you are installing to their machine. Plus it is probably only fair to be honest about what you are doing. I have had no negative feedback only positive for the way I achieved it.

regards
xpher ;)
0
TheNeilCommented:
You can just use the standard Delphi TMediaplayer component...just so long as you have your MPEG CODEC installed correctly. Be warned though, for some MPEG files you might need dedicated hardware to handle the compression/decompression
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
xpherCommented:
This wont work if codecs etc not installed on user's machine.

xpher
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.