Activate desinterlace

This commit is contained in:
Yorick Barbanneau 2015-12-09 00:02:47 +01:00
parent 02cda94439
commit f4610fc436

View file

@ -11,7 +11,6 @@ import re
import os
import subprocess
import logging
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
@ -20,11 +19,10 @@ def usage():
params = {
"desinterlace": False,
"file_output": "video",
"file_output": "",
"file_input": "",
"vbitrate": "600k",
"abitrate": "96k",
"video_quality": "good",
"h264_vcommand": [
"-trellis", "0",
"-me_method", "umh",
@ -35,9 +33,14 @@ params = {
"-g", "250"
],
"h264_acommand": ["-strict", "experimental"],
"webm_vcommand": "-rc_lookahead 16 -keyint_min 0 -g 250 -skip_threshold \
0 -level 116",
"webm_acommand": "-strict -2",
"webm_vcommand": [
"-rc_lookahead", "16",
"-keyint_min", "0"
"-g", "250",
"-skip_threshold", "0",
"-level", "116"
],
"webm_acommand": ["-strict", "experimental"],
"verbose": True,
"pattern": "",
"twopass": False,
@ -49,7 +52,7 @@ VERSION = "0.1dev"
def execute(command, shell=False):
"""
Execute a system command and return its results.
Thanxx Strycote from Lutyris.net
Thanxx Strycote from Lutris.net
"""
try:
stdout, stderr = subprocess.Popen(command,
@ -117,7 +120,9 @@ def processArg(sysarg):
if opt in ("-o", "--output"):
params["file_output"] = arg
if opt in ("-d", "--desinterlace"):
params["desinterlace"] = True
logging.info("Desinterlace activated")
params["h264_vcommand"] += ["-vf", "yadif"]
params["webm_vcommand"] += ["-vf", "yadif"]
if opt in ("-i", "--input"):
params["file_input"] = arg
if opt in ("-p", "--pattern"):
@ -172,6 +177,7 @@ def encode_h264(src, dest):
dest+".mp4",
"-loglevel", "quiet"
]
logging.debug(encode)
subprocess.run(encode)
@ -180,7 +186,6 @@ if __name__ == "__main__":
if not exec_ffmpeg:
print('ffmpeg not found, exiting')
sys.exit(2)
print('export_video v%s with FFMPEG %s', VERSION, exec_ffmpeg)
processArg(sys.argv[1:])
if not params["file_input"]:
print("you must specify a file / directory input")