diff --git a/Video/test.png b/Video/test.png new file mode 100644 index 0000000..8a2c9b6 Binary files /dev/null and b/Video/test.png differ diff --git a/app.py b/app.py index e2df025..bf9493a 100644 --- a/app.py +++ b/app.py @@ -1,5 +1,22 @@ -s = "this is a test string containing random variables 1234567890 !@#$%^&*_+-=;:<>,." +import numpy as np +from matplotlib import pyplot as plt +from constants import videoformatting + +s = "This is a test string containing random variables 1234567890 !@#$%^&*_+-=;:<>,. a" l = len(s) -print(s, l) \ No newline at end of file +# print(videoformatting.variables("prod", quality="1080", frames="30", colour=True)) + +arr = [] + +for i in range(l): + arr.append(ord(s[i])) + +n = np.array(arr) + +n = n.reshape((9,9)) + +plt.imshow(n, interpolation='nearest') +plt.savefig('./Video/test.png') +# plt.show() \ No newline at end of file diff --git a/constants/__pycache__/videoformatting.cpython-311.pyc b/constants/__pycache__/videoformatting.cpython-311.pyc new file mode 100644 index 0000000..032ce56 Binary files /dev/null and b/constants/__pycache__/videoformatting.cpython-311.pyc differ diff --git a/constants/videoformatting.py b/constants/videoformatting.py new file mode 100644 index 0000000..eace0a0 --- /dev/null +++ b/constants/videoformatting.py @@ -0,0 +1,37 @@ +# FrameSize to Resolution mapping +_FrameSizes = { + "1080": (1920, 1080), + "720": (1280, 720), + "test": (30, 30) +} +_FrameRates = { + "30": 30, + "24": 24, + "test": 1 +} + +# User Specific Resolution and framerate +_outputDefaultResolution = "720" +_outputDeafultFrameRate = "24" + +# Frame size exposed +FrameSize = _FrameSizes[_outputDefaultResolution] +FrameRate = _FrameRates[_outputDeafultFrameRate] + +""" +Input Signature => (ENV, Quality, Frames, Colour) +Output signature => (FrameSize, FrameRate, No. of Channels) +""" + +def variables(ENV, quality=None, frames=None, colour=False): + if ENV == "prod": + FS = FrameSize if quality == None else _FrameSizes[quality] + FR = FrameRate if frames == None else _FrameRates[frames] + C = 3 if colour else 1 + elif ENV == "test": + FS = _FrameSizes["test"] + FR = _FrameRates["test"] + C = 3 if colour else 1 + else: + return -1 + return (FS, FR, C)