jdillenkofer / camera_proxy

MIT License
46 stars 17 forks source link

stream from Reolink PT cannot be consumed with ffmpeg #5

Closed rpnoll1977 closed 3 years ago

rpnoll1977 commented 3 years ago

Using a Reolink PT camera and ffmpeg on the command line as the client, i got an error message about missing boundary

 Expected boundary '--' not found, instead found a line of n bytes

I wasnt's able to cure this using command line switches, so I changed this part to deliver content-length information to make it work.

def frame_generator(): while True: camera_stream_manager.update_last_accessed_timestamp(name) frame = queue.get() output = io.BytesIO() frame.save(output, 'JPEG') len = output.tell() output.seek(0) yield (b'--frame\r\n' b'Content-Type: image/jpeg\r\nContent-Length: ' + str(len).encode() + b'\r\n\r$ return Response(frame_generator(), mimetype='multipart/x-mixed-replace; boundary=frame')

jdillenkofer commented 3 years ago

Hi, i added the Content-Length header to the stream response. Can you tell me if the problem is fixed on the current develop branch?

rpnoll1977 commented 3 years ago

problem fixed, thank you

jdillenkofer commented 3 years ago

Thanks for the help.