How to play a MP4 video?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Not possible at the moment, sorry. I have had luck with using AVI files encoded with XViD codec, which gives quality comparable to MP4 (though the filesizes may be larger). You can play said AVI files with Active DirectShow object.

    There are no impossible things, there is only lack of skill needed to complete the task.

  • Not possible? O_o Why do you say that?

    It works fine, at least with DX11 & Media Foundation option in the Active DirectShow object (I remember I had it work with DX9 too in the past but maybe it's more random).

    Of course you must be sure the codecs used to encode video & audio in the MP4 file are installed on the user's machine (MP4 is just a container, not a compression format).

  • Not possible? O_o Why do you say that?

    It works fine, at least with DX11 & Media Foundation option in the Active DirectShow object (I remember I had it work with DX9 too in the past but maybe it's more random).

    Of course you must be sure the codecs used to encode video & audio in the MP4 file are installed on the user's machine (MP4 is just a container, not a compression format).

    Hi Yves,
    I have DirectX 12 installed and still can't play a MP4 video with the Active DirectShow object... Can you please explain in detail? What is Media Foundation? Thanks a lot!

  • Ah, you need the 2.5+ DLC, it adds a DirectX 11 display option to the application and the MS Media Foundation option can be activated in the properties of the Active DirectShow object in DX11 mode (with this option the Active DirectShow object uses MS Media Foundation instead of Direct Show)

  • I managed to play MP4 vidos via Direct Show object in Direct3D 9 mode by installing the K-Lite Codec Pack (K-Lite_Codec_Pack_1560_Basic.exe).

    So you can play pretty much all common audio and video formats.

  • I managed to play MP4 vidos via Direct Show object in Direct3D 9 mode by installing the K-Lite Codec Pack (K-Lite_Codec_Pack_1560_Basic.exe).

    So you can play pretty much all common audio and video formats.

    If you intend to distribute your game, this becomes reliant that the end user has this installed on their machine. I ran into this issue a LOT with my demo in 2017. It's best to use something like WMV that will be more commonly available by default on the user's machine.

    Please login to see this link.

  • If you intend to distribute your game, this becomes reliant that the end user has this installed on their machine.

    That's right but the way the Direct Show obejct works.


    There may be another solution but it feels a little bit like a workaround. It might work in most cases and without having to install DirectX codecs.
    The WebView2 object can display videos too. You also can control the playback with JavaScript if necessary.

    Just use the Load HTML action with this code to start:

    HTML
    <video width='400' autoplay>
      <source src='C:\folder\video.mp4' type='video/mp4'>
      Video playback is not supported.
    </video>


    More info here: Please login to see this link.


    Even if this isn't the most clean solution - it works. Just collecting solutions here. :)

    Regards
    Gustav

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!