My previous version has flaws. It works well for opaque GIFs, but OpenCV is famous for not being good with transparent images. So instead of OpenCV I use imageio for GIF iteration and PIL for adding GIF frames to the static background.
Why do more?
The original algorithm left these artifacts, look at the cyan block on the intersection of GIF frame and a darker abstract part:
Initially, I aimed to make one big post, but I am splitting it up. This Part 1 is about how I made the frames to generate videos from.
I have been on and off doing this project for a few months. Many things did not work for me – from ffmpeg to sheer OpenCV/ffmpeg installation on Apple M1 systems – and I am not 100% sure what made it work to this day. I plan to put myself in a situation where I have to do it again, and I will make a guide then. However, right now, I can only say that this video tutorial on running native ffmpeg and this guide from OpenCV themselves are good places to start.
The last time I used OpenCV was in 2017 when I worked on my graduate work. Back then, I processed prerecorded videos with no need to worry about audio. So I had some background prior to this project, but I was in no way ready for the ride.
Following Channels’ docs I encountered yet another error the solution to what was not obvious right off the bat.
This was my original post in October 2020 and I stand by it.
You can make your project work with Google Firebase - it handles signals well enough. Yes it is primarily used by mobile developers, but overall it is fine for web too.
I spent trying to install Django Channels on my local Linux 18.04, and I kind of made it work, but then I had to deploy it... And as a professional backender you don't want to let people down.
I decided to try Channels because my Python-related friends talked about it. But days into the trouble I asked my friend about a certain step and he asked me in return "oh so [you use it because] they fixed Channels since two years ago?". I as like ??????????????????. So that moment I ditched it. Too much time wasted, but I like the result I achieved with Firebase.
What I am saying - Firebase is fast and universal. In a matter of days I managed to make and deploy an internal Customer Support chat service that connected mobile app users and a support from the web.</p>
I will be writing a new series on Django + Firebase, and this post is pretty much a short introduction.
BTW, if you want to run ffmpeg or any other command inside a python script (a very reasonable idea), use subprocess:
command = "ffmpeg -f concat -safe 0 -i list.txt -c copy final_video.avi -y"
As a result – the videos got smashed together – some frames even never appeared.
As far as I understood this is a collaboratory project, and it is currently maintained by Wagner De Lima.
You can find very useful materials here and there, but the purpose behind this tutorial is to help set up social authentication for your DRF-based API by following clear and easy steps. So that nobody suffers from the lack of base knowledge or the lack of time – been there, done that.
Table of contents:
1. Registering an app in Facebook and Google developer’s panels 2. Getting User Access Token from Facebook/Google 2.1 Facebook 2.2 Google 3. Installing drf-social-oauth2 3.1 settings.py 3.2 Facebook 3.3 Google 4. Creating a local app 5. Converting Token from Facebook/Google into a DRF Access token 6. Accessing things with this new Token 7. Refreshing Access Token 8. Changing Access Token Expiration