Created
July 3, 2017 15:26
-
-
Save jkotra/272b6afebf24df0dbb71b6ef44646a18 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
from conf import * | |
##################################### | |
#Jagadeesh Kotra | |
#https://github.com/jagadeesh-kotra/x264zones | |
#Contact: [email protected] | |
##################################### | |
f=open('{0}'.format(file), "r") | |
b1=f.read() | |
b2=b1.replace("\n", "").replace("type", "").replace("intdefault", "").replace("0", "").replace("R", "").split() | |
while len(b2) != 0: | |
banding=b2 | |
z1=(banding[0]) | |
z2=(banding[1]) | |
z3="crf=0.0" | |
z4="b=0.0" | |
if bitrate > 0: | |
zones2='{1},{0},{2}'.format(z2, z1, z4) | |
f1=open("x.txt", "a+") | |
f1.write(zones2) | |
banding.pop(0) | |
banding.pop(0) | |
banding.pop(0) | |
else: | |
zones1='{1},{0},{2}'.format(z2, z1, z3) | |
f1=open("x.txt", "a+") | |
f1.write(zones1) | |
banding.pop(0) | |
banding.pop(0) | |
banding.pop(0) | |
final=open("x.txt", "r") | |
b3=final.read() | |
b4=b3.replace(".0", "/") | |
s = b4[:-1] | |
print ("--zones {0}".format(s)) | |
os.remove("x.txt") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment