Skip to content

Instantly share code, notes, and snippets.

@dahnielson
Created July 7, 2010 09:12
Show Gist options
  • Save dahnielson/466488 to your computer and use it in GitHub Desktop.
Save dahnielson/466488 to your computer and use it in GitHub Desktop.
Transfer rate/storage capacity calculator
# Load in IPython and use as transfer rate
# and storage capacity calculator.
bytes = 8
bits = 24
width = 1280
height = 720
fps = 24
def select720p()
width = 1280
height = 720
def select1080p()
width = 1920
height = 1080
def select2k()
width = 2048
height = 1080
def bitsPerSecond():
return width * height * bits * fps
def bytesPerSecond():
return width * height * bytes * fps
def byteToMegabyte(byte):
return byte / 1000000
def byteToGigabyte(byte):
return byte / 1000000000
def byteToMebibyte(byte):
return byte / 1048576
def byteToGibibyte(byte):
return byte / 1073741824
def minutes(minutes):
print "%d B" % (bytesPerSecond() * 60 * minutes)
print "%d MB" % (byteToMegabyte(bytesPerSecond() * 60 * minutes))
print "%d GB" % (byteToGigabyte(bytesPerSecond() * 60 * minutes))
def help():
print "bitsPerSecond()"
print "bytePerSecond()"
print "byteToMegabyte(byte)"
print "byteToMebibyte(byte)"
print "minutes(minutes)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment