djfun / audio-visualizer-python Goto Github PK
View Code? Open in Web Editor NEWa little GUI tool to render visualization videos of audio files
License: Other
a little GUI tool to render visualization videos of audio files
License: Other
Some dicussion about this took place in #15 this is now the formal place for projectM discussions. If you have suggestions for other visualization libraries please create a new issue. projectM is written in C++ we would need to create our own bindings. Perhaps using SWIG.
http://projectm.sourceforge.net/
https://github.com/projectM-visualizer/projectm
http://www.swig.org/
The name isn't very clear and feels kind of misleading, perhaps should come up with a new name
Proposed containers and codecs:
https://gist.github.com/IamDH4/9149c81dc99aa15f98c860e02cb5808f
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"
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
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
At least under HiDPI gnome, the text size in the preview looks pretty messed up:
And that continues into the exported product:
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.
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
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.
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"
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.
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:
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.
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 :)
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
macOS
Windows
Current Dependencies on feature-newgui
Branch
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 :)
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.
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.
So I was looking at the bit of code that defines the ffmpeg output...
I assume that -f rawvideo -vcodec rawvideo
is 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. ๐
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.
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
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
Please, add a screenshot and a demo video to help new users understand it better.
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 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.
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.
Saving presets while you have the preset manager is open doesn't update the preset manager currently.
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.
I have a suggestion: PyAuVis? or VisPy?
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.
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.
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.
I have finish off new video size hight, width. I can't push the new branch to the do pull on it to master
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!
When I run the main.py in Kali Linux, it shows the Segmentation Fault error.
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.
The background could be an optional parameter, either that or display an error if it's not set.
Being able to choose the font is great, but being able to change the size, position & formatting would be even better.
An Appimage version of the application that include all the dependencies .
Find a good name that is not as generic as "audio-visualizer-python".
If we have a good name, we need a logo.
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'
]
}
)
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?
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
There are a few bugs with the video component that I'm unsure how to fix:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.