--
-- Host: localhost    Database: aVideo_Encoder
-- ------------------------------------------------------


--
-- Table structure for table `configurations_encoder`
--

CREATE TABLE `configurations_encoder` (
  `id` int NOT NULL,
  `allowedStreamersURL` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
  `defaultPriority` int DEFAULT NULL,
  `created` datetime DEFAULT NULL,
  `modified` datetime DEFAULT NULL,
  `version` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `autodelete` tinyint(1) DEFAULT '1',
  `resolutions` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `configurations_encoder`
--

INSERT INTO `configurations_encoder` VALUES (1,'https://webtv.aes.ml/',1,'2024-08-21 16:44:03','2024-08-21 16:44:03','5.0',1,NULL);

--
-- Table structure for table `encoder_queue`
--

CREATE TABLE `encoder_queue` (
  `id` int NOT NULL AUTO_INCREMENT,
  `fileURI` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `filename` varchar(400) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `status` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `status_obs` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `return_vars` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `worker_pid` int DEFAULT NULL,
  `worker_ppid` int DEFAULT NULL,
  `priority` int DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `videoDownloadedLink` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `downloadedFileName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `streamers_id` int NOT NULL,
  `override_status` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `formats_id` int NOT NULL,
  `created` datetime DEFAULT NULL,
  `modified` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_encoder_queue_formats_idx` (`formats_id`),
  KEY `fk_encoder_queue_streamers1_idx` (`streamers_id`),
  CONSTRAINT `fk_encoder_queue_formats` FOREIGN KEY (`formats_id`) REFERENCES `formats` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_encoder_queue_streamers1` FOREIGN KEY (`streamers_id`) REFERENCES `streamers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=439 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `encoder_queue`
--


--
-- Table structure for table `formats`
--

CREATE TABLE `formats` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `code` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `created` datetime DEFAULT NULL,
  `modified` datetime DEFAULT NULL,
  `extension` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `extension_from` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
  `order` smallint unsigned DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `formats`
--

INSERT INTO `formats` VALUES (1,'MP4 Low','ffmpeg -i {$pathFileName} -vf scale=-2:360 -movflags +faststart -preset veryfast -vcodec h264 -acodec aac  -max_muxing_queue_size 1024 -y {$destinationFile}','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',10),(2,'WEBM Low','ffmpeg -i {$pathFileName} -vf scale=-2:360 -movflags +faststart -preset veryfast -f webm -c:v libvpx -b:v 1M -acodec libvorbis -y {$destinationFile}','2024-08-21 16:44:02','2024-08-21 16:44:02','webm','mp4',20),(3,'MP3','ffmpeg -i {$pathFileName} -acodec libmp3lame -y {$destinationFile}','2024-08-21 16:44:02','2024-08-21 16:44:02','mp3','mp3',30),(4,'OGG','ffmpeg -i {$pathFileName} -acodec libvorbis -y {$destinationFile}','2024-08-21 16:44:02','2024-08-21 16:44:02','ogg','mp3',40),(5,'MP3 to Spectrum.MP4','ffmpeg -i {$pathFileName} -filter_complex \'[0:a]showwaves=s=1280x720:mode=line,format=yuv420p[v]\' -map \'[v]\' -map 0:a -c:v libx264 -c:a copy {$destinationFile}','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp3',50),(6,'Video.MP4 to Audio.MP3','ffmpeg -i {$pathFileName} -y {$destinationFile}','2024-08-21 16:44:02','2024-08-21 16:44:02','mp3','mp4',60),(7,'MP4 SD','ffmpeg -i {$pathFileName} -vf scale=-2:540 -movflags +faststart -preset veryfast -vcodec h264 -acodec aac  -max_muxing_queue_size 1024 -y {$destinationFile}','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',11),(8,'MP4 HD','ffmpeg -i {$pathFileName} -vf scale=-2:720 -movflags +faststart -preset veryfast -vcodec h264 -acodec aac  -max_muxing_queue_size 1024 -y {$destinationFile}','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',12),(9,'WEBM SD','ffmpeg -i {$pathFileName} -vf scale=-2:540 -movflags +faststart -preset veryfast -f webm -c:v libvpx -b:v 1M -acodec libvorbis -y {$destinationFile}','2024-08-21 16:44:02','2024-08-21 16:44:02','webm','mp4',21),(10,'WEBM HD','ffmpeg -i {$pathFileName} -vf scale=-2:720 -movflags +faststart -preset veryfast -f webm -c:v libvpx -b:v 1M -acodec libvorbis -y {$destinationFile}','2024-08-21 16:44:02','2024-08-21 16:44:02','webm','mp4',22),(11,'Video to Spectrum','60-50-10','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',70),(12,'Video to Audio','60-40','2024-08-21 16:44:02','2024-08-21 16:44:02','mp3','mp4',71),(13,'Both Video','10-20','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',72),(14,'Both Audio','30-40','2024-08-21 16:44:02','2024-08-21 16:44:02','mp3','mp3',73),(15,'MP4 Low','10','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',74),(16,'MP4 SD','11','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',75),(17,'MP4 HD','12','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',76),(18,'MP4 Low SD','10-11','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',77),(19,'MP4 SD HD','11-12','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',78),(20,'MP4 Low HD','10 12','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',79),(21,'MP4 Low SD HD','10-11-12','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',80),(22,'Both Low','10-20','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',81),(23,'Both SD','11-21','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',82),(24,'Both HD','12-22','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',83),(25,'Both Low SD','10-11-20-21','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',84),(26,'Both SD HD','11-12-21-22','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',85),(27,'Both Low HD','10-12-20-22','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',86),(28,'Both Low SD HD','10-11-12-20-21-22','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','mp4',87),(29,'Multi Bitrate HLS VOD encrypted','ffmpeg -re -i {$pathFileName} -c:a aac  -b:a 128k -c:v libx264 -vf scale=-2:360 -g 48 -keyint_min 48  -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 800k -maxrate 856k -bufsize 1200k -f hls -hls_time 6 -hls_list_size 0 -hls_key_info_file {$destinationFile}keyinfo {$destinationFile}low/index.m3u8 -c:a aac  -b:a 128k -c:v libx264 -vf scale=-2:540 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 1400k -maxrate 1498k -bufsize 2100k -f hls -hls_time 6 -hls_list_size 0 -hls_key_info_file {$destinationFile}keyinfo {$destinationFile}sd/index.m3u8 -c:a aac  -b:a 128k -c:v libx264 -vf scale=-2:720 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -b:v 2800k -maxrate 2996k -bufsize 4200k -f hls -hls_time 6 -hls_list_size 0 -hls_key_info_file {$destinationFile}keyinfo {$destinationFile}hd/index.m3u8','2024-08-21 16:44:02','2024-08-21 16:44:02','mp4','m3u8',9),(30,'Dynamic HLS','-c:v h264 -vf scale=-2:{$resolution} -r 24 -g 48 -keyint_min 48 -sc_threshold 0 -bf 3 -b_strategy 2 -minrate {$minrate}k -crf 23 -maxrate {$maxrate}k -bufsize {$bufsize}k -c:a aac -b:a {$autioBitrate}k -f hls -hls_time 6 -hls_list_size 0 -hls_key_info_file {$destinationFile}keyinfo {$destinationFile}res{$resolution}/index.m3u8','2024-08-21 16:44:03','2024-08-21 16:44:03','m3u8','mp4',6),(31,'Dynamic MP4','-vf scale=-2:{$resolution} -movflags +faststart -preset veryfast -vcodec h264 -acodec aac  -b:a {$autioBitrate}k  -max_muxing_queue_size 1024 -y {$destinationFile}','2024-08-21 16:44:03','2024-08-21 16:44:03','mp4','mp4',7),(32,'Dynamic WEBM','-vf scale=-2:{$resolution} -movflags +faststart -preset veryfast -f webm -c:v libvpx -b:v 1M -acodec libvorbis -b:a {$autioBitrate}k  -y {$destinationFile}','2024-08-21 16:44:03','2024-08-21 16:44:03','webm','mp4',8),(33,'Audio to HLS','','2024-08-21 16:44:03','2024-08-21 16:44:03','m3u8','mp3',88),(34,'Audio to MP4','','2024-08-21 16:44:03','2024-08-21 16:44:03','mp4','mp3',89),(35,'Audio to WEBM','','2024-08-21 16:44:03','2024-08-21 16:44:03','webm','mp3',90);

--
-- Table structure for table `upload_queue`
--

CREATE TABLE `upload_queue` (
  `id` int NOT NULL AUTO_INCREMENT,
  `encoders_id` int NOT NULL,
  `resolution` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `format` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  `videos_id` int NOT NULL,
  `status` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_upload_queue_encoders_idx` (`encoders_id`),
  CONSTRAINT `fk_upload_queue_encoders` FOREIGN KEY (`encoders_id`) REFERENCES `encoder_queue` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

--
-- Dumping data for table `upload_queue`
--



