6c56306873
Full-featured video conversion platform with: - FFmpeg-based pipeline system with composable stages (transcode, scale, filter, audio, bitrate, framerate, trim, deinterlace, denoise, stabilize) - Live stream management with real-time format switching (RTMP/RTSP/HTTP) - Industrial/nuclear power plant control room themed UI with gauges, switches, LED indicators - Format switchboard for instant conversion between 16+ video/audio formats - Pipeline designer with visual flow editor and drag-and-drop stage composition - Job queue with priority scheduling and batch conversion - WebSocket server for real-time progress broadcasting - REST API for all operations (upload, convert, streams, pipelines, queue) - System monitoring (CPU, memory, disk) with animated gauge displays - Docker Compose setup with web, websocket, and worker services https://claude.ai/code/session_01WxmHGnVFXGm2bwbFREHkHb
42 lines
968 B
PHP
42 lines
968 B
PHP
#!/usr/bin/env php
|
|
<?php
|
|
|
|
/**
|
|
* Video Converter Suite - WebSocket Server
|
|
*
|
|
* Provides real-time status updates to connected clients.
|
|
* Usage: php bin/websocket-server.php
|
|
*/
|
|
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use Ratchet\Server\IoServer;
|
|
use Ratchet\Http\HttpServer;
|
|
use Ratchet\WebSocket\WsServer;
|
|
use VideoConverter\WebSocket\StatusServer;
|
|
|
|
$config = require __DIR__ . '/../config/app.php';
|
|
$host = $config['websocket']['host'];
|
|
$port = $config['websocket']['port'];
|
|
|
|
echo "=== Video Converter Suite - WebSocket Server ===\n";
|
|
echo "Starting on {$host}:{$port}\n\n";
|
|
|
|
$statusServer = new StatusServer();
|
|
|
|
$server = IoServer::factory(
|
|
new HttpServer(
|
|
new WsServer($statusServer)
|
|
),
|
|
$port,
|
|
$host
|
|
);
|
|
|
|
// Broadcast status every 2 seconds
|
|
$server->loop->addPeriodicTimer(2, function () use ($statusServer) {
|
|
$statusServer->broadcastStatus();
|
|
});
|
|
|
|
echo "WebSocket server running. Press Ctrl+C to stop.\n";
|
|
$server->run();
|