obs rtsp 推流
原生obs不支持rtsp直接推流,需要使用插件,但mac无法正常显示插件ui,有库路径问题,需要运行修复脚本
issue 地址: https://github.com/iamscottxu/obs-rtspserver/issues/185
#!/bin/bash
# Exit on error
set -e
echo "Starting OBS RTSP Server plugin installation fix..."
# Check if running as root
if [ "$EUID" -eq 0 ]; then 
    echo "Please do not run this script as root"
    exit 1
fi
# Define paths
PLUGIN_DIR="$HOME/Library/Application Support/obs-studio/plugins"
RTSP_PLUGIN_DIR="$PLUGIN_DIR/obs-rtspserver.plugin"
DOWNLOAD_DIR="$HOME/Downloads"
ZIP_NAME="obs-rtspserver-v3.1.0-macos-arm64.zip"
UNZIPPED_DIR="$DOWNLOAD_DIR/obs-rtspserver-unzipped"
# Check if OBS is running
if pgrep -x "obs" > /dev/null; then
    echo "Please quit OBS before running this script"
    exit 1
fi
# Check if the zip exists
if [ ! -f "$DOWNLOAD_DIR/$ZIP_NAME" ]; then
    echo "Error: $ZIP_NAME not found in Downloads folder"
    echo "Please download the plugin from: https://github.com/iamscottxu/obs-rtspserver/releases"
    exit 1
fi
# Create necessary directories
echo "Creating plugin directory structure..."
mkdir -p "$RTSP_PLUGIN_DIR/Contents/MacOS"
mkdir -p "$RTSP_PLUGIN_DIR/Contents/Resources"
# Unzip the package
echo "Unzipping package..."
unzip "$DOWNLOAD_DIR/$ZIP_NAME" -d "$UNZIPPED_DIR"
# Copy files from expanded package
echo "Copying plugin files..."
cp "$UNZIPPED_DIR/obs-rtspserver/bin/obs-rtspserver.so" "$RTSP_PLUGIN_DIR/Contents/MacOS/obs-rtspserver"
cp -r "$UNZIPPED_DIR/obs-rtspserver/data/" "$RTSP_PLUGIN_DIR/Contents/Resources/"
# Create Info.plist
echo "Creating Info.plist..."
cat > "$RTSP_PLUGIN_DIR/Contents/Info.plist" << 'EOL'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleName</key>
    <string>obs-rtspserver</string>
    <key>CFBundleIdentifier</key>
    <string>com.iamscottxu.obs-rtspserver</string>
    <key>CFBundleVersion</key>
    <string>3.1.0</string>
    <key>CFBundleShortVersionString</key>
    <string>3.1.0</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleExecutable</key>
    <string>obs-rtspserver</string>
    <key>CFBundlePackageType</key>
    <string>BNDL</string>
    <key>CFBundleSupportedPlatforms</key>
    <array>
        <string>MacOSX</string>
    </array>
    <key>LSMinimumSystemVersion</key>
    <string>10.13</string>
</dict>
</plist>
EOL
# Update library paths
echo "Updating library paths..."
install_name_tool -change "UI/obs-frontend-api/obs-frontend-api.dylib" "@rpath/obs-frontend-api.dylib" \
    -change "libobs/libobs.framework/Versions/A/libobs" "@rpath/libobs.framework/Versions/A/libobs" \
    "$RTSP_PLUGIN_DIR/Contents/MacOS/obs-rtspserver"
# Sign the plugin
echo "Signing plugin..."
codesign --force --deep --sign - "$RTSP_PLUGIN_DIR"
# Clean up
echo "Cleaning up..."
rm -rf "$UNZIPPED_DIR"
echo "Installation complete!"
echo "Please start OBS and check if the RTSP server plugin appears in the Tools menu." 
    转载请标明,谢谢
 
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号