How to take image snapshot with client side camera in my django web application

ぐ巨炮叔叔 提交于 2019-11-29 01:15:37

问题


I have a django web application in which i want give a option to capture the image in the registration form,"the registration can be done from any client system" when ever press the capture image button then client system camera should open and take the image should store in server side folder how can i do this.

I am thinking that camera should open from html page and send the image to server, but I am not able open camera using html code.

I hope some one might have done this if yes please give me sample code.


回答1:


You can use WebRTC for this; html5rocks.com has a nice tutorial, see especially the example of taking screenshots. To store the image on the server, you'll have to upload it via AJAX.




回答2:


You have several options to access client webcam. The easiest way is HTML5. But you can use sveral tools in silverlight and flash plugin.

See how-to-access-webcam-from-html5 and html5-getusermedia-record-webcam-both-audio-and-video

After getting image in page you can send it to server in diffrent ways including JavaScript (with AJAX) or using HTML form element (like file input)



来源:https://stackoverflow.com/questions/20659698/how-to-take-image-snapshot-with-client-side-camera-in-my-django-web-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!