Anime Re-encoding anime

daratmp+wxqvs

New Challenger
gem
Joined
Dec 7, 2024
Messages
97
Reaction score
255
Points
627
Location
Netherlands
Anyone here re-encodes their anime to save space? I like to archive all of it, because ive learned that not everything on the internet is forever.
The settings i've been using in Handbrake makes it look basically identical in motion but saves about 50% of the space.

These are the settings i use. I probably have no idea what i'm doing, but its working for me so far.
1734197450998.png

1734197463320.png
 
Mmm I could use this, I have an external hard drive with some old animes and I'd really appreciate to have more space so I can archive more. So I just have to make modifications in VIDEO and FILTERS? How much time does it take you for 1 video?
 
Yes so you can use the program called 'Handbrake' to basically compress the files, at the cost of video quality.

How much time does it take for 1 video? That depends what CPU/GPU you have, and which encoder you use, and which settings.
If you have an Nvidia GPU you can use NVEnc, which is really fast, but less good quality/efficiency wise as opposed to using x265/x264 that use CPU and are therefor way slower.

For me, about 1 minute 30 seconds per 20min episode, when i use NVEnc H.265 at the quality settings i posted before.
1734214746061.png


Definitely use these settings for the audio and subtitles, it makes it so it doesn't touch them. By default it fucks with the audio and subtitles:
1734214573707.png

1734214590244.png

1734215163426.png


Ideally you would use 10bit AV1 on like medium-high quality, but that encodes with like 1fps. But it would shrink the filesize to like 1/3th while looking almost identical to blu-ray quality.
Post automatically merged:

I usually download my anime from Nyaa, and some uploaders do way better encoding than i am doing.
But theres also alot of shows that are either way too high quality or bad quality but still huge file size. There was this one show i really wanted to save for later, but just wasnt worth the 60GB, so I was forced to do the encoding myself.
 
Last edited:
FFMpeg encoding using AV1.

Unfortunately for anime i'm seeding most of what i download so i can't change it. BUT! that doesn't mean for storage reasons i won't re-encode.

To be explicit here, i download and re-encode my porn. And a 2Gb 40min 1080p video becomes about 300-500Mb, and looks/sounds about the same. yeah i can't play it on my SmartTV because AV1 decoding is too slow (for the moment). But space saved feels worth it. I think i was getting 200Mb-250Mb for an episode for anime though when i was testing (as compared to 400Mb-1.2Gb). And SD content, i can probably get down to 50-80Mb.

The bulk of the savings is in the keyframes being delayed from 2-3 seconds, to i put about 2000 frames (closer to 20-30 seconds), as that's like half the bandwidth of normally encoded videos.

Typical calling, make a batch file and use this (for Linux/Bash replace %1 with "$1" (yes include the quotes))

Bash:
ffmpeg -i %1 -vcodec libsvtav1 -vf format=yuv420p10le
    -scodec copy -map 0:v -map 0:a -strict experimental
    -acodec aac -q:a 0.85 -preset 5 -crf 35 -svtav1-params
    lookahead=120:keyint=2000 %1.mp4

If it's 1080 it will use 5Gb ram, so have some free memory set aside. It can also take several times the length of the video, so expect a 20min episode to take 1.5-2 hours. (Note, 8 cores, 8 efficiency cores at 3.5Ghz on my machine... So it may take longer for you)

Tweak the settings, crf 30-32 will be higher quality but be somewhat larger, and preset 5 is a nice middle-ground, if you need it fast make it 8-10 and it won't be as compact, if you don't care about time, change to a 3. Audio, 0.6-0.7 is fine for lectures speech and not so much music. changing the audio to copy may be preferred if you don't want to change that.

Start the encoding, put ffmpeg as low priority and just let it eat the idle cycles in the background while you work, you probably won't notice much. You can even put your computer to sleep and have it resume and it should work as long as the file is local and not network, so you don't have to leave the computer on 24/7.

Here's an example with pokemon intro. I hope spike doesn't mind i've split into 3 parts; Use VLC to play.
 

Attachments

Last edited:
OK, question for you crazy cats: Does FFMPEG have some kind of a graphic overlay that will let me turn a video’s soft subtitle files into hard subs, then re-encode the file into another format with zero loss to quality? My TV doesn’t like .MKV files at all, and the command-line version of FFMPEG is a bit too complicated for ol’ Gorse’s monkey-brain.
 
OK, question for you crazy cats: Does FFMPEG have some kind of a graphic overlay that will let me turn a video’s soft subtitle files into hard subs, then re-encode the file into another format with zero loss to quality? My TV doesn’t like .MKV files at all, and the command-line version of FFMPEG is a bit too complicated for ol’ Gorse’s monkey-brain.

This is a new thing for me, but i gave it a quick test. Apparently you do a video filter and specify the subtitles. ASS and SRT subtitles are acceptable.

Code:
ffmpeg -i Spaceballs.mp4 -vf subtitles=spaceballs.srt Spaceballs-hard.mp4

out.mp4.jpg


into another format with zero loss to quality?

No, there will be quality loss. Though if you ramp the CRF or bitrate high you own't notice as much loss. Just consider a one-off for immediate use and then throw it away.

(Though if you could encode as DVD subtitles, then that MIGHT work, but i am not familiar enough with subtitle handling to help with that)

If you have a NAS, it likely has transcoding which may have an option for the same thing as a pass-through. If not then don't worry about keeping it after you quickly re-encode it for a viewing. I have to recode AV1 videos before using on my TV and they usually are twice as big but are very temporary.
 
