Skip to content

Real-Time Messaging Protocol

리얼 타임 메시징 프로토콜(Real Time Messaging Protocol, 흔히 줄여서 RTMP)은 어도비 시스템즈사의 독점 컴퓨터 통신 규약이다. RTMP는 오디오, 비디오 및 기타 데이터를 인터넷을 통해 스트리밍할 때 쓰인다. RTMP는 어도비 플래시 플레이어와 서버 사이의 통신에 이용된다.

RTMP 종류는 다음과 같다.

  • RTMP (기본): 1935번 포트 사용, 암호화되지 않은 RTMP, 혹시나 1935번 포트로 시도해서 실패하면 443 포트(RTMPS)나 80 포트(RTMPT)로 재시도함.
  • RTMPT (RTMP Tunneled): RTMP 데이터를 HTTP로 감싼 것. 기본 포트는 80번. HTTP 헤더 때문에 RTMP보다는 크기가 큼.
  • RTMPS (RTMP Secure): RTMP 데이터를 HTTPS로 감싼 것. 플래시 재생기는 SSL 입출력을 지원하므로 그 기능을 사용함.
  • RTMPE (Encrypted RTMP): 128비트로 암호화된 RTMP. SSL보다는 가볍지만 SSL 인증같은게 없음. 암호화 채널을 사용하기 때문에 기본 RTMP보다 약간 성능에 영향을 줄 수 있음.
  • RTMPTE (Encrypted RTMP Tunneled): 80번 포트 사용. RTMPT, RTMPE 섞어 놓은 형태. 플래시 플레이어 9,0,115,0 필요. 서버 성능에 영향을 줌.
  • RTMFP (Real Time Media Flow Protocol): UDP에서 동작. 기본 RTMP는 TCP에서 동작. 항상 암호화 된 상태로 데이터를 전송.

처음 목표는 오직 플래시에만 쓰이는 것이었다. 그러나 현재는 플래시뿐 아니라 어도비 라이브사이클 데이터 서비시즈 ES와 같은 다른 응용 프로그램에서 RTMP이 쓰이고 있다. 그리고 RTMP 규격은 2009년 1월 20일에 어도비에서 발표했다.

Projects

스트리밍 테스트

docker run --rm -it -p 1935:1935 --name nginx-rtmp tiangolo/nginx-rtmp

스트리밍할 소스는 OBS로 전송한다

  1. Open OBS Studio
  2. Click the "Settings" button
  3. Go to the "Stream" section
  4. In "Stream Type" select "Custom Streaming Server"
  5. In the "URL" enter the rtmp://<ip_of_host>/live replacing <ip_of_host> with the IP of the host in which the container is running. For example: rtmp://192.168.0.30/live
  6. In the "Stream key" use a "key" that will be used later in the client URL to display that specific stream. For example: test
  7. Click the "OK" button
  8. In the section "Sources" click de "Add" button (+) and select a source (for example "Screen Capture") and configure it as you need
  9. Click the "Start Streaming" button

영상을 받는 플레이어를 (e.g. vlc) 실행한다:

  1. Open a VLC player (it also works in Raspberry Pi using omxplayer)
  2. Click in the "Media" menu
  3. Click in "Open Network Stream"
  4. Enter the URL from above as rtmp://<ip_of_host>/live/<key> replacing <ip_of_host> with the IP of the host in which the container is running and <key> with the key you created in OBS Studio. For example: rtmp://192.168.0.30/live/test
  5. Click "Play"
  6. Now VLC should start playing whatever you are transmitting from OBS Studio

See also

Favorite site