Windows

스트리밍 프로토콜 기본 프로그램을 VLC로 설정하기

yg1ee 2026. 7. 24. 19:56

RTSP, RTMP, SRT 프로토콜에 대해 VLC를 기본 재생 프로그램으로 설정합니다.

 

아래 파일을 다운로드 받고 PowerShell을 관리자 권한으로 연 후에,

저장된 디렉터리에서 ./setVLC 를 입력해서 실행하면 됩니다.

setVLC.ps1
0.00MB

 

VLC 64비트, 32비트 순으로 프로그램 유무를 파악해서
있는 경우 기본 프로그램으로 설정한 후 성공을 알리는 문자열이 뜨고,
없는 경우에는 오류 문자열이 뜹니다.

 

아래는 스크립트의 내용입니다.

# setVLC.ps1
$setStreamingProgram = {
  param($vlc, $arch)
  
  # RTSP
  New-Item -Path 'Registry::HKEY_CLASSES_ROOT\rtsp' -Force | Out-Null
  Set-Item -Path 'Registry::HKEY_CLASSES_ROOT\rtsp' -Value 'URL:RTSP Protocol'
  New-ItemProperty `
    -Path 'Registry::HKEY_CLASSES_ROOT\rtsp' `
    -Name 'URL Protocol' `
    -Value '' `
    -PropertyType String `
    -Force | Out-Null

  New-Item -Path 'Registry::HKEY_CLASSES_ROOT\rtsp\shell\open\command' -Force | Out-Null
  Set-Item `
    -Path 'Registry::HKEY_CLASSES_ROOT\rtsp\shell\open\command' `
    -Value "`"$vlc`" `"%1`""

  # RTMP
  New-Item -Path 'Registry::HKEY_CLASSES_ROOT\rtmp' -Force | Out-Null
  Set-Item -Path 'Registry::HKEY_CLASSES_ROOT\rtmp' -Value 'URL:RTMP Protocol'
  New-ItemProperty `
    -Path 'Registry::HKEY_CLASSES_ROOT\rtmp' `
    -Name 'URL Protocol' `
    -Value '' `
    -PropertyType String `
    -Force | Out-Null

  New-Item -Path 'Registry::HKEY_CLASSES_ROOT\rtmp\shell\open\command' -Force | Out-Null
  Set-Item `
    -Path 'Registry::HKEY_CLASSES_ROOT\rtmp\shell\open\command' `
    -Value "`"$vlc`" `"%1`""

  # SRT
  New-Item -Path 'Registry::HKEY_CLASSES_ROOT\srt' -Force | Out-Null
  Set-Item -Path 'Registry::HKEY_CLASSES_ROOT\srt' -Value 'URL:SRT Protocol'
  New-ItemProperty `
    -Path 'Registry::HKEY_CLASSES_ROOT\srt' `
    -Name 'URL Protocol' `
    -Value '' `
    -PropertyType String `
    -Force | Out-Null

  New-Item -Path 'Registry::HKEY_CLASSES_ROOT\srt\shell\open\command' -Force | Out-Null
  Set-Item `
    -Path 'Registry::HKEY_CLASSES_ROOT\srt\shell\open\command' `
    -Value "`"$vlc`" `"%1`""
  
  Write-Host "VLC ${arch}비트가 RTSP, RTMP, SRT 프로토콜의 기본 스트리밍 프로그램으로 설정되었습니다." -ForegroundColor Cyan
  Write-Host
}

$vlc64 = 'C:\Program Files\VideoLAN\VLC\vlc.exe'
$vlc86 = 'C:\Program Files (x86)\VideoLAN\VLC\vlc.exe'

if (Test-Path $vlc64) {
  & $setStreamingProgram $vlc64 64
}
elseif (Test-Path $vlc86) {
  & $setStreamingProgram $vlc86 32
}
else {
  Write-Host "VLC 프로그램을 찾지 못했습니다." -ForegroundColor Red
}

 

 

 

혹시나 아래처럼 한글이 다 깨져서 "이거 뭐냐" 하시는 분들은

아래 중 택1하시면 해결됩니다.

1. 윈도우에서 공식 배포하는 PowerShell 신버전을 설치하기

2. Notepad++ 등의 프로그램으로 스크립트 파일의 인코딩을 "UTF-8 BOM"으로 변경

 

구버전의 PowerShell에서, UTF-8에 한글이 들어간 걸 용납하지 못하는 모습

 

PowerShell 7.6에서는 대인배답게 UTF-8에 한글이 들어가있어도 잘 나옴