For the complete documentation index, see llms.txt. This page is also available as Markdown.

RTSP 시뮬레이터

카메라 없이 추론 파이프라인을 테스트할 수 있도록 업로드한 비디오 파일을 반복 재생되는 RTSP 소스로 스트리밍합니다.

RTSP Simulator는 업로드한 비디오 파일을 실시간 RTSP 스트림으로 바꾸는 엣지 컨테이너 서비스입니다. 실제 카메라가 설치되기 전에 장치에서 추론 파이프라인을 구축하고 테스트하거나, 워크플로에 대해 알려진 클립을 다시 재생하는 데 사용할 수 있습니다.

업로드합니다 .mp4 파일을 웹 인터페이스나 REST API를 통해 업로드하면, 서비스가 이를 RTSP 호환 형식으로 트랜스코딩하고, 중지할 때까지 결과를 연속 루프로 게시합니다.

RTSP Simulator는 Enterprise 고객에게만 제공됩니다. Roboflow 영업팀에 문의하세요 자세한 내용을 알아보세요.

연결 정보

다음으로 바꾸세요 <device-ip> Deployment Manager의 디바이스 페이지에 표시된 IP 주소로.

목적
주소

RTSP 스트림

rtsp://<device-ip>:8554/stream

Web UI, REST API 및 Swagger 문서

http://<device-ip>:8080

포트
프로토콜
목적

8080

HTTP

Web UI, REST API, Swagger 문서는 /docs

8554

RTSP (TCP)

비디오 스트림 출력입니다. UDP 전송은 비활성화되어 있으며, UDP를 선호하는 클라이언트는 TCP 인터리브 방식으로 협상합니다.

여러 클라이언트가 동시에 스트림을 읽을 수 있습니다.

비디오 형식

오직 .mp4 파일만 허용됩니다. 업로드는 자동으로 트랜스코딩되어 스트림이 모든 RTSP 클라이언트에서 작동합니다:

  • 코덱: H.264, Baseline 프로파일

  • 픽셀 형식: yuv420p

  • 오디오: 제거됨, 비디오만

  • 최대 파일 크기: 기본값은 5GB

웹 인터페이스 사용

열기 http://<device-ip>:8080 브라우저에서.

1

업로드

드래그하여 .mp4 파일을 페이지 위로 끌어다 놓습니다. 파일이 업로드되고 스트리밍 형식으로 변환됩니다.

2

재생

"재생"을 선택하여 스트리밍을 시작하세요. 비디오는 무한히 반복되며 RTSP 서버에 게시됩니다.

3

연결

추론 파이프라인, Deployment Manager 스트림 또는 임의의 RTSP 클라이언트를 다음에 연결하세요 rtsp://<device-ip>:8554/stream.

4

중지

"중지"를 선택하여 스트림을 종료하고 변환된 파일을 제거하세요.

배포에서 시뮬레이션 스트림을 사용하려면 카메라를 추가하듯 장치의 스트림 소스로 추가하세요. 참조: 스트림 추가.

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

모든 엔드포인트는 JSON을 반환합니다. 대화형 Swagger 문서는 다음에서 제공됩니다. http://<device-ip>:8080/docs. 참조: 서비스 모든 온디바이스 서비스 API에 공통으로 적용되는 규칙을 확인하세요.

일반적인 흐름

/stop 는 디스크 공간을 확보하기 위해 원본 파일과 변환된 파일을 모두 삭제하므로, 다음 /play.

업로드

오직 .mp4 가 허용되며, 업로드가 시작되기 전에 활성 스트림이 중지됩니다. 선택적 설정 부분은 트랜스코딩 중 적용되는 변환 설정의 JSON 문자열입니다. 변환된 파일에 포함되므로 나중에 변경하려면 다시 업로드해야 합니다.

Upload a video file

post

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.

Body
filestring · binaryRequired

Video file to upload. Must be .mp4.

settingsstringOptional

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.

Example: {"target_fps": 30, "crf_quality": 23, "max_width": 1920}
Responses
200

Upload and conversion succeeded

application/json
successbooleanRequired
messagestringRequired
post/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"
  }
}

스트리밍

Start streaming

post

Starts publishing the converted video to the RTSP server, looping until stopped. Uses the current stream settings.

Responses
200

Streaming started

application/json
successbooleanRequired
messagestringRequired
rtsp_urlstringRequired

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.

