added option to force fps

This commit is contained in:
Zen 2020-01-16 11:15:35 +02:00
parent e5bee97583
commit cea25186b1

View file

@ -95,13 +95,22 @@ class Av1an:
parser.add_argument('--audio_params', '-a', type=str, default=self.audio, help='FFmpeg audio settings') parser.add_argument('--audio_params', '-a', type=str, default=self.audio, help='FFmpeg audio settings')
parser.add_argument('--threshold', '-tr', type=int, default=self.threshold, help='PySceneDetect Threshold') parser.add_argument('--threshold', '-tr', type=int, default=self.threshold, help='PySceneDetect Threshold')
parser.add_argument('--logging', '-log', type=str, default=self.logging, help='Enable logging') parser.add_argument('--logging', '-log', type=str, default=self.logging, help='Enable logging')
parser.add_argument('--encode_pass', '-p', type=int, default=self.encode_pass, help='Specify 1 or 2 pass encoding') parser.add_argument('--encode_pass', '-p', type=int, default=self.encode_pass, help='Specify encoding passes')
parser.add_argument('--output_file', '-o', type=str, default='', help='Specify output file') parser.add_argument('--output_file', '-o', type=str, default='', help='Specify output file')
parser.add_argument('--force_fps', '-fps', type=int, default=0, help='Force fps of output file')
# Parse arguments
self.args = parser.parse_args() self.args = parser.parse_args()
self.encode_pass = self.args.encode_pass self.encode_pass = self.args.encode_pass
if self.args.force_fps == 0:
self.force_fps = ''
else:
self.force_fps = f' -r {self.args.force_fps}'
self.ffmpeg_pipe = f' {self.force_fps} -pix_fmt yuv420p -f yuv4mpegpipe - |'
# Setting logging depending on OS # Setting logging depending on OS
if self.logging != self.args.logging: if self.logging != self.args.logging:
if sys.platform == 'linux': if sys.platform == 'linux':