Manual states that WebM vp8 is available, but there is no GUI that reveals this option in Blender

Hi!

Quick Background info:

WebM is a very important open source video codec for providing lossy real-time transparent video.
As it barrels ahead in development, valuable use-case is lost unnecessarily to users of software leveraging earlier versions of the codec. The feature seems available, just not hooked up to UI.

Who is benefiting from older WebM versions?

It’s common place for big companies to upgrade very slowly. They are often out of date because of how difficult it is to upgrade game engines, how much customization needs to be done to the source code, and how much we can afford in R&D to overhaul the workflow to suite the next upgrades… particularly during production.

For example unity 2018.1.2 may not be the latest version of Unity, but it’s proven and trusted so many big companies are like that. Specifically with that version, only VP8 is working, not VP9

In order to change the old narrative of Blender not being suitable to big companies, let’s take every road of least resistance to make Blender corporate friendly so that the added reach will improve it over time.

I’ve brought this up here:

and here:

My impression based on the manual and discussions on the forum and right-click, that not many people know about this useful codec. To those who do, it seems that the consensus is that the feature is there in Blender but simply needs to be revealed by adding in some GUI. I’d certainly do it if I knew how. This is why I’m posing it here where more people are aware of the benefits and hopefully whether this is just a few lines of code to fix.

Thanks for your consideration.

-S

I’m pretty clueless with python, but I managed to scrap something together. It doesn’t run.

I’m using windows 10 pro, and Blender 2.90.0 Alpha. Date 2020-06-07 22:16, Hash: 281319653e6b

Does anyone know why this code is resulting in an error?

import os

def run_ffmpeg():
filepath = “E://Directory//Directory//Directory//Directory//Directory//Directory//output//”
os.system("ffmpeg -i "+ filepath + “IMAGESEQUENCE_%04d.png” -c:v libvpx -metadata:s:v:0 alpha_mode=“1” + filepath + “OUTPUTMOVIE.webm”)
print(filepath + “IMAGESEQUENCE_%04d.png”)

run_ffmpeg()

Note; I’ve fudged the directory and the names of the image sequences etc for NDA.

Literally all I’m trying to do is access a hidden feature. Apparently ffmpeg defaults to libvpx9 if you don’t tell it to use libvpx, which is used to access VP8 webm. However, I get the error when running my script instead of a script without having mentioned libvpx;

location: :-1
Error: File “E:\Directory\Directory\Directory\Directory\Directory\Directory\SCENE.blend\Python_WEBM-VP8-After-Render”, line 7
os.system("ffmpeg -i "+ filepath + “IMAGESEQUENCE_%04d.png” -c:v libvpx -metadata:s:v:0 alpha_mode=“1” + filepath + “OUTPUTMOVIE.webm”)
^
SyntaxError: invalid syntax

location: :-1

Error: Python script failed, check the message in the system console

If I can just get this script working, I might be able to then figure out how to hook it up to the GUI.

-S

Hi,
I think it’s a problem with quotes. With the quotes around alpha_mode=“1”.

os.system("ffmpeg -i “+ filepath + " IMAGESEQUENCE_%04d.png -c:v libvpx -metadata:s:v:0 alpha_mode=1 " + filepath + " OUTPUTMOVIE.webm”)

1 Like

I don’t know if that was causing any issues with the alpha, I think the quotes however were an issue there:

import bpy
import os

def run_ffmpeg():
filepath = “E://Directory//Directory//Directory//Directory//Directory//Directory//output//”
os.system("ffmpeg -i -f 60 "+ filepath + “IMAGESEQUENCE_%04d.png” + " -c:v libvpx -metadata:s:v:0 alpha_mode=“1” -y -auto-alt-ref 0 " + filepath + “OUTPUTMOVIE.webm”)
print(filepath + “IMAGESEQUENCE_%04d.png”)
bpy.app.handlers.render_complete.append(run_ffmpeg)

#run_ffmpeg()

If I make a well designed GUI option to switch to vp8, and I submit some decent code, might that be accepted?

I hope I can get to that point, at the moment, I’m struggling just to control the bitrate

-S

Now I have everything I need under control in this version, and it’s working as expected:

import bpy
import os

def run_ffmpeg():
filepath = “E://Directory//Directory//Directory//Directory//Directory//Directory//output//”
os.system("ffmpeg -i "+ filepath + “IMAGESEQUENCE_%04d.png” + " -c:v libvpx -b: 1500k -r 60 -metadata:s:v:0 alpha_mode=“1” -y -auto-alt-ref 0 " + filepath + “OUTPUTMOVIE.webm”)
print(filepath + “IMAGESEQUENCE_%04d.png”)

#bpy.app.handlers.render_complete.append(run_ffmpeg)

run_ffmpeg()

Next, I need to integrate the user output directories and variable names for output moves and sequences.

If I can get my head around it, I’ll also try to hook up some GUI some time in the future.