menu
  Home  ==>  papers  ==>  graphic  ==>  delphi_video_player   

Delphi Video Player - Felix John COLIBRI.

  • abstract : video player with Delphi source code
  • key words : video player - mp4 - wmv
  • software used : Windows XP Home, Delphi 2006
  • hardware used : Pentium 2.800Mhz, 512 M memory, 140 G hard disc
  • scope : Delphi 7, 8 Delphi 2005, 2006, Turbo Delphi, Turbo 2007, Rad Studio 2007-2010
  • level : Delphi developer
  • plan :


1 - Delphi Video Players

When Delphi started to be presented using videos, I was unhappy to use the standard video players, because :
  • some audio was barely understandable, and required two or three back steps replays to make sense
  • the Delphi demo was too quick to see which menu exactly was clicked to set some functionality
  • since the demo text was nearly never available in source, I had to stop the image to be able to quietly read the pascal text. Sometimes the controls stopping the video were at the bottom of the screen, which caused the Delphi IDE Menu at the top to be scrolled out of view.
  • to remember the important points, no snapshot facility was possible (other than copying the screen to the ClipBoard)

So I wrote my little home cooked Flash player which just did the job for me.



But then

  • the ShockWave version changed, and the new Activx was not as easy to use
  • some other weired formats were used (QuickTime, Wmv etc)
Now that the launch of XE is nearing, video season has arrived again. And, surprise, the used format is now MP4.



I was desperately looking for a way to tame this format, and could not find much solace on Tamaracka, StackOverflow or Google. Finally I looked on Torry, an found exactly what I was looking for: tMPlayer.



2 - tMplayer video player

As quoted from Torry:

  • "By Zozito Pelegrin. TMPlayer is not a video player; it is a open source Delphi component front-end of MPLAYER.
    You can create your own media player with a few lines of code or include almost any kind of media-video to your application in an easy way.
    Based on the original code from the MPUI project of Martin J. FIELDER and also is included a free tMPlayer project in the demo folder."



    Therefore :

    • tMplayer uses MPLAYER as the video engine. The .ZIP contains MPLAYER.EXE (a 7 Meg .EXE containing all the codecs and the video machinery)
    • as Zozito Pelegrin honestly mentions, tMplayer is "not a media player, but an encapsulaton of a media player".
      Granted. But on this account, our own little Swf Player was not a mediaplayer either: it is an Ocx encapsulation. Even Henri GOURVEST's DSPack is a layer above MS Direct Show and DirectX technologies. I doubt any Delphi product will ever go down to writing the codecs or the cosine transforms or whatever to unpack the media flows !

      As far as I am concerned, tMPlayer it is whatever I needed to customize my video needs.

    • tMPLayer is derived from MPUI which is another, former, Delphi encapsulation of MPLAYER. The MPUI site is worth looking at because it has a one page documentation about the available commands


    To recap, tMplayer is
    • free
    • open source (the encapsulation. Mplayer is also free, but not in Delphi)
    • with a nice, working, efficient tMPlayer demo (called MZPlayer), in source and .EXE format.


    Voilą :

    xe_preview



    Therefore, tMplayer : What else ?



    3 - tMplayer customization

    Although the demo .EXE can be used as a full fledged viewer right out of the box, we added a couple of minor modifications :
    • changed the 10 second jump in a 3 second jump (1, 10 and 60 seconds were already on the toolbar)
    • added a tDirectory / tFileLisbox, with favorites and history for improved search, in addition to the existing OpenDialog
    • added a "restart from previous session"
    • added a snapshot, with destination selection and ClipBoard


    Let's also mention that
    • we could not play the .SWF
    • MP4 and WMV were a snap


    4 - Suggestion

    Delphi seems to integrate more and more external tools: memory manager, Active Query, Indy Http Server (for Wad), now Jedi Svn, Beyond Compare, AQTime, CodeSite etc. Which is fine, since we all benefit from the derived productivity gains.

    So I could suggest to Delphi team to look at this tMPlayer, and add it to the Palette



    5 - Links

    the tMPlayer code: and other projects :
    • MPlayer, the Movie Player
    • MPUI - the mPlayer frontend for Windows - Martin FIELDER
    • The DSPack Project : a set of Delphi Components and class to write Multimedia Applications using MS Direct Show and DirectX technologies - Henry GOURVEST


    As usual:
    • please tell us at fcolibri@felix-colibri.com if you found some errors, mistakes, bugs, broken links or had some problem downloading the file. Resulting corrections will be helpful for other readers
    • we welcome any comment, criticism, enhancement, other sources or reference suggestion. Just send an e-mail to fcolibri@felix-colibri.com.
    • or more simply, enter your (anonymous or with your e-mail if you want an answer) comments below and clic the "send" button
      Name :
      E-mail :
      Comments * :
       

    • and if you liked this article, talk about this site to your fellow developpers, add a link to your links page ou mention our articles in your blog or newsgroup posts when relevant. That's the way we operate: the more traffic and Google references we get, the more articles we will write.
  • Created: aug-10. Last updated: jul-15 - 98 articles, 131 .ZIP sources, 1012 figures
    Copyright © Felix J. Colibri   http://www.felix-colibri.com 2004 - 2015. All rigths reserved
    Back:    Home  Papers  Training  Delphi developments  Links  Download
    the Pascal Institute

    Felix J COLIBRI

    + Home
      + articles_with_sources
        + database
        + web_internet_sockets
        + oop_components
        + uml_design_patterns
        + debug_and_test
        + graphic
          – delphi_3d_designer
          – write_a_flash_player
          – delphi_video_player
        + controls
        + colibri_utilities
        + colibri_helpers
        + delphi
        + firemonkey
        + compilers
      + delphi_training
      + delphi_developments
      + sweet_home
      – download_zip_sources
      + links
    Contacts
    Site Map
    – search :

    RSS feed  
    Blog