this post was submitted on 20 Oct 2024
34 points (97.2% liked)

datahoarder

6763 readers
36 users here now

Who are we?

We are digital librarians. Among us are represented the various reasons to keep data -- legal requirements, competitive requirements, uncertainty of permanence of cloud services, distaste for transmitting your data externally (e.g. government or corporate espionage), cultural and familial archivists, internet collapse preppers, and people who do it themselves so they're sure it's done right. Everyone has their reasons for curating the data they have decided to keep (either forever or For A Damn Long Time). Along the way we have sought out like-minded individuals to exchange strategies, war stories, and cautionary tales of failures.

We are one. We are legion. And we're trying really hard not to forget.

-- 5-4-3-2-1-bang from this thread

founded 4 years ago
MODERATORS
 

I know for photos i could throw them through something like Converseen to take them from .jpg to .jxl, preserving the quality (identical visially, even when pixel peeping), but reducing file size by around 30%. What about video? My videos are in .h265, but can i reencode them more efficiently? im assuming that if my phone has to do live encoding, its not really making it as efficient as it could. could file sizes be reduced without losing quality by throwing some processing time at it? thank you all

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 3 points 3 weeks ago* (last edited 3 weeks ago)

I will use AVC and HEVC terminology for h264/x264 and h265/x265 respectively.

For video, you get jumps of compression quality from AVC to HEVC, from 8-bit to 10-bit, and from HEVC to AV1.

Depending on your source material, changing compression settings, like target quality, variable bitrate, etc, can also have significant gains. It will depend on your source and target though, and may need some testing to get "right". If you're looking for the best compression, that may be on a file by file basis, because different kinds of video have significantly different compression behavior or concerns. That's likely not feasible for a mass of files though.

Playback compatibility should also be considered. AVC mp4 is the most compatible, right now, if you consider all kinds of and older mobile and embedded devices. If you're fine with modern or desktop, you can go for the best compression codecs.


To get an idea of encoding time investment and quality, you can use ffmpeg with default quality settings, and target the different encoding targets.

AV1 10-bit, Opus audio:

ffmpeg -i input.mp4 -c:a libopus -c:v libsvtav1 -pix_fmt yuv420p10le out_av1-10bit-opus.mkv

AVC mp4 (when targeting mp4 these codec settings are the default, so in fact don't have to be specified):

ffmpeg -i input.mp4 -c:a aac -c:v libx264 -pix_fmt yuv420p out_avc-aac.mp4

HEVC 10-bit, opus:

ffmpeg -i input.mp4 -c:a libopus -c:v libx265 -pix_fmt yuv420p10le out_hevc-10bit-opus.mkv