RTSP, RTMP, SRT 프로토콜에 대해 VLC를 기본 재생 프로그램으로 설정합니다.
아래 파일을 다운로드 받고 PowerShell을 관리자 권한으로 연 후에,
저장된 디렉터리에서 ./setVLC 를 입력해서 실행하면 됩니다.
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"으로 변경

