I've been searching for quite some time now, but the only example I've seen where camera motion keyframes (movements) can be extracted from a video is in blender. I'm looking for a script, library, colab notebook, or any recommendation to be able input a video (for example, getting the camera keyframe movements from a video of a drone flying around) and exporting it to any type of file. The main purpose of this is double-sided: I want to be able to take the camera keyframe movements from the drone video and input it into an AI Art Animation and I want to be able to learn and add this python tool or library into a colab notebook of AI tools I've been slowly building over the months. Any help from you masterful wizards will be appreciated. Thanks!
I'm a "hacker", "novice-intermediate" level python coder, meaning I can read code and understand most basic and some advanced type coding. I'm able to read code quite well and manipulate it to my preferences, but I just don't even know where to start when it comes to the request I'm asking, ergo my post to Stack.
Related
I am currently trying to write a program that will detect a notification sound from an app and press some keys in response. I want it to be able to detect a specific sound from a sound file. This app also has background noise coming from it.
My research has been less than successful in finding an audio recognition software. If worst comes to worst I can also just use something that pulls audio from input and finagle OBS.
I am learning Python & Kivy: (Life was a lot easier using assembly for embedded controllers).
Now the whole display is rotated 90 degrees CCW. Demo programs that used to work are now displayed rotated.
Presumably I did something that set a permanent "rotate display" flag while running Python. Where and how can I reset it? I rebooted the computer but no improvement.
Win-7 64. Python 3.4
I ran into this problem a while back when I was learning Kivy. I even left a frustrated comment on a youtube video.
There's a file at c:\users\[username]\.kivy\config.ini which you need to modify or delete.
I have been working with some drones and robotics projects using arduino and python. There was a kickstarter project for a neat little hex copter, that hasn't been managed well.
I was lucky, i got my copter and then some time later after some frustrated email exchanges, i finally recieved the camera as well. To this day, their forum has people still complaining. Their maker forum is now down and their wiki hasn't been updated with any specifics on the camera.
http://www.flexbot.cc/wiki/index.php?title=Main_Page#Hardware
Their app to accompany the drone still doesn't support the camera module. Not that it'd matter, as their code isn't very well documented or annotated.
https://github.com/HexAirbot
There are some tips on switching the camera on the comments page of their kickstarter campaign.
https://www.kickstarter.com/projects/1387330585/hex-a-copter-that-anyone-can-fly/posts/1093716
So, sob story over, i'm stuck with this neat little wifi camera that i am unsure on how to connect to. I know how to switch it on and it does have a micro-usb port on it.
What library in Python could i use to stream an image from this camera given that it is a wifi camera. If i wanted the video stream as a numpy matrix.
I need to interface with the camera, so i can connect and disconnect.
Then, be able to read images frame by frame with ffmpeg. I have some python modules that can detect and read from a camera, but how can my code ensure that the camera is connected?
Totally stuck. Any help would be appreciated.
Considering you are building for the android platform, you will more than likely need to use some sort of java/python driver/interface, unless you just use java.
Here is an article on java/python, and using python from within java.
Using Python from within Java
Background
I'm attempting to craft a simple video playback script for a small cinema that automates the playing of videos and control of the projector, sound and lighting systems. I have two video outputs, one goes to a monitor in the projection booth, and the other directly to the projector. I desire to play video (and only video) fullscreen to the projector while putting controls and a small (~1/4 screen) preview on the monitor. This will allow the projectionist to view the video being output and control the playback from the monitor in the booth while all the audience ever sees is the video output.
Problem
I am currently using Python to control VLC player (with libvlc Python bindings) to playback videos. I have everything working fine except that I can't figure out how to get a preview (direct copy) of the video being played fullscreen on the projector output into my GUI.
I have tried using the clone filter, but I cant get the cloned window to automagically appear full screen nor in my GUI. The clone filter seems like the logical choice but it seems to be VERY inflexible when it comes to specifying destination screens, fullscreen, etc. I must be able to open video windows full screen on the projector monitor. Professionalism is key and it would look bad if the projectionist had to drag a window over and double click on it when the movie started.
Currently Using:
Debian Linux
Python 2.7
wxPython
libvlc
I would like to continue using Python as I already have the code for controlling the projector, sound processor, lighting and curtain written and tested. I chose VLC because it really seems bulletproof when it comes to video playback but am not committed to it's continued use. I also chose wxWidgets for my GUI as a result of past experience but I am not stuck on that either.
This describes the direct solution and does not concentrate on any alternative or the overall design of your application.
As Your Application and VLC media player are separate processes, you will not be able to get what you want directly because there is no "shared memory" between those 2 applications. The best shot to "copy" the decoded frames from VLC will be to e.g. send a RAW Video .mts stream (ts is usually used for this kind of usecase) and send e.g. to udp://localhost:1234.
In your application, you will need to be able to receive the ts stream, "decode" it and display at the spot of interest.
For start, i would try if you are able to do this using 2 vlc players that you control manually. When you achieved that the first VLC streams to udp and outputs on the main display at the same time, and the other VLC player receives and plays the udp stream you can go on:
Find a player library that you can use directly in your wxpython application and check if it can receive the udp stream as well E.g.
https://wxpython.org/Phoenix/docs/html/wx.media.MediaCtrl.html
This player lib for example requires gstreamer as a base.
As a result, main display and the picture in your applicatoin might have a latency of some seconds. To come around this latency, the best way that i currently know is using WebRTC but this is a lot more complex setup than the above.
https://www.sipwise.org/news/technical/tv-over-webrt/
Sure in case you do some "encoding" for WebRTC or even for UDP, you would need to utilize some hardware encoder, e.g. Nvidia NVENC in order to be able to guarantee the needed resources are always there.
I would like to move a (stereoscopic) video on a computer screen automatically. Think of the video as the ball in a Pong game. The problem is that it should be a stereoscopic 3D video. So the video size itself is kind of small. I did this kind of movements with pictures or drawing object, but I don't know how to do it with video material!
Does somebody know how I can do this? I already searched for video tools in python like pygame or pyglet. I have an external player Bino 3d which can open the desired video. But how can I make it move around the screen?
Or is there a tool in other programming languages like c/c++ or Matlab which can help?
By the way, the program will be on a Linux OS.
I'll be grateful for any help or hints!
Anna
I'd try to use a decent video client (mplayer, vlc). They can present the video in lots of ways, hopefully your stereoscopic issue can be solved by them.
Then I would let the client present a single window (not fullscreen) which I then would move around using window manager controls.
If you must not have window decorations around the video or if the output shall be a specific window, I think mplayer at least can be told to use an existing window to perform the output in. Maybe that's an approach then.