Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
657a5d7
use frame from composite components without extra composite
tassaron Feb 15, 2026
c97fba1
estimated time remaining
tassaron Feb 15, 2026
a97d45e
begin testing preset manager
tassaron Mar 4, 2026
461e33d
bump version numbers
tassaron May 28, 2026
6826c69
don't complain about known unsupported widgets
tassaron May 28, 2026
b19121a
fix test to use list of unwanted files
tassaron May 28, 2026
219f7e6
Title Text component: rename "Text Layout" to "Alignment". Fixes #102
tassaron May 28, 2026
9a7e574
test that drag-and-drop reorders components
tassaron May 31, 2026
3cdc733
bump pillow version
tassaron Jun 1, 2026
75252a6
update Qt namespace
tassaron Jun 1, 2026
3695b8d
add estimated time to GUI
tassaron Jun 1, 2026
e5b303e
organize MainWindow.__init__
tassaron Jun 2, 2026
5b5b8e6
move setup functions to top of __init__
tassaron Jun 3, 2026
d02d64c
add ComponentPreviewClick action (QUndoCommand)
tassaron Jun 3, 2026
7948b01
click preview window to move title text
tassaron Jun 3, 2026
9b400d2
rename ComponentUpdate to ComponentTrackedWidgetUpdate
tassaron Jun 5, 2026
47def12
Title Text component: centering text is undoable
tassaron Jun 5, 2026
327eada
remove some unnecessary code
tassaron Jun 5, 2026
dc3e567
update Qt namespace
tassaron Jun 5, 2026
3a5126e
minor style/consistency fixes
tassaron Jun 5, 2026
b593e20
Image component: Add shadow options & "center image" button
tassaron Jun 5, 2026
a998a38
Image component: don't change x, y with mouse or button if imagePath …
tassaron Jun 5, 2026
a6d295d
test changing (x, y) with mouse click & center text button
tassaron Jun 6, 2026
2a4d074
change of resolution is undoable
tassaron Jun 6, 2026
dd7a086
close undoDialog and presetManager when MainWindow closes
tassaron Jun 9, 2026
d99cf81
rework relativeWidgets to use less floats
tassaron Jun 11, 2026
071ff3c
allow multiple `--verbose`/`-v` arguments to set log level
tassaron Jun 12, 2026
fd61520
rename parent to loader
tassaron Jun 12, 2026
3b7979f
reduce log spam
tassaron Jun 12, 2026
eaa18ca
update GitHub Actions from v3 to v6
tassaron Jun 13, 2026
e04a6b6
better error when inserting invalid components
tassaron Jun 17, 2026
61363f6
change debug hotkeys to F2 and F5
tassaron Jun 17, 2026
082e872
update resolution periodically instead of instantly
tassaron Jun 17, 2026
989eba1
improve log messages
tassaron Jun 17, 2026
21f9290
improve relativeWidgets to prevent drift caused by rounding errors
tassaron Jun 17, 2026
d003385
remove custom logging level
tassaron Jun 17, 2026
9c3e974
new hotkeys using function keys (F1 through F5)
tassaron Jun 17, 2026
3b724a1
fix drawing multiple preview frames every program launch
tassaron Jun 17, 2026
5d70138
clean up log messages
tassaron Jun 17, 2026
ae85c1e
test if random color of new components is saved for undo/redo
tassaron Jun 17, 2026
4e7def9
add `--size` argument to set resolution from commandline
tassaron Jun 17, 2026
552e851
remove superfluous redraws of the preview window
tassaron Jun 18, 2026
c622183
better log messages
tassaron Jun 18, 2026
82c032c
fix incorrect positions when undoing center and click actions
tassaron Jun 18, 2026
a89e7c9
change absolute imports to relative
tassaron Jun 18, 2026
87a01dc
improve log messages
tassaron Jun 18, 2026
6eb4205
move shared code from Image & Text comps into libcomponent.actions
tassaron Jun 18, 2026
7c6a8ce
test renaming presets
tassaron Jun 19, 2026
4cc13d5
merge resolution changes together in undoStack
tassaron Jun 19, 2026
57e4b8a
Video component: reuse preview frames in same manner as Spectrum comp
tassaron Jun 19, 2026
6925481
add stop method to FfmpegVideo
tassaron Jun 19, 2026
e4186cf
fix rotate
tassaron Jun 19, 2026
d5f24c2
rename Component to BaseComponent
tassaron Jun 19, 2026
c3aabe4
test deletePreset and createPresetFile
tassaron Jul 29, 2026
0437323
resize preview frames using pillow
tassaron Sep 3, 2026
1d922f5
change hotkeys, remove pillow-simd mention, add pytest-xdist info
tassaron Sep 3, 2026
281faf9
Commandline mode: set output size after loading components
tassaron Sep 3, 2026
02600f8
better error checking during rendering
tassaron Sep 3, 2026
08cc8a9
relative widgets code cleanup, show tooltips in gui when logging is e…
tassaron Sep 3, 2026
aa459c6
test Spectrum reuses preview frames
tassaron Sep 3, 2026
891f55b
test Title Text comp uses updated rounded value
tassaron Sep 3, 2026
4fa21ef
test resizing (changing output resolution)
tassaron Sep 3, 2026
92be176
Waveform: fix incorrect frame size when using scale/x/y options with …
tassaron Sep 17, 2026
edf9596
merge undo actions better
tassaron Sep 17, 2026
bb1bd21
more informative names for QUndoCommands
tassaron Sep 17, 2026
e46cd5f
fix Conway Life comp: update grid scale after loading a preset
tassaron Oct 26, 2026
a15a79d
update pillow to v13.0.0
tassaron Oct 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
env:
DISPLAY: ':99.0'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Set up Python 3.12
uses: actions/setup-python@v3
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install system dependencies
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ prof/
.env/
.vscode/
tests/data/config/log/
tests/data/config/presets/
tests/data/config/settings.ini
tests/data/config/autosave.avp
*.mkv
Expand Down
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,20 @@ python3 -m avp
| Ctrl+A | Save Project As... |
| Ctrl+O | Open Project |
| Ctrl+N | New Project (prompts to save current project) |
| F2 | Open Projects Menu |
| F3 | Open Preset Manager |
| F4 | Open Undo History |
| Ctrl+Z | Undo |
| Ctrl+Shift+Z _or_ Ctrl+Y | Redo |
| Ctrl+T _or_ Insert | Add Component |
| Ctrl+R _or_ Delete | Remove Component |
| Ctrl+W _or_ Delete | Remove Component |
| Ctrl+Space | Focus Component List |
| Ctrl+Shift+S | Save Component Preset |
| Ctrl+Shift+C | Remove Preset from Component |
| Ctrl+Shift+S | Save Preset for Selected Component |
| Ctrl+Shift+C | Remove Preset from Selected Component |
| Ctrl+Up | Move Selected Component Up |
| Ctrl+Down | Move Selected Component Down |
| Ctrl+Home | Move Selected Component to Top |
| Ctrl+End | Move Selected Component to Bottom |
| Ctrl+Shift+U | Open Undo History |
| Ctrl+Shift+F | Show FFmpeg Command |

