Skip to content

Technical Plugin AI

Daniel Neto edited this page Oct 29, 2026 · 1 revision

Technical: AI plugin

Submits metadata, transcription, translation, dubbing and shorts work to the AVideo AI service.

Audience: developers, advanced administrators and AI-assisted diagnosis. Plugin catalog.

Source baseline

  • Review date: 2026-10-29. Method: static source analysis; runtime/provider behavior was not exercised.
  • Code ownership: AVideo Streamer repository.
  • Reported version: 6.1.
  • Source revision: 7d48f2dfc0289236718a3f9fba7c5ffecff4a37f.
  • Entry class file: AI.php.

Confirm the installed plugin version independently of the Streamer version. Configuration defaults below are not a dump of this installation's saved settings.

Behavior and operational checks

Submission and completion are asynchronous. Trace the requested action, callback/result records, optional wallet charge and produced media/metadata independently. A browser request completing does not prove that the AI job finished. Subtitle playback also depends on the subtitle/player integration.

Dependencies

Plugin Required by declaration Source reason
YPTWallet Optional Charges AI usage to the user wallet balance
VideoHLS Optional Optional dubbing/HLS track integration
SubtitleSwitcher Optional Optional subtitle track integration for transcriptions
Bookmark Optional Optional bookmark integration for AI Shorts

Literal runtime plugin references: API, Scheduler, VideoHLS, YPTWallet. These calls do not mean every referenced plugin is mandatory.

Hook integration

Override Implementation
getTags() AI.php:134
getPluginMenu() AI.php:667
getVideosManagerListButton() AI.php:673
getFooterCode() AI.php:743
executeEveryMinute() AI.php:1205
afterNewVideo($videos_id) AI.php:1225
getPermissionsOptions() AI.php:1240

Configuration assignments

These are direct assignments inside getEmptyDataObject(), not evaluated effective defaults. Stored plugins.object_data, globals, structured values and conditional branches may alter runtime behavior. Private/default credential values are omitted.

Field Literal default or expression type Literal source label/help Evidence
AccessToken Private setting; value omitted — source
priceForBasic 0 Price for Basic Service: Enter the charge amount for AI processing. Insufficient wallet balance will prevent processing. Successful charges apply to both your and the admin's CDN wallet on the marketplace. source
priceForTranscription 0 Price for Transcription Service: Enter the charge amount for AI processing. Insufficient wallet balance will prevent processing. Successful charges apply to both your and the admin's CDN wallet on the marketplace. source
priceForTranslation 0 Price for Translation Service: Enter the charge amount for AI processing. Insufficient wallet balance will prevent processing. Successful charges apply to both your and the admin's CDN wallet on the marketplace. source
priceForShorts 0 Price for Shorts Service: Enter the charge amount for AI processing. Insufficient wallet balance will prevent processing. Successful charges apply to both your and the admin's CDN wallet on the marketplace. source
priceForDubbing 0 Price per second for Dubbing Service: Enter the charge amount for AI processing. Insufficient wallet balance will prevent processing. Successful charges apply to both your and the admin's CDN wallet on the marketplace. source
autoProcessAll false Auto Process All: This will create the transcription + basic + shorts automatically for all new videos source
showOnlyVideoChat false Show only Video Chat: Show only the Video Chat button in My videos, hiding the full AI-Powered button. source
CompanionApiToken Private setting; value omitted Companion API Token (auto-generated): Obtained automatically the first time this site connects to Companion. Do not edit manually - clear it to force a fresh reconnect. source
CompanionOrganizationId "" Companion Organization ID (auto-generated): Set automatically once connected. Do not edit manually. source
CompanionSiteId "" Companion Site ID (auto-generated): Set automatically once connected. Do not edit manually. source
companionChatAccessMode Computed/structured; inspect source Who can use the video Chat: Choose who can automatically see the AI chat widget on a video's watch page. source

Files and request surface

This inventory distinguishes implementation files from an API specification. Includes, templates, callbacks and CLI workers are not interchangeable HTTP endpoints. Request-field names below are direct source references, not a complete schema or permission declaration.