Last edited:
I have an 8tb drive and barely have half of it full, so no. That said, if you want to do good encodes look at what settings others use. Many uploaders on nyaa specify theirs and you can use ffprobe to get a general picture of how something was encoded.

AV1 is god-tier, but hardly practical unless you have powerful enough hardware. HEVC is perfectly fine and miles better than H.264.

OK, question for you crazy cats: Does FFMPEG have some kind of a graphic overlay that will let me turn a video’s soft subtitle files into hard subs, then re-encode the file into another format with zero loss to quality? My TV doesn’t like .MKV files at all, and the command-line version of FFMPEG is a bit too complicated for ol’ Gorse’s monkey-brain.

MKV is a container format, the codecs used for encoding the videos/audio streams could be anything, including H.264, which is used in MP4. In that case you could copy the untouched video stream into an MP4 and MP4 also has the capabilities to store soft subtitles, no need to hard sub anything. At the end of the day it depends entirely on what your TV supports and I know from experience that documentation about that stuff is oftentimes nonexistent. Sadly that means a lot of trial and error.
 
I have an 8tb drive and barely have half of it full, so no. That said, if you want to do good encodes look at what settings others use. Many uploaders on nyaa specify theirs and you can use ffprobe to get a general picture of how something was encoded.

AV1 is god-tier, but hardly practical unless you have powerful enough hardware. HEVC is perfectly fine and miles better than H.264.

From what i understand, Mpeg4 is half the size of Mpeg 2. x265 (HEVC) is about 30% smaller than Mpeg4, and AV1 is 30% smaller than x265. So AV1 you should have close to half the bitrate to match it than mpeg4.

But seriously dropping keyframes to a longer period will save you a lot more than anything else. Some encodings i've done i got about the same size as the original video. Then just by extending key frames to 200-300 frames away and the video size dropped by like a third!

Yeah seeking is a little slower, and some players will just jump to the closest keyframe, but that is the price i pay for tiny files.

As for the amount of time it takes. That really depends on how much processing you want AV1 to do. -preset 10 is a default i believe; while 12 is the fastest. But identifying duplicates and really getting better compression you need to go under 7.

I started doing 5 for everything, but i've changed that to 3. I don't care if it takes a day or three to encode in the background, i'm not watching it. Then again i have an OCD on efficiency where i try to use all my resources at full if i can.

Though, newer generation of video cards soon will support AV1 encoding. They probably won't be as space efficient as software, but would be decent for streaming or initial capturing.

As for CRF levels... I would treat 20 as basically lossless, 30-32 is great for general viewing, and i would even go up to 35 (which i use for adult videos). Go above 35 and artifacts and errors start to become noticeable, while 30-32 they are unnoticeable unless you are looking really closely for them.

Your brain is really good at fixing errors and filling in gaps in videos. Paused screens, then all the errors in a single frame jumps out at you.

MKV is a container format, the codecs used for encoding the videos/audio streams could be anything <snip>

It sounded like the player on the TV didn't support subtitles at all. Or like on mine where i sideloaded VLC, some subtitles tend to come up so light it's impossible to read. The DVD-style hard coded subtitles (images with transparency of the text) sounds like it may work but those aren't really supported unless you make it a VOB, and if you do that I'm not sure you can use Mpeg4. Quite confusing.

Then there's the case where some Mpeg4 refuses to play because it was DivX and they didn't want to pay a license, but a tiny tool to change the codec ID to FourCC and it was happy to do playback. (with Project Mayo, 3vix, and DivX and the early Mpeg4, they took a few parts of Mpeg4 and used that primarily, much like how Jpeg files are JFIF which is a sub-format of Jpeg but was easy to implement and did almost everything halfway decently, then none of the other Jpeg formats caught on).

In my experience ASS and SRT subtitles work find in MP4 files, and most codecs and audio works too. If you merely want to change containers, you can attempt and experiment.

Code:
ffmpeg -i inputfile -map 0 -c copy outputfile

Though some subtitle formats and some audio formats aren't 'officially supported', if you get that error, add -strict experimental which will allow it to do it anyways and then it may or may not work for you, though PC players are more lenient.

I found AV1 to be terribly slow for encoding it myself, I wanna save space, but I also want to save electricity lol. But whenever I see anime on Nyaa that is encoded with AV1 already, then i always download that one.

I notice a lot of the AV1s encoded on Nyaa amount to be effectively lossless. Good for long term storage, but not for general viewing, especially on smart TV's in the last 5 years unless you go the expensive top line Samsung or something. But yeah i do the same and go for AV1 when it's there.
 
Last edited:

Users who are viewing this thread

Connect with us

Latest Threads

Digimon Story Cyber Sleuth invisible texts bug on vita 3k

The game is working very fine, but there is one problem: some texts in the game are appearing...
Read more

Anime/manga villains

Who is the one villain you hate the most? Or the most annoying for you?
For me it's Shigaraki...
Read more

What is the power difference between a Gameboy Classic and a Color?

I feel that it was barely that different unless you check late gen (aka 2000-2001) games that...
Read more

I.Q.: Intelligent Qube

1738753788503.jpeg


Aka Kurushi in Europe (for some reasons Japan has an english name while Europe got...
Read more

Miss Hokusai 2015

The series is set in the Edo period and covers the careers of the painter Tetsuzo...
Read more

Online statistics

Members online
135
Guests online
227
Total visitors
362

Forum statistics

Threads
3,383
Messages
62,259
Members
219,537
Latest member
morlanpol

Support us

Back
Top