add scaling option to clips.json
This commit is contained in:
@@ -6,6 +6,10 @@ import ffmpeg
|
|||||||
import subprocess
|
import subprocess
|
||||||
import glob
|
import glob
|
||||||
import sys
|
import sys
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
argParser = argparse.ArgumentParser()
|
||||||
|
|
||||||
|
|
||||||
jsonFileName = sys.argv[1]
|
jsonFileName = sys.argv[1]
|
||||||
#jsonFileName = "***REMOVED***Kniebeuge.json"
|
#jsonFileName = "***REMOVED***Kniebeuge.json"
|
||||||
@@ -37,7 +41,14 @@ for clip in clipDict:
|
|||||||
w=clip['crop']['w'],
|
w=clip['crop']['w'],
|
||||||
h=clip['crop']['h']
|
h=clip['crop']['h']
|
||||||
)
|
)
|
||||||
stream = ffmpeg.filter(stream, "scale", height="480", width="-2" )
|
|
||||||
|
h = 480
|
||||||
|
w = -2
|
||||||
|
if 'scale' in clip:
|
||||||
|
h = clip['scale']['h'] if 'h' in clip['scale'] else 480
|
||||||
|
w = clip['scale']['w'] if 'w' in clip['scale'] else -2
|
||||||
|
stream = ffmpeg.filter(stream, "scale", height=h, width=w )
|
||||||
|
|
||||||
stream = ffmpeg.output(stream,
|
stream = ffmpeg.output(stream,
|
||||||
clip['target'],
|
clip['target'],
|
||||||
vcodec="vp9",
|
vcodec="vp9",
|
||||||
@@ -66,7 +77,14 @@ for clip in clipDict:
|
|||||||
w=clip['crop']['w'],
|
w=clip['crop']['w'],
|
||||||
h=clip['crop']['h']
|
h=clip['crop']['h']
|
||||||
)
|
)
|
||||||
stream = ffmpeg.filter(stream, "scale", height="480", width="-2" )
|
|
||||||
|
h = 480
|
||||||
|
w = -2
|
||||||
|
if 'scale' in clip:
|
||||||
|
h = clip['scale']['h'] if 'h' in clip['scale'] else 480
|
||||||
|
w = clip['scale']['w'] if 'w' in clip['scale'] else -2
|
||||||
|
stream = ffmpeg.filter(stream, "scale", height=h, width=w )
|
||||||
|
|
||||||
stream = ffmpeg.output(stream,
|
stream = ffmpeg.output(stream,
|
||||||
clip['target'],
|
clip['target'],
|
||||||
vcodec="vp9",
|
vcodec="vp9",
|
||||||
|
|||||||
Reference in New Issue
Block a user