this post was submitted on 21 Jul 2025
24 points (100.0% liked)

Free and Open Source Software

19761 readers
3 users here now

If it's free and open source and it's also software, it can be discussed here. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 2 years ago
MODERATORS
 

Context: I'm currently using an older Samsung phone to convert h264 dashcam videos to HEVC/h265 to save space. These are many, 10 minute long videos, and the process is incredibly labour intensive, since I have to do each one manually.

The conversion itself is really fast (maybe 2-3 minutes), and the results are excellent (usually half the size with the same quality).

Question: Is there software for Linux that can convert at similar speeds, preferably batched? Handbreak has been incredibly slow.

Caveat: I'm using a Framework 13 (11th gen Intel) laptop with an Intel integrated graphics card, so I can't really leverage that in the same way a dedicated GPU can be. But still, I can only imagine that my laptop should be able to outperform my super old phone! LOL

I'm not really looking to compress the videos (I've experimented, and the quality loss from an already "poor" source just doesn't cut it). HEVC/h265 conversion would be ideal.

Is there anything else I can try?

top 8 comments
sorted by: hot top controversial new old
[–] Novocirab@feddit.org 12 points 1 week ago* (last edited 1 week ago)

ffmpeg is usually the tool of choice.

An example for batch converting of all AVI videos in a folder:

for i in *.avi; do ffmpeg -i "$i" "${i%.*}.mp4"; done

Source & further reading here on StackOverflow. The comments to the answer provide examples of how to explicitly tweak the quality level. Inverting what this specific comment suggests, conversion from H264 to H265 could be done by something like this, assuming all your videos' names end on .mkv:

for f in *.mkv; do ffmpeg -i "$f" -map 0 -movflags faststart -c:v libx265 -c:a copy -c:s copy "${f/x264/x265}"; done

I wonder: if one wants to make things run in parallel, would that be as easy as adding " & " before the last semicolon here? I suspect this could work as long as there are only a few handful of files, but lead to troubles once there's more.

[–] i_am_not_a_robot@discuss.tchncs.de 11 points 1 week ago (1 children)

You're wrong about not being able to levelage your Intel graphics. Intel 11th gen has hardware HEVC (h265) encoding. Your Samsung phone probably also has HEVC hardware encoding faster than your CPU encoding. You want the ffmpeg hevc_vaapi codec, and it should go even faster if you use -hwaccel vaapi for decoding.

[–] Showroom7561@lemmy.ca 0 points 1 week ago

I know it can be leveraged, but it's not nearly as powerful as a dedicated GPU. I was converting in Windows using Intel Quick Sync, but never found it to be "fast", at least not when compared to my old Samsung phone.

Thanks for the tip, though. I will try to leverage it!

[–] hellfire103@lemmy.ca 7 points 1 week ago

FFmpeg is your friend. Here's a command that should work:

mkdir converted; for i in *.mp4; do ffmpeg -i $i converted/${i::-3}.hevc; done
[–] Lemmchen@feddit.org 4 points 1 week ago

It won't get much faster than properly used Handbrake.

[–] 4am@lemmy.zip 3 points 1 week ago (1 children)

Didn’t ffmpeg just post another huge speed gain?

[–] YodaDaCoda@aussie.zone 3 points 1 week ago

Only when using one specific obscure filter

[–] small44@piefed.social 3 points 1 week ago