Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
client "import cv2
def rtsp_client():
# RTSP yayınına bağlanma (Jetson Nano'nun IP adresini ve RTSP portunu girin)
rtsp_url = 'rtsp://<jetson_nano_ip>:8554'
# RTSP akışını almak için VideoCapture kullanıyoruz
cap = cv2.VideoCapture(rtsp_url)
if not cap.isOpened():
print("RTSP yayınına bağlanılamadı.")
return
while True:
# RTSP yayından görüntü al
ret, frame = cap.read()
if not ret:
print("Yayından görüntü alınamadı.")
break
# Alınan görüntüyü ekrana göster
cv2.imshow('RTSP Yayını', frame)
# 'q' tuşuna basılırsa yayını durdur
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# Kaynakları serbest bırak
cap.release()
cv2.destroyAllWindows()
if __name__ == "__main__":
rtsp_client()
"
streamer "
import cv2
import subprocess
import threading
# Gstreamer pipeline ayarları
def gstreamer_pipeline(
capture_width=1920,
capture_height=1080,
display_width=960,
display_height=540,
framerate=30,
flip_method=0,
):
return (
"nvarguscamerasrc ! "
"video/x-raw(memory:NVMM), "
"width=(int)%d, height=(int)%d, framerate=(fraction)%d/1 ! "
"nvvidconv flip-method=%d ! "
"video/x-raw, width=(int)%d, height=(int)%d, format=(string)BGRx ! "
"videoconvert ! "
"video/x-raw, format=(string)BGR ! appsink drop=True"
% (
capture_width,
capture_height,
framerate,
flip_method,
display_width,
display_height,
)
)
# OpenCV ile kameradan görüntü alma
def capture_camera():
video_capture = cv2.VideoCapture(gstreamer_pipeline(), cv2.CAP_GSTREAMER)
if video_capture.isOpened():
while True:
ret, frame = video_capture.read()
if not ret:
break
yield frame
else:
print("Unable to open camera")
exit(0)
# RTSP üzerinden yayın yapmak için GStreamer pipeline oluşturma
def start_rtsp_streaming():
command = [
'gst-launch-1.0', 'appsrc', '!',
'videoconvert', '!',
'x264enc', 'speed-preset=ultrafast', 'tune=zerolatency', '!',
'rtph264pay', 'config-interval=1', 'pt=96', '!',
'udpsink', 'host=0.0.0.0', 'port=8554'
]
# GStreamer komutunu çalıştırmak için subprocess kullanıyoruz
subprocess.Popen(command)
# Kamera akışını RTSP ile yayınlayacak fonksiyon
def rtsp_streaming_process():
# RTSP yayınını başlatıyoruz
start_rtsp_streaming()
# OpenCV ile kamera görüntüsünü sürekli alıp işleyin
for frame in capture_camera():
# Burada frame üzerinde YOLOv8 gibi işlemler yapabilirsiniz
# Örneğin, yüz algılama veya nesne algılama işlemleri eklenebilir
# Görüntüyü göstermek isterseniz:
cv2.imshow("CSI Camera", frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cv2.destroyAllWindows()
if __name__ == "__main__":
rtsp_streaming_process()
"
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team