재배포 URL 사용

콘솔에서 공유 링크를 만들면 링크 토큰(sl_…)이 들어간 재배포 URL 이 나옵니다. 링크에서 허용한 프로토콜의 URL 만 보이며, “플레이어 전용” 링크는 웹 플레이어·임베드 URL 만 제공합니다. 아래 예시의 <slug>·<code>·sl_… 는 콘솔에 표시된 값으로 바꿉니다.

웹 플레이어·임베드

웹 플레이어
https://castline.dotoritos.net/watch/sl_…
임베드 (링크에서 임베드 허용 필요)
<iframe src="https://castline.dotoritos.net/embed/sl_…?autoplay=1&muted=1" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>

임베드는 링크에서 임베드 허용을 켜야 하고, 허용 출처(예: https://www.example.com)를 적으면 그 사이트에서만 재생됩니다. 자동 재생은 브라우저 정책상 음소거(muted=1)일 때만 됩니다.

직접 재생 URL

HLS
https://hls.castline.dotoritos.net/c/<slug>/<code>/index.m3u8?token=sl_…
WebRTC (WHEP)
https://rtc.castline.dotoritos.net/c/<slug>/<code>/whep?token=sl_…
RTSP (TCP 전송만 지원)
rtsp://castline.dotoritos.net:8554/c/<slug>/<code>?token=sl_…
RTMP
rtmp://castline.dotoritos.net:1935/c/<slug>/<code>?token=sl_…
SRT (CastLine 간편 문법)
srt://castline.dotoritos.net:8890?streamid=read:c/<slug>/<code>:castline:sl_…&pkt_size=1316

VLC·ffplay

RTSP 는 TCP 전송만 지원합니다. VLC 는 설정 → 입력/코덱 → “RTP over RTSP (TCP)” 를 켜거나 아래처럼 실행합니다.

VLC (RTSP over TCP)
vlc --rtsp-tcp "rtsp://castline.dotoritos.net:8554/c/<slug>/<code>?token=sl_…"
ffplay (RTSP)
ffplay -rtsp_transport tcp "rtsp://castline.dotoritos.net:8554/c/<slug>/<code>?token=sl_…"
ffplay (SRT)
ffplay "srt://castline.dotoritos.net:8890?streamid=read:c/<slug>/<code>:castline:sl_…&pkt_size=1316"

SRT 주소의 %23 인코딩

SRT 표준 문법의 streamid 는 #!:: 로 시작합니다. URL 에서 # 는 “fragment 시작” 기호라서 그대로 쓰면 그 뒤가 잘려 전달되지 않습니다. 그래서 URL 에 넣을 때는 반드시 # 를 %23 으로 바꿉니다(ffmpeg libsrt 는 streamid 를 URL 디코딩합니다).

SRT (표준 streamid 문법, # 을 %23 으로 인코딩)
srt://castline.dotoritos.net:8890?streamid=%23!::m=request,r=c/<slug>/<code>,u=castline,s=sl_…&pkt_size=1316

장비나 프로그램에 Stream ID 입력칸이 따로 있으면 그 칸에는 인코딩하지 않은 원래 값을 넣습니다.

장비의 "Stream ID" 칸에 따로 넣을 때 (인코딩하지 않음)
#!::m=request,r=c/<slug>/<code>,u=castline,s=sl_…

CastLine 간편 문법(read:c/<slug>/<code>:castline:sl_…)은 # 가 없어 인코딩이 필요 없습니다.

hls.js 로 내 웹페이지에 넣기

임베드(iframe) 대신 직접 플레이어를 만들 때의 최소 예시입니다. 토큰은 URL 쿼리 또는 Authorization: Bearer 헤더로 보냅니다.

hls.js 로 내 웹페이지에서 재생
<video id="player" controls muted autoplay playsinline></video>
<script src="https://cdn.jsdelivr.net/npm/hls.js@1"></script>
<script>
  const src = 'https://hls.castline.dotoritos.net/c/<slug>/<code>/index.m3u8';
  const token = 'sl_…';
  const video = document.getElementById('player');
  if (window.Hls && Hls.isSupported()) {
    // 토큰을 URL 대신 Authorization 헤더로 보낸다
    const hls = new Hls({
      xhrSetup: (xhr) => xhr.setRequestHeader('Authorization', 'Bearer ' + token),
    });
    hls.loadSource(src);
    hls.attachMedia(video);
  } else if (video.canPlayType('application/vnd.apple.mpegurl')) {
    video.src = src + '?token=' + token; // Safari 기본 HLS
  }
</script>

코덱 호환 표

CastLine 은 영상을 다시 인코딩하지 않고(remux) 그대로 전달합니다. 그래서 출력이 받지 못하는 코덱의 트랙은 빠집니다(재생은 되지만 소리나 화면이 없음). 콘솔 스트림 상세에서 출력별 호환 여부를 확인할 수 있습니다.

출력영상음성CCTV 에서 흔한 문제
HLSH264, H265, AV1, VP9AAC, Opus, FLACG.711(PCMA/PCMU) 음성은 빠짐
WebRTCH264, VP8, VP9, AV1 (H265 는 브라우저에 따라 다름)Opus, G722, G711RTMP·OBS 의 AAC 음성은 빠짐
RTSP / SRT대부분 그대로대부분 그대로—
RTMP (재배포·외부 송출)H264 (Enhanced RTMP: H265, AV1, VP9)AAC, MP3 (Enhanced RTMP: Opus 등)G.711 음성 불가
YouTube 외부 송출H264 (또는 H265·AV1) 필수AAC 필수음성 없음·G.711 카메라는 YouTube 가 거부
  • 웹 플레이어는 코덱을 보고 WebRTC 와 HLS 중 맞는 쪽을 먼저 시도하고, 3초 안에 재생되지 않으면 다른 쪽으로 바꿉니다.
  • G.711 음성 카메라는 웹 플레이어에서 WebRTC 로, AAC 음성(OBS·RTMP)은 HLS 로 재생됩니다.
  • 음성 변환(G.711 → AAC)은 아직 지원하지 않습니다. 필요하면 현장 중계기에서 ffmpeg 로 -c:a aac 변환 후 보내세요.