How to test ffmpeg in PySide 6.4?
-
I am trying to test media player with ffmpeg in PySide 6.4. From this link https://doc-snapshots.qt.io/qt6-6.4/qtmultimedia-index.html it says: "You can test the FFmpeg backend right now by using a Qt build that has FFmpeg enabled and setting the QTMEDIABACKEND environment variable to ffmpeg: export QTMEDIABACKEND=ffmpeg"
This statement above seems to be for C++.
Could somebody provide some tips on how to do that in PySide?
I have installed the latest PySide 6.4
Thank you -
Hi and welcome to devnet,
I would define it in the terminal where you start your script.
-
@SGaist thank you for the quick reply.
I apologize but I did not get your comment. I need to define what and how?
Do I need to add another package to my pyside6.4 package (which I installed using pip)?
I grepped the pyside6.4 package that was installed and could not find any occurrence of ffmpeg in it.
I am new to pyside (and Qt) and have never tested a functionality which is not yet in production before.Thank you for your understanding.
-
Let's go from the start:
- what are you using to start your Python application ?
- do you know what an environment variable is ?
- which OS are you running ?
-
@greengoblin said in How to test ffmpeg in PySide 6.4?:
python <myapp.py> from command prompt
The suggestion is just before that line try putting in:
set QT_MEDIA_BACKEND=ffmpeg
Whether this is intended to work under Windows I don't know.
-
@JonB Thank you but this did not work.
As per my initial question, this statement " by using a Qt build that has FFmpeg enabled" is bothering me. How can I confirm that the version of PySide 6.4 that I installed indeed has ffmpeg? That's why I was asking if I need to install anything else.
Thank you
-
@greengoblin
My suspicion is that this would have nothing to do with the PySide. Rather however the Qt6.4. it uses has been built. And assuming the PySide6 comes with a pre-compiled Qt6.4 I don't know how you would know, and that might well have been built without the necessary flag/support.Thank you but this did not work.
Does this mean it behaved no differently from before, i.e. no message about the environment variable/ffmpeg now?
-
I made some progress. I recreated a new virtual environment and reinstalled PySide. However, when I set the environment variable I get an error. Note that I am using the example player that comes with PySide
(ffmpeg) C:\ffmpeg>
(ffmpeg) C:\ffmpeg>set QT_MEDIA_BACKEND=ffmpeg(ffmpeg) C:\ffmpeg>python player.py
could not load multimedia backend "ffmpeg"
QtMultimedia is not currently supported on this platform or compiler.(ffmpeg) C:\ffmpeg>
If I do not set the variable, the player starts fine.