Package: vidify
VidifyWatchmusic videos in real-timefor the songs playing on your deviceA lighter and less dev-oriented version of this README can be found atvidify.org. The official site also has translations available.Table of contentsInstallationThe APIsThe PlayersThe External PlayerAudio SynchronizationUsage and configurationFAQDevelopment resourcesTestsCurrent LimitationsInstallationVidify is intended to be modular. By default, it includes support for the most popular music players (a.k.a.APIs). Same goes for thevideo players(currently,VLCby default). This can be extended by installing the required dependencies listed in their sections.Here are the different ways to install Vidify, depending on your Operating System:Cross-platform:Withpip:pip install --user vidify. Optional APIs and Players can be installed withpip install --user vidify[extra1,extra2], which is equivalent to installing the list of dependencies needed forextra1andextra2.Windows or Linux:Using the binaries from thelatest stable releases. These include support for all optional APIs, and use mpv as the player.Linux:Arch Linux: you can install it from the AUR:vidify. Maintained by me (marioortizmanero).Gentoo Linux: there's an ebuild maintained byAndrewAmmerlaanin theGURU overlayatmedia-video/vidify:eselect repository enable guru && emerge --sync guru && emerge vidifyFeel free to upload it to your distro's repositories! Let me know in an issue so that I can add it to this list.Note: Vidify requires Python >= 3.6.The APIsAn API is simply a source of information about the music playing on a device. For example, the Spotify desktop client, or iTunes. Here are the currently supported ones:NameWiki linkExtra requirementsDescriptionLinux Media Players (mpris_linux*)🔗Installed by default(see the wiki)Any MPRIS compatible media player for Linux or BSD (99% of them, like Spotify, Clementine, VLC...).Spotify for Windows & MacOS (swspotify*)🔗Installed by defaultThe Spotify desktop app for Windows & MacOS, using theSwSpotifylibrary.Spotify Web (spotify_web*)🔗Installed by defaultThe official Spotify Web API, usingTekore. Check the wiki for more details on how to set it up.* The name inside parenthesis is used as a key for theargumentsand theconfigoptions.--api mpris_linuxwould force using the Linux Media Players API, for instance. It's also used for the extra dependencies installation with pip:pip install vidify[extra1]would install all the extra requirements forextra1with pip.The playersThe embedded video players inside the app. The default one is VLC because it's more popular, but you can use others if you have the player itself installed, and the Python extra dependencies.NameExtra requirementsDescriptionArguments/config optionsVLC (vlc)VLCThe default video player. Widely used and very solid.--vlc-args <VLC_ARGS>Mpv (mpv)Mpv,python-mpvA command-line portable video player. More lightweight and precise than VLC.--mpv-flags <MPV_ARGS>(only boolean flags)External (external)Installed by defaultPlay the videos on external devices. Check theexternal players sectionfor more.NoneFor now, the only way to specify what player to use is withargumentsor inside theconfig filewith the internal name. You can use--player mpvor save it in your config file for future usage:[Defaults]player=mpvThe external playerThe external player lets you play Vidify's music videos essentially anywhere. It will send all the music video information to an external application. Here are the current implementations:Vidify TV: available on Android, Android TV and Amazon Fire Stick TV.Play Store page.Audio synchronizationVidify has an audio synchronization feature. The full repository is invidify/audiosync. It's still Work-In-Progress.Audiosync is only available on Linux for now. It's strongly recommended to use Mpv as the video player. You can install it withpip install vidify[audiosync], along with the following dependencies:FFTW:libfftw3on Debian-based distros.ffmpeg:ffmpegon most repositories. It must be available on your path.pulseaudio:pulseaudio, pre-installed on most repos.youtube-dl: this is installed by default with Vidify, but make sure it's available on your path.It's also available asvidify-audiosyncon the AUR, and it comes pre-installed in the binaries.It can be activated with--audiosync, or inside yourconfig file:[Defaults]audiosync=trueYou can calibrate the audiosync results with the option--audiosync-calibrationoraudiosync_calibration. By default it's 0 milliseconds, but it may depend on your hardware.Note: if when using audiosync there's no sound, you might need to disable stream target device restore by editing the corresponing line in/etc/pulse/default.patoload-module module-stream-restore restore_device=false.Note 2: you should make sure that the sink being recorded is eitheraudiosync, or the one where the music is playing. Here's an example on Pavucontrol (it's usually called 'Monitor of ...'):UsageThe app has an interface that will guide you through most of the set-up, but you can use command line arguments and the config file for more advanced options (and until the GUI is completely finished):usage: vidify [-h] [-v] [--debug] [--config-file CONFIG_FILE] [-n] [-f] [--dark-mode] [--stay-on-top]
              [--width WIDTH] [--height HEIGHT] [-a API] [-p PLAYER] [--audiosync]
              [--audiosync-calibration AUDIOSYNC_CALIBRATION] [--vlc-args VLC_ARGS]
              [--mpv-flags MPV_FLAGS] [--client-id CLIENT_ID] [--client-secret CLIENT_SECRET]
              [--redirect-uri REDIRECT_URI]ArgumentDescription-n,--no-lyricsdo not print lyrics.-f,--fullscreenplay videos in fullscreen mode.--dark-modeenables dark mode for the GUI.--stay-on-topthe app window will stay on top of other apps.--width <WIDTH>set the width for the downloaded videos (this is useful to play lower quality videos if your connection isn't good).--height <HEIGHT>set the height for the downloaded videos.-a,--apispecify the API to use. See theAPIs sectionfor more info about the supported APIs.-p,--playerspecify the player to use. See thePlayers sectionfor more info about the supported players.--audiosyncenables theAudio Synchronizationfeature (disabled by default).--audiosync-calibrationYou can calibrate the delay in milliseconds audiosync returns with this. It can be positive or negative. The default is 0ms.--config-file <PATH>indicate the path of yourconfig file.The config fileThe configuration file is created by default at your usual config directory:Linux:~/.config/vidify/config.ini(or in$XDG_CONFIG_HOME, if defined)Mac OS X:~/Library/Preferences/vidify/config.iniWindows:C:\Users\<username>\AppData\Local\vidify\vidify\config.iniYou can use a custom one by passing--config-file <PATH>as an argument. The config file is overriden by the configuration passed as arguments, but keeps your settings for future usage.Here's an example of one. It uses theINI config file formatting. Most options are inside the[Defaults]section.All the available options for the config file are the same as the arguments listed in theUsage section, except for--config-file <PATH>, which is only an argument. Their names are the same but with underscores instead of dashes. For example,--use-mpvwould be equivalent touse_mpv = true.FAQVidify doesn't work correctly with Python 3.8 and PySide2PySide2 started supporting Python 3.8 with the 5.14 release. Make sure you're using an updated version and try again.TypeError: 'Shiboken.ObjectType' object is not iterablewill be raised otherwise.ModuleNotFoundError: No module named 'gi'when using a virtual environmentFor some reason,python-gobjectmay not be available inside a virtual environment. You can create a symlink inside it with:ln-s"/usr/lib/python3.8/site-packages/gi""$venv_dir/lib/python3.8/site-packages"or install it with pip followingthis guide.Vidify doesn't recognize some downloaded songsIf the song doesn't have a metadata field with its title and artist (the latter is optional), Vidify is unable to know what song is playing. Try to modify the metadata of your downloaded songs with VLC or any other tool.FileNotFoundError: Could not find module 'libvlc.dll'.Make sure that both Python and VLC are either 32 bits, or 64 bits, but not different. You should have a directory calledC:\Program Files (x86)\VideoLAN\VLC(32b), orC:\Program Files\VideoLAN\VLC(64b).Not playing any videos (HTTP Error 403: Forbidden)If Vidify is not playing any videos, and is throwing 403 Forbidden errors (with the--debugargument). The YouTube-DL cache has likely become corrupt or needs to be regenerated because of other reasons, please try deleting~/.cache/youtube-dl.DevelopmentHelpful documentation links for contributing:DBus,pydbus,MPRIS,Qt for Python.python-vlc,python-mpv.The app logo was created byxypnoxin thisissue.The changelog and more information about this program's versions can be found in theReleases page.External player implementationsThe Vidify external player has an open protocol for anyone to implement their own app or program to play the videos. You can read more about how it works in thiswiki article.TestsYou can run the module locally withpython -m vidify.This project usesunittestfor testing. Run them withpython -m unittest. You'll need all the extra dependencies installed for this to work.