Picture Visualization Development - Help needed
#1
Update 2015-08-29 18:45
As promised the visualization has been released!
For more informations please go to: http://forum.kodi.tv/showthread.php?tid=236514

Update 2015-08-27 13:20
Okay, signal processing is super complicated (at least for me) and that's why I give in. I read a lot (like a looooooot) and just don't get it.
So, I'll go ahead and release the visualization within the next few days (somewhere before monday) AND throw the source on github.
The spectrum part at the bottom will look.. well not near as good as I wanted it to but at least something is there.

If anyone with knowledge in signal-processing and such want's to help me out, PLEASE go ahead and do so (either by just rewriting the crap I did or by giving
me any form of useful information I seem to lack).

Update 2015-08-23 18:56
So... I reached the point where I'm doing the "final touches" HOWEVER...
... I read a lot about how spectrum work, how you calculate the frequency data from the audio data (FFT = Fast Fourier transform) and that it is
near impossible to get the visualization anywhere near as good looking as the ones made with e.g. after effects. Why? because there is a lot of
handwork needed to get the frequencies mapped correctly which is very difficult to do dynamically. At least for me with the knowledge I have.
So if someone who knows more about that and feels like helping me out, you are very very welcome to do so.
This brings me to the next point. Source code.
I'll surly open-source this project but please keep in mind, this is/was my first c++/opengl project every so the code most certainly is not the nicest
one you've ever read ^^
Also, I developed on linux, for linux. I guess it will work on osx as well (as it's unix) but windows and mobile I haven't tested, and never will as I just don't care about any platform other than linux.. So that's that.
I'll do some more code-commenting before releasing the source.

The addon itself I'll release as soon as I feel like writing a new thread holding all necessary information and so on...
For now I just wanna at least enjoy my Sunday afternoon ^^

Update 2015-08-20 14:46
Quick update...
Presets are somewhat in place (Still a bit buggy as I don't quite understand how the random/next/previous preset thing is supposed to work meaning sometimes the active preset index is kinda off o.O)
Spectrum is (again) somewhat in place. The bars (64 as of now) are visible and animated. Now it's just a matter of mapping the audiodata to each individual bar. Glad there is so much documentation available *sigh* (I'll figure something out I hope ^^)

Update 2015-08-17 09:30
So, instead of working on the animation-part I tried fixing the scaling problem and hurray, I did. Big Grin
Also, I decided against the whole "fetching images from websites" thing. This would just take to long to implement and I
don't have the time for that. That's why I came up with another Idea.
Basically if you specify "~/Pictures" as image-source for the visualization and this folder holds other folders like "Landscape", "Weather", "Anime" etc.
than each of those sub-folders will be a Preset you can select from.
I think this is a smart way of doing things and allows for the community to come up with awesome Wallpaper collection packs (or whatever you wanna call it)

Update 2015-08-14 20:20
Just a quick update saying that the transitions between images is now in place and the transition-time is configurable from the settings (1-5 sec.)
Next up is the visualization at the bottom I guess Smile
Oh and btw., as of now I'm using it already combined with "Dr.Toxic's Weather Fanart Pack" and it is just amazing IMHO Big Grin

Currently implemented
- Display random, local images (jpg/png) as visualization background (I encountered that SOIL, the image lib I'm using, can have problems with some images
meaning they won't get displayed/will be skipped. This might be due to unexpected headers, 64-bit images etc.)
- Use sub-folders as presets
- Smooth transition/cross-fade between images (cross-fade time can be configured)
- Set a image update interval (1 - 10 min.)
- Update image when a new track starts playing

ToDo
- A visualization at the bottom

Known bugs
- The visualization get's reinitialized when toggling full screen, while navigation Kodi, while re-sizing Kodi or just moving the Kodi-window meaning a new wallpaper will get loaded. Won't get fixed as can't find a way to fix it. Also I display the visualization only when in fullscreen, so I don't care...

At the end I want the whole visualisation to look something like:
https://www.youtube.com/watch?v=-ajOCcftODg

Original posting
Hi there,

first of all, when I say "we" I mean me and a friend of mine (both never developed c++ before or used opengl)

Now strait to the point.
We wanted to create a very simple visualization which displays random images from different sources (local directory, web-sites like 500px, flickr etc.) and a simple,
bar based, visualization at the bottom of the screen.

So far, all we managed, is to create a addon which displays simple lines (At least something right? ^^)
...BUT...
as soon as we try to load an image (jpg, png or even a uncompressed bmp) using different library's (SOIL, DevIL etc.) or even using native opengl functions, kodi crashes horribly without any form of error output.

After about 6-8 hours we gave up as we haven't even found a way to get any error-logs which makes it ridiculously hard to develop.

So, the question is:
1. How would one get error-logs/debug-messages
2. Is there a easy and reliable way to load images and display them in opengl

Any help/ideas are highly appreciated Smile

cheers,
Tadly
Reply
#2
errors can be read on stdout/stderr -> run kodi from a terminal.
soil works fine if used properly. i have a few examples, no guarantee's as this was quick hackwork. but it works for me. e.g. https://github.com/notspiff/screensaver.matrixtrails

note; screensaver or visualization - soil part is the same..
Reply
#3
I actually can't believe I didn't thought about opening kodi from the command-line *facepalm*

Gave it a quick test but all I get is...
Quote:/usr/bin/kodi: line 165: 23801 Segmentation fault (core dumped) "$LIBDIR/${bin_name}/${bin_name}.bin" $SAVED_ARGS
Crash report available at /home/tadly/kodi_crashlog-20150810_141022.log
...and well, crashlog is empty, as always.

I'm certain we messed up with SOIL. The problem just was to get the error telling us WHAT we messed up ^^

Will have a look at that extension. Thanks for that Smile
Reply
#4
did you install gdb ? in general gdb is the answer to your question - run gdb on the kodi binary, as long as the addons has symbols it will work just fine "in there" as well.

if you are a nub you might want to look into gdb frontends. i use 'ddd' but that is out of old habit mostly. it kinda sucks.
Reply
#5
actually I didn't.. Will have a look at that as well.
Never used gdb before though so let's see what I can make out of it Big Grin

Edit:
Well, gdb says "/usr/bin/kodi": not in executable format: File format not recognized
Looks like it's not that easy.. Will do some googeling once I'm home

Edit2:
alright, running "gdb /usr/lib/kodi/kodi.bin" does work, however all I get this time is:
Quote:Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()

Not sure what I should make out of that :/
Reply
#6
no debug symbols (you have to have -g in your CXXFLAGS).
Reply
#7
First of, sorry you have to deal with my stupidity ^^

Second, I bet you mean I'd have to build kodi with the debug symbol and
not my addon (as I already do that)

Strange enough that this would explain why gdb says "no debugging symbols found" *facepalm.. again*
Reply
#8
So..
I built kodi myself with debug symbols enabled (gdb still was saying that it can't find any though) and the error-output still is the same.

However, after lots of googeling how I'd get that to work, I stumbled across the official kodi-wiki (again) which says:
Quote:...If you didn't have debugging enabled at the time, please enable it and recreate the problem. This feature was added in SVN revision 22194 and relies on the gnu debugger GDB being installed to work.
So, I do have gdb installed (obviously).
Running kodi on it's own, the last thing the crashlog contains is Visualisation::Start() (the segmentation fault is in there as well somewhere at the top)
Running kodi with gdb again, I only get the segmentation fault.

Edit:
I started implementing the soil stuff using glut now and test it on my pc so I don't relay on kodi anymore (still failing hard but at least I get error outputs if there are some. Currently it just doesn't show me the image).
Once I managed to get it working there I can port it over to the Kodi (I hope)
Reply
#9
Would be cool if you pull this of.
A picture viz is wanted since ever. None exists so users are stuck with a so-so combined slideshow/music experience.
Reply
#10
I'll give it all I've got.
So far I can display random images from a single directory. However it's pretty CPU-intensive and randomly crashes (No idea why though).
Also I have no idea how difficult it will be to port it over to Kodi if I happen to get it to work ^^

Anyway, I guess I'll just keep posting updates when I feel like it and have something new.

Oh btw. I've opened a feature request about VisPy and Kodi. Let's see how that goes ^^
http://forum.kodi.tv/showthread.php?tid=235068
Reply
#11
make the code available.
Reply
#12
ironic_monkey:
There is not a whole lot to see apart from the worst c++ code one has ever written Big Grin

But if you want it, I guess I can put it somewhere and updated it as code changes..
I just don't think a github repo would make much sens right now...

So, as I don't feel any shame (actually I do, I do a lot Big Grin), here is what I've got so far...
https://gist.github.com/Tadly/3a9c7bbfd856a2169bd3
Reply
#13
We all started somewhere, so never be ashamed to show off code Wink

This would be a great feature, so good luck with it.

If you get it up in a proper Github repository then others may be able to comment on your work and suggest improvements. Check my sig for a guide.
Reply
#14
I'm not new to git Wink
As I said in a previous post I just think it's way to early to put it in a proper repo as it's more of a playground right now
to get familiar with c++ and opengl.

As it stands, this might take a while *sigh*
Reply
#15
looks fine. obviously glut cannot be used for windowing/context (that's already set up when the addon is called) but other than that..
Reply

Logout Mark Read Team Forum Stats Members Help
Picture Visualization Development - Help needed0