Prologue
Aaand, my open source journey continues! I was very fortunate to get selected for Google Summer of Code (GSoC) this year. I have to admit that it has propelled me to work with many open source tools.
I worked on extending the video player in GNU MediaGoblin to accommodate multiple resolutions of the video. It has been a great experience for me! I am extremely grateful to my mentors, Boris Bobrov and Christopher Webber.
What I have worked on so far…
Community Bonding Period
May 4, 2017 – May 29, 2017
As I was quite new to the technologies that were required for this project, I spent most of my time getting used to Celery, Gstreamer and VideoJS.
- I built a sample project to get used to scheduling jobs and prioritizing them using Celery. It was really helpful for designing and implementing parallelism in transcoding video into multiple resolutions.
- I looked at some of the VideoJS plugins for rendering multiple qualities of video.
- We finalized the design changes for the backend.
Phase 1
May 30, 2017 – June 26, 2017
The main design change is adding the workflow
method to the Class VideoProcessingManager
. The Celery tasks are of two types: main_task and complimentary_task. The video is transcoded to the default resolution (which is set by the instance owner) in the main_task. After completion of the main_task, the video is transcoded to the other resolutions in different complimentary_tasks concurrently.
Major commits
- 16ef1164 Modify
CommonVideoProcessor
to accommodate multiple qualities - 7cc9b6d1 Add main_task, complimentary_task and cleanup
- 9a27fa60 Add additional celery config settings
- 25ecdec9 Add priority to the celery tasks
- 2771f467 Add
VideoProcessingManager.workflow()
tests - ee2b53de Add test_chord for
TestSubmissionVideo
Commits Link: https://gitlab.com/vijeth-aradhya/mediagoblin/commits/multiple-qualities-backend
Phase 2
June 27, 2017 – July 24, 2017
The major changes committed during this period are upgrading the VideoJS player version to v5.20.1 and adding video-resolution-switcher (v0.4.2), a VideoJS plugin. At this point, the video player could change the resolution of the video.
Major commits
- 809ebf45 Add
get_all_media()
inMediaEntryMixin
- ca469bb0 Add video-resolution-switcher (video.js plugin) v0.4.2
- d66d08d1 Change video.js version to v5.20.1
- b57a682c Add change-video-resolution.js to start video-resolution-switcher plugin
- 9dea49e6 Modify video.html to add video-resolution-switcher plugin
Commits Link: https://gitlab.com/vijeth-aradhya/mediagoblin/commits/multiple-qualities-frontend
Final Phase
July 25, 2017 – August 29, 2017
In this phase, I concentrated on perfecting the work that I had done. I fixed small bugs, modified the logging and added more tests. I also modified the processing panel to show the progress of processing the video to the default resolution (previously, only the total progress of video processing was shown). Hence, I had to do a migration to the MediaEntry
table for this to be possible.
Major commits
- 36c1e7dc Replace print statements to logging
- 3456abe9 Fix percentage reporting
- 170cd28f Create a seperate test for get_all_media
- beb9121c Add main_transcoding_progress column migration
- b89e12a2 Add main_transcoding_progress to ProgressCallback
- e86e08ae Show default resolution progress in processing panel
Commits Link: https://gitlab.com/vijeth-aradhya/mediagoblin/commits/transcoding_progress
Further work that can be done…
I feel that I have successfully completed the proposed project, but there is always scope for improvement. I have decided to stick around with the MediaGoblin community even after GSoC so that I can continue to improve the video plugin, contribute to other parts of the code and help newcomers to start contributing in the future.
More features/ideas
- One of the features that is required is to show the real time progress of processing of each of the resolutions. Currently, only the total progress and the default resolution progress is shown in the processing panel.
- I think that there should be better error handling after we shifted to
workflow()
fromProcessMedia.run()
. Currently, we directly schedule the Celery tasks by callingworkflow()
in submit/lib.py but we previously scheduled them by callingProcessMedia.run()
in processing/task.py. - When the user has low network connection and he/she is trying to watch a video, then the player has to automatically switch to a lower resolution of the video (adaptive streaming discussion). MPEG DASH support might seem a bit too far-fetched right now, but it is still a good addition to the player.
Outstanding bugs
If there are any bugs/issues, then they will be listed in the issue tracker.