File Source role Direct request fields observed
AI.php plugin entry class lang, langName, language, token
Objects/Ai_metatags_responses.php class/helper implementation —
Objects/Ai_responses.php class/helper implementation —
Objects/Ai_responses_json.php class/helper implementation —
Objects/Ai_scheduler.php class/helper implementation —
Objects/Ai_transcribe_responses.php class/helper implementation —
View/Ai_metatags_responses/add.json.php JSON entry point; inspect caller and guard ai_responses_id, casualDescription, completion_tokens, id, keywords, metaDescription, price_completion_tokens, price_prompt_tokens, professionalDescription, prompt_tokens, rrating, rratingJustification, shortSummary, videoTitles
View/Ai_metatags_responses/delete.json.php JSON entry point; inspect caller and guard id
View/Ai_metatags_responses/index.php PHP page/include/worker; inspect caller —
View/Ai_metatags_responses/index_body.php PHP page/include/worker; inspect caller —
View/Ai_metatags_responses/list.json.php JSON entry point; inspect caller and guard draw
View/Ai_responses/add.json.php JSON entry point; inspect caller and guard elapsedTime, id, videos_id
View/Ai_responses/delete.json.php JSON entry point; inspect caller and guard id
View/Ai_responses/index.php PHP page/include/worker; inspect caller —
View/Ai_responses/index_body.php PHP page/include/worker; inspect caller —
View/Ai_responses/list.json.php JSON entry point; inspect caller and guard draw
View/Ai_transcribe_responses/add.json.php JSON entry point; inspect caller and guard ai, ai_responses_id, duration, id, language, mp3_url, size_in_bytes, text, total_price, vtt
View/Ai_transcribe_responses/delete.json.php JSON entry point; inspect caller and guard id
View/Ai_transcribe_responses/index.php PHP page/include/worker; inspect caller —
View/Ai_transcribe_responses/index_body.php PHP page/include/worker; inspect caller —
View/Ai_transcribe_responses/list.json.php JSON entry point; inspect caller and guard draw
View/companionWidget.js browser/worker JavaScript; verify loader —
View/companionWidget.php PHP page/include/worker; inspect caller —
View/editor.php PHP page/include/worker; inspect caller —
async.json.php JSON entry point; inspect caller and guard type
autoSave.json.php JSON entry point; inspect caller and guard —
companion.php class/helper implementation —
companionAdminLogin.json.php JSON entry point; inspect caller and guard action
createAll.json..php PHP page/include/worker; inspect caller —
cutVideo.json.php JSON entry point; inspect caller and guard aspectRatio, description, endTimeInSeconds, startTimeInSeconds, title
delete.json.php JSON entry point; inspect caller and guard ai_metatags_responses_id, ai_transcribe_responses_id, id
deleteLang.json.php JSON entry point; inspect caller and guard key
deleteMP3.json.php JSON entry point; inspect caller and guard —
deleteTranscription.json.php JSON entry point; inspect caller and guard —
footer.php PHP page/include/worker; inspect caller —
index.php PHP page/include/worker; inspect caller —
install/install.sql schema/migration SQL —
install/updateV2.0.sql schema/migration SQL —
install/updateV3.0.sql schema/migration SQL —
install/updateV4.0.sql schema/migration SQL —
install/updateV5.0.sql schema/migration SQL —
install/updateV6.0.sql schema/migration SQL —
page.php PHP page/include/worker; inspect caller videoChatOnly
prices.json.php JSON entry point; inspect caller and guard —
progress.json.php JSON entry point; inspect caller and guard lang, type
receiveAsync.json.php JSON entry point; inspect caller and guard ai_responses_id, completion_tokens, language, msg, price_completion_tokens, price_prompt_tokens, prompt_tokens, relativeFile, relativeFileVTT, response, type
save.json.php JSON entry point; inspect caller and guard ai_metatags_responses_id, ai_transcribe_responses_id, id, index, label
shorts.php PHP page/include/worker; inspect caller —
tabs/basic.json.php JSON entry point; inspect caller and guard —
tabs/basic.php PHP page/include/worker; inspect caller —
tabs/companionChat.json.php JSON entry point; inspect caller and guard action, auto, overwrite
tabs/companionChat.php PHP page/include/worker; inspect caller —
tabs/dubbing.panel.php PHP page/include/worker; inspect caller —
tabs/dubbing.php PHP page/include/worker; inspect caller —
tabs/image.json.php JSON entry point; inspect caller and guard —
tabs/image.php PHP page/include/worker; inspect caller —
tabs/langs.php PHP page/include/worker; inspect caller —
tabs/shorts.ajax.php PHP page/include/worker; inspect caller —
tabs/shorts.php PHP page/include/worker; inspect caller —
tabs/transcription.php PHP page/include/worker; inspect caller —
tabs/transcriptions.json.php JSON entry point; inspect caller and guard —
tabs/translation.php PHP page/include/worker; inspect caller —
tabs/usage.json.php JSON entry point; inspect caller and guard —
tabs/usage.php PHP page/include/worker; inspect caller —
tabs/video.json.php JSON entry point; inspect caller and guard —
tools/cleanTables.php PHP page/include/worker; inspect caller —

