I am writing a code for video transmission via internet.
The coding has been done in Python and libraries from pygame (tried using openCV but lag increased)
pxarray = pygame.PixelArray(img)
packet = bytearray(640*480*3)
k=0
for i in range(640) :
for j in range(480) :
packet[k] = pxarray[i,j] & 255
k=k+1
packet[k] = (pxarray[i,j] >> 8) & 255
k=k+1
packet[k] = (pxarray[i,j] >> 16) & 255
k=k+1
how is it possible to optimize this code??...
I do not intend to further reduce the resolution n my webcam captures images at 30fps.
Lag is of around 350-450msec.....
The coding has been done in Python and libraries from pygame (tried using openCV but lag increased)
pxarray = pygame.PixelArray(img)
packet = bytearray(640*480*3)
k=0
for i in range(640) :
for j in range(480) :
packet[k] = pxarray[i,j] & 255
k=k+1
packet[k] = (pxarray[i,j] >> 8) & 255
k=k+1
packet[k] = (pxarray[i,j] >> 16) & 255
k=k+1
how is it possible to optimize this code??...
I do not intend to further reduce the resolution n my webcam captures images at 30fps.
Lag is of around 350-450msec.....