Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP...

37
ONVIF @ WUNCA #38 บรรยายโดย ผศ.ดร.กิตติพงษ์ สุวรรณราช และรัฐวิภาค อู ่ทองมาก มหาวิทยาลัยราชภัฏพิบูลสงคราม (ศูนย์เทคโนโลยีสารสนเทศ) การใช้เทคโนโลยี Onvif ในการให้บริการนักศึกษา สาหรับ Smart University

Transcript of Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP...

Page 1: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

ON

VIF

@ W

UN

CA

#3

8

บรรยายโดย ผศ.ดร.กตตพงษ สวรรณราช และรฐวภาค อทองมากมหาวทยาลยราชภฏพบลสงคราม (ศนยเทคโนโลยสารสนเทศ)

การใชเทคโนโลย Onvif ในการใหบรการนกศกษาส าหรบ Smart University

Page 2: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

Age

nd

a• เทคโนโลย Onvif

• ปญหากอนทจะม Onvif ใชงาน• การเรมศกษาเทคโนโลย Onvif

• มาตรฐานตางๆ ของ Onvif

• การใชงานเทคโนโลย Onvif ใน Smart University

• การเขยน App เพอสงงาน Onvif

Page 3: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป
Page 4: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

ONVIF

• ONVIF stands for Open Network Video Interface Forum It's an open industry standard that provides interoperability among IP security devices such as security cameras, video recorders, software, and access control systems.

• Founded in 2008 by Axis Communications, Bosch Security Systems, and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members.

Page 5: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป
Page 6: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป
Page 7: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป
Page 8: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป
Page 9: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

ONVIF มความจ าเปนในมหาวทยาลยของเราอยางไร?

• เรามความตองการรวมระบบกลอง CCTV และ IP Camera เขาดวยกนใหเปนระบบเดยวกนทงหมด• เราตองการใชประโยชนจากกลองใหมากขน ไมไดมองแคความปลอดภยเพยงอยางเดยว• เรามพนทในมหาวทยาลย 997 ไร นกศกษาตองใชจกรยานยนตในการเดนทางไปยงอาคารเรยนตาง ๆ• เราจะสามารถชวยกนประหยดการใชพลงงาน และลดคาใชจายใหเดก ๆ ไดอยางไร โดยใชระบบกลองทเรามอย

ดวยเหตผลน เราจงสรางระบบ PSRU-Smart Camera ขนมา

Page 10: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

เรมตนศกษา Onvif จากกลองเลกๆ vstarcam c7824WIP

+ Onvif Device Manager

Page 11: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

โปรแกรมทชวยในการเขาถงอปกรณ Onvif

