Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(DRAFT) Transcoding #18

Open
Hubro opened this issue Aug 11, 2021 · 2 comments
Open

(DRAFT) Transcoding #18

Hubro opened this issue Aug 11, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@Hubro
Copy link
Owner

Hubro commented Aug 11, 2021

THIS DRAFT IS A WORK IN PROGRESS

Comments are welcome though


Add the possibility of doing automatic transcoding of clips to other qualities.

I am a big believer in the Unix philosophy of "do one thing and do it well". Since "streaming clips over the internet" and "doing automatic video transcoding" is two very different things, I would like to avoid putting them into the same application.

For that reason, I propose writing a new application that will automatically transcode all clips in a directory into multiple qualities. This application can be deployed onto the same clip folder as Clipface. Clipface can be modified to find the alternative video sources and make them available in the user interface.

Suggested application name: clipface-transcode. (Creative, I know.)

Overview

The simplest way to enable transcoding will be to deploy the official clipface-transcoding Docker image on the same clip directory that Clipface is using. The transcode process will place finished lower-quality clips into a subdirectory called .clipface-transcode/. Clipface will detect these clips and display them as quality options in the user interface.

Changes to Clipface

On the front end, the user will now see options for other qualities. By default, "Source" will be selected. When the user selects a different quality, the lower quality clip will be played instead. The choice will be saved as a local user setting and that quality will be used for all clips.

Transcoding process

TODO

Challenges

  • What do we do when clips are deleted? How do we reliably delete the orphaned transcoded clips?
    • A cleanup function that runs daily (?) could loop through the transcoded clips and confirm that their source still exists, and if not, delete them.
  • If the transcoded clips are keyed by clip name, how will we handle the original clips being renamed? Transcoding the clip all over again just because it has a new name seems very wasteful.
    • Key transcoded clips by MD5 hash instead? This will survive clip renames, but will be very computationally expensive for large clips. The hashes will have to be cached and associated with the clip name.
@snnacks
Copy link

snnacks commented Aug 12, 2021

I like this idea. I made a post on r/selfhosted the other day about Clipface and had numerous questions about transcoding so I'm sure a lot of people would use this feature. I'm assuming you could adjust quality/bitrates somehow though? The reason I ask is because if it just has a default bitrate for a resolution of 1080p, some people use ultrawide monitors and it has more pixels to encode, or someone might upload a 30fps clip, etc.

@Hubro
Copy link
Owner Author

Hubro commented Aug 15, 2021

I'm assuming you could adjust quality/bitrates somehow though?

Yep, it was in the first draft, before I decided to not add this directly to the Clipface code base. The user will be able to supply a list of resolutions, encoding qualities and speed presets (fastest, faster, fast etc.)

@Hubro Hubro added the enhancement New feature or request label Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants