I recently used a small video camera for an overseas journey and realised on return that the video files generated are formatted in such a way that prevents them from being read by most professional video editing/converting software. To get around this took a little research, so for those who are having similar issues I thought I’d post how I fixed the files. These instructions are for Windows, if anyone converts for use on OSX please post in the comments.
- First, download ffmpeg, look for the link with “Static” in the title under the correct OS type heading (32-bit or 64-bit).
- Open this compressed file (might need to install 7zip if you can’t immediately open the archive).
- Extract the bin/ffmpeg.exe file from the archive and copy it into the folder with your video files.
- Create a new text file in the same folder and add this text into it:
for %%a in ("*.*") do ffmpeg -i "%%a" -c:v libx264 -preset slow -crf 20 -c:a libvo_aacenc -b:a 128k "newfiles\%%~na.mp4"
- Rename this file “Convert.bat”.
- Double-click this file
It will create new video files (in H264 format), after which you can delete the original AVI files.
Now you should be able to move these two files into any folder with the broken video files, run the “Convert.bat” file and it fix your videos.
If, like me, you had your camera mounted upside-down for practical purpose, then use this script instead, which will also rotate the video 180 degrees.
for %%a in ("*.*") do ffmpeg -i "%%a" -c:v libx264 -vf "vflip,hflip" -preset slow -crf 20 -c:a libvo_aacenc -b:a 128k "newfiles\%%~na.mp4"