#!/bin/bash

# 简单的PySceneDetect安装脚本

echo "🎬 安装PySceneDetect..."

# 安装PySceneDetect
pip install scenedetect[opencv]

if [ $? -eq 0 ]; then
    echo "✅ PySceneDetect安装成功！"
    
    # 验证安装
    echo "🧪 验证安装..."
    python -c "import scenedetect; print(f'PySceneDetect版本: {scenedetect.__version__}')"
    
    if [ $? -eq 0 ]; then
        echo "✅ PySceneDetect验证成功！"
        echo ""
        echo "🚀 现在可以使用改进的场景检测功能了："
        echo "- 重新导入视频将使用PySceneDetect进行更准确的分镜"
        echo "- 如果PySceneDetect不可用，系统会自动回退到OpenCV方法"
    else
        echo "❌ PySceneDetect验证失败"
        exit 1
    fi
else
    echo "❌ PySceneDetect安装失败"
    exit 1
fi
