Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Video/test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 19 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
@@ -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)
# 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()
Binary file not shown.
37 changes: 37 additions & 0 deletions constants/videoformatting.py
Original file line number Diff line number Diff line change
@@ -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)