RTSP सिम्युलेटर
कैमरे के बिना inference pipelines का परीक्षण करने के लिए अपलोड की गई video file को looping RTSP source के रूप में स्ट्रीम करें।
RTSP सिम्युलेटर एक एज कंटेनर सेवा है जो अपलोड की गई वीडियो फ़ाइल को लाइव RTSP स्ट्रीम में बदल देती है। इसका उपयोग भौतिक कैमरा इंस्टॉल होने से पहले डिवाइस पर इन्फ़रेंस पाइपलाइनों को बनाने और परीक्षण करने के लिए, या किसी ज्ञात क्लिप को Workflow के विरुद्ध दोबारा चलाने के लिए करें।
आप एक अपलोड करते हैं .mp4 फ़ाइल वेब इंटरफ़ेस या REST API के माध्यम से, या Deployment Manager से एक वीडियो चुनें। सेवा इसे RTSP-संगत प्रारूप में ट्रांसकोड करती है और जब तक आप इसे रोक नहीं देते, परिणाम को निरंतर लूप पर प्रकाशित करती रहती है।
कनेक्शन विवरण
बदलें <device-ip> को Deployment Manager में डिवाइस पेज पर दिखाई गई IP पता से बदलें।
RTSP स्ट्रीम
rtsp://<device-ip>:8554/stream
वेब UI, REST API, और Swagger दस्तावेज़
http://<device-ip>:8080
8080
HTTP
वेब UI, REST API, Swagger दस्तावेज़ यहाँ /docs
8554
RTSP (TCP)
वीडियो स्ट्रीम आउटपुट। UDP ट्रांसपोर्ट अक्षम है; जो क्लाइंट UDP को प्राथमिकता देते हैं वे TCP-interleaved पर डाउनग्रेड हो जाते हैं।
एक ही समय में कई क्लाइंट स्ट्रीम पढ़ सकते हैं।
वीडियो प्रारूप
वेब UI, CLI, और API केवल .mp4 फ़ाइलें स्वीकार करते हैं। अपलोड स्वतः ट्रांसकोड किए जाते हैं ताकि स्ट्रीम किसी भी RTSP क्लाइंट के साथ काम करे:
कोडेक: H.264, बेसलाइन प्रोफ़ाइल
पिक्सेल प्रारूप: yuv420p
ऑडियो: हटाया गया, केवल वीडियो
अधिकतम फ़ाइल आकार: डिफ़ॉल्ट रूप से 5 GB
Roboflow वीडियो का उपयोग
जब आप डिवाइस तक उसके स्थानीय नेटवर्क पर नहीं पहुँच सकते, तब Deployment Manager से वीडियो सेट करें। डिवाइस वीडियो डाउनलोड करता है और उसे स्ट्रीम करता है।
कार्ड वीडियो का नाम, RTSP URL, और डाउनलोड तथा स्ट्रीम की स्थिति दिखाता है। जब कोई Roboflow वीडियो सेट होता है, तब स्थानीय वेब UI और CLI नियंत्रण लॉक रहते हैं। स्थानीय अपलोड पर वापस जाने के लिए, "Local upload" चुनें और सहेजें।
वेब इंटरफ़ेस का उपयोग
खोलें http://<device-ip>:8080 एक ब्राउज़र में।
सिम्युलेटेड स्ट्रीम को किसी deployment में उपयोग करने के लिए, इसे उसी तरह डिवाइस पर एक stream source के रूप में जोड़ें जैसे आप कैमरा जोड़ते हैं। देखें स्ट्रीम जोड़ें.
CLI का उपयोग
हेडलेस या केवल SSH-आधारित पहुँच के लिए, rtsp-cli टूल डिवाइस पर एक इंटरैक्टिव टर्मिनल इंटरफ़ेस प्रदान करता है।
वेब UI के बिना वीडियो आयात करने के लिए, पहले इसे इनपुट डायरेक्टरी में कॉपी करें, फिर CLI लॉन्च करें और I.
I
आयात करें
से एक वीडियो चुनें और परिवर्तित करें /data/input/
P
चलाएँ
RTSP स्ट्रीमिंग शुरू करें
S
रोकें
स्ट्रीमिंग रोकें और परिवर्तित फ़ाइलें हटाएँ
D
हटाएँ
वीडियो फ़ाइलें हटाएँ
C
कॉन्फ़िग
स्ट्रीम सेटिंग्स समायोजित करें (बिटरेट, बफ़र, देरी)
R
रीफ़्रेश
स्थिति प्रदर्शन को रीफ़्रेश करें
Q
बाहर निकलें
CLI से बाहर निकलें
स्ट्रीम का परीक्षण
स्ट्रीम लाइव है यह पुष्टि करने के लिए किसी भी RTSP प्लेयर से कनेक्ट करें।
स्ट्रीम केवल TCP पर सर्व की जाती है, इसलिए ffplay को पहले UDP आज़माने देने के बजाय TCP ट्रांसपोर्ट को मजबूर करें।
HTTP API
सभी endpoint JSON लौटाते हैं। इंटरैक्टिव Swagger दस्तावेज़ यहाँ सर्व किया जाता है http://<device-ip>:8080/docs. देखें सेवाएँ डिवाइस पर सभी सेवा APIs द्वारा साझा नियमों के लिए।
API बिना प्रमाणीकरण के है, और यह चल रही स्ट्रीम को रोक सकता है तथा अपलोड किया गया वीडियो हटा सकता है। जो भी पोर्ट 8080 तक पहुँच सकता है, वह दोनों कर सकता है।
सामान्य प्रवाह
वह rtsp_url द्वारा लौटाया गया /play और /status हमेशा नाम देता है localhost, क्योंकि सेवा URL को अपने ही दृष्टिकोण से रिपोर्ट करती है। केवल डिवाइस पर चल रहा consumer ही इसे ज्यों का त्यों उपयोग कर सकता है। किसी और जगह, डिवाइस पता बदलें: rtsp://<device-ip>:8554/stream.
पोर्ट है RTSP_PORT, जिसका डिफ़ॉल्ट है 8554 लेकिन यह प्रत्येक डिवाइस के लिए कॉन्फ़िगर किया जा सकता है। पढ़ें rtsp_port से /info डिफ़ॉल्ट मान मानने के बजाय।
/stop डिस्क स्थान खाली करने के लिए मूल और परिवर्तित दोनों फ़ाइलें भी हटाता है, इसलिए अगले /play.
अपलोड करें
केवल .mp4 स्वीकार किया जाता है, और अपलोड शुरू होने से पहले सक्रिय स्ट्रीम रोक दी जाती है। वैकल्पिक सेटिंग्स भाग ट्रांसकोडिंग के दौरान लागू होने वाली रूपांतरण सेटिंग्स की एक JSON स्ट्रिंग है। क्योंकि वे परिवर्तित फ़ाइल में ही समाहित हो जाती हैं, बाद में उन्हें बदलने के लिए फिर से अपलोड करना आवश्यक है।
Uploads a video and converts it to the RTSP streaming format. Only .mp4 is accepted. An active stream is stopped before the upload begins.
The optional settings part is a JSON string of conversion settings, applied during transcoding. Because they are baked into the converted file, changing them later requires re-uploading.
Video file to upload. Must be .mp4.
Optional JSON string holding an UploadSettings object. It is a string part rather than a nested object because the service parses it with json.loads before validating, so the UploadSettings schema below documents the shape rather than being referenced here.
{"target_fps": 30, "crf_quality": 23, "max_width": 1920}Upload and conversion succeeded
No file selected, unsupported extension, invalid upload settings, or the file is not a readable video
File exceeds MAX_FILE_SIZE (5 GB by default)
Request failed validation
Conversion failed
Not enough free disk space for the upload
POST /upload HTTP/1.1
Host: device-ip:8080
Content-Type: multipart/form-data
Accept: */*
Content-Length: 93
{
"file": "binary",
"settings": "{\"target_fps\": 30, \"crf_quality\": 23, \"max_width\": 1920}"
}{
"success": true,
"message": "Video uploaded successfully",
"video": {
"filename": "factory_line.mp4",
"size": 125000000,
"size_mb": 119.21,
"extension": ".mp4"
}
}स्ट्रीमिंग
Starts publishing the converted video to the RTSP server, looping until stopped. Uses the current stream settings.
Streaming started
RTSP stream URL as the service sees it, always naming localhost, on the port set by RTSP_PORT (8554 by default). Consumers off the device must substitute the device address; read rtsp_port from /info rather than assuming 8554.
Already streaming, or no video has been uploaded
The stream failed to start
POST /play HTTP/1.1
Host: device-ip:8080
Accept: */*
{
"success": true,
"message": "Streaming started",
"rtsp_url": "rtsp://localhost:8554/stream"
}Stops the stream and deletes both the original and converted files to free disk space. Uploading again is required before the next /play.
Streaming stopped and files deleted
Not currently streaming
Stop failed
POST /stop HTTP/1.1
Host: device-ip:8080
Accept: */*
{
"success": true,
"message": "text"
}/delete स्ट्रीम चल रही हो यह आवश्यक नहीं है, वीडियो फ़ाइलें हटाता है; यदि कोई स्ट्रीम चल रही हो तो पहले उसे रोकता है।
Deletes the original and converted video files, stopping the stream first if it is running. Unlike /stop, this succeeds whether or not a stream is active.
Files deleted
No video files found to delete
Delete failed
POST /delete HTTP/1.1
Host: device-ip:8080
Accept: */*
{
"success": true,
"message": "text"
}स्थिति
स्ट्रीमिंग सत्य होता है जब components.mediamtx.healthy (स्ट्रीमिंग सर्वर) और components.ffmpeg_process.running (ट्रांसकोड और प्रकाशन प्रक्रिया) दोनों सत्य होते हैं। components.stream एंट्री इसे नियंत्रित नहीं करती: components.stream.source_ready स्टार्टअप के दौरान थोड़ी देर के लिए असत्य हो सकता है जबकि स्ट्रीमिंग पहले से सत्य पढ़ रहा होता है, जो सामान्य है। टूटे हुए स्ट्रीम का स्थान पता लगाने का सबसे तेज़ तरीका यह विवरण है: जाँचें components यह देखने के लिए कि कौन सा भाग अस्वस्थ है, कुछ भी पुनः आरंभ करने से पहले।
Returns whether the stream is live, plus the health of each component, which is the fastest way to localize a failure.
streaming is true when components.mediamtx.healthy and components.ffmpeg_process.running are both true; the components.stream entry does not gate it. components.stream.source_ready can be false briefly during startup, which is normal.
Current status
RTSP stream URL as the service sees it, always naming localhost, on the port set by RTSP_PORT (8554 by default). Null when not streaming. Consumers off the device must substitute the device address; read rtsp_port from /info rather than assuming 8554.
GET /status HTTP/1.1
Host: device-ip:8080
Accept: */*
Current status
{
"streaming": true,
"rtsp_url": "rtsp://localhost:8554/stream",
"video": {
"filename": "sample.mp4",
"size": 1048576,
"size_mb": 1,
"extension": ".mp4"
},
"components": {
"mediamtx": {
"healthy": true,
"error": null
},
"ffmpeg_process": {
"exists": true,
"pid": 1234,
"running": true,
"exit_code": null
},
"stream": {
"api_available": true,
"source_ready": true,
"readers": 1,
"error": null
}
}
}/info सेवा जिन सीमाओं के साथ चल रही है उन्हें रिपोर्ट करता है, जिसमें खाली डिस्क स्थान और अधिकतम अपलोड आकार शामिल है, जिसे बड़ी फ़ाइल भेजने से पहले जाँचना उपयोगी है।
Returns disk space, the upload size limit, accepted extensions, and the RTSP port.
System information
Maximum upload size in bytes, set by MAX_FILE_SIZE
Accepted file extensions. Only .mp4 today.
Port the RTSP stream is served on, set by RTSP_PORT
GET /info HTTP/1.1
Host: device-ip:8080
Accept: */*
System information
{
"disk_space": {
"total": 1,
"used": 1,
"free": 1,
"free_gb": 1
},
"max_file_size": 1,
"max_file_size_gb": 1,
"allowed_extensions": [
"text"
],
"rtsp_port": 1
}स्ट्रीम सेटिंग्स एंडपॉइंट
प्लेबैक सेटिंग्स अपलोड सेटिंग्स से भिन्न होती हैं: वे स्ट्रीमिंग समय पर लागू होती हैं और बिना दोबारा अपलोड किए सत्रों के बीच बदली जा सकती हैं। एक अपडेट अगले /playपर प्रभावी होता है, न कि वर्तमान में चल रही स्ट्रीम पर।
Returns the current playback settings.
Current settings
Playback settings, changeable between streaming sessions without re-uploading.
Maximum bitrate in kbps
5000Buffer size in KB
3000Maximum delay in milliseconds
500GET /stream-settings HTTP/1.1
Host: device-ip:8080
Accept: */*
Current settings
{
"max_bitrate_kbps": 5000,
"buffer_size_kb": 3000,
"max_delay_ms": 500
}Persists new playback settings. They apply to the next streaming session, not the one currently running.
Playback settings, changeable between streaming sessions without re-uploading.
Maximum bitrate in kbps
5000Buffer size in KB
3000Maximum delay in milliseconds
500Settings saved
Request failed validation
Failed to persist settings
POST /stream-settings HTTP/1.1
Host: device-ip:8080
Content-Type: application/json
Accept: */*
Content-Length: 66
{
"max_bitrate_kbps": 5000,
"buffer_size_kb": 3000,
"max_delay_ms": 500
}{
"success": true,
"message": "text"
}कॉन्फ़िगरेशन
पर्यावरण चर
इन्हें डिवाइस के Configuration टैब में सेवा पर सेट करें। देखें डिवाइस कॉन्फ़िगरेशन अपडेट करें.
MAX_FILE_SIZE
5368709120
बाइट्स में अधिकतम अपलोड आकार (5 GB)
RTSP_PORT
8554
RTSP सर्वर पोर्ट
WEB_PORT
8080
वेब UI और API पोर्ट
LOG_LEVEL
INFO
लॉगिंग वर्बोसिटी: DEBUG, INFO, WARNING, या ERROR
अपलोड सेटिंग्स
इन्हें रूपांतरण के दौरान लागू किया जाता है, इसलिए इन्हें बदलने के लिए वीडियो को फिर से अपलोड करना पड़ता है।
target_fps
मूल
लक्षित फ़्रेम दर, 1 से 120। मूल बनाए रखने के लिए छोड़ दें
crf_quality
23
गुणवत्ता स्तर, 0 से 51 (18 उच्च है, 23 मध्यम है, 28 निम्न है)
max_width
मूल
डाउनस्केलिंग के लिए अधिकतम चौड़ाई, 320 से 7680। मूल बनाए रखने के लिए छोड़ दें
स्ट्रीम सेटिंग्स
इन्हें प्लेबैक के समय लागू किया जाता है और CLI config मेनू या /stream-settings एंडपॉइंट से स्ट्रीमिंग सत्रों के बीच बदला जा सकता है।
max_bitrate_kbps
5000
kbps में अधिकतम बिटरेट, 100 से 100,000
buffer_size_kb
3000
KB में बफ़र आकार, 100 से 50,000
max_delay_ms
500
मिलीसेकंड में अधिकतम देरी, 50 से 5,000
अंतिम अपडेट
क्या यह उपयोगी था?