Data and migrations

Tables named in available CREATE TABLE statements: ai_metatags_responses, ai_responses, ai_responses_json, ai_scheduler, ai_transcribe_responses. Apply installation/update behavior through the owning plugin; this reference is not a script for running historical migrations manually.

Main-file named symbols

Visibility and implementation semantics must be checked in source. Nonempty string defaults are represented as . This is a symbol reference, not a stable public API promise.

Function or method Source
getPluginDependencies() 24
isTestEnvironment() 122
getTags() 134
getMetadataURL() 144
getPricesURL() 149
getDescription() 154
getName() 165
getUUID() 170
getPluginVersion() 175
formatPrice($value) 185
getPriceDecimals($value, $minimum = 2, $maximum = 8) 190
getEmptyDataObject() 198
getVideoShortsMetadata($videos_id) 257
getVideoTranslationMetadata($videos_id, $lang, $langName) 292
getVideoBasicMetadata($videos_id) 333
getVideoTranscriptionMetadata($videos_id, $lang) 377
getVideoDubbingMetadata($videos_id, $lang) 418
getTokenForVideo($videos_id, $ai_responses_id, $param) 460
getTokenFromRequest() 479
getMP3Path($videos_id) 501
getMP3LowerPath($videos_id) 510
getMP3RegularAndLower($videos_id) 521
getLowerMP3($videos_id, $try = 0) 641
getPluginMenu() 667
getVideosManagerListButton() 673
getTagTypeId() 693
deleteAllRecords() 711
getVTTLanguageCodes($videos_id) 724
getFooterCode() 743
getCompanionChatWidgetHTML() 754
getVTTFiles($videos_id) 789
getFirstVTTFile($videos_id) 803
getProgressBarHTML($classname, $text) 812
executeCutVideo($row) 823
chargeUser($type, $users_id, $videos_id) 881
asyncVideosIdAndSendSocketMessage($videos_id, $type, $users_id) 924
asyncVideosId($videos_id, $type, $users_id) 934
AIAlreadyHave($videos_id, $type) 1075
processTranscription($row) 1113
processShorts($row) 1138
processBasic($row) 1161
processAll($row) 1184
executeEveryMinute() 1205
afterNewVideo($videos_id) 1225
getPermissionsOptions() 1240
canUseAI() 1249

Supporting PHP declarations

These symbols are grouped by source file; inspect the class declaration and visibility before calling them.

Objects/Ai_metatags_responses.php

Declared classes: Ai_metatags_responses.

Named symbol Source
getSearchFieldsNames() 9
getTableName() 13
getAllAi_responses() 17
setId($id) 36
setVideoTitles($videoTitles) 45
setKeywords($keywords) 55
setProfessionalDescription($professionalDescription) 65
setCasualDescription($casualDescription) 69
setShortSummary($shortSummary) 73
setMetaDescription($metaDescription) 77
setRrating($rrating) 81
setRratingJustification($rratingJustification) 85
setPrompt_tokens($prompt_tokens) 89
setcompletion_tokens($completion_tokens) 93
setPrice_prompt_tokens($price_prompt_tokens) 97
setPrice_completion_tokens($price_completion_tokens) 101
setAi_responses_id($ai_responses_id) 105
getId() 110
getVideoTitles() 114
getKeywords() 118
getProfessionalDescription() 122
getCasualDescription() 126
getShortSummary() 130
getMetaDescription() 134
getRrating() 138
getRratingJustification() 142
getPrompt_tokens() 146
getcompletion_tokens() 150
getPrice_prompt_tokens() 154
getPrice_completion_tokens() 158
getAi_responses_id() 162
getAllFromVideosId($videos_id) 166

Objects/Ai_responses.php

Declared classes: Ai_responses.

Named symbol Source
getSearchFieldsNames() 10
getTableName() 15
getAllVideos() 20
setId($id) 47
setElapsedTime($elapsedTime) 52
setVideos_id($videos_id) 57
getId() 63
getElapsedTime() 68
getVideos_id() 73
setPrice($price) 78
getPrice() 83
getAllImageFromVideo($videos_id) 88
getAllBasicFromVideo($videos_id) 127
getAllTranscriptionFromVideo($videos_id) 166
getAllFromVideo($videos_id) 194
getHistory($videos_id) 281
getValidTranscriptions($videos_id) 312
getTranscriptions($videos_id) 324
hasTranscriptions($videos_id) 341
getTranscriptionText($videos_id) 347
getTranscriptionVtt($videos_id) 357
getLatest($videos_id) 367

