TimeLineAnnotator / desktop

A GUI for graphical analysis and annotation of video and audio files.
https://tilia-app.com
Creative Commons Attribution Share Alike 4.0 International
8 stars 2 forks source link

QtWarningMsg: No QtMultimedia backends found. #95

Closed FelipeDefensor closed 1 month ago

FelipeDefensor commented 1 month ago

I was able to fix this, but will document it here for future reference.

I got these warnings when booting up TiLiA:

QtWarningMsg: No QtMultimedia backends found. Only QMediaDevices, QAudioDevice, QSoundEffect, QAudioSink, and QAudioSource are available. QtWarningMsg: Failed to initialize QMediaPlayer "Not available"

Attempting to load any media seemed to fail, as the duration never changed from zero. Also, clicking the play button would not trigger playback.

This happened on Windows 11, right after I upgraded from PyQt6.6 to PyQt6.7.

FelipeDefensor commented 1 month ago

I found out that setting the environment variable QT_MEDIA_BACKEND to windows solved the issue. So this indicated a problem related to ffmpeg, as the default value for that variable is ffmpeg. Using the windows backend is not ideal, as it can't play some media formats (e.g. OGG), and I wasn't sure how other OSes would behave with their native backend.

I attempted installing ffmpeg and adding it to PATH to no avail. Upon trying to build a new release to see the behavior in production, pyinstaller complained about missing DLLs, somewhat like this:

29997 WARNING: Library not found: could not resolve 'libopus-0-a3254020fecb60495e60c82aaa0b8b1e.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
29998 WARNING: Library not found: could not resolve 'libvorbisenc-2-67bba0bfb1864165ab785b4875f3052f.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
29998 WARNING: Library not found: could not resolve 'avutil-58-b1f51997a6665a4f274b539a784624e9.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
29998 WARNING: Library not found: could not resolve 'libaom-9bc9ff8a6d17a016e68bb4f44fdd4c33.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
29999 WARNING: Library not found: could not resolve 'libspeex-1-5f1b71d5b54e8dd10fdf935934dece0a.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
29999 WARNING: Library not found: could not resolve 'libx264-164-cd9402bbb21d1cea6d3700684b574af8.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
29999 WARNING: Library not found: could not resolve 'libmp3lame-0-4c85391f6acc80a71aa47affb51e1aa8.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
30000 WARNING: Library not found: could not resolve 'libiconv-2-9e6bf66faada58d34b0c3c88db44b2b9.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
30000 WARNING: Library not found: could not resolve 'libvpx-1-0525d139447fbd4f499a708489777e0a.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
30000 WARNING: Library not found: could not resolve 'libdav1d-abc2cd116141dbd002b18f05bc0a108d.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
30000 WARNING: Library not found: could not resolve 'libopencore-amrwb-0-66563afc622e6159b2dcf654a88217e4.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
30001 WARNING: Library not found: could not resolve 'libvorbis-0-f7cdd39bcb7870fc005ed7516ed16fa2.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
30001 WARNING: Library not found: could not resolve 'zlib1-f2ad9b084a1a133bf3202d8ac1d39ae2.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
30001 WARNING: Library not found: could not resolve 'libx265-7159063fae10501d61b8fc9dbf911e57.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
30001 WARNING: Library not found: could not resolve 'liblzma-5-87ff93945d4eaf3accbcbdb6bb4f8f67.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
30002 WARNING: Library not found: could not resolve 'libopenjp2-60b9f94791ad8cc0823e845518f826e6.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
30002 WARNING: Library not found: could not resolve 'xvidcore-3e8bed1e9a9ca8ea2f7704b08308a902.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
30002 WARNING: Library not found: could not resolve 'libtwolame-0-f0dfaa53c080b4064eed916ac81b36ed.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
30002 WARNING: Library not found: could not resolve 'libopencore-amrnb-0-89df564a4ce56dea03c5ca69d384610d.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
30003 WARNING: Library not found: could not resolve 'swresample-4-145ca521ab9fe87947670095859f128a.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avcodec-60.dll'.
30003 WARNING: Library not found: could not resolve 'avutil-58-b1f51997a6665a4f274b539a784624e9.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\swresample-4.dll'.
30003 WARNING: Library not found: could not resolve 'libxml2-2-fcebdaedef8df8013f894c117931124f.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avformat-60.dll'.
30003 WARNING: Library not found: could not resolve 'avcodec-60-f63cbac0c72fc68821be5111ff62b851.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avformat-60.dll'.
30004 WARNING: Library not found: could not resolve 'libiconv-2-9e6bf66faada58d34b0c3c88db44b2b9.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avformat-60.dll'.
30004 WARNING: Library not found: could not resolve 'zlib1-f2ad9b084a1a133bf3202d8ac1d39ae2.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avformat-60.dll'.
30004 WARNING: Library not found: could not resolve 'libbluray-2-e1447a1b81f8da62005005cba0a312e7.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avformat-60.dll'.
30004 WARNING: Library not found: could not resolve 'libgmp-10-27e2984acc1218ce49d7a0506edd617d.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avformat-60.dll'.
30004 WARNING: Library not found: could not resolve 'avutil-58-b1f51997a6665a4f274b539a784624e9.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avformat-60.dll'.
30005 WARNING: Library not found: could not resolve 'avutil-58-b1f51997a6665a4f274b539a784624e9.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\swscale-7.dll'.
30007 WARNING: Library not found: could not resolve 'libwinpthread-1-7980ab0ffd8adaa444e4b4926cdf939c.dll', dependency of 'C:\\Users\\Felipe\\dev\\tilia-desktop\\venv\\Lib\\site-packages\\PyQt6\\Qt6\\plugins\\multimedia\\avutil-58.dll'.

The original warnings where less numerous (5 or 6) and dindn't feature a hash in the name of the DLLs.

FelipeDefensor commented 1 month ago

The solution was installing PyAV (pip install av), copying all the DLLs from venv/Lib/site-packages/av.libs to a folder outside the virtual environment, adding that folder to PATH, and reinstalling PyQt. This also fixed the pyinstaller build. Uninstalling PyAV later did not reproduce the bug.