Windows Batch Files - Senscape/Dagon GitHub Wiki
Use drag & drop to convert a video into Theora using FFMPEG2THEORA.
With this batch file you can simply drop a video file onto the batch-file icon and conversion is automatic. The output will have the same name with the file extension .ogv in the same directory as the source file. Resolution and frame-rate are also preserved from the source file.
Key Notes:
-
Currently only tested on Win 7. Subtle differences in other versions may or may not cause problems.
-
FFMPEG2THEORA will convert almost anything, but conversion issues or limitations are beyond this simple tutorial.
-
The file currently defaults to a quality of 6 on a scale 0 to 10. The quality can be adjusted by editing one number in the batch-file and saving it. Do not double-click the batch-file as that will cause it to run. Instead, right-click and choose 'Edit' from the menu. The actual number to change is indicated as a note in the file, it's very simple.
-
Occasional errors seem to result from FFMPEG2THEORA when it finishes which lead to a red screen. Just hit the space-bar to exit. I have found that the output file is still created and plays OK.
-
Finally, this is not the most recommended way to create the final video for your game. It is fine for testing or casual conversion but to get the best quality all videos should be originally rendered out as single images in non-lossy formats such as .bmp, .png, or .tif. All post-render processing should be done on the single images and only when the final video is desired should they be combined. Converting video to video will ALWAYS degrade the picture quality to some degree, not unlike taking a laser-copy of a laser-copy of a laser-copy...
FFMPEG2THEORA can create movies from single images but conflicts exist between Windows and FFMPEG2THEORA that prevent a simple batch-file from working. It can be overcome with some tricky programming that is beyond me at the moment. I hope to work it out and post it later.
Getting started:
-
Right-click on Windows desktop and select New-> Text Document. Rename to whatever you like. Leave the extension as a .txt.
-
Select all the text in the Batch-file text below and copy it with control-C.
-
Double-click on the new text file and after it opens, paste into it with control-V.
-
Save the document, then rename the extension to ".bat".
-
Download ffmpeg2theora.exe and put it in the folder c:\Windows\System32. This ensures Windows can find it.
-
Drag your file onto the desktop batch file and a window will pop up with progress and file information. Yellow means busy, green means success, and red means an error. Hitting the space key will close the window. Control-C will abort the batch-file at any time (make sure the command window is selected first)
Batch-file text:
:: ------ Batch file to read a video file and convert to .ogv using ffmpeg2theora.exe
:: don't print out commands
echo off
prompt ">>>"
:: change window title-bar message
title "Converting Video....output in same folder as input"
:: yellow to indicate busy...
color E0
:: change -v in the next line to change quality. Range is 0 to 10 for worst to best output.
:: Note that higher quality will also force bigger file sizes.
ffmpeg2theora -v6 %1
if errorlevel 1 goto abort
:: green to indicate ok
color A0
echo "Success!"
pause
exit
:abort
color CF
echo " "
echo "Problem, see window output"
pause
exit