コード例 #1
0
ファイル: server.py プロジェクト: gjdv/pymjpeg
 def do_GET(self):
     logging.debug('GET response code: 200')
     self.send_response(200)
     # Response headers (multipart)
     for k, v in request_headers().items():
         self.send_header(k, v)
         logging.debug('GET response header: ' + k + '=' + v)
     # Multipart content
     self.serve_images()
コード例 #2
0
ファイル: server.py プロジェクト: rollys/pymjpeg
 def do_GET(self):
     self.send_response(200)
     # Response headers (multipart)
     for k, v in pymjpeg.request_headers().items():
         self.send_header(k, v)
     # Multipart content
     for filename in glob('img/*'):
         # Part boundary string
         self.end_headers()
         self.wfile.write(pymjpeg.boundary)
         self.end_headers()
         # Part headers
         for k, v in pymjpeg.image_headers(filename).items():
             self.send_header(k, v)
         self.end_headers()
         # Part binary
         for chunk in pymjpeg.image(filename):
             self.wfile.write(chunk)
コード例 #3
0
ファイル: server.py プロジェクト: damiencorpataux/pymjpeg
 def do_GET(self):
     self.send_response(200)
     # Response headers (multipart)
     for k, v in pymjpeg.request_headers().items():
         self.send_header(k, v) 
     # Multipart content
     for filename in glob('img/*'):
         # Part boundary string
         self.end_headers()
         self.wfile.write(pymjpeg.boundary)
         self.end_headers()
         # Part headers
         for k, v in pymjpeg.image_headers(filename).items():
             self.send_header(k, v) 
         self.end_headers()
         # Part binary
         for chunk in pymjpeg.image(filename):
             self.wfile.write(chunk)
コード例 #4
0
ファイル: server.py プロジェクト: johnrmann/pymjpeg
    def do_GET(self):
        global LOOP_WAIT_TIME

        self.send_response(200)
        # Response headers (multipart)
        for k, v in pymjpeg.request_headers().items():
            self.send_header(k, v) 
        # Multipart content
        while (True):
            self.end_headers()
            self.wfile.write(pymjpeg.boundary)
            self.end_headers()
            for k, v in pymjpeg.image_headers(content=self.server.image_data).items():
                self.send_header(k,v)
            self.end_headers()
            # Write the image data.
            print "Writing image data"
            self.wfile.write(self.server.image_data)
            # Wait...
            time.sleep(LOOP_WAIT_TIME)
コード例 #5
0
ファイル: server.py プロジェクト: josephgvariam/opencv-webcam
 def do_GET(self):
     self.send_response(200)
     # Response headers (multipart)
     for k, v in pymjpeg.request_headers().items():
         self.send_header(k, v) 
     # Multipart content
     filename = '../img/camera0.jpg'
     while True:
         # Part boundary string
         self.end_headers()
         self.wfile.write(pymjpeg.boundary)
         self.end_headers()
         # Part headers
         for k, v in pymjpeg.image_headers(filename).items():
             self.send_header(k, v) 
         self.end_headers()
         # Part binary
         for chunk in pymjpeg.image(filename):
             self.wfile.write(chunk)
         time.sleep(0.2)
コード例 #6
0
    def do_GET(self):
        global LOOP_WAIT_TIME

        self.send_response(200)
        # Response headers (multipart)
        for k, v in pymjpeg.request_headers().items():
            self.send_header(k, v)
        # Multipart content
        while (True):
            self.end_headers()
            self.wfile.write(pymjpeg.boundary)
            self.end_headers()
            for k, v in pymjpeg.image_headers(
                    content=self.server.image_data).items():
                self.send_header(k, v)
            self.end_headers()
            # Write the image data.
            print "Writing image data"
            self.wfile.write(self.server.image_data)
            # Wait...
            time.sleep(LOOP_WAIT_TIME)
コード例 #7
0
 def do_GET(self):
     logging.debug('GET response code: 200')
     self.send_response(200)
     # Response headers (multipart)
     for k, v in pymjpeg.request_headers().items():
         self.send_header(k, v)
         logging.debug('GET response header: ' + k + '=' + v)
     # Multipart content
     for filename in glob('img/*.jpg'):
         logging.debug('GET response image: ' + filename)
         # Part boundary string
         self.end_headers()
         self.wfile.write(bytes(pymjpeg.boundary, 'utf-8'))
         self.end_headers()
         # Part headers
         for k, v in pymjpeg.image_headers(filename).items():
             self.send_header(k, v)
             # logging.debug('GET response header: ' + k + '=' + v)
         self.end_headers()
         # Part binary
         # logging.debug('GET response image: ' + filename)
         for chunk in pymjpeg.image(filename):
             self.wfile.write(chunk)