Onvif Device Manager (เปน Open source Software ทท าใหเราสามารถเขาถงอปกรณทรองรบ Onvif ไดงาย ๆ

Page 12: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

ONVIF Profiles Concept

- งายตอการตรวจสอบความเขากนไดของอปกรณ เพยงแคดท Profile เทานน- ชวยใหผใชสามารถระบคณสมบตการท างานรวมกนระหวางอปกรณไดอยางงายดาย- ไมจ าเปนตองมความรดานเทคนค

Page 13: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

เพยงแค Profiles เหมอนกน กท ำงำนรวมกนไดทนท

Page 14: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

• สงขอมลวดโอผานเครอขาย (Streaming) และควบคมการสตรมวดโอผานเครอขาย IP• ควบคม PTZ (pan, tilt, zoom)

ONVIF Profiles S

Page 15: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

• มาตราฐานส าหรบผลตภณฑทใชในระบบรกษาความปลอดภย เชน ควบคมการเขาถงประตและการจดการเหตการณและการเตอนภย

ONVIF Profiles C (IP-based basic access control)

Page 16: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

• มาตรฐานส าหรบอปกรณทสามารถบนทกขอมลวดโอผานเครอขาย เชนซอฟตแวรการจดการวดโอ

ONVIF Profiles G (edge storage and retrieval)

Page 17: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

• มาตรฐาน Quick Installation หรอการตงคาอปกรณอยางรวดเรว ผาน TLS (Transport Layer Security

ONVIF Profiles Q (quick installation)

ONVIF Profiles A

• ท างานรวมกบ Profiles C

• รองรบการให / เพกถอนใบรบรอง (credentials)

• การสราง Schedules

• ก าหนดสทธการเขาถง

Page 18: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

การท างานรวมกนของอปกรณผาน ONVIF Profiles

Page 19: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

ONVIF PTZ (Pan, Tilt, Zoom)

• Pan คอ การขยบกลองในแนวแกน X (ซาย, ขวา)

• Tilt คอ การขยบกลองในแนวแกน Y (มมกม, เงย)

• Zoom คอ การซมภาพ (รองรบเฉพาะบางรน บางยหอ)

Page 20: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

<tptz:ContinuousMove>

<tptz:ProfileToken> {{ Token }} </tptz:ProfileToken>

<tptz:Velocity>

<tt:PanTilt x=" {{ x params }} " y=" {{ y params }} "></tt:PanTilt>

<tt:Zoom x=" {{ zoom params }} "></tt:Zoom

</tptz:Velocity>

<tptz:Timeout>PT{{ timeout params }}S</tptz:Timeout>

</tptz:ContinuousMove>

ONVIF PTZ Raw XML

Page 21: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

ตวอยางการใชงาน PYTHON กบ ONVIF-PTZ

1. ตดตง ONVIF library (https://github.com/quatanium/python-onvif)

2. Import onvif library

3. ตงคา ONVIF Media service

4. ประกาศตวแปร position Global variables

5. สราง Request เพอท าการ Pan, Tilt, Zoom

Page 22: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

ตงคา ONVIF Media service• mycam = ONVIFCamera('192.168.0.112', 80, 'admin', '12345')

• # สราง Media Service

• media = mycam.create_media_service()

• # สราง ptz service object

• ptz = mycam.create_ptz_service()

• # ดง profile จากกลอง• media_profile = media.GetProfiles()[0];

• # ตงคาคาตางๆส าหรบการท า ContinuousMove

• request = ptz.create_type('GetConfigurationOptions')

• request.ConfigurationToken = media_profile.PTZConfiguration._token

• ptz_configuration_options = ptz.GetConfigurationOptions(request)

• request = ptz.create_type('ContinuousMove')

• request.ProfileToken = media_profile._token

Page 23: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

ประกาศตวแปร Position Global variables

• global XMAX, XMIN, YMAX, YMIN

• XMAX=ptz_configuration_options.Spaces.ContinuousPanTiltVelocitySpace[0].XRange.Max

• XMIN = ptz_configuration_options.Spaces.ContinuousPanTiltVelocitySpace[0].XRange.Min

• YMAX =ptz_configuration_options.Spaces.ContinuousPanTiltVelocitySpace[0].YRange.Max

• YMIN = ptz_configuration_options.Spaces.ContinuousPanTiltVelocitySpace[0].YRange.Min

* ท ำกำรตงคำระยะสงสดและต ำสด โดยดงคำจำก Profiles กลอง

* กลองแตละแบรนดมระยะท ำกำรไมเทำกน

Page 24: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

สราง Request เพอท าการ Pan, Tilt, Zoom

# ตวอยำงกำรปรบมมกลองขน (Move up)• request.Velocity.PanTilt._x = 0

• request.Velocity.PanTilt._y = YMAX

• perform_move(ptz, request, timeout)

# ตวอยำงกำรปรบมมกลองทำงขวำ (Move right)• request.Velocity.PanTilt._x = XMAX

• request.Velocity.PanTilt._y = 0

• perform_move(ptz, request, timeout)

Page 25: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

การใชเทคโนโลย ONVIF ใหบรการนกศกษาส าหรบ Smart University

Page 26: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

มหาวทยาลยราชภฎพบลสงครามไดน าเทคโนโลย ONVIF มาใหบรการนกศกษาเพอดภาพปจจบนในสถานทใหบรการตางๆของมหาวทยาลยผานแอพพลเคชน

LINE

ท ำใหนกศกษำมนใจวำมำแลวจะไดรบบรกำรแนนอน

Page 27: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

ปญหาทน ามาสการพฒนา

• พนทใหบรการในมหาวทยาลยมจ ากด• นกศกษาเดนทางมาแลวไมไดรบบรการ

Page 28: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

เราเลอก LINE เปน Platform หลกในการพฒนา

•รองรบทกอปกรณ•ไมตองเรยนรการใชงาน•ทกคนม LINE !!

Page 29: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

สถตการใชงาน LINE ในประเทศไทย

Page 30: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

แนวคดการพฒนา ONVIF รวมกบ LINE

Page 31: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

ความสามารถของ LINE BOT ONVIF

Page 32: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

แนวคดการดภาพสดจากกลองดวย RTSP Protocol

Page 33: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

แนวคดการพฒนา RTSP รวมกบ LINE

RTSP

Re stream with FFMPEG

Streaming server

ภาพจากสถานทตางๆในมหาวทยาลย

Streaming MP4

Page 34: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

PSRU-ONVIF

ลอง SCAN QR Code เพอชมตวอยางครบ !!

PSR

U S

mar

t C

amer

a

Page 35: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป
Page 36: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป
Page 37: Smart University...and Sony Corporation, the standard was adopted by most manufacturers in the IP security industry and to date, there are 470+ members. ONVIF ม ความจาเป

Q & A