Please right click on the following link and "save as": https://github.com/mikeycal/the-video-editors-render-script-for-blender/raw/master/video_editors_render_script.py
Perform non-3D renders in HALF the time on multi-core CPUs.
Supports all Blender audio, video and image codecs.
Use 8kb/s - 640kb/s compressed audio instead of Blender's 32kb/s - 384kb/s limit.
Create animated GIFs with your Blender video project
Fully cross platform
Uses Blender's render property settings by default, or set script override settings.
Make videos that are streamable and will process faster on services like YouTube.
Use the most current version of FFmpeg, or even use a custom build with libfdk_aac
Double click rendering. The script creates a reusable, clickable, executable.
It's a well commented script, so you can easily review it and edit it without compiling.
Render on headless video rendering server by installing Linux, FFmpeg and Blender on a spare computer.
It's GPL licensed, so you can adapt it, improve it, and redistribute it.
Developed and maintained by Blender Video Editing Series instructor, "Mikeycal." ;)
At times you will need to edit this Python Script. So I would advise that you download a free Source Code editor for your platform of choice. Here are my recommendations (I use Gedit):
This script assumes that blender is saved to the following default path: "C:\Program Files\Blender Foundation\Blender\blender.exe" this is the default path when you install blender using the .msi Installer. You can get that Installer at the following link: https://www.blender.org/download/ If you choose to install Blender in a different place, please set a custom path in this script.
If necessary, use your source code editor to set the path to FFmpeg and Blender. You need to go to line 97 and 98 in video_editors_render_script.py
By default Line 97 and 98 are set to the following paths:
Windows: "C:\Program Files\Blender Foundation\Blender\blender.exe" C:\ffmpeg\bin\ffmpeg.exe
Put the script in any folder and "SAVE AS..." your custom blend file as "1.blend" to the same folder.
Open cmd.exe and go to the directory with your files.
Run this script from the same folder using cmd.exe: (use the quotation marks for paths with spaces)
"C:\Program Files\Blender Foundation\Blender\blender.exe" -b 1.blend -P video_editors_render_script.py
The script will create a clickable executable, in the same directory, that you can use for all future renders. (Windows_Click_to_Render.bat)
While the script is running, You can see logical CPU core usage and RAM usage in your Windows 'Performance Monitor' (Press [Windows Key] + R) Type: perfmon /res
After script finishes, you will see a Render time in the Command Prompt. See how much it improved your render time by looking at the final script time.
Improve the look of CMD.exe by right clicking on the "Title Bar" of CMD.exe and changing the "Defaults" to the recommended settings:
1) Go to https://www.blender.org/download/ and download the OSX zip file of Blender. 2) Create a folder in the OSX "Applications" folder called "Blender" (with a capital B) 3) Place all Blender files in the "/Application/Blender" folder. 4) This script is already setup to look for Blender in this location.
If necessary, use your source code editor to set the path to FFmpeg and Blender. You need to go to line 103 and 104 in video_editors_render_script.py
By default Line 103 and 104 are set to the following paths:
OSX: /Applications/Blender/blender.app/Contents/MacOS/blender
/Applications/ffmpeg
Put the script in any folder and "SAVE AS..." your custom blend file as "1.blend" to the same folder.
Open the "TERMINAL" program, from Spotlight, and change to the directory with the files.
Run this Script from the same folder using Terminal:
/Applications/Blender/blender.app/Contents/MacOS/blender -b 1.blend -P video_editors_render_script.py
The script will create a clickable executable, in the same directory, that you can use for all future renders. (OSX_Click_to_Render.command)
Check CPU and RAM usage by typing "top" into the terminal
apt-get install blender ffmpeg
pacman -S blender ffmpeg
dnf install blender ffmpeg
or
yum install blender ffmpeg
Alternatively:
tar -xvf ffmpeg-release-64bit-static.tar.xz
Download Blender from https://www.blender.org/download/, just make sure that you add the correct paths to line 109 and 110 of the script.
Unzip with tar -jxvf blender-2.78c-linux-glibc219-x86_64.tar.bz2
If necessary, use your source code editor to set the path to FFmpeg and Blender. You need to go to line 109 and 110 in video_editors_render_script.py
By default Line 109 and 110 are set to the following paths:
GNU/Linux: (Install from repository, and call programs directly): blender ffmpeg
Linux and other *nix platforms can set a specific terminal program to run the script from. Some popular options include the following:
"gnome-terminal -e"
, "konsole -e"
, "xterm -e"
, "guake -e"
, "terminator -e"
Put the Script in any folder and "SAVE AS..." your custom blend file as "1.blend" to the same folder.
Open Terminal window and go to the directory where your files are located.
Run this script from the same folder using the Terminal:
blender -b 1.blend -P video_editors_render_script.py
The script will create a clickable executable, in the same directory, that you can use for all future renders. (Linux_Click_to_Render.sh)
It's important to note that often linux environments are setup to prohibit executing .sh scripts by clicking. But you can usually turn that feature on in the preferences of your favorite linux file manager. On my linux setup, I set clicking an .sh file to PROMPT me. The prompt dialog asks if I would like to open in an editor or run the script. This is the option I recommend using.
Check CPU and RAM usage by typing "top" into the terminal
Where to Set Program Paths:
Windows: GOTO line 98, 99
OSX: GOTO line 104, 105
Linux: GOTO line 110, 111
Other: GOTO line 117, 118
Where should I place this Script?
How does the script use my .blend File?
How do I render with this script?
The first time that you render with this script, you will need to run the following Terminal Commands:
cd c:\Users\mikeycal\Video
(Change to the directory with this script and 1.blend file.)
"c:\PATH\ TO\ blender" -b 1.blend -P video_editors_render_script.py
(Use Quotes with Spaces)
This script will automatically generate a "clickable" render file that you can use for all future renders. After you have run the script 1 time, you can move the "Click_to_Render" file and "video_editors_render_script.py" file to any folder you like, it will render any project named 1.blend from any folder you place those 2 files in.
Windows: Windows_Click_to_Render.bat
OSX: OSX_Click_to_Render.command
Linux: Linux_Click_to_Render.sh
Other: Click_to_Render.sh
How do I change the number of CPU cores that the Script can use?
What are the RAM requirements? (1.6GB - 3GB per Core)
Can I deactivate multi-core rendering and use this script for rendering 3D projects?
How do I alter the MUX settings to add custom FFmpeg arguments to the final video?
How do I use FFmpeg's range of bitrate settings instead of Blender's?
How do I render an Animated GIF?
Settings that you can alter:
gif_framerate: if set to "" (empty), it will use the Blender Frame Rate ("15" is the default)
stats_mode: ["full" or "diff"] ("full" is default)
custom_gif_scale_x_value: If you set this to "" (empty), it will default to blender's render settings resolution. Y value will be proportionate.
dither_options: ("none" is default)
the_scaler: ("lanczos" is default)
I rendered the same video using different dither and _statmode settings. Here are the file size results to compare. (See image quality difference here. )
scene.render.ffmpeg.audio_codec = 'NONE'\n
must be included. It turns off the audio for your project. Audio is rendered separately with this script, so it must be turned off when the video is rendering. Leaving audio on will simply slow down the render.Some common override settings you can use include the following:
(Python requires 4 spaces before scene.render.*)
" scene.render.resolution_x = 800\n"
" scene.render.resolution_y = 600\n"
" scene.render.resolution_percentage = 100\n"
" scene.render.image_settings.file_format = XVID\n"
" scene.render.ffmpeg.format = MPEG4\n"
" scene.render.ffmpeg.codec = H264\n"
" scene.render.ffmpeg.video_bitrate = 8000\n"
" scene.render.ffmpeg.gopsize = 18\n"
" scene.render.ffmpeg.use_lossless_output = False\n"
" scene.render.ffmpeg.minrate = 0\n"
" scene.render.ffmpeg.maxrate = 9000\n"
" scene.render.ffmpeg.muxrate = 10080000\n"
" scene.render.ffmpeg.packetsize = 2048\n"
" scene.render.ffmpeg.buffersize = 1792\n"
" scene.render.fps = 24\n"
" scene.render.fps_base = 1.001\n"
Note blender frame rate is determined by the following formula:
round(scene.render.fps / scene.render.fps_base,2) [23.98]
In February of 2017, I came across a post on stackexchage.com (http://blender.stackexchange.com/questions/7738/how-to-make-vse-render-faster) A user named "Isti115" pointed out that a person could speed up video rendering by using the Blender background instance feature in conjunction with FFmpeg's concatenation feature.
I soon decided that I would create a cross platform python script that would use the built-in version of python, included with Blender, to automate the multicore render process. I wanted a script that would work everywhere, and was easy to read, edit, and adapt. By March 27, 2017, after weeks of cross platform coding and testing, I had finished the first Release Candidate of the Python Script.
In the process of writing this script, I made some discoveries about Blender. I learned that, not only could you speed up the rendering of video processing, but you could equally speed up image processing done with the compositor. The only thing that Blender couldn't do is speed up video renders that include keyframed 3D objects. Basically, keyframes applied to 3d objects lose sync with this method of rendering. But, image processing, like removing a Green Screen from footage, works well.
As soon as my initial programming goals were achieved, I decided to see if there were other FFmpeg features that I could automate. I came across ubitux's website (http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html) where he described how to properly create animated gifs with FFmpeg. So that feature got added to this script as an option.
This Script represents my passion to continue to help Blender to become a more usable video editing program. In addition to my Blender Video Editing Series, I invest a lot of time into making Blender easier to use because I like that it is Open Source, Cross Platform and has an amazing community dedicated to developing new features that enable us all to be more creative.
If anyone can figure out how to add an option that would show render progress in the terminal window, that works with Windows Prompt and Bash shell, that feature would be greatly appreciated. It would be nice if it could be turned on or off since such a feature may cause a slight render slow down. It's important to note that this Python Script is my first time using Python. So I'm still learning and any helpful tips on using Python would also be appreciated. :)
Isti115 has developed his own program that also utilizes the multi-core process that is written in C# and even has a GUI. You can check it out here: https://github.com/Isti115/BlenderRenderController. I actually started developing my script at nearly the same time he was working on his program. As of version 1 of this script, our projects share no code. Not because I wouldn't want to, but because I had already developed the majority of my code by the time I learned he had made his code available. I feel that this is actually a good thing because it means we both attacked a similar problem in our own unique ways. This should make newer versions of our projects even better. Anyway, send your love and support Isti115's way. We need to support all developers that are making Blender better. :)
I consider this script a work in progress. I hope to add features as needed. It's important to note that this Python Script is my first time using Python. So I'm still learning and any helpful tips on using Python would also be appreciated. If you have any suggestions on features, find bugs, or if you have added some feature that you think I should include, send me an email at mikeycaldotcom@yahoo.com . If you want to help me out, you can send me a Paypal donation at my Yahoo address or help me make the code better. In addition, visit my website at http://Mikeycal.com and see what I'm up to lately. I am dedicated to providing cross platform resources and instructional videos free of charge. Checkout my Blender Video Editing Series at the following link: https://www.youtube.com/playlist?list=PLjyuVPBuorqIhlqZtoIvnAVQ3x18sNev4