VideoCutTool will help to trim videos on-the-fly in Wikimedia Commons. Currently, a video in Wikimedia Commons cannot be edited online. They have to be downloaded, changes made and later re-uploaded. As this process tends to take a good amount of time, the VideoCutTool makes authorized users work hopefully up-to 10x faster. This tool will be deployed on Wikimedia Toolforge, a hosting environment that provides services for the Wikimedia movement.
VideoCutTool has two different repositories “Front-end” and “Back-end”.
Commons:VideoCutTool Wiki Page:
Hosted in Wikimedia toolforge:
VideoCutTool is hosted in the Wikimedia Hosting environment Toolforge, This tool is hosted in two different apps, front-end and back-end.
- Done Into GSoC and Wikimedia Hackathon 2019.
- Done Bi-Weekly_Report-1
- Done Bi-Weekly_Report-2
- Done Bi-Weekly_Report-3
- Done Bi-Weekly_Report-4
- Done Bi-Weekly_Report-5
Developed a simple and user-friendly interface using React Ant Design library. This tool can do:
- Visual Cropping without manually entering the values to crop the video.
- Visual Trimming without manually entering the values to trim the video.
- Notify the user about the changes made.
- Validate video URLs with the regular expressions.
VideoCutTool back-end is built in Node.js using express server. With in the tool all video encodings are done using ffmpeg.
It allows users to perform multiple actions at once, i.e abilities to trim, crop and rotate videos. Also to Disable audio from video.
Users can perform any actions based on their requirements, and the workflow of this tool goes as following in fig: 2.1
Fig: 2.1 flow chart of the VideoCutTool
How to Use ViedoCutTool?
Step-1: Video URL
Start with Commons video URL as input to the VideoCutTool.
VideoCutTool supports mp4|webm|mov|flv|ogv extensions.
Fig: 1.1 Landing page takes Video URLs as input
Step-2: Video Settings
Once the video is being uploaded then following operations can be done –
Fig: 1.2 Video Settings – Users get to select their choice of operations.
1. Trim Video:
A long video can be trimmed into small ones, by clicking on the Trim options in the video settings, user can easily drag the time sliders and set the “Start” and “Stop” times of the video. On clicking the “Add More” button another time slider will be added to perform following sub-operations –
- Generate Multiple Videos: On clicking on ‘Multiple Videos’ option, user can trim a video into more than one videos. These multiple trimmed videos can be downloaded or uploaded to the Commons by logging into VideoCutTool.
Eg: A video of 15:25 min can be trimmed to multiple videos like one part of 4 minutes and the other half with the remaining time (or upto the user).
- Prepare a Single Video: On clicking on ‘Single Video’ checkbox, all the trimmed videos from it’s parent video will be concatenated and made as a single video again.
Eg: Trim any 2 minutes from a video of 15 mins, and trim a 3 minute part from the same video. Now you can concatenate both the parts and make it into a single video of 5 mins.
Fig 1.3 Visual Trimming – Users can trim the videos by dragging left/right on the sliders.
- Crop Video
By tapping on the ‘Crop Video’ from the settings, user can see the new layer in the video player then user can drag the layer within the player to adjust it’s height, width and corners of the output video. All the values will be auto recorded, no need to give any inputs.
Fig: 1.4 Visual Cropping – Users can crop the required area of the video.
- Rotate Video
On tapping the ‘Rotate Video’ from the settings, the video will be instantly rotated 90 degrees to the right. It also gives the instance preview of the output video.
Fig: 1.5 Rotate Video – Users can Rotate video.
- Disable Audio
On clicking the ‘Disable Audio’ from the settings, the audio will be disabled from the video.
User can turn on/off each feature, and each time they turn on/off, the user will receive a notification on the window.
After the user is done with editing, they can click on the ‘Preview’ button, the tool will start encoding the output video. This takes a while to process the video computation. As it takes more time, users will be displayed a loading spinner on the screen, so they are updated about the process.
Fig: 1.6 Preview of the video according to the users requirements.
Once the video is encoded, user will receive two options either to download the video, or to upload it to the Commons. I
To Do :
When the user logins and clicks on “Upload to commons Button” There are few minor errors.
- when clicks on the “Download Button” the browser is redirecting and playing the video in browser instead of showing the pop-up for the download.
- Hosted in toolforge, we need to make sure that it works properly.
How is this tool useful?
Many users upload, download, and sometimes edit re-uploaded video/audio files in the Wikimedia Commons, this tool makes the process smoother and much simple, reliable and faster without any conflicts.
Working on real-world problems, writing safe and secure codes for to make it to production, collaborating with teams from any place, proper communication with the mentors and community folks, have been a great learning experience for me. I will keep sharing this knowledge of OSS and my learnings with others to keep them on the same plate and inspire the coming generation.
I learnt a lot working with Hassan Amin, he has been so supportive, always encourages me in all the tough times throughout the GSoC period. Given an opportunity, I would love to work with him again.
My mentors, org admins, and community folks were very helpful all the time, guiding me in the best possible direction. Tons of heartful thanks to Srishti Sethi and Hassan Amin ♥