Permalink
Browse files

Revolver now gets proxies and fullres resolutions

You can now choose proxies and full-res video resolutions in Velvet Revolver
  • Loading branch information...
szaszak committed Oct 21, 2018
1 parent cba6f05 commit b58ed4d6ab892e0d35b6d580321a1bc164263a44
Showing with 42 additions and 14 deletions.
  1. +42 −14 Blender_2.79/velvet_revolver.py
@@ -22,7 +22,7 @@
"name": "velvet_revolver ::",
"description": "Mass-create proxies and/or transcode to equalize FPSs",
"author": "szaszak - http://blendervelvets.org",
"version": (1, 0, 20171025),
"version": (1, 0, 20181019),
"blender": (2, 79, 0),
"warning": "Bang! Bang! That awful sound.",
"category": ":",
@@ -247,13 +247,15 @@ def execute(self, context):
class VideoSource(object):
"""Uses video source to run FFMPEG and create proxies or full-res copies"""
def __init__(self, ffCommand, filepath, v_source, v_res, v_format,
def __init__(self, ffCommand, filepath, v_source, v_res, v_res_w, v_res_h, v_format,
fps, deinter, ar, ac):
self.ffCommand = ffCommand
self.input = v_source
self.filepath = filepath
self.fps = fps
self.arate = str(ar)
self.v_size = "%sx%s" % (v_res_w, v_res_h)
if deinter:
self.deinter = "-vf yadif"
@@ -266,17 +268,17 @@ def __init__(self, ffCommand, filepath, v_source, v_res, v_format,
self.achannels = ""
if v_res == "proxy":
# Proxy files generated by Velvet Revolver end with "_proxy.mov"
# Proxy files generated by Velvet Revolver end with "_proxy.mov"
self.v_output = self.input[:-4] + "_proxy.mov"
if v_format == "is_prores":
self.format = "-probesize 5000000 -s 640x368 -c:v prores \
self.format = "-probesize 5000000 -c:v prores \
-profile:v 0 -qscale:v 13 -vendor ap10 \
-pix_fmt yuv422p10le -acodec pcm_s16be"
elif v_format == "is_mjpeg":
self.format = "-probesize 5000000 -s 640x368 -c:v mjpeg \
self.format = "-probesize 5000000 -c:v mjpeg \
-qscale:v 5 -acodec pcm_s16be"
else: # v_format == "is_h264":
self.format = "-probesize 5000000 -s 640x368 -c:v libx264 \
self.format = "-probesize 5000000 -c:v libx264 \
-pix_fmt yuv420p -c:a copy"
# -preset ultrafast was having problems
# dealing with ProRes422 from Final Cut
@@ -301,8 +303,8 @@ def __init__(self, ffCommand, filepath, v_source, v_res, v_format,
def runFF(self):
# Due to spaces, the command entries (ffCommand, input and output) have
# to be read as strings by the call command, thus the escapings below
callFFMPEG = "\"%s\" -i \"%s\" -y %s -r %s %s -ar %s %s \"%s\"" \
% (self.ffCommand, self.input, self.format, self.fps,
callFFMPEG = "\"%s\" -i \"%s\" -y %s -r %s -s %s %s -ar %s %s \"%s\"" \
% (self.ffCommand, self.input, self.format, self.fps, self.v_size,
self.deinter, self.arate, self.achannels, self.v_output)
print(callFFMPEG)
@@ -327,15 +329,35 @@ class VelvetRevolver(bpy.types.Operator, ExportHelper):
('is_h264', 'h264 (experimental)', '')
)
proxies = BoolProperty(
name="Create proxies",
description="Create proxies with same FPS as current scene",
default=False,
)
prop_proxy_w = IntProperty(
name="Proxy size (width)",
description="Proxy videos will have this width",
default=640
)
prop_proxy_h = IntProperty(
name="Proxy size (height)",
description="Proxy videos will have this height",
default=368
)
copies = BoolProperty(
name="Full-res copies",
name="Create full-res copies",
description="Create full-res copies with same FPS as current scene (slow)",
default=False,
)
proxies = BoolProperty(
name="360p proxies",
description="Create 640x368 proxies with same FPS as current scene",
default=False,
prop_fullres_w = IntProperty(
name="Full-res size (width)",
description="Full-res videos will have this width",
default=1920
)
prop_fullres_h = IntProperty(
name="Full-res size (height)",
description="Full-res videos will have this height",
default=1080
)
v_format = EnumProperty(
name="Format",
@@ -366,9 +388,13 @@ def draw(self, context):
layout = self.layout
box = layout.box()
box.label('What to do in selected folder? Create...')
box.label('In selected folder (please select):')
box.prop(self, 'proxies')
box.prop(self, 'prop_proxy_w')
box.prop(self, 'prop_proxy_h')
box.prop(self, 'copies')
box.prop(self, 'prop_fullres_w')
box.prop(self, 'prop_fullres_h')
box.label('Proxies and/or copies should be in:')
box.prop(self, 'v_format')
box.label("Resulting videos will have %.2f FPS." % fps)
@@ -415,6 +441,7 @@ def execute(self, context):
for source in sources:
v_res = "proxy"
vs = VideoSource(ffCommand, videosFolderPath, source, v_res,
self.prop_proxy_w, self.prop_proxy_h,
self.v_format, fps, self.prop_deint,
self.prop_ar, self.prop_ac)
vs.runFF()
@@ -423,6 +450,7 @@ def execute(self, context):
for source in sources:
v_res = "fullres"
vs = VideoSource(ffCommand, videosFolderPath, source, v_res,
self.prop_fullres_w, self.prop_fullres_h,
self.v_format, fps, self.prop_deint,
self.prop_ar, self.prop_ac)
vs.runFF()

0 comments on commit b58ed4d

Please sign in to comment.