Giter Club home page Giter Club logo

audio-visualizer-python's People

Contributors

djfun avatar hunterwolfat avatar rikai avatar tassaron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

audio-visualizer-python's Issues

Proper setuptools.py

Can you explain the logic behind the current setuptools.py file? Looks like it was made to create an exe for windows but I'm not sure.

Was looking to adjust setuptools and adjust the directory structure for proper python packaging so we can run the tool without doing "python main.py"

Color issue

When I click the box by the text that says Visualizer:, AVP crashes with this message:

Traceback (most recent call last):
  File "main.py", line 172, in <lambda>
    window.pushButton_visColor.clicked.connect(lambda: self.pickColor('vis'))
  File "main.py", line 307, in pickColor
    color = QtGui.QColorDialog.getColor()
AttributeError: module 'PyQt5.QtGui' has no attribute 'QColorDialog'
Abort trap: 6

Update to Qt5

Last thing that needs to be done before packaging is an update to Qt5.8. Work on this is currently underway in the feature-newgui-qt5 branch

HiDPI seems broken

At least under HiDPI gnome, the text size in the preview looks pretty messed up:
image

And that continues into the exported product:
image

My current working theory is that UI scaling is messing with the font size, waiting on someone with HiDPI to try in a non-scaled environment to see if it corrects the issue and if so we can continue from there. Could also be something else, though.

The UI looks a bit messy as well, but that's somewhat expected, tbh. It looks about as bad on the mac, so that's a separate issue.

Unable to Run After installing

I'm on Ubuntu 16.04.2. I installed the python and ffmpeg/avconv stuff, then I downloaded the code and trying python3 main.py and get the following

Traceback (most recent call last):
File "main.py", line 8, in
from PIL.ImageQt import ImageQt
File "/usr/lib/python3/dist-packages/PIL/ImageQt.py", line 26, in
from PyQt5.QtGui import QImage, qRgba, QPixmap
RuntimeError: the PyQt5.QtCore and PyQt4.QtCore modules both wrap the QObject class

Multi-pass encoding

I took a swing at implementing this myself already, but it was more difficult than i anticipated.

The ability to do multi-pass encoding would help to improve the quality:filesize ratio, though.

command line input

it would be awesome if it was possible to run this as an commmand line tool.

something like this
python3 main.py -i input.mp3 -o output.mp4 -b background.png -t "The text"

Add the ability to specify more parameters.

From the discussion in PR #4:

Being able to specify the frame size, fps, audio and video codecs and bitrates, format & more makes sense and honestly probably shouldn't be hardcoded at all.

Additionally, I think a dialog to specify custom additional parameters might be nice to have as well.

There's probably some crossover with #6 and this issue as well.

Expand functionality, add more visualization options

As introduced in #9 (comment), the idea is to have the ability to add more visualization options.
I made a UI mockup with http://pencil.evolus.vn/ how such a system could look like:
audio-visualizer-mockup1
If someone wants to extend this mockup, I can upload the .epgz file.

I would like to have some thoughts, opinions, new ideas on this suggestion and possibly already people who would offer to help with the programming.

Waveform component is too sensitive/fast

The waveform component is very sensitive. It would be more useful if it moved slower. I consider this a bug because the current sensitivity is just ugly, not really suitable to be called a "visualizer".

It's using FFmpeg filters called showwaves and showfreqs.

Any input/feedback/help is appreciated :)

Option 1:

  • Create some FFmpeg complex_filter command that smooths that audio stream before the showwaves filter
    • I tried this but I don't know if it's even possible

Option 2:

  • Give FFmpeg some wrong parameters (i.e., draw frame too small). You can create a smoother effect this way but it results in a blurry image. Maybe we could do something with it, though

