I want this to be able to run on an old 32 bit laptop that is limited in ability. I am using Code::Blocks 17.12 (20 will not load). Command line answer or GUI answer; either is usable. There might be an API that I am not aware of, or some code that I have not tried, or you might have made something like this years ago and can show me that code.

If you understand the question, then you might have worked through this years ago. I tried OpenCV; I tried OpenGL; I tried ActiveX; The vast amount of bloat code that accompanies those is beyond what will fit on my old laptop.

I am looking for something simple that runs in C++. It needs to play a small (~ 10 second) AVI in a window that is in my C++ GUI program. No need for any user controls at all. That is it. Windows Media Player is outside of my program therefore not usable.

I do not want some third party program that my code runs outside of my program. I want a C++ library.

  • Windows 7 sp0 (for now, later it should work on XP)
  • Code::Blocks 17.12
  • MinGW GCC (whatever comes with CB-17.12)
  • No Visual (Basic, C++, Studio, etc.)
  • "old 32 bit laptop" doesn't narrow which version of Windows XP OS / what libraries the device is running. You also don't mention which compiler/tool chain you are using. Unclear if you found learn.microsoft.com/en-us/windows/win32/multimedia/mci Alternatively search for "C/C++ Microsoft Windows Programming" books (pdf) published when XP was released may provide what you seek. Commented Mar 15 at 5:08
  • You need a small C++ library to play AVI, right? Maybe something like code.videolan.org/videolan/libvlcpp?
    – Nicolas Raoul
    Commented Mar 15 at 6:27
  • @Morrison Chang Thank you for the link to mci. I have now studied mci and found that it requires Microsoft Visual Studio or Visual something all of which I have found does not work well or fit on my laptop with what else is there. MCI is not an option. Books on the subject sounds reasonable. Thank you for your help. I am using Windows XP (32 bit) Service Pack 1 (sp2 clashes with other software that I use).
    – Line Item
    Commented Mar 15 at 21:45
  • @Nicolas Raoul, Thank you for the suggestion. I think that you are correct that I need a small C++ library to play AVI. videolan and libvlcpp might be the best idea if they do not require Visual Studio stuff, and if I can get them to work with Code::Blocks 17.12. I have been aggressively studying this, but it is so complicated that sometimes I have had to stop and do something else for a while before studying more about it.
    – Line Item
    Commented Mar 15 at 22:00
  • 1
    @Nicolas Raoul, Thank you for your extensive editing of my question. I shall study this and attempt to learn from it.
    – Line Item
    Commented Mar 18 at 16:31

1 Answer 1


If this is a simple file ("AVI" tells nothing) you might use "Animate" from CommCtrl (https://stackoverflow.com/questions/3725265/play-avi-using-animation-control). Otherwise I would go with mplayer in slave mode (https://github.com/tomek-o/VideoPlayer/blob/master/VideoPlayer/MplayerOpenSource.cpp) or libmpv (but I'm not sure about XP compatibility here).

  • Thank you. I will now study CommCtrl via your link. I remember that it was powerful in Visual Basic 6. But, I would be looking to use it in C++11 with a GCC compiler via Code::Blocks. I might test mmplayer "in slave mode", which I did not know existed, before I get back to you also. Thank you.
    – Line Item
    Commented Mar 15 at 22:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.