this post was submitted on 16 May 2024
65 points (97.1% liked)

Selfhosted

39980 readers
770 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

Hello! I recently listened to a podcast that talked about how storing media files in .av1 format is very efficient and storage-friendly. I've been storing my files in .mkv format, but now I'm considering using Handbrake or a similar service to convert all my video files to .av1 if it's more compressed than .mkv. So;

  • What format do you store your media?
  • What is the optimal way of storing media?
  • Do you use handbrake or similar services (feel free to suggest) to convert media files?
all 29 comments
sorted by: hot top controversial new old
[–] tobogganablaze@lemmus.org 62 points 5 months ago* (last edited 5 months ago) (1 children)

.mkv is just a container and can contain any encode. All my av1 encodes are .mkv files.

But the majority of my videos are in h264 for compatability, though I've been adding more av1 and h265 encodes lateley. But storage isn't much of a concern for me.

[–] Sunny@slrpnk.net 6 points 5 months ago

Oh, I was not aware of this at all, thanks for letting me know :)

[–] swooosh@lemmy.world 41 points 5 months ago* (last edited 5 months ago) (2 children)

The future is av1. Is it worth it to compress everything asap? No. Not all devices can play av1. You will still shoot pictures and videos in 264 or 265. Can you already edit av1? Do you do that? Check that everything you own and do can work with av1. You should prefer 265 over 264 nowadays.

Is it worth it for your own videos? It depends. If you have a lot, like terrabytes lot, of your own videos. Then yes, you could save storage. But, the time it'll take to reencode and the power consumption it needs isn't worth it. Just use av1 from nowon whereever possible if you export videos instead of 265 if all your devices and clients and friends who you're sending them to can play it. I converted all old media to 265 two years ago (or so) to have everything compatible. I do not plan on converting to av1 just for storage reasons. Storage is cheap compared to the time I invest in caring about it. Converting for compatibility yes, storage no. I switched to immich and I have no files on my phone or laptop anymore.

Torrents? No it's definetly not worth it to reencode. The guys who release the files are aware of av1 and they will switch as soon as almost all devices support av1 and people scream for it. It is not worth it to reencode imo. Just redownload once it's available. You can push av1 adoption by releasing videos in av1 yourself. Ask for it. Talk about it. Spread the word.

[–] Sunny@slrpnk.net 9 points 5 months ago (1 children)

Thanks, this answered pretty much all I was curious about. Appriciate it!

[–] swooosh@lemmy.world 7 points 5 months ago* (last edited 5 months ago) (1 children)

Same holds for avif and jxl. They are very storage efficient but jpg is still the best choice for compatibility reasons. You can use jxl to annoy chrome users because they can't view it and probably apple users as well but apart from that fun there's no reason to convert your whole library to it. Your devices, clients and editors have to support it. And we are still not there yet. Best is to spread the word that it'll be the future but the future is not yet today. Best for their adoption is to stay away from vendors who try to push their own standard like apple.

Export in avif/jxl if you know you can play it everywhere but don't convert a whole library to it unless you know you want have problems with it in the future. Jpg with 70% quality isn't that bad.

[–] Sunny@slrpnk.net 3 points 5 months ago

Sounds good, thanks for letting me know. I'll pass on the word :)

[–] Scrath@lemmy.dbzer0.com 3 points 5 months ago

Not all devices can play av1. You will still shoot pictures and videos in 264 or 265. Can you already edit av1? Do you do that? Check that everything you own and do can work with av1. You should prefer 265 over 264 nowadays.

The default windows 10 installation for example can't even handle h265 -.-

[–] gwheel@lemm.ee 11 points 5 months ago (2 children)

I don't reencode anything, I keep the raw bdmv rip and remuxed mkv for jellyfin. Even if the difference is imperceptible, as long as I have the storage space there's no reason to spend time fiddling with conversion when it can only make things look worse.

[–] Sunny@slrpnk.net 4 points 5 months ago

Yeah I simply wasnt aware of this, thought it was smart to change to the latest standards - but comments here have pointed out that its not worth chaning, plus it will change itself over time. Thanks anyways!

[–] Tregetour@lemdro.id 4 points 5 months ago* (last edited 5 months ago)

As an experiment, take any remux from your collection and encode it by dividing the raw video bitrate by 2.5

What you'll invariably find:

  • Perceptible quality degradation at 100 per cent scale: 0%
  • " @ 200 per cent scale: <1%
  • Space saving: >50%
[–] bjoern_tantau@swg-empire.de 10 points 5 months ago

If I get my files already compressed they stay that way. If I rip something like a DVD I will just encode it in whatever is good at the moment. Re-encoding usually only makes sense if you can drastically reduce filesize. If you go from one lossy format to another you will always lose quality. So if that just means slightly smaller files I wouldn't do it.

[–] slazer2au@lemmy.world 10 points 5 months ago (1 children)

