Unlike centralized social media your videos aren't automatically optimized on Nostr. Her are some good tools to compress your videos for smaller size and better streaming before upload.

πŸ”ΉAndroid

FFshare - Open source, ffmpeg based

https://github.com/caydey/ffshare

Proton - Google Play Store

https://play.google.com/store/apps/details?id=com.arthur.hritik.proton.video.compressor

πŸ”ΉDesktop - both are available for Linux, Mac & Windows.

Handbrake

https://handbrake.fr/

FFmpeg

https://ffmpeg.org/

Reply to this note

Please Login to reply.

Discussion

we could be doing a lot better job though

True. I see a lot of 1 minute videos that are triple digit MB in size. A lot can easily be compressed by a factor of ten.

Using H264/MP4 doesn't help (though it would be fine for 1 minute videos if people encoded right)

It does help with compatibility. Many devices can't decode h265/HVEC.

H265 is worse but VP9 webm is better

I don’t know about videos but it would be nice if we converted image files into JPEG XL, because it has inherited a party trick from FLIF where you only need to i.e. download half of the file to have half of the resolution.

Should save on bandwidth and file storage, since you don’t need redundant tumbnails and alternative resolution files.

https://flif.info/animation.html

Totally need this. Suggestions for ffmpeg?

Handbrake uses FFmpeg under the hood, so if you like a GUI that's probably the best option. For using FFmpeg directly, any LLM should be able to do a good job of devising the correct command line to do whatever you want. For Nostr I use h264 for the video codec for widest compatibility.

Thanks, anything else I should know about nitrate resolution, etc?

I usually drop the resolution for social media posting personally, 480 or 720 is fine. For the bitrate look into the crf (Constant Rate Factor) option. The higher you set this the lower the bitrate. Depending on the video it can save a lot of space without losing too much quality.

`-c:v libx264 -crf 22 -preset slow` is a good baseline and adjust from there.

A pretty in depth article covering FFmpeg.

https://thelinuxcode.com/how-reduce-video-size-with-ffmpeg/

Don't listen to the H264 part. VP9 (or AV1) should come before H264. Can do both if a platform requires H264.

Don't chase compatibility by doing shit wrong to be compatible with other people doing shit wrong. If you post a video on nostr correctly, it won't show in Primal because Primal sucks - don't pretend that's the good tech's fault

https://video.nostr.build/5bd2630854421ea1c235aaec97f8c69f5eac4c65fa804acbfe2324bb51ae4340.webm

Here's an example of a video posted on nostr correctly - it doesn't show in Primal for me because Primal sucks and dickrides H264/MP4, but Ryan wants you to make that your problem by letting Primal demand you suck the same

I do agree with the ffmpeg/handbrake recommendations though

I know nostr:nprofile1qqsfnz2sqsflkatdssmeztxr90s8xrd7r07xkhfwaa6eu9zkcguljpgprpmhxue69uhkc6t8dp6xu6twvaex2mrp0yhxxmmdqyv8wumn8ghj7am9d33k7mt99ehx7um5wgh8w6twv5q3kamnwvaz7tmwdaehgu3wwphhyar9d4hkuetjduhxxmmdh047hg would appreciate people using these.

You can also do some file size reduction in your video editing software at export. Using LumaFusion on my phone I made a 47 sec video at 57MB. I’m guessing that sort of thing can help?

That's a good start. For social media these can take it even further. Get that 58 down to single digits.

Thanks Ryan that's really helpful, that's why you're the cream of the crop.

More people will watch your video if it loads quickly. Media optimization for internet use is important. If something doesn't load quickly, people just move on.

nostr:nevent1qqs0up7yph37243zaa8l3ccrc73uf04rdzke3h06qfwvtm85r0xrnlspzamhxue69uhhyetvv9ujuurjd9kkzmpwdejhgtczyr02k7w6lgwzhe955mf6egf40dk25zm5f06x44ff5khyvs5g270xsqcyqqqqqqgeh7pd9

Somewhat related subject, can these tools remove metadata as well?

Do you think compression is necessary for iPhone videos?

Any video, yeah. Your phone saves for maximum quality. For posting on the Web you want to optimize for loading speed and bandwidth. Major platforms do this on their servers, Nostr doesn't have this yet unfortunately.

Ok good to know! Thanks Ryan πŸ™

Phone videos are the worst. When I move them to other storage I always batch re-encode them.

#amethyst compresses locally before posting...

Yeah I've of the clients that does. I get much better results with Proton though, smaller files with better quality.

True, it's not to be meant a high grade compression. Just a basic one to crunch the worst away...

Images are not optimized either. Plenty of folks with 10mb PFPs around here.

This. When I vibed a game using avatars as game assets the biggest hurdle was optimizing them for use in game. Centralized services doing all the work for you has left most people ignorant of the importance of media optimization for Internet use unfortunately.