{"id":18750601,"url":"https://github.com/invis1ble/media-intelligence","last_synced_at":"2025-04-12T23:32:18.806Z","repository":{"id":108444278,"uuid":"609597148","full_name":"Invis1ble/media-intelligence","owner":"Invis1ble","description":"A library for processing and analyzing media content, providing tools for audio, video and text analysis.","archived":false,"fork":false,"pushed_at":"2023-03-12T22:45:10.000Z","size":79,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T18:05:20.535Z","etag":null,"topics":["analysis","audio","audio-processing","davinci","gpt","intelligence","media","openai","speech-to-text","text","text-processing","video","video-processing","whisper-ai","youtube"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Invis1ble.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-03-04T16:56:07.000Z","updated_at":"2023-09-08T18:41:37.000Z","dependencies_parsed_at":"2023-03-28T00:21:25.209Z","dependency_job_id":null,"html_url":"https://github.com/Invis1ble/media-intelligence","commit_stats":{"total_commits":26,"total_committers":1,"mean_commits":26.0,"dds":0.0,"last_synced_commit":"fa3982b483d993346fbd640686cb09d4c2363e07"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Invis1ble%2Fmedia-intelligence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Invis1ble%2Fmedia-intelligence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Invis1ble%2Fmedia-intelligence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Invis1ble%2Fmedia-intelligence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Invis1ble","download_url":"https://codeload.github.com/Invis1ble/media-intelligence/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647257,"owners_count":21139081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analysis","audio","audio-processing","davinci","gpt","intelligence","media","openai","speech-to-text","text","text-processing","video","video-processing","whisper-ai","youtube"],"created_at":"2024-11-07T17:12:35.251Z","updated_at":"2025-04-12T23:32:14.445Z","avatar_url":"https://github.com/Invis1ble.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Media Intelligence\n==================\n\nThis repository contains PSR-compatible code for media analysis and processing.\n\n\nDependencies\n------------\n\nIn order to use this package you need to install the following utilities:\n\n- [yt-dlp](https://github.com/yt-dlp/yt-dlp) is a command-line program to download videos from YouTube.com and a few more sites.\n- [ffmpeg](https://www.ffmpeg.org/) required by `yt-dlp` for post-processing tasks.\n\n\nInstallation\n------------\n\nTo install this package, you can use Composer:\n\n```bash\ncomposer require invis1ble/media-intelligence\n```\n\nor just add it as a dependency in your `composer.json` file:\n\n```json\n\n{\n    \"require\": {\n        \"invis1ble/media-intelligence\": \"^2.0\"\n    }\n}\n```\n\nAfter adding the above line, run the following command to install the package:\n\n```bash\ncomposer install\n```\n\n\nUsage\n-----\n\nTo use most of the tools you need to set [OpenAI API Key](https://platform.openai.com/account/api-keys)\n\n```php\n\u003c?php // ./public/index.php\n\ndeclare(strict_types=1);\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse Invis1ble\\MediaIntelligence\\VideoToFacts\\Application;\n\n// Set here your own OpenAI API Key.\n// Visit https://platform.openai.com/account/api-keys for more details.\n$openAiApiKey = '';\n$audioTargetDirectoryPath = sys_get_temp_dir();\n\n$application = new Application(\n    apiKey: $openAiApiKey,\n    audioTargetDirectory: new SplFileInfo($audioTargetDirectoryPath),\n);\n\n$facts = $application-\u003erun('https://www.youtube.com/watch?v=JdMw9lQTNnc');\n/** @var iterable\u003cstring\u003e $facts List of the extracted facts */\n\nforeach ($facts as $fact) {\n    echo \"- $fact\\n\";\n}\n\n```\n\n\n### Logging setup\n\nTo set up logging, you need to set a PSR-3-compatible logger for the services that you want to log.\n[Monolog](https://github.com/Seldaek/monolog) is recommended as implementation.\n\n```php\n\n// ...\n\nuse Monolog\\Handler\\StreamHandler;\nuse Monolog\\Level;\nuse Monolog\\Logger;\n\n// ...\n\n$logger = new Logger(\n    name: 'video_to_facts_logger',\n    handlers: [\n        // write all staff to the file\n        new StreamHandler(__DIR__ . '/../logs/video_to_facts.log', Level::Debug),\n        // write info and higher to console\n        new StreamHandler(STDOUT, Level::Info),\n    ],\n);\n\n$application = new Application(\n    apiKey: $openAiApiKey,\n    audioTargetDirectory: new SplFileInfo($audioTargetDirectoryPath),\n    debug: true,\n);\n\n$application-\u003esetLogger($logger);\n\n$facts = $application-\u003erun('https://www.youtube.com/watch?v=JdMw9lQTNnc');\n/** @var iterable\u003cstring\u003e $facts List of the extracted facts */\n\n```\n\nOutput of the above code:\n\n![VideoToFacts Application output](https://user-images.githubusercontent.com/1710944/224415770-a28c6822-f55b-49d7-a5f6-3c95e79c583f.png)\n\n\n### Translation\n\nYou can translate the facts to many languages, just pass the language name to the FactsExtractor through application:\n\n```php\n$application-\u003erun('https://www.youtube.com/watch?v=1sRLDDIRL4U', 'Ukrainian');\n```\n\n\nKnown issues and limitations\n----------------------------\n- At the moment, we are forced to split long videos into shorter segments due to OpenAI API limitations, which reduces\nthe efficiency and accuracy of content analysis. If you have any suggestions on how to solve this problem,\nplease do not hesitate to write about it in the Issues, and I will gladly consider your idea.\n\nStay tuned!\n\n\nLicense\n-------\n\n[The MIT License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvis1ble%2Fmedia-intelligence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finvis1ble%2Fmedia-intelligence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvis1ble%2Fmedia-intelligence/lists"}