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

Integrated video hosting via pictrs or peertube? #2318

Open
dessalines opened this issue Jun 13, 2022 · 10 comments
Open

Integrated video hosting via pictrs or peertube? #2318

dessalines opened this issue Jun 13, 2022 · 10 comments
Labels
area: media enhancement New feature or request

Comments

@dessalines
Copy link
Member

With pictrs, we've tightly coupled a separate image host with lemmy. We have pictrs instance settings in the config, and have image upload buttons in the UI.

Since a good amount of people are asking for it, and since a lot of other platforms like reddit are making videos and shorts first-class citizens in the UI, maybe we should start thinking about ways to do the same.

Some ideas:

  • See if video support / processing could be added to pictrs. IIRC pictrs does have this somewhat, although I think sound gets stripped, and I'm not sure of the limitations.
  • Integrate with a Peertube instance. Maybe a custom peertube URL, and admin login could be provided in the config, and videos could be uploaded via that, and then we show the embeds in lemmy.
  • Find another rust-specific image host that works with docker

I also want to re-iterate that IMO the main problem of images not being decentrally hosted ( and thus sharing hosting costs like torrents do ), will start to be a much bigger problem as we add videos, with many potentially large videos being individually hosted by many servers while sharing none of the hosting burden. Peertube does support webtorrents, but I'm skeptical about how much that actually gets used, since its not connected to regular torrents, and is only active while people are viewing the videos. If I had a lot more time I'd work on building a media server built atop public torrents, de-duped by file hashes or image perceptual hashes.

cc @asonix @Nutomic

#2312

@dessalines dessalines added the enhancement New feature or request label Jun 13, 2022
@DMTryptamines
Copy link

Would it be possible to leverage the live streaming feature in Lemmy?

@dessalines
Copy link
Member Author

dessalines commented Jun 16, 2022

Since lemmy's a link aggregator, ppl could post links to livestreams, and communities could sticky them, assuming whatever video solution we decide on supports it.

@Nutomic
Copy link
Member

Nutomic commented Jun 17, 2022

I have many doubts how this could work with Peertube. Would videos from all users get uploaded to the same account? That would get quite messy. In terms of federation, videos could be federated twice, via Peertube and Lemmy, which will also cause problems. Also, installing Peertube alongside Lemmy would increase resource usage a lot, especially for transcoding.

I think a better solution would be to improve the video player in lemmy-ui which is extremely basic. It only allows playback and thumbnail size or in fullscreen, nothing in between. Some more controls could also be useful. Video processing in pict-rs should be no problem as in uses ffmpeg, might just need some tweaks like keeping sound (and then sound could be muted by default in the lemmy-ui video player). Plus it might be useful to move the upload size limit into lemmy config, to make it easy to change. Maybe even use different size limits for image/video files.

So overall, i think only a couple of minor tweaks are necessary to make basic videos work much better in Lemmy. That should cover most use cases, without the complications of integrating with another platform. For more advanced use cases, its better to link to a specialized video platform.

@Thann
Copy link

Thann commented Jun 22, 2022

storing and serving videos take a TON of space and memory.
I think it would be good to relegate hosting videos to a separate service, because it drastically changes the hosting requirements.

I prefer a $60 "high memory" VM for hosting a basic peertube instance, but lemmy will work just fine on a $5 VM.

@dessalines
Copy link
Member Author

dessalines commented Jun 24, 2022

@asonix what would be the main issues with adding videos to pictrs?

@asonix
Copy link
Collaborator

asonix commented Jun 24, 2022

there's not really a technical barrier to adding videos to pictrs

i'd just rather not

@Nutomic
Copy link
Member

Nutomic commented Jun 27, 2022

@asonix Is there any particular reason? After all, it should be easy enough to enable or disable video uploads with a config option.

@sam365724
Copy link
Contributor

@asonix I saw that pictrs has support for muted video already. @Nutomic Is that testable already? I would love to have that feature, what help is needed to push it forward?

@asonix
Copy link
Collaborator

asonix commented Sep 26, 2022

There are some fixes around video going into the 0.4 branch that make this work better. 0.3 had issues identifying uploaded mp4 files, meaning really the only real use was for uploading GIFs. 0.4 will also have support for full videos, and better controls for limiting video sizes (there's now a configuration option for specifying the maximum number of frames allowed in uploaded media)

@Nutomic
Copy link
Member

Nutomic commented Sep 29, 2022

@sam365724 You can adjust docker-compose.yml to use the 0.4 beta image. It should work assuming there are no breaking api changes.

https://hub.docker.com/r/asonix/pictrs/tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: media enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants