Giter Club home page Giter Club logo

twitter-video-summarizer's Introduction

Edwin Sun's Twitter-Video Converter

video-edsun123 created by GitHub Classroom

Main Exercise: Using the twitter feed, construct a daily video summarizing a twitter handle day

  1. Convert text into an image in a frame
  2. Do a sequence of all texts and images in chronological order.
  3. Display each video frame for 3 seconds

Overview

This API retrieves tweets from the last 24 hours of tweets from that user's timeline then returns a video of all tweets in that timeline.

Each text from the tweet is converted to text on a frame which is shown for 3 seconds. Then each is saved as a 3 second video in the current directory and a text_file keeps track of those video filenames. The text file is necessary to concatenate all the files into a mega video called mergedfile.mp4. Note: before each call, the program will clean out the current directory and the text file to prepare for writing more mp4 files in the next call.

For the queueing system, I have 1 consumer process that retrieves the tweets and 2 producer processes that convert those tweets to videos. Using the module queue helps lock the processes so that current tasks are finished and also facilitates adding and removing tasks from the queue task system.

Files

  1. Main program is run in queue_test.py To run...
python3 tweet_vid_converter.py
  1. Video file names are stored in list.txt
  2. Keys for authentication is stored in separate keys file called keys.py
TWITTER_API_KEY = XXXXXXXXX
TWITTER_API_SECRET_KEY = XXXXXXXXXXXXXXXXXX
TWITTER_ACCESS_TOKEN = XXXXXXXXX
TWITTER_ACCESS_TOKEN_SECRET = XXXXXXXXXXXXXXXXXXXXXXXXXXX

*Note: if you want to change specific number of tweets and change the tweet handle. Change the variables username and num_tweets in lines 59 and 60. 

Threads

Normally you would expect on thread is assigned to each core. Given a mac computer with 4 cores, it should handle 4 threads of tweet-video conversion. However, I've found that the performance jumps around 30-40% in cpu usage instead of 25%. Then it is found that by default, each thread for frame conversion is ~1.5 threads per core. So for performance reasons, I've had at most 2 producers or 2 threads to do the video-thread conversion

#Flask application I have issues conecting to the amazon ec2 instance because ports for 80 is closed. However, I was able to fix the issue by going to an ubuntu server hosted by amazon. I was able to ssh into the webserver, scp files into the server, downloaded the dependencies in the server, and ran it using rest service. There is a folder called eflask2 that helps install dependencies and run the application in the ubuntu web server.

twitter-video-summarizer's People

Contributors

edsun123 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.