Option 3:

  • Take the FFmpeg input every 30 frames (for example) and do some interpolation/smoothing/fading between the frames to make a smoother, more unique visualization outside of FFmpeg (easiest option, I'll probably try this eventually)

Package for Easier Installation

Below I'll outline some packaging possibilities. Bundling dependencies with container formats on Linux, and for easier distribution on Windows and Mac may require a licensing change. The feature-newgui branch is where all development for the next release is happening.

Linux

  • Snap Package
  • AppImage
  • Flatpack
  • Deb & RPM Repos

macOS

  • py2app
  • Homebrew

Windows

  • cx_Freeze + Installer

Current Dependencies on feature-newgui Branch

  • numpy
  • pillow-simd
  • qt5
  • pyqt5
  • ffmpeg 3.3

Conway's component does not prevent infinite growth

Putting an infinite growth pattern into the Conway's Game of Life component will crash while "computing evolution", because there is no limit to stop infinite recursion causing infinite memory usage until the program is killed by the OS

This is a preset that crashes the program if imported into the component:

[Components]
Conway's Game of Life
1
OrderedDict([('GRID', [(6, 4), (6, 5), (6, 8), (7, 4), (7, 7), (8, 4), (8, 7), (8, 8), (9, 6), (10, 4), (10, 6), (10, 7), (10, 8)]), ('color', (85, 0, 127)), ('customImg', False), ('image', ''), ('preset', 'Infinite Growth Crash'), ('scale', 32), ('shadow', False), ('shapeType', 0), ('showGrid', True), ('tickRate', 5)])

I'll fix this myself eventually but if anyone want to help, feel free :)

Make v2 (newgui) installable

I am trying to resurrect this project because I'm still proud of the work I did on the feature-newgui branch. At the very least I would like to get the project working from that branch mostly as-is with critical bugs fixed.

I don't necessarily need any help with this, I'm just creating an issue to help track my progress.

@djfun How interested are you in merging newgui nowadays (given that it's been a while)? If you don't want it to replace the original then we could perhaps split this into a separate repo (with both of us having write permission). I don't mind either way.

The app works on Kubuntu 22.04 (my system) if I pip install it. I'm choosing to focus on that OS, and Windows 11, for the time being. I'm gonna try to get a py2exe (pip freeze?) type of distribution, then I'll test on Windows 10.

To-Do List

  • Create some tests of the Core at least -- these can be included with the app so people can run them to gather data to report bugs
  • Remove avconv support (that's vestigial code in my opinion)
  • In the error message that says the version of ffmpeg, inform the user that they need the GPL version. Tell them where to put the exe file or let them select a location.
  • Changing Color component to a gradient causes instant crash without an exception. Could be a segmentation fault in Qt but normally it would print an error message of some kind.
    • Happens on Windows 11 with Qt 5.15.2
    • Does not happen on Ubuntu 22.04 with Qt 5.15.3
      • Does happen on Ubuntu if using commandline mode!
  • Fix "QThread destroyed while still running" at program exit
  • Ctrl+C may cause atexit module to raise an exception during exit, due to circular logic (the cleanup method is run twice)
  • Message about using Pillow-SIMD instead of Pillow should not appear on the Windows version because compiling stuff on Windows is impossible (lol, but seriously)
  • Sometimes the QUndoStack has an error during exit
  • Video Pipe seemingly does not send frames on Windows 11. Works on Ubuntu with same ffmpeg (4.4.1 GPL-licensed, compiled with gcc 11)

Finish Implementing Presets Backend

Waiting on UI implementation, most of the backend code is in-place thanks to @tassaron2. Remove button does not currently have a method associated with it.

Confusing ffmpeg flags

So I was looking at the bit of code that defines the ffmpeg output...

I assume that -f rawvideo -vcodec rawvideois defining the input formats for the input file being piped in?

Is the -pix_fmt rgb24 also for that?

I find the ordering of the flags a bit confusing, as -s 1280x720, -r 30& -y are all settings related to the output format, at least i believe, that are intermixed with input format settings, unless i'm misunderstanding?

Additionally, is the matroska container used for a specific reason, or is that just personal preference? I'm looking to increase compatibility in various ways and just want to make sure that's not some sort of hard requirement. :)

Any clarification you might be able to give on these things would be wonderful. ๐Ÿ‘

Relative positioning and dimensions for everything

Currently changing the output resolution drastically changes the video due to absolute positioning being used by components everywhere. Only the scaling options are relative. If we change all components to use relative positioning, then changing the output resolution will not affect the appearance of the video. Thus someone can export at different resolutions using the same project file.

We should make all components use floats to define their positions as suggested by @IamDH4 in #29. We can use either spinboxes with percentages or sliders in the GUI instead of the current text inputs.

No module named 'PyQt4'

Hi,

I have followed all the steps and currently have a python3 virtual environment inside which I am trying to run main.py
I keep getting this error

Traceback (most recent call last):
  File "main.py", line 2, in <module>
    from PyQt4 import QtCore, QtGui, uic
ImportError: No module named 'PyQt4'

Even if I have Py-Qt4 installed.
I've tried several times and cannot solve it.

Could you please help me with this ?

Thanks,
Ilyass

Crash when exporting video in GUI mode

What works

  • Exporting a video in commandline mode works on Windows 11.
  • Opening app in GUI mode works on Windows 11.

What doesn't work

  • Exporting a video in GUI mode on Windows 11. Usually crashes sometime before 10%, sometimes at 0%
  • Edited: I doubt this issue is Windows-specific, I just haven't replicated it elsewhere

Known details

  • No error message or Python exception
  • During export process there is communication between the QThread which creates the video, and the QThread which updates the preview window (which is itself located in the MainThread). There's a good chance that this is the source of the issue, since the preview thread is not used in commandline mode
  • The last log message before crash is "Dispatching Frames for Compositing" which is from the video thread

Steps to solve

  • Examine code for threading/memory errors
  • Add more logging to pinpoint error location
  • [Last Resort] Add option to disable the preview during export (commenting out line 661 fixes issue)

Hotkeys

Please suggest any hotkeys you want in this issue.

Ones I'm thinking of right now:
ctrl+s Save Project
ctrl+a Save Project As
ctrl+o Open Project
ctrl+n New Project

ctrl+t Add Component (must use cursor keys & enter to pick a menu item)
alt-enter Focus Component List (navigate after focus with the tab key)

All the following hotkeys apply to the currently selected component:

ctrl+shift+s Save Preset
ctrl+shift+o Open Preset
ctrl+shift+c Clear Preset

ctrl+up Move Component Up
ctrl+down Move Component Down
ctrl+home Move Component to Top
ctrl+end Move Component to Bottom

ctrl+r Remove Component

TypeError: 'QByteArray' does not have the buffer interface

  1. I don't get the preview.
  2. And I am not able to create the video.
    This error appears for the events mentioned above.
Traceback (most recent call last):
  File "C:\Users\Tolotra Samuel\PycharmProjects\toysong\audio-visualizer-python-master\preview_thread.py", line 67, in process
    nextPreviewInformation["visColor"])
  File "C:\Users\Tolotra Samuel\PycharmProjects\toysong\audio-visualizer-python-master\core.py", line 86, in drawBaseImage
    strio.write(buffer.data())
TypeError: 'QByteArray' does not have the buffer interface

Undo/redo functionality

Undo/redo functionality is essential for an editing program of any kind. Qt has an Undo Framework that seems straightforward to use, but it requires changing every potential user action into a QUndoCommand object and giving it a corresponding undo method. So this feature will require a lot of code changes.

The undo stack will only be used for the main window and component widgets. Components should be easy to convert by changing code in one place (component.py). The biggest thing is changing the component list actions and preset actions in mainwindow.py and presetmanager.py.

Hotkeys should be the standard Ctrl-Z for undo and Ctrl-Shift-Z/Ctrl-Y for redo. There could be undo/redo buttons next to the Projects button in the GUI.

Title text component options for nicer text

It would be easier to make nice-looking text on different background images if there were an option to add a stroke (outline) or drop-shadow to text. I would also like to see the ability to select extra font styles such as Small Caps, Bold, Oblique, and Italic.

color, image, and video components need extra settings

Color component should have options for gradients (preferably with transparency). Size could also be useful.

The image component should have an option to scale proportionally instead of stretching to the full frame size. Video component also needs the same scaling settings as the image component.

All three components need the ability to set a custom x, y origin for the image, which combined with scaling/size settings would allow for split-screen or picture-in-picture effects.

Repo Name

I have a suggestion: PyAuVis? or VisPy?

TypeError - video_thread.py tries to join a string and an int

Hello,
In the GUI I picked the classic visualizer. Gave it an mp3. When I hit "Create Video" the program crashed with the message:

Traceback (most recent call last):
  File "/home/user/py/env/avp/lib/python3.6/site-packages/avpython/video_thread.py", line 250, in createVideo
    cmd = " ".join(ffmpegCommand)
TypeError: sequence item 13: expected str instance, int found
Aborted (core dumped)

Adding these lines to video_thread.py fixed the issue (right before "cmd = " ".join(ffmpegCommand)":

        i = 0
        while i < len(ffmpegCommand):
            ffmpegCommand[i] = str(ffmpegCommand[i])
            i += 1

With that change the program works as expected. Thanks.

Switch to MLT Framework

We seem to have plateaued as far as performance goes utilizing Pillow-SIMD throughout the stack. After we get the next release out, we should consider switching to a more applicable framework / library for video production. MLT Framework seems to be at the top of that list, with major opensource video production projects using it. It is written in C with a C++ wrapper and has SWIG python bindings.

https://www.mltframework.org

using components and projects from the command-line

You should be able to open an .avp project file using the command-line:
main.py projectfile

If an input/output is specified, the program should automatically create a video.
main.py projectfile -i audio -o path

But to really allow for an automated podcast workflow, some components like image and video need to accept arguments too. Maybe this can create a new component at the top (or bottom, or custom placement) of the list. I'm not sure what the syntax for these should be though.

Non-native disabled listbox on macOS

Unlike the rest of the components, the disabled listbox looks non-native, may want to look into this to see if there's anything that can be done to make it look nicer.

non-native listbox

Can't push project.

I have finish off new video size hight, width. I can't push the new branch to the do pull on it to master

Changing the location of the visual effects

I wanted to get your input on how much work it would be to change the location of the visual effects? I was hoping to move the bars to the bottom of the display and remove the bottom row. Is this possible, and if so, which file should I look in?

Thanks for creating the script!

Outdated macOS installation instructions

I don't have access to macOS.

Seeking someone who is more familiar with that platform. Please fork the project and create a pull request with an updated readme.

It doesn't necessarily have to use Homebrew like the current instructions, but it should be as easy as possible.

Let us know if you've tested on x86 or M1.

Find a good name

Find a good name that is not as generic as "audio-visualizer-python".
If we have a good name, we need a logo.

setup.py broken in feature-newgui branch

Since commit e92e9d7 setup.py is completly borked.

It tried fixing it myself but ran into other issues.

  • Using install_requires with 'pillow-simd' does not work (dependency is not found even if it is installed), while using 'Pillow' seems to work. I think the reason for this is Pillow-SIMD is meant to be a drop-in replacement.

  • Although listing 'Pillow' as a dependency forces me to install olefile, which seems completly uneccessary under Linux, or am I wrong?

  • Even with this fixed there won't bin any working file in the bin directory because you rely on avpython. I tried looking it up but it is beyond me. The main issue here is that there only seems to be windows executables available and I cannot find a source.

My attempt at fixing setup.py (not complete):

from setuptools import setup, find_packages
  		  
setup(
    name='audio_visualizer_python',
    version='1.0',
    description='A little GUI tool to render visualization videos of audio files',
    license='MIT',
    url='https://github.com/djfun/audio-visualizer-python',
    packages=find_packages(),
    package_data={
        'src': ['*'],
    },
    install_requires=['Pillow-SIMD', 'numpy'],
    entry_points={
        'gui_scripts': [
            'audio-visualizer-python = avpython:main'
        ]
    }
)

Call render from a component

Hello! I'm working on some custom components and I was wondering if there was a way I could request a re-render of the preview? We've got a component which allows the user to select a random image, but every time they have to mess around a bit to actually see which image they get. Is there any way I could request a render from a component?

2023-05-12.22-39-36.mp4

Problem

Hello, first of all thank you for developing this tool. I though have a problem, when I try to run the application. After I have downloaded the different things, and would run the command with python3 main.py it only comes with the message: /usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python: can't open file 'main.py': [Errno 2] No such file or directory

I'm a noob to this, but I will appreciate If you can help me.

All the best Erik

Change Project and Preset Button Layouts

Need to add a New Project option. Perhaps this should all be contained within a dedicated Project button with a menu. Need to figure somthing out with presets. The user should be able to remove a preset without recalling it first.

selection_054

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.