Setup Gstreamer with Python on Windows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MyrinNew
    Senior Member
    • Feb 2024
    • 5175

    #1

    Setup Gstreamer with Python on Windows

    When I started trying Gstreamer with Python on Windows 10, it took me quite some time to set up the dev environment. So this might help others on the way.


    The most convenient approach is through MSYS2. Here are the steps:

    1. Download and install MSYS2: https://www.msys2.org
    2. Install Python, GStreamer, tools, plugins, and PyGObject
      • Open MSYS2 UCRT64 terminal
      • Update MSYS2 pacman -Syu. After this, the terminal may close; you need to open it again.
      • Install gcc pacman -S mingw-w64-ucrt-x86_64-gcc
      • Install Python, GStreamer, tools, plugins, and PyGObject
        pacman -S mingw-w64-x86_64-python3 mingw-w64-x86_64-gstreamer mingw-w64-x86_64-gst-devtools mingw-w64-x86_64-gst-plugins-{base,good,bad,ugly} mingw-w64-x86_64-python3-gobject
      • Add the following paths to ~/.bashrc




    export PATH="/mingw64/bin:$PATH"
    export XDG_DATA_DIRS="/mingw64/share/:$XDG_DATA_DIRS"
    • Apply bashrc: source ~/.bashrc

    1. Test: run this on the terminal python -c "import gi; gi.require_version('Gst', '1.0'); from gi.repository import Gst; print(Gst.version_string())"




    More...
Working...