Compare commits

..

No commits in common. "e5b2043298d5ac8a99cfc752650e9bbb22c30bdb" and "bd241c3b6fbcd3d80bc4bb39fd018671f48dc76f" have entirely different histories.

View File

@ -148,7 +148,7 @@ def encode_libaom(inputfile: str, outputfile: str, crf: int, preset: Union[str,
def score_vmaf(outputfile: str, inputfile: str) -> dict[str, float]: def score_vmaf(outputfile: str, inputfile: str) -> dict[str, float]:
""" """
Calculate a file's VMAF score. Higher is better Calculate a file's VMAF score
Parameters: Parameters:
outputfile (str): Path to output file outputfile (str): Path to output file
@ -179,48 +179,6 @@ def score_vmaf(outputfile: str, inputfile: str) -> dict[str, float]:
return vmaf return vmaf
def score_psnr(outputfile: str, inputfile: str):
"""
Calculate a file's MSE (mean-square error) using PSNR. A lower value is better
Parameters:
outputfile (str): Path to output file
inputfile (str): Path to input file
Return:
TBD
"""
ff = ffmpy.FFmpeg(
inputs=OrderedDict([(outputfile, None), (inputfile, None)]),
outputs={"-": "-lavfi psnr=stats_file=psnr.log -f null"},
)
ff.run()
# Steps to get mse value
def score_ssim(outputfile: str, inputfile: str):
"""
Calculate a file's SSIM rating. TBD
Parameters:
outputfile (str): Path to output file
inputfile (str): Path to input file
Return:
TBD
"""
ff = ffmpy.FFmpeg(
inputs=OrderedDict([(outputfile, None), (inputfile, None)]),
outputs={"-": "-lavfi ssim=stats_file=ssim.log -f null"},
)
ff.run()
# Steps to get ssim value
if __name__ == "__main__": if __name__ == "__main__":
if not os.path.isdir("encoded"): if not os.path.isdir("encoded"):
os.mkdir("encoded") os.mkdir("encoded")