Coder Social home page Coder Social logo

wikimedia / labs-tools-videocuttool Goto Github PK

View Code? Open in Web Editor NEW
5.0 18.0 1.0 11.46 MB

Github mirror of "labs/tools/VideoCutTool" - our actual code is hosted with Gerrit (please see https://www.mediawiki.org/wiki/Developer_access for contributing)

License: Other

HTML 1.04% CSS 0.15% JavaScript 85.22% SCSS 12.92% Procfile 0.04% Pug 0.05% Shell 0.59%

labs-tools-videocuttool's Introduction

VideoCutTool

An online tool to cut/trim videos in Wikimedia commons.

See live demo at: VideoCutTool

Learn More

You can learn more in the VideoCutTool page.

Installation

To set up the tool on your local machine, follow these steps

Get OAuth2.0 Credentials

Go to: https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose.

Create an application with the following grants:

  • Edit existing pages.
  • Create, edit, and move pages.
  • Upload new files.
  • Upload, replace, and move files.

Setting the CallBack URL

If it's for production, use call back URL as: https://videocuttool.wmcloud.org/api/auth/mediawiki/callback

If it's for development, use call back URL as: http://localhost:8000/api/auth/mediawiki/callback

Creating .env file

Store the obtained Client ID, and Client Secret, in the .env file, under the keys CLIENT_ID, and CLIENT_SECRET respectively.

Name the file as .env.dev if its for development, or .env.prod if its for production.

Note: These files should follow the format, given in the .env.example file

Running locally

The tool uses Docker to install and run everything with a single command.

Install Docker from this link: https://docs.docker.com/get-docker/

Clone Repo

Run these commands to clone the code from the remote repo:

git clone "https://gerrit.wikimedia.org/r/labs/tools/VideoCutTool"

cd ./VideoCutTool

Database

On a development system
  • View the users list using the following commands:
    • Connect to postgresql using psql --host=0.0.0.0 --port=5435 --dbname=videocuttool --username=videocuttool
    • Enter the password (by default it is set to videocuttool)
    • Run select * from Users;
  • View the list of videos being edited/that have been processed:
    • Connect to postgresql using psql --host=0.0.0.0 --port=5435 --dbname=videocuttool --username=videocuttool
    • Enter the password (by default it is set to videocuttool)
    • Run select * from Videos;

Run environment

Run this command inside VideoCutTool to start development Docker container, if you operating system is Windows

docker-compose -f .\docker-compose.dev.yml up --build -V

If your operating system is other than Windows (Linux/Mac), run this command instead

docker-compose -f ./docker-compose.dev.yml up --build -V

The first time you run it will take some time (4-8 minutes depending on your internet speed) because it will pull the necessary images from Docker and install NPM packages. Once it is up and running changes will be hot loaded.

Note: Anytime you update package.json the build process will take a while.

To run production you can run this command:

docker-compose -f .\docker-compose.prd.yml up -d

for windows

and

docker-compose -f ./docker-compose.prd.yml up -d

for other operating systems.

You are now good to go, and should have successfully set up the tool on your local machine for development. If you encounter any error while setting this up locally, do checkout our tickets on phabricator, if you could find something relevant there.

Note: If are facing errors specific to mediawikiId, please have a look here

Connecting to Cloud VPS Servers

If you want to set up cloud services for production, follow here:

Cloud VPS Horizon URL: https://horizon.wikimedia.org

  • videocuttool instance using ssh -J <username>@primary.bastion.wmflabs.org <username>@videocuttool.videocuttool.eqiad1.wikimedia.cloud
  • nc-videocuttool instance using ssh -J <username>@primary.bastion.wmflabs.org <username>@nc-videocuttool.videocuttool.eqiad1.wikimedia.cloud

Installing VideoCutTool in cloud server

To install the tool in the cloud server (production), follow here

Install the following utilities:

  • git
  • docker

Setting up beta version

Set up your Cloud VPS Horizon, from the above tutorial.

beta-videocuttool instance using ssh -J <username>@primary.bastion.wmflabs.org <username>@beta-videocuttool.videocuttool.eqiad1.wikimedia.cloud

where username is your gerrit-authorized username

After setting up the cloud, set up Crontab, for syncing your beta with the current master

  • Create a file for storing the logs
sudo mkdir /app/logs
sudo touch /app/logs/beta.log
  • Create a crontab for the root user
sudo crontab -e

opens the Cron-tab for the root user, and paste the below line on the editor

0 * * * * /app/VideoCutTool/server-sync.sh >> /app/logs/beta.log

Note: The above line runs the server-sync.sh file at every hour.

If you couldn't find /app/VideoCutTool in the server instance, go ahead and install dependencies like

via apt or some other package manager you prefer.

  • After installing these, go to /app, and use the above git pull command to get the repository on the beta-server
  • Now follow the above steps to set up crontab.
  • Make sure to run all the docker commands in the detached mode, via the -d flag

If you face any issues regarding setting up beta instance, feel free to raise your queries on phabricator, or contact us via Zulip.

Credits

VideoCutTool is created by Gopa Vasanth as a part of 2019 Google Summer of Code in the mentorship of Pratik Shetty, Hassan Amin and James Heilman.

Khr2003 joined as a co-maintainer of the tool and revamped the code base.

Sohom Datta (@soda on phabricator.wikimedia.org) joined as a co-maintainer of the tool for Google Summer of Code 2023 as a mentor to the project.

labs-tools-videocuttool's People

Contributors

aashray446 avatar abdul-alhasany avatar abhishekbvs avatar afzalkhan210 avatar bhaarat-khatri avatar deepchauhan avatar gopavasanth avatar gopavasanth-sap avatar harshithpabbati avatar iampranavdhar avatar jayprakash-se avatar lalit97 avatar minhducsun2002 avatar mrjoebcarvalho avatar najnifatima avatar nixerus avatar ogechivivian avatar pranav-yadav avatar prathamvaidya avatar punithnayak avatar sandyabhi avatar sarthakkundra avatar shcherbadev avatar sohomdatta1 avatar srialavandar avatar ssd71 avatar tobi406 avatar translatewiki avatar varun-s22 avatar zabemath avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

sohomdatta1

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.