Where can I find documentation for the preview() and show() function for VideoClips? - python-3.x

I just want to see how exactly they work, and I can't seem to find them in either moviepy or pygame's websites. Basically I just want to see at what time a user presses a specific key during a clip, and record that time/possibly insert an image at that time while the movie is playing. I know moviepy does that already to some extent, but it's only for mouse clicks.
Thank you for your time.

I found the source code but no answer. I ended up editing the source code, and while that works, I would much rather do something else than that if possible.
To have a more elaborate answer to the rest of my question, basically it's not something I think is feasible to directly edit the video file WHILE it's playing. I also don't know if it would be a good idea to save every single and just combine them. I was able to find an extremely efficient, but niche solution by modifying the preview frame while it plays, and having that persist across every new frame. Then I saved JUST the overlay to a file, and can use that however else I feel.
I have seen no other threads/users actually deal with moviepy in this way, so feel free to PM me or ask on the thread if you want more info.
Source code here

Related

Computer keyboard into piano keyboard with AutoHotkey

I want to be able to use my computer keyboard as a piano keyboard, however the default version of AutoHotkey only supports one "voice" at a time. I tried running an instance for each note, but that doesn't fix it if I press the same note repeatedly.
I found this thread on how this might be solved with the BASS library, but I'm pretty green when it comes to coding and so I'm not certain how to incorporate the library into my simple code.
Here's another similar forum that might solve things, but it has a delay and the overlapping solution doesn't really solve my issue.
This is such a simple idea (play sound when a button is pressed), but somehow it's way out of my depth. Currently my code looks like this:
~1::
SoundPlay, C:\Users\Fires\Downloads\2489__jobro__piano-ff\39187__jobro__piano-ff-040.wav
for each note
Edit:
~a::
FileDelete, %A_ScriptDIR%\Sound1.AHK
FileAppend,
(
SoundPlay, C:\Users\Fires\Desktop\New folder (4)\043.wav, Wait
), %A_ScriptDir%\Sound1.AHK
Run, %A_ScriptDIR%\Sound1.AHK
Return
is what I am using now, but it's still iffy when two are pressed at the same time.
Its likely due to the "Wait". according to the documentation:
https://autohotkey.com/docs/commands/SoundPlay.htm
"If a file is playing and the current script plays a second file, the first file will be stopped so that the second one can play. On some systems, certain file types might stop playing even when an entirely separate script plays a new file."
It looks like this is an "issue" with AutoHotKey. And its not possible to open multiple "voices" or simultaneous sounds. it is completely possible to make a C# program that does the same thing, I've done it before. and i have bits of the code now still (it plays midi sounds, instead of wavs, but same concept play notes asynchronously).

Creating a drawn audio reactive visual

I'm looking to create this project in processing, however, I'm finding the terminology a bit hard. I'm not sure how to call the effect where the line is staying permanently throughout the song to 'draw' the music data.
I would appreciate any guidance on what tutorials I could look at or an answer from someone.
My aim is to create something as close to this as possible:
https://www.youtube.com/watch?v=Bb5PTitqtlc&t=58s
Stack Overflow isn't really designed for general "how do I do this" type questions. It's for specific "I tried X, expected Y, but got Z instead" type questions. But I'll try to help in a general sense:
You need to break your problem down into smaller pieces and then take those pieces on one at a time. Write down exactly what you want to happen, in English, and that will be an algorithm that you can think about implementing with code.
Get something simple working. Can you write a simple sketch that plays a song? Then work your way forward in small steps. Can you write a simple sketch that prints out some numeric values based on the song that's playing? Separately from that, can you create a very simple visualization using hard-coded numbers? Get all of that working separately before you think about combining them into a sketch that shows a visualization based on a song that's playing.
Then if you get stuck, you can post a more specific question along with a MCVE. Good luck.

Libraries for text manipulation

So...
I plan on doing an animation that pulls all the text from the screen to the middle and lets it pulse like a heart. For that I checked if I'm able to manipulate whole Strings and Chars the way I'm able to manipulate circles, for example. I found the libraries Nexttext and Fontastic, but those seem to be outdated, therefore I can't use them with Processing 3.0. Than there is the library Geomerative, which I manged to install through Processings library manager, but this one yields the error "duplicate libraries", which I can't find a , for me understandable, workaround for. I'm also using minim, since I combine the pulse with music input, minim works fine though.
Thus I'm asking if anyone here has an idea on how to fix this error, make the outdated libraries run or maybe someone has an alternative way/library to manipulate text.
Apparently the processing forum is not that active, hence I'm asking here, there was one suggestions tho, that I should search for similar Java libraries, which I yet have to do.
What exactly do you mean when you say you want to pull text from the screen? Do you mean you want to get text from another application and copy it into Processing? Or are you just talking about doing something inside the Processing window?
If you're just talking about manipulating text within the Processing window, then I'm not sure why you need a library for this. Processing has several functions that allow you to draw text, change its font, size, positioning, etc.
Anyway, the issue you've encountered is a known bug. Looks like the only solution for now is to use an old version of Processing. You can download them from the same place you downloaded Processing 3.
Both Geomerative and Fontastic work with Processing 3.2.3
Bare in mind is the bug Kevin mentioned.
However, the only issue I had was compiling examples that had this line:
import processing.opengl.*;
Simply remove or comment this line and the example should compile

Unchangeable EXIF datas

Do you know if there are unchangeable EXIF datas ?
In my case i want to know the real date of creation of a jpeg image. So I thought the EXIF's datas was the best way but I realized that with a software like XnView you can change it. So there is any way i can now the real date of the creation of an image ?
In another hand, is it possible to know if a EXIF datas has been modified ?
Thx fo all,
And sorry for my bad english
Have a good day !
:)
In principle, it is not possible to be sure the data hasn't been edited, although it may take a great deal of skill to do so indetectably. Some of the major camera makers (Canon and Nikon, possibly others) offer an "image authentication" feature in their pro model cameras which is designed to make it impossible to modify the image after it has been taken. They do this for the benefit of people doing legal work - evidence shots and the like. To use this, you have to switch it on (via the camera settings) before you take the picture. Even with these though, it is still possible to alter the data: both the Canon and Nikon authentication systems have been cracked (presumably with considerable difficulty).
As for normal pictures, yes, these are very easy to alter. However many (most?) programs which can edit EXIF data leave their own signs. For example, Adobe Photoshop always adds its own name somewhere in the EXIF, apparently whether you want it to or not. You can see this with many different EXIF viewers, especially with the more advanced ones like PhotoME. (Which, sadly, is no longer maintained.)
Short answer: yes, it is always possible to exit EXIF, and almost always possible to do it indetectably, but it may requite the right tools and quite a lot of skill. You can't ever be certain it has not been done.

simultaneous text editing

I'm trying to program a Webpage, which allows to edit a text document simultaneously.
To program something like a Chat in Node.js is not very difficult, but working on the same text makes it kinda tricky.
I thought about sending the char position and the changes characters, but if someone types something previous to the change, the change would be placed on the wrong position.
What's the best way to exchange Modifications between my clients?
You should use Socket.io to have make your Real-Time application.
I just founded a nice blog article which speaks about real time edition, see here.
It's also providing a link to the github project and to an open source online editor project.
Take a look and try to understand how they do stuff like this, good luck !
Two people cannot be manipulating the same object at the same time from a different place. You basically have two choices.
1. Let them take turns with the object
2. duplicate it if they both want it, but that doesnt sound like it would end well

Resources