NOTE: For the most recent version of this Script, please go to this GitHub Gist
This Python Script searches for all video files matching a specific pattern in the same directory (sub-directories not included) and then generates a Windows Batch Script (UseOnce.cmd
) you can then execute to convert those matching video files into Non-Variable 30fps MP4s.
At Cineversity.com we often find ourselves converting
large numbers of poorly formed .mov
files to 30 FPS non-variable .mp4
files
so that we can edit C4DLive Rewinds. FFmpeg is the best solution to this problem that we've discovered. Unfortunately, it's a pain to manually convert a bunch of files, so I've developed this set of scripts.
-
Ensure your computer matches the Requirements.
- Requirements
- Windows
- FFmpeg must be installed and accessible as
ffmpeg
from the Windows Command Line - Python 2.6 is Installed (I'm using
print "Hello World"
rather thanprint("Hell World")
) - If your system doesn't meet these requirements, this script won't work.
- Requirements
-
Copy
buildConverterBatch.py
into the same directory as your video files. -
Edit
buildConverterBatch.py
in a text editor to match the naming of your files. Specifically:source_prefix = "18_NAB_SCREEN" source_suffix = ".mov" destination_suffix = "_30fps.mp4"
-
Save your edited file.
-
Tap the Windows key on your keyboard and type
command
then hitEnter
. -
Drag the
buildConverterBatch.py
file into the command prompt. HitEnter
. You should see something like:================================================================================ Generate Ffmpeg Converter Script Creates a Windows Batch file for converting files to constant 30fps with Ffmpeg Note: Open this file in a Text Editor and change the values under `# USER INPUT` if you would like something other than default behavior. ================================================================================ Searching E:\NAB_18_BU\Captures\Sabour_Day3_20180411 for 18_NAB_SCREEN*.mov MATCH: 18_NAB_Screen-4_11_2018-1_34_PM-1523478892_1.mov MATCH: 18_NAB_Screen-4_11_2018-1_34_PM-1523478892_2.mov MATCH: 18_NAB_Screen-4_11_2018-1_34_PM-1523478892_3.mov MATCH: 18_NAB_Screen-4_11_2018-1_34_PM-1523478892_4.mov Generating UseOnce.cmd... SUCCESS: Double click on UseOnce.cmd to convert matched files.
-
The
buildConverterBatch.py
script will create a file namedUseOnce.cmd
that will looks something like:REM UseOnce.cmdREM Batch converts files in this directory to 30fps. Ffmpeg -i E:\NAB_18_BU\Captures\Sabour_Day3_20180411\18_NAB_Screen-4_11_2018-1_34_PM-1523478892_1.mov -r 30 E:\NAB_18_BU\Captures\Sabour_Day3_20180411\18_NAB_Screen-4_11_2018-1_34_PM-1523478892_1_30fps.mp4 Ffmpeg -i E:\NAB_18_BU\Captures\Sabour_Day3_20180411\18_NAB_Screen-4_11_2018-1_34_PM-1523478892_2.mov -r 30 E:\NAB_18_BU\Captures\Sabour_Day3_20180411\18_NAB_Screen-4_11_2018-1_34_PM-1523478892_2_30fps.mp4 Ffmpeg -i E:\NAB_18_BU\Captures\Sabour_Day3_20180411\18_NAB_Screen-4_11_2018-1_34_PM-1523478892_3.mov -r 30 E:\NAB_18_BU\Captures\Sabour_Day3_20180411\18_NAB_Screen-4_11_2018-1_34_PM-1523478892_3_30fps.mp4 Ffmpeg -i E:\NAB_18_BU\Captures\Sabour_Day3_20180411\18_NAB_Screen-4_11_2018-1_34_PM-1523478892_4.mov -r 30 E:\NAB_18_BU\Captures\Sabour_Day3_20180411\18_NAB_Screen-4_11_2018-1_34_PM-1523478892_4_30fps.mp4
-
If everything looks correct, run
UseOnce.cmd
and make yourself a pot of coffee, it's going to be a long wait.
This script was developed by Donovan Keith for Cineversity.com and is Copyright (C) 2018 Maxon Computer Inc.
MIT License
Copyright (c) 2018 Maxon Computer Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.