this post was submitted on 21 Jul 2025
26 points (100.0% liked)
Free and Open Source Software
19856 readers
21 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
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
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.