Objects/Ai_responses_json.php

Declared classes: Ai_responses_json.

Named symbol Source
getSearchFieldsNames() 9
getTableName() 13
setId($id) 17
setResponse($response) 21
setAi_type($ai_type) 28
setAi_responses_id($ai_responses_id) 32
getId() 36
getResponse() 40
getAi_type() 44
getAi_responses_id() 48
getAllFromAIType($type, $videos_id = 0) 52

Objects/Ai_scheduler.php

Declared classes: Ai_scheduler.

Named symbol Source
getSearchFieldsNames() 25
getTableName() 29
setId($id) 33
setJson($json) 37
setStatus($status) 44
setAi_scheduler_type($ai_scheduler_type) 49
setCreated_php_time($created_php_time) 53
setModified_php_time($modified_php_time) 57
getId() 62
getJson() 66
getStatus() 70
getAi_scheduler_type() 74
getCreated_php_time() 78
getModified_php_time() 82
getAllToExecute() 87
isAlreadyScheduled($videos_id, $type, $status) 99
getFromVideoAndStatus($videos_id, $type, $status) 105
saveToProcessAll($videos_id, $users_id) 123

Objects/Ai_transcribe_responses.php

Declared classes: Ai_transcribe_responses.

Named symbol Source
getSearchFieldsNames() 10
getTableName() 15
getAllAi_responses() 20
setId($id) 47
setVtt($vtt) 52
setLanguage($language) 57
setDuration($duration) 62
setText($text) 71
setTotal_price($total_price) 76
setSize_in_bytes($size_in_bytes) 81
setMp3_url($mp3_url) 86
setAi_responses_id($ai_responses_id) 91
getId() 97
getVtt() 102
getLanguage() 107
getDuration() 112
getText() 117
getTotal_price() 122
getSize_in_bytes() 127
getMp3_url() 132
getAi_responses_id() 137
getVTTPaths($videos_id, $lang = '') 142
save() 170
saveVTT($vtt, $language, $duration, $text, $total_price, $size_in_bytes, $mp3, $jsonDecoded) 181

companion.php

Declared classes: CompanionAI.

Named symbol Source
getConnectionError() 19
connectionErrorMessage($httpCode, $hasAccessToken) 24
getBaseUrl() 43
isConfigured() 67
getFrontendBaseUrl() 74
isValidEmbedUrl($embedUrl) 92
isValidConfigUrl($configUrl) 109
getWidgetConfigUrl($embedUrl, $configUrl = '') 139
request($method, $path, $params = array(), $headers = array()) 159
getIntegrationKey() 189
authHeader() 195
saveConnection($body, $fingerprint) 200
getSiteApiSecret() 224
connectionFingerprint($accessToken) 230
connect($accessToken) 236
ensureConnected() 261
linkMarketplace($accessToken) 275
status() 283
adminLoginUrl($users_id, $displayName) 303
submitVideo($videos_id) 318
isPasswordProtected($videos_id) 343
getVideoStatus($videos_id, &$httpCode = null) 349
enableChat($videos_id) 365
disableChat($videos_id) 401
getStoredChatConfig($videos_id) 412
isSubtitleSwitcherEnabled() 428
getSubtitle($videos_id, &$httpCode = null) 433
subtitleLanguage($detected) 449
getSubtitleState($videos_id) 468
saveSubtitleState($videos_id, $state) 475
subtitleResult($error, $code, $msg, $extra = array()) 490
importSubtitle($videos_id, $overwrite = false, $automatic = false) 504
storeSubtitle($videos_id, $filename, $subtitle, $overwrite, $automatic) 532
scheduleSubtitleImport($videos_id, $users_id) 613
processScheduledSubtitle($row) 630
canUseChat() 671
whoCanUseChatOnWatchPage() 684

tabs/shorts.ajax.php

Named symbol Source
getTranscriptionJson($start, $end, $transcriptionJson) 48
getShortsButtons($key) 64

Diagnostics and validation

  1. Check the installed/enabled version and the dependencies/settings above.
  2. Identify the actual failing page, request, callback or worker and correlate its timestamp with the AVideo log.
  3. Follow the linked method and caller. Check business-state changes and output artifacts as well as HTTP status.
  4. Reproduce the relevant workflow in a test environment. External provider, Encoder, live-server, storage, payment and authenticated flows require their real integrations.

Related test filenames (name matches only; not executed by generation):

Shared diagnostic workflow. This page is not a security audit or a claim of end-to-end validation.

Clone this wiki locally