mirror of
https://github.com/stevenrobertson/cuburn.git
synced 2025-03-13 06:51:28 -04:00
Retrieve out suffix without creating a renderer
This commit is contained in:
parent
636efcd059
commit
9bcfc36b7a
@ -64,14 +64,6 @@ class Output(object):
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
@property
|
||||
def suffix(self):
|
||||
"""
|
||||
Return the file suffix that will be used. If more than one suffix will
|
||||
be used, the value returned is the one considered to be "primary".
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
class PILOutput(Output, ClsMod):
|
||||
lib = pixfmtlib
|
||||
@ -112,13 +104,6 @@ class PILOutput(Output, ClsMod):
|
||||
return {'.jpg': out}, {}
|
||||
return {'.'+self.type: self._convert_buf(buf)}, []
|
||||
|
||||
@property
|
||||
def suffix(self):
|
||||
if self.type == 'jpeg':
|
||||
if self.alpha: return '_color.jpg'
|
||||
return '.jpg'
|
||||
return '.'+self.type
|
||||
|
||||
class TiffOutput(Output, ClsMod):
|
||||
lib = pixfmtlib
|
||||
|
||||
@ -149,10 +134,6 @@ class TiffOutput(Output, ClsMod):
|
||||
out.seek(0)
|
||||
return {'.tiff': out}, []
|
||||
|
||||
@property
|
||||
def suffix(self):
|
||||
return '.tiff'
|
||||
|
||||
|
||||
class ProResOutput(Output, ClsMod):
|
||||
lib = pixfmtlib
|
||||
@ -203,10 +184,6 @@ class ProResOutput(Output, ClsMod):
|
||||
self._subp.stdin.write(buffer(host_frame))
|
||||
return {}, []
|
||||
|
||||
@property
|
||||
def suffix(self):
|
||||
return '.mov'
|
||||
|
||||
|
||||
class X264Output(Output, ClsMod):
|
||||
lib = pixfmtlib
|
||||
@ -314,11 +291,6 @@ class X264Output(Output, ClsMod):
|
||||
self._write(buffer(self.zeros), self.asubp)
|
||||
return out
|
||||
|
||||
@property
|
||||
def suffix(self):
|
||||
if self.alpha: return '_color.h264'
|
||||
return '.h264'
|
||||
|
||||
class VPxOutput(Output, ClsMod):
|
||||
lib = pixfmtlib
|
||||
|
||||
@ -435,10 +407,13 @@ class VPxOutput(Output, ClsMod):
|
||||
self._write(buf, self.subp)
|
||||
return out
|
||||
|
||||
@property
|
||||
def suffix(self):
|
||||
return '.webm'
|
||||
|
||||
def get_suffix_for_profile(gprof):
|
||||
opts = dict(gprof.output._val)
|
||||
ext = dict(jpeg='.jpg', png='.png', tiff='.tiff', x264='.h264',
|
||||
prores='.mov', vp8='.webm', vp9='.webm')[opts.get('type', 'jpeg')]
|
||||
if opts.get('alpha'):
|
||||
ext = '_color' + ext
|
||||
return ext
|
||||
|
||||
def get_output_for_profile(gprof):
|
||||
opts = dict(gprof.output._val)
|
||||
|
Loading…
Reference in New Issue
Block a user