damus icon indicating copy to clipboard operation
damus copied to clipboard

Media Optimization

Open jb55 opened this issue 1 year ago • 2 comments

This is a tracking issue for media optimization-related tasks

  • [ ] #2212
  • [ ] #2098
  • [ ] #1717

Transcoding/video uploads:

  • [ ] https://github.com/damus-io/damus/issues/2357
  • [ ] https://github.com/damus-io/damus/issues/2220
  • [ ] https://github.com/damus-io/damus/issues/2219
  • [ ] https://github.com/damus-io/damus/issues/2217
  • [ ] https://github.com/damus-io/damus/issues/2218
  • [ ] https://github.com/damus-io/damus/issues/2216

@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.

jb55 avatar May 06 '24 20:05 jb55

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.

fishcakeday avatar May 06 '24 21:05 fishcakeday

@fishcakeday thanks I broke these into tickets for tracking

jb55 avatar May 06 '24 21:05 jb55

customer feedback on playback UX: https://github.com/damus-io/damus/issues/2422

alltheseas avatar Sep 05 '24 15:09 alltheseas