post/play
POST /play HTTP/1.1
Host: device-ip:8080
Accept: */*
{
  "success": true,
  "message": "Streaming started",
  "rtsp_url": "rtsp://localhost:8554/stream"
}

Stop streaming and delete video files

post

Stops the stream and deletes both the original and converted files to free disk space. Uploading again is required before the next /play.

Responses
200

Streaming stopped and files deleted

application/json
successbooleanRequired
messagestringRequired
post/stop
POST /stop HTTP/1.1
Host: device-ip:8080
Accept: */*
{
  "success": true,
  "message": "text"
}

/delete 는 스트림이 실행 중일 필요 없이 비디오 파일을 제거하며, 실행 중이라면 먼저 중지합니다.

Delete video files

post

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.

Responses
200

Files deleted

application/json
successbooleanRequired
messagestringRequired
post/delete
POST /delete HTTP/1.1
Host: device-ip:8080
Accept: */*
{
  "success": true,
  "message": "text"
}

상태

스트리밍 다음 경우 true입니다 components.mediamtx.healthy (스트리밍 서버) 및 components.ffmpeg_process.running (트랜스코드 및 게시 프로세스)가 모두 true일 때입니다. components.stream 항목은 이를 게이트하지 않습니다: components.stream.source_ready 는 시작 중 잠시 false일 수 있으며, 그동안 스트리밍 은 이미 true로 읽히는데, 이는 정상입니다. 분해 정보는 실패한 스트림의 원인을 가장 빠르게 찾는 방법입니다: 다음을 확인하세요 components 무엇이 비정상인지 확인하고, 아무것도 다시 시작하기 전에 살펴보세요.

Get streaming status

get

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.

Responses
200

Current status

application/json
streamingbooleanRequired
rtsp_urlstring · nullableOptional

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
GET /status HTTP/1.1
Host: device-ip:8080
Accept: */*
200

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 서비스가 실행 중인 제한을 보고하며, 여기에는 남은 디스크 공간과 최대 업로드 크기도 포함됩니다. 큰 파일을 업로드하기 전에 확인할 가치가 있습니다.

Get system information

get

Returns disk space, the upload size limit, accepted extensions, and the RTSP port.

Responses
200

System information

application/json
max_file_sizeintegerRequired

Maximum upload size in bytes, set by MAX_FILE_SIZE

max_file_size_gbnumberRequired
allowed_extensionsstring[]Required

Accepted file extensions. Only .mp4 today.

rtsp_portintegerRequired

Port the RTSP stream is served on, set by RTSP_PORT

get/info
GET /info HTTP/1.1
Host: device-ip:8080
Accept: */*
200

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, 현재 실행 중인 스트림에는 적용되지 않습니다.

Get stream settings

get

Returns the current playback settings.

Responses
200

Current settings

application/json

Playback settings, changeable between streaming sessions without re-uploading.

max_bitrate_kbpsinteger · min: 100 · max: 100000Optional

Maximum bitrate in kbps

Default: 5000
buffer_size_kbinteger · min: 100 · max: 50000Optional

Buffer size in KB

Default: 3000
max_delay_msinteger · min: 50 · max: 5000Optional

Maximum delay in milliseconds

Default: 500
get/stream-settings
GET /stream-settings HTTP/1.1
Host: device-ip:8080
Accept: */*
200

Current settings

{
  "max_bitrate_kbps": 5000,
  "buffer_size_kb": 3000,
  "max_delay_ms": 500
}

Update stream settings

post

Persists new playback settings. They apply to the next streaming session, not the one currently running.

Body

Playback settings, changeable between streaming sessions without re-uploading.

max_bitrate_kbpsinteger · min: 100 · max: 100000Optional

Maximum bitrate in kbps

Default: 5000
buffer_size_kbinteger · min: 100 · max: 50000Optional

Buffer size in KB

Default: 3000
max_delay_msinteger · min: 50 · max: 5000Optional

Maximum delay in milliseconds

Default: 500
Responses
200

Settings saved

application/json
successbooleanRequired
messagestringRequired
post/stream-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"
}

구성

환경 변수

장치의 구성 탭에서 서비스에 이 값을 설정하세요. 참조: 디바이스 구성 업데이트.

변수
기본값
설명

MAX_FILE_SIZE

5368709120

바이트 단위 최대 업로드 크기(5GB)

RTSP_PORT

8554

RTSP 서버 포트

WEB_PORT

8080

Web 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 구성 메뉴 또는 다음을 통해 스트리밍 세션 사이에 변경할 수 있습니다 /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

마지막 업데이트

도움이 되었나요?