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

Media Optimization #2214

Open
8 tasks
jb55 opened this issue May 6, 2024 · 2 comments
Open
8 tasks

Media Optimization #2214

jb55 opened this issue May 6, 2024 · 2 comments
Labels
data Bandwidth, data usage, etc media perf technical tracking Tracking issues video

Comments

@jb55
Copy link
Collaborator

jb55 commented May 6, 2024

This is a tracking issue for media optimization-related tasks

Transcoding/video uploads:

@fishcakeday has been doing some work on the nostr.build side, so we shouldn't try to overlap work where we don't need to. Even is that case, we should still be looking at optimizations for non-nostr-build media sources via proxies.

@fishcakeday
Copy link
Contributor

fishcakeday commented May 6, 2024

May I suggest to start with doing the initial transcoding of the video on the client:
https://developer.apple.com/documentation/avfoundation/media_reading_and_writing/exporting_video_to_alternative_formats

Then pick the correct quality:
https://developer.apple.com/documentation/avfoundation/avassetexportpresetmediumquality - is a good one for this purpose.

Resolution:
https://developer.apple.com/documentation/avfoundation/avassetexportpreset640x480 - 480p is universally great and perfect for a phone sized video in 99% of cases. I do not advise going over 720p for this purpose.

Ensure to set this:
https://developer.apple.com/documentation/avfoundation/avassetexportsession/1390593-shouldoptimizefornetworkuse - this moves the important bits to the beginning of the file and allows quick start of the playback

You could also enforce:
https://developer.apple.com/documentation/avfoundation/avassetexportsession/1622333-filelengthlimit - since NB limits free to 10MB, but no limit for users with account. (Optional)

There are many options that can be used to make videos great and quick without any proxies if they are uploaded from Damus, AFAIK Amethyst already doing it, but the quality is unwatchable and not well chosen.

@jb55
Copy link
Collaborator Author

jb55 commented May 6, 2024

@fishcakeday thanks I broke these into tickets for tracking

@jb55 jb55 added the tracking Tracking issues label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data Bandwidth, data usage, etc media perf technical tracking Tracking issues video
Projects
Status: Backlog
Development

No branches or pull requests

3 participants