I'm quite new to the world of FFmpeg and video editing tools, but I essentially need to change the hash of a large set of videos that are organized in folders and subfolders and the easiest way I've come into is remuxing and/or re-encoding the video. Currently, I am using the program HandBrake to bulk re-encode videos in each folder from a .mp4
to a .mkv
and that has done the trick. However, it is practically infeasible to do this for every single subfolder with hundreds of video files in each folder.
I have used FFmpeg briefly before and I'm wondering how I can best automate FFmpeg to search through each folder and its subfolders, find each .mp4
video, re-encode it to a .mkv
, and then save it under the same name and path as the original video.
I've been reading through FFmpeg documentation to determine how this can be done, but I'm wondering if anyone here is experienced enough in FFmpeg to lend me a helping hand. Thank you very much
cmd.exe
andpowershell
. In Mac/Linux, it would be something likefind . -name "*.mp4" | while read f; do ffmpeg -i "$f" .... "${f%%mp4}mkv"; done
. So you have to find the equivalent syntax for one of the Windows shells.