Does someone have a script that converts all videos files from 264 to 265 and changes the name?

Even an attempt at it would be appreciated

looks like I will not convert anything at all.

It is definitely not worth converting x264, even less x265, to av1, if you are the only consumer. Just think about it. To get any “significant” space gains, while keeping a close to original quality (you will inevitably lose some detail), you need to spend maybe at least 3-4x more time encoding than the actual total video length, probably more, maybe 5x. Taking an average of 3GB/hour, 2TB is about 650 hours. x5 that’s like 3250 hours. An 8 core ryzen will have like 150W total system load encoding av1. 3250h * 0.15 kWh =~ 500 kWh. 500 kWh * 0.15$/kWh (I took an optimistic electricity cost for these days, might be a lot more depending where you live) = $75 in electricity costs. Setting encodes, moving files around, will also take up some significant amount of time. You will gain maybe 1TB, if compressing audio to opus as well, less than that you will have significant video quality losses. 1TB of hdd space is worth $15 these days. And you don’t waste time/electricity+money/video quality.

So it’s only worth to get existing published encodes of the material you own, of if you are planning on publishing yourself. Or just for fun, if you want to experiment and encode one movie to see what’s the best you can get out of av1.

source: https://www.reddit.com/r/AV1/comments/ymrs5v/id_like_to_encode_my_entire_library_to_av1/

37 points

What about

#!/bin/bash

find . -type f -name '*.mp4' -exec sh -c 'ffmpeg -i "$0" -c:v libx265 "${0%.mp4}-conv.mp4""' {} \;
permalink
report
reply
13 points

Kind of. But this is encoded using CPU and will be time consuming. Search for FFMPEG GPU acceleration. The installation (building) will take some time but the time saved during mass conversion of videos will be worth it. I believe FFMPEG supports RCOM on Amd and Cuda on Nvidia . So any gpu should be fine.

permalink
report
parent
reply
12 points

I generally think that for storage/archiving you should use CPU encoding and only use GPU for things like transcoding where real-time results are crucial.

GPU encoding is a lot worse quality than CPU, and you can’t change the settings to what you want. Better to just accept the extra time requirement to get a better result.

permalink
report
parent
reply
5 points

This. Also unless you have raw BluRay sources recompressing already compressed video isn’t exactly a great idea either way. The space savings will never be worth the loss in visual quality. If you were to retain the quality the space used would probably be similar even with a more efficient / newer codec.

permalink
report
parent
reply
3 points

GPU decoding is the way to go, it frees up the CPU to do the encoding so you’re still cutting down time without adding GPU weirdness to the output.

permalink
report
parent
reply
2 points
*

I agree with you. With GPU encoding the options to tweak are less and the quality drop is noticeable if the source ain’t that great. But if you try to encode a full movie on a weak CPU it’s going to take ages.

permalink
report
parent
reply
0 points

So, I should not look into enabling hardware acceleration?

permalink
report
parent
reply
0 points

Thxn i’ll have another look into it!

permalink
report
parent
reply
2 points

That looks promising. Just keep in mind that this will take a very long time to run. I believe there is a *arr out there that can manage this / show progress, but the name escapes me

permalink
report
parent
reply
3 points

I think it’s Tdarr you’re thinking of.

permalink
report
parent
reply
1 point

Or use A FFMPEG script to sort all the x264 videos and keep it in a separate folder and use handbrake with GPU and mass convert all the videos in that particular folder. AV1 is also good but as some other user said, your hardware needs to support it.

permalink
report
parent
reply
1 point
*

I guess newer hardware is cheaper than drives

permalink
report
parent
reply
33 points

Just keep in mind you’re going to lose quality. Any time you compress something in a lossy format is going to get worse.

Another note, if you’re not worried about quality loss, you might look into AV1 over h265. Much better compression. Though, that might not work with your setup.

permalink
report
reply
2 points

Thx for reminding me.

Is it ready for prime time already?

permalink
report
parent
reply
7 points
*

Short answer yes. Much longer. More complex answer. Mostly. If you’re planning on your devices being able to support hardware decoding and large resolutions/ high frame rates. Sit-top boxes and appliances are not quite there right now. I believe the newer Chromecast HD absolutely supports av1. But most of the older Chromecast including Chromecast TV do not support it directly. So it will have to be re-encoded to be streamed.

That said, the codec itself is fantastic. As an example for animated content, especially. I have some super high quality rips of the old old cartoon from the '80s of the Ghostbusters franchise. We’re talking nearly a gigabyte encoded in h264 for a 22 minute episode. At SD resolution. Upscaling them to 720p and encoding them with av1. And a constant rate factor of about 40. They’ve been coming in between 80 and 200 MB in episode depending upon how much movement there is etc. The one thing with av1 is That as it degrades it sort of smooths everything which works out perfectly for animation most of the time. It can work for live action etc. As well. But you will encounter smoothing as detail is lost. But overall, it is much more preferable to the H style codex so far

permalink
report
parent
reply
5 points

I would try making one video into the format you want and see if it plays where you want it.

permalink
report
parent
reply
10 points
*

I use a handbrake container and a watch folder. Just move what you want converted to the watch folder and handbrake does the rest.

permalink
report
reply
2 points

That’s a great idea!! Thanks!

permalink
report
parent
reply
1 point

That’s more work at the first glance since it’s not just a couple of videos

permalink
report
parent
reply
7 points

Check out Tdarr

permalink
report
reply
1 point

Agreed. I’ve converted my library all to 265 using Tdarr, I’m up to 11.5 TB of saved space. I like having all my media be uniform for my Plex server, and Tdarr is a nice and easy tool to achieve it

permalink
report
parent
reply
-1 points

I did that a long time ago and I was more pleased with unmanic but I’ve got one job and that’s just to convert 264 to 265 which should be straightforward and easy and many people should want this as ee all have limited storage

permalink
report
parent
reply

Piracy: ꜱᴀɪʟ ᴛʜᴇ ʜɪɢʜ ꜱᴇᴀꜱ

!piracy@lemmy.dbzer0.com

Create post
⚓ Dedicated to the discussion of digital piracy, including ethical problems and legal advancements.

Rules • Full Version

1. Posts must be related to the discussion of digital piracy

2. Don’t request invites, trade, sell, or self-promote

3. Don’t request or link to specific pirated titles, including DMs

4. Don’t submit low-quality posts, be entitled, or harass others



Loot, Pillage, & Plunder

📜 c/Piracy Wiki (Community Edition):


💰 Please help cover server costs.

Ko-fi Liberapay

Community stats

  • 4.8K

    Monthly active users

  • 3.4K

    Posts

  • 87K

    Comments