## Using Commandline Interface

Expand All @@ -147,24 +148,22 @@ Projects can be created with the GUI then loaded from the commandline for easy a
- Pillow 12.1.0
- NumPy 2.4.1

### Developing a New Component

- Information for developing a component is in our wiki: [How a Component Works](https://github.com/djfun/audio-visualizer-python/wiki/How-a-Component-Works)
- File an issue on GitHub if you need help fitting your visualizer into our component system; we would be happy to collaborate

### Running Automatic Tests

Run unit and integration tests with `pytest`.
* First you will need to install with `pip install pytest pytest-qt`
* You may omit the slowest test with `pytest -k "not commandline_export"`
* You may use [pytest-xdist](https://pypi.org/project/pytest-xdist/) for speedier test execution

### Installing from TestPyPI

Because some dependencies (namely numpy) are not always on TestPyPI, you must specify when installing that these dependencies should come from the real PyPI.
* `pip install -i https://test.pypi.org/simple/ audio-visualizer-python==x.x.x --extra-index-url https://pypi.org/simple numpy`

### Getting Faster Export Times

- [Pillow-SIMD](https://github.com/uploadcare/pillow-simd) may be used as a drop-in replacement for Pillow if you desire faster video export times, but it must be compiled from source. For help installing dependencies to compile Pillow-SIMD, see the [Pillow installation guide](https://pillow.readthedocs.io/en/stable/installation/building-from-source.html).

### Developing a New Component

- Information for developing a component is in our wiki: [How a Component Works](https://github.com/djfun/audio-visualizer-python/wiki/How-a-Component-Works)
- File an issue on GitHub if you need help fitting your visualizer into our component system; we would be happy to collaborate

## License

Source code of audio-visualizer-python is licensed under the MIT license.
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
[build-system]
requires = ["uv_build>=0.9.23,<0.10.0"]
requires = ["uv_build>=0.9.23,<=0.11.16"]
build-backend = "uv_build"

[project]
name = "audio-visualizer-python"
description = "Create audio visualization videos from a GUI or commandline"
readme = "README.md"
version = "2.2.4"
version = "2.3.0"
requires-python = ">= 3.12"
license = "MIT"
license-files = ["LICENSE", "AUTHORS"]
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3 :: Only",
"Intended Audience :: End Users/Desktop",
"Topic :: Multimedia :: Video",
Expand All @@ -36,7 +35,7 @@ maintainers = [
]
dependencies = [
"numpy>=2.4.1",
"pillow>=12.1.0",
"pillow>=13.0.0",
"pyqt6>=6.10.2",
]

Expand Down
5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

28 changes: 1 addition & 27 deletions src/avp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,8 @@
import sys
import os
import logging


__version__ = "2.2.4"


class Logger(logging.getLoggerClass()):
"""
Custom Logger class to handle custom VERBOSE log level.
Levels used in this program are as follows:
VERBOSE Annoyingly frequent debug messages (e.g, in loops)
DEBUG Ordinary debug information
INFO Expected events that are expensive or irreversible
WARNING A non-fatal error or suspicious behaviour
ERROR Any error that would interrupt the user
CRITICAL Things that really shouldn't happen at all
"""

def __init__(self, name, level=logging.NOTSET):
super().__init__(name, level)
logging.addLevelName(5, "VERBOSE")

def verbose(self, msg, *args, **kwargs):
if self.isEnabledFor(5):
self._log(5, msg, args, **kwargs)


logging.setLoggerClass(Logger)
logging.VERBOSE = 5
__version__ = "2.3.0"


if getattr(sys, "frozen", False):
Expand Down
3 changes: 2 additions & 1 deletion src/avp/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sys
from avp.cli import main
from .cli import main

if __name__ == "__main__":
if sys.argv[0].endswith("-script.pyw"):
sys.argv[0] = sys.argv[0][:-11]
Expand Down
8 changes: 4 additions & 4 deletions src/avp/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Core class must store settings as class variables
# before we can use many things in AVP
Core.storeSettings()
log = logging.getLogger("AVP.Main")
log = logging.getLogger(__name__)


def main() -> int:
Expand Down Expand Up @@ -56,11 +56,11 @@ def main() -> int:
# Both branches here may occur in one execution:
# Commandline parsing could change mode back to GUI
if mode == "GUI":
from avp.gui.mainwindow import MainWindow
from .gui.mainwindow import MainWindow

mainWindow = MainWindow(proj, dpi)
main = MainWindow(proj, dpi)
log.debug("Finished creating MainWindow")
mainWindow.raise_()
main.raise_()

return app.exec()

Expand Down
52 changes: 41 additions & 11 deletions src/avp/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from .core import Core


log = logging.getLogger("AVP.Commandline")
log = logging.getLogger(__name__)


class Command(QtCore.QObject):
Expand Down Expand Up @@ -53,15 +53,24 @@ def parseArgs(self):
"--version", "-V", action="version", version=f"%(prog)s {__version__}"
)

parser.add_argument(
"--size",
"-s",
help="set output frame size (resolution)",
choices=Core.resolutions,
)

# input/output automatic-export commands
parser.add_argument("-i", "--input", metavar="SOUND", help="input audio file")
parser.add_argument(
"-o", "--output", metavar="OUTPUT", help="output video file"
"-i", "--input", metavar="<filename>", help="input audio filename"
)
parser.add_argument(
"-o", "--output", metavar="<filename>", help="output video's filename"
)
parser.add_argument(
"--export-project",
action="store_true",
help="use input and output files from project file if -i or -o is missing",
help="use input and output filenames from project file if -i or -o is missing",
)

# mutually exclusive debug options
Expand All @@ -74,8 +83,9 @@ def parseArgs(self):
debugCommands.add_argument(
"--verbose",
"-v",
action="store_true",
help="send log messages and ffmpeg output to stdout, and create more verbose log files (good to use before --log)",
action="count",
default=0,
help="send log messages and FFmpeg output to stdout, and create more verbose log files (good to use before --log)",
)

# project/GUI options
Expand All @@ -88,9 +98,11 @@ def parseArgs(self):
parser.add_argument(
"-c",
"--comp",
metavar=("LAYER", "ARG"),
help="first arg must be component NAME to insert at LAYER."
'"help" for information about possible args for a component.',
metavar=("<layer>", "<argument>"),
help="Insert component at <layer> (a number from -1 to 50, "
"where 0 is rendered below 50 and -1 is always on top). "
"First argument must be the name of a component. More arguments configure the component. "
"(For example, use '-c 0 classic help' for help with Classic Visualizer component.)",
nargs="*",
action="append",
)
Expand All @@ -102,8 +114,8 @@ def parseArgs(self):

args = parser.parse_args()

if args.verbose:
Core.stdoutLogLvl = logging.DEBUG
if args.verbose > 0:
Core.stdoutLogLvl -= 10 * args.verbose
Core.makeLogger(deleteOldLogs=False, fileLogLvl=logging.DEBUG)

if args.log:
Expand Down Expand Up @@ -142,6 +154,14 @@ def parseArgs(self):
for arg in compargs:
self.core.selectedComponents[i].command(arg)

if args.size:
print("Setting output size to %s" % args.size)
w, h = args.size.split("x")
self.core.settings.setValue("outputWidth", w)
self.core.settings.setValue("outputHeight", h)
for i in range(len(self.core.selectedComponents)):
self.core.selectedComponents[i].updateResolution()

if args.export_project and args.projpath:
errcode, data = self.core.parseAvFile(projPath)
input_ = None
Expand Down Expand Up @@ -177,6 +197,7 @@ def parseArgs(self):
and "help" not in sys.argv
and "--verbose" not in sys.argv
and "-v" not in sys.argv
and "-vv" not in sys.argv
and "--log" not in sys.argv
):
parser.print_help()
Expand All @@ -195,14 +216,23 @@ def createAudioVisualization(self, input, output):
# quit(0) after video is created
self.worker.videoCreated.connect(self.videoCreated)
self.lastProgressUpdate = time.time()
self.lastEstimatedTimeUpdate = time.time()
self.worker.progressBarSetText.connect(self.progressBarSetText)
self.worker.estimatedTimeUpdate.connect(self.estimatedTimeUpdate)
self.createVideo.emit()

def stopVideo(self, *args):
self.worker.error = True
self.worker.cancelExport()
self.worker.cancel()

@QtCore.pyqtSlot(str)
def estimatedTimeUpdate(self, value):
if time.time() - self.lastEstimatedTimeUpdate < 5.0:
return
print(value)
self.lastEstimatedTimeUpdate = time.time()

@QtCore.pyqtSlot(str)
def progressBarSetText(self, value):
if "Export " in value or time.time() - self.lastProgressUpdate < 0.1:
Expand Down
12 changes: 6 additions & 6 deletions src/avp/components/__template__.ui
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
Expand All @@ -36,7 +36,7 @@
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
Expand All @@ -53,7 +53,7 @@
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
Expand All @@ -70,7 +70,7 @@
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
Expand All @@ -87,7 +87,7 @@
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
Expand All @@ -102,7 +102,7 @@
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
Expand Down
6 changes: 3 additions & 3 deletions src/avp/components/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from ..toolkit.frame import BlankFrame, FloodFrame, FramePainter


log = logging.getLogger("AVP.Components.Color")
log = logging.getLogger(__name__)


class Component(BaseComponent):
Expand All @@ -20,8 +20,8 @@ def widget(self, *args):
# disable color #2 until non-default 'fill' option gets changed
self.page.lineEdit_color2.setDisabled(True)
self.page.pushButton_color2.setDisabled(True)
self.page.spinBox_width.setValue(int(self.settings.value("outputWidth")))
self.page.spinBox_height.setValue(int(self.settings.value("outputHeight")))
self.page.spinBox_width.setValue(int(self.core.settings.value("outputWidth")))
self.page.spinBox_height.setValue(int(self.core.settings.value("outputHeight")))

self.fillLabels = [
"Solid",
Expand Down
Loading
Loading