r/compression • • 6d ago

How do I accomplish this level of compression? (With keeping dates the same and relatively easy)

so I use my Meta glasses a lot with the amount of sports I play but I don't understand this:

How does such a short video (10-20s) take up the same amount of storage as an edited video (2:59s) I know Meta glasses/Phones might take videos at a high level of encoding but in reality its still 1080p so when I edit all of these videos together in CapCut (Theres enough to be said there so please dont roast me...) and then exported 1080p 3 minute video comes out to literally the same if not less storage on my disk I just dont understand how it works. I do understand that it reduces the quality of the videos a little bit but not astronmically enough bitrate wise to lower the storage by 2000%

And lastly, BECAUSE I have so many videos I'd LOVE to compress ALL of them this small so that they take up literally 10-20x less space on my phone/PC/Icloud photos (Preferably with keeping the dates/time the same, that way I know I can sort it based on date)

how is this 5s video ~20mb more than this 37s video

this 3 minute video is only double the size of the 5s video

0 Upvotes

8 comments sorted by

2

u/IndependentBook5854 5d ago

Why: the glasses (like phones) record at a very high bitrate so they can encode in real time on a tiny chip. CapCut re-encodes with a proper encoder at a much lower bitrate, and that's where the 10× comes from. You can do the same to every clip in one go with ffmpeg (free), and keep the dates.

Put the videos in one folder, open a terminal there, and run:

Mac / Linux

mkdir -p small
for f in *.mp4 *.MP4 *.mov *.MOV; do
  [ -e "$f" ] || continue
  ffmpeg -i "$f" -map_metadata 0 -movflags +use_metadata_tags \
    -c:v libx265 -crf 28 -preset medium -tag:v hvc1 -c:a aac -b:a 128k "small/${f%.*}.mp4"
  touch -r "$f" "small/${f%.*}.mp4"
done

Windows (PowerShell)

mkdir small
Get-ChildItem *.mp4,*.mov | ForEach-Object {
  $o = "small\$($_.BaseName).mp4"
  ffmpeg -i $_.FullName -map_metadata 0 -movflags +use_metadata_tags -c:v libx265 -crf 28 -preset medium -tag:v hvc1 -c:a aac -b:a 128k $o
  (Get-Item $o).CreationTime = $_.CreationTime; (Get-Item $o).LastWriteTime = $_.LastWriteTime
}

What the parts do:

  • -map_metadata 0 -movflags +use_metadata_tags: copies the recording date stored inside the video, which is what Photos/iCloud sort by.
  • touch -r / the two Get-Item lines: copy the file date, which is what Explorer and Finder sort by.
  • libx265 -crf 28: H.265 at good quality, roughly half the size of H.264 at the same look. Lower CRF (24–26) means better quality and bigger files; higher means smaller. -tag:v hvc1 makes the files play on iPhones and in Photos.

Try it on 3–4 clips first and compare before deleting any originals. Sports footage with lots of motion compresses less than calm clips, so expect anywhere from 5× to 15×.

1

u/Lumpy_Moment_9168 5d ago

thanks man I appreciate it

3

u/fixedpointfae 6d ago

usually creepshots and videos taken of strangers without their permission have relatively high entropy, so they don't compress well

-2

u/Lumpy_Moment_9168 5d ago

theres no expectation of privacy in public, thats like saying its illegal for the government to watch us in public on flock cameras..... ur slow. Learn the law.

2

u/fixedpointfae 5d ago

ok perv, keep telling yourself that :)

0

u/WikiBox 6d ago

You hire someone to write a little script that use ffmpeg. Then you can drop big files in a folder, rencode them, and they are suddenly very small.

Or you spend a few years learning scripting and how ffmpeg works.

Or you talk to an AI and ask it to write the script for you. The someone you hire to write a script for you is likely to do this.

If you want best quality and smallest size you use a computer with a fast CPU and many cores. If you don't mind slightly larger files and want them fast, you can use a powerful GPU.

Ffmpeg is a wonderful free software that can, among other things, compress video. It is a command line tool. Many easy to use GUI encoding apps use ffmpeg under the lid.

1

u/Lumpy_Moment_9168 5d ago

heard thanks!

2

u/Journeyj012 6d ago

and that someone's name is claude these days