I've a bunch of video files, mostly H264. To save storage, I wrote a batch script, that converts all of them to H265 using ffmpeg. Problem: Some files cause ffmpeg to use ALL my memory (24 GB). Then it crashes (cause it try to allocate even more RAM), which stops the converting process.
I think that these files are corrupt in some kind. Because with other files, it works well with low memory consumption. Now I want to reject those broken ones, so that unattended converting is possible.
How is it possible to detect such corruption? Can ffmpeg do this, or is a third party tool required?
My ffmpeg call
set crf=20
set codec=265 ffmpeg -hide_banner -i "!fullSourcePath!" -c:v libx%codec% -crf %crf% "%targetPath%\!targetFileName!"