In whichever format it came in. If someone has a guide on how to convert from whatever to x264/5 with minimal loss it would be appreciated.

When I try with hand break the quality dips to much to not make the conversion worth it.

[–] Clusterfck@lemmy.sdf.org 2 points 5 months ago

As others here have mentioned, Tdarr can handle a lot of it automatically

[–] ArtikBanana@lemmy.dbzer0.com 9 points 5 months ago (1 children)

Just want to add that at the moment AV1 is only beneficial for encoding to lower bitrate videos.
It's still better to use x265 for high bitrate.

[–] Sunny@slrpnk.net 3 points 5 months ago

Noted, thanks :)

[–] ramble81@lemm.ee 7 points 5 months ago (1 children)

.iso …. Storage is cheap and I want it as native as possible, that way I keep all my menus, original video and audio quality without any chance of introducing artifacts.

[–] MonkderDritte@feddit.de 3 points 5 months ago* (last edited 5 months ago) (1 children)

But one bit flip and you can trash the whole iso. Which is why i don't even pdf my scans but keep them as png.

[–] drspod@lemmy.ml 2 points 5 months ago

If you're not storing on a filesystem that calculates and checks erasure codes then you can always generate PAR2 files yourself.

[–] changeableface@lemmy.world 7 points 5 months ago (2 children)

If you take the plunge to re-encode, check out the self hosted app tdarr, very handy for large libraries, or watching folders for new files, plus you can distribute the load to other computers if you have any spare headroom.

Encoded over 20tb in a few days with three machines and saved around 6tb of space.

[–] Kushan@lemmy.world 3 points 5 months ago

Another recommendation for tdarr, set it up in January and let it transcode away, going to h265 for all my media - saved me over 40TB of space so far and I haven't noticed a massive drop In quality or had any playback issues.

[–] Sunny@slrpnk.net 1 points 5 months ago (1 children)

Ah nice recommendation, have seen that name been mentioned before but wasnt sure what it was for. Now I know! :)

[–] changeableface@lemmy.world 2 points 5 months ago (1 children)

With docker-conpose it took less than 20 mins to setup the system across several machines and have it working. Definitely worth investigating.

Pro tip 1, use it to strip out any languages you don't need and other optimisation techniques like reordering streams will save space and reduce transcoding overheads.

Pro tip 2, You'll encoded fastest if you can offload to a GPU, I did this in two gaming pcs with decent albeit 7 year old, Nvidia cards, but you'll get slightly better results (barely noticeable quality wise, but slightly smaller) through a CPU encode, it'll just takes about 7 to 20 times as long.

[–] Sunny@slrpnk.net 2 points 5 months ago

Thanks again for the addtitional insights on this! I was indeed planning up picking up an Intel Arc 310 or a 380 later on as they are super cheap and seem to be excellent at hardware transcoding :)

[–] IronKrill@lemmy.ca 5 points 5 months ago

File format? mkv, so convenient. But media codec would be h265 any day. I find the video quality to file size to be perfect for most films and only have issues with it on the largest files and the lowest power hardware (Roku TV). For the movies I really love and rewatch I sometimes get h264 for the better visual quality. I tried some AV1 files and found the artifacts really ugly, but admittedly these were very small files. That and the lack of hardware decoding on most hardware is preventing me from migrating.

[–] Faceman2K23@discuss.tchncs.de 3 points 5 months ago (1 children)

You're confusing a container format (MKV) with a video codec (AV1)

MKV is just a container like a folder or zip file that contains the video stream (or streams, technically you can have multiple) which could be in H264, H265, AV1 etc etc, along with audio streams, subtitles and many other files that go along, like custom Fonts, Posters, etc etc.

As for the codec itself, AV1 done properly is a very good codec but to be visually lossless it isn't significantly better than a good H265 encode without doing painfully slow CPU encodes, rather than fast efficient GPU encodes. people that are compressing their entire libraries to AV1 are sacrificing a small amount of quality, and some people are more sensitive to its flaws than others. in my case I try to avoid re-encoding in general. AV1 is also less supported on TVs and Media players, so you run into issues with some devices not playing them at all, or having to use CPU decoding.

So I still have my media in mostly untouched original formats, some of my old movie archives and things that aren't critical like daily shows are H265 encoded for a bit of space saving without risking compatibility issues. Most of my important media and movies are not re-encoded at all, if I rip a bluray I store the video stream that was on the disk untouched.

[–] Sunny@slrpnk.net 2 points 5 months ago

Yeah I realised when a few others pointed it out. Learnt a lot from these comments, including yours. Thanks for clearing it up! 🙌

[–] Smash@lemmy.self-hosted.site 2 points 5 months ago

AV1 (NVEnc) + Opus in webm containers

[–] possiblylinux127@lemmy.zip 0 points 5 months ago

I use VHS tapes

Just kidding I use mpv