Hello guys, I need to host a video sharing site that support srt files for translating videos
I've searched the Internet and found ClipBucket its a good script but you must pay for Subtitle extention
is there any free script do such a thing?

Dani AI

Generated

Short answer: accept uploaded SRT files but serve them to the player as WebVTT sidecar files and attach them with the HTML5 <track> element. That gives the broadest, standard browser support and lets users toggle subtitles without re-encoding the video — exactly the workflow was steering toward. See the WebVTT format and the <track> element for how browsers expect sidecar captions, and how players like Video.js consume them. (developer.mozilla.org)

Minimal example (client side):

<video controls crossorigin>
  <source src="/media/video.mp4" type="video/mp4">
  <track kind="subtitles" src="/subs/video.en.vtt" srclang="en" label="English" default>
</video>

Simple, safe PHP conversion at upload time (very small, production needs extra validation):

<?php
$srt = file_get_contents($_FILES['srt']['tmp_name']);
$srt = preg_replace("/\r\n|\r/", "\n", $srt);              // normalize newlines
$vtt = "WEBVTT\n\n" . preg_replace('/(\d{2}:\d{2}:\d{2}),(\d{3})/', '$1.$2', $srt);
file_put_contents("/path/to/subs/video.en.vtt", $vtt);     // save VTT for the player
?>

Make sure you serve .vtt as Content-Type: text/vtt and UTF-8; some players or browsers will reject or mis-parse files with wrong MIME, BOM, or comma timestamps. Video.js and other modern players expect WebVTT sidecars or will accept converted files. If you prefer to transcode or hard-bake captions (not toggleable), ffmpeg can burn or package captions during encoding. For server-side conversion you can also use small utilities or libraries (Node/PHP/Python) and ffmpeg workflows. (drupal.org)

If you want a ready-made free platform instead of building this yourself, modern open-source video projects already include caption support and will accept SRT/VTT uploads and handle conversion: PeerTube and MediaCMS are examples that accept SRT/VTT and integrate caption management. If you only need client-side fallback for legacy browsers, use a small WebVTT polyfill or on-the-fly converter. (docs.joinpeertube.org)

Troubleshooting checklist: ensure the VTT starts with WEBVTT, timestamps use dots (00:00:12.345), file is valid UTF-8 without BOM, server serves text/vtt, place <track> after <source> elements, and check CORS if tracks are on another domain. These fixes solve most "subtitles not showing" issues. (developer.mozilla.org)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.