All Posts programming The Ultimate Storage Hack: How to Save Terabytes by Converting Your Media Library to AV1

The Ultimate Storage Hack: How to Save Terabytes by Converting Your Media Library to AV1

ยท 1026 words ยท 5 minute read

We have all been there. You go to download a new game, export a project, or back up your phone, only to see the dreaded notification: Storage Almost Full.

Before you run out and buy another expensive external hard drive, there is a better, smarter way to reclaim your disk space. By converting your local video archives into the next-generation AV1 video codec, you can slash your file sizes by up to 50% without sacrificing visual quality.

Here is why AV1 is the ultimate storage-saving hack and how you can convert your entire library today.


What is AV1 and Why Should You Care? ๐Ÿ”—

For the last decade, most of our videos have been encoded in H.264 (AVC) or H.265 (HEVC). While they did the job, they were built for an older era of technology.

AV1 (AOMedia Video 1) is an open-source, royalty-free video format designed by tech giants like Google, Apple, Netflix, and Microsoft. Its primary superpower is ultra-efficient compression.

  • Up to 50% smaller than H.264 files at identical visual quality.
  • Roughly 30% smaller than H.265 (HEVC).
  • Zero licensing fees, meaning it has rapidly become the universal web standard for streaming.

Imagine a 10GB movie collection shrinking down to 5GB or less, freeing up half your drive instantly.


The Catch: Compression Takes Brainpower ๐Ÿ”—

Before you convert everything, you need to understand the trade-off: encoding time.

Because AV1 uses incredibly complex math to squeeze video data down to the absolute minimum, your computer has to work hard to compress it. If you have an older processor, converting a movie might take some time. However, if you are looking for long-term archiving where files just sit on a drive, the upfront processing time is well worth the massive space savings.


How to Convert Your Media to AV1 Using FFmpeg ๐Ÿ”—

The most powerful, free tool for this job is FFmpeg. It is a command-line utility that handles video conversion effortlessly.

To convert a single video into a highly optimized, storage-friendly AV1 file, use this exact command in your terminal or command prompt:

ffmpeg -i input.mp4 -c:v libsvtav1 -crf 26 -preset 4 -c:a libopus output.mkv

Why these specific settings work best for storage ๐Ÿ”—

  • -c:v libsvtav1: This utilizes the SVT-AV1 encoder, which delivers the best balance of speed and compression.
  • -crf 26: This controls the quality. A Constant Rate Factor (CRF) of 26 is the “sweet spot” for AV1, stripping away unneeded file weight while keeping the video looking crisp and sharp to the human eye.
  • -preset 4: This tells the encoder how hard to work. Lower numbers mean tighter compression but slower speeds. Preset 4 or 5 is perfect for maximizing storage efficiency.
  • -c:a libopus: Don’t forget the audio! Opus is the most efficient audio codec available, saving you even more megabytes.
  • .mkv: The Matroska container perfectly holds both AV1 video and Opus audio.

Speeding Up the Process (For Multi-core CPUs) ๐Ÿ”—

AV1 encoding is incredibly heavy on processors. If the conversion is running too slowly, you can add the -g flag to optimize scene changes and speed up encoding.

ffmpeg -i input.mp4 -c:v libsvtav1 -crf 26 -preset 5 -g 240 -c:a libopus output.mkv

Stop Buying Hard Drives, Start Compressing ๐Ÿ”—

If you have folders full of old gameplay clips, drone footage, phone backups, or movie archives, letting them sit in old formats is wasting massive amounts of disk space. Converting your library to AV1 is like upgrading your hard drives for free.

Give FFmpeg a try on a few files today, look at the size difference, and watch your free storage space climb back up.


Automate the conversion process ๐Ÿ”—

on MacOS and Linux distros ๐Ÿ”—

Save the text below as a file named convert_media_to_AV1.sh in your main media directory.

#!/bin/bash

echo "============================================================"
echo "         AV1 RECUSIVE BATCH CONVERSION UTILITY              "
echo "============================================================"
echo

# Find all matching video files recursively, ignoring case
find . -type f \( -iname "*.mp4" -o -iname "*.mkv" -o -iname "*.avi" -o -iname "*.mov" -o -iname "*.ts" \) | while read -r file; do

    # Extract path, filename, and extension
    dir=$(dirname "$file")
    filename=$(basename "$file")
    basename="${filename%.*}"

    # Skip files that already have '_AV1' in the filename to prevent loops
    if [[ "$basename" == *_AV1 ]]; then
        continue
    fi

    echo "------------------------------------------------------------"
    echo "Processing: $file"

    # Run FFmpeg conversion, saving alongside the original file
    ffmpeg -i "$file" -c:v libsvtav1 -crf 26 -preset 4 -g 240 -c:a libopus "$dir/${basename}_AV1.mkv" -y

    if [ $? -eq 0 ]; then
        echo "Conversion successful: ${basename}_AV1.mkv created."
    else
        echo "ERROR: Conversion failed for '$filename'."
    fi
done

echo "------------------------------------------------------------"
echo "All conversions complete! All original files have been preserved."

Because macOS and Linux handle file security tightly, you need to give the script permission to run before executing it. Open your Terminal, change directories to your media folder, and run these commands:

\1. Make the script executable:

chmod +x convert_media_to_AV1.sh

\2. Run the script:

./convert_media_to_AV1.sh

on Windows ๐Ÿ”—

Save the script/code below as convert_video_into_av1.bat. Make sure the file extension is .bat. Put the saved file in the same folder as the videos you want to convert. Double click on the file convert_video_into_av1.bat to run it and wait.

After the videos are converted, check the converted videos. If the converted video is as good as the original video, delete the original video to save disk space.

@echo off
setlocal enabledelayedexpansion

:: Recursively loop through all files in the current folder and subfolders
for /R "%~dp0" %%f in (*.mp4 *.mkv *.avi *.mov *.ts) do (
    
    :: Skip files that already have '_AV1' in the filename to prevent re-encoding them
    echo %%~nf | findstr /I /C:"_AV1" >nul
    if errorlevel 1 (
        
        echo --------------------------------------------
        echo Processing: "%%~dpf%%~nxf"
        
        :: Run FFmpeg conversion, saving alongside the original file
        ffmpeg -i "%%f" -c:v libsvtav1 -crf 26 -preset 4 -g 240 -c:a libopus "%%~dpf%%~nf_AV1.mkv" -y
    )
)

echo --------------------------------------------
echo All conversions complete!
pause

I hope you enjoyed reading this post as much as I enjoyed writing it. If you know a person who can benefit from this information, send them a link of this post. If you want to get notified about new posts, follow me on YouTube , Twitter (x) , LinkedIn , and GitHub .

Translations:  ุงู„ุนุฑุจูŠุฉ (ุชูˆููŠุฑ ู…ุณุงุญุฉ ุงู„ุชุฎุฒูŠู†: ูƒูŠู ุชูˆูุฑ ุฃูƒุชุฑ ู…ู† ุฌูŠุฌุง ุจุงูŠุช ุนุจุฑ ุชุญูˆูŠู„ ููŠุฏูŠูˆู‡ุงุชูƒ ุฅู„ู‰ AV1)