ভিডিও ও সাইট

ভিডিও কনভার্শন

এই অধ্যায়টি এখনও অনুবাদ হয়নি, তাই ইংরেজিতে দেখানো হচ্ছে।

এই পাতায়

With FFmpeg on the server, every upload is encoded into the resolutions you choose and gets a thumbnail and seek-bar pictures. Without FFmpeg, videos play as they were uploaded. Everything here is on Admin → Media & FFmpeg.

Setting up FFmpeg

The site needs both ffmpeg and ffprobe, and PHP must be allowed to start a program (proc_open, exec or shell_exec). The FFmpeg card says what it found:

  • Found both tools - with the version lines. You are ready.
  • Could not run ffmpeg / ffprobe - type the full paths into Path to ffmpeg and Path to ffprobe. On most cPanel servers they are /usr/bin/ffmpeg and /usr/bin/ffprobe. Leave them empty when the tools are on the system PATH.
  • This server does not let PHP start another program - no conversion is possible; ask your host to allow one of those functions, or upload MP4 files only.

Then tick Convert uploads automatically (it is off on a new install) and Save.

Resolutions to make

Tick the sizes under Resolutions to make: 2160p (4K), 1440p (2K), 1080p (Full HD), 720p (HD), 480p, 360p and 240p. A new install makes 720p, 480p and 360p. A video is never made bigger than it arrived: a 480p upload only produces 480p and below. Each size is saved next to the original as name_720p.mp4.

A package can cap this with Highest resolution made, and Converted first puts its members' uploads at the front of the queue (Admin → Packages).

File size

ModeWhat you get
Fastest - bigger filesFor a slow server with a long queue. Files come out somewhat bigger.
Balanced (recommended)Quick and still small. A size the upload already is, at a low enough bitrate, is copied in seconds instead of encoded again.
Small filesEvery size encoded afresh for the smallest file; two to three times as long as Balanced.
Smallest filesSlowest, and noticeably softer in busy scenes. For a site short of disk or bandwidth.

Every mode keeps the resolution. Each size has a bitrate ceiling (1080p about 4 Mbit/s, 720p 2.2, 480p 1.1, 360p 0.65), never above the upload's own. Extra audio tracks and subtitles are left out; an encode that would come out bigger than the original is replaced by a copy of it. Fine-tune the quality moves every size sharper or softer.

The other switches

SettingWhat it does
Start straight awayStarts a background worker as soon as an upload lands, instead of waiting for cron. Needs Path to php (for background jobs) when php is not in the usual place.
Take a thumbnailGrabs a frame when the uploader chose no picture. Thumbnail second: -1 takes the frame a tenth of the way in.
Pictures on the seek barMakes a strip of small frames (uploads/storyboards/), so resting the pointer on the seek bar shows that moment.
Keep the original fileOff deletes the original once the sizes are made. Saves disk, but the original quality is gone for good.
Carry on after a stopEncodes in short pieces, so a restart or time limit does not start the video over.
Do not encode what is already smallCopies an H.264 upload that is already lean for its size. Used by Fastest and Balanced.
Give way to the websiteRuns FFmpeg at low priority, so pages stay quick.
While people are on the site, conversion may useOn shared hosting: the share of time the encoder may run while pages are being opened (Half is recommended). Not used on Windows or where PHP cannot signal a program; the page says so.
Quick things firstThumbnail and seek-bar pictures first, then the sizes smallest first, so a video plays early.
Frame rate30 frames a second at 480p and below.
Processor cores0 lets FFmpeg decide; 1 or 2 on shared hosting.
Keep free on the disk (MB)Default 300. With less free, conversion waits instead of filling the disk, and the admin bell says so.
Jobs per runHow many conversions one worker does before it stops.

The queue

The card Conversion, live at the top refreshes itself: what is converting now (size, progress, time left), what is up next, what failed and why, and what finished lately. Beside each job: Stop, To the front, Remove, Try again or Convert again. Above the lists:

  • Start converting now - starts a worker in the background.
  • Convert one here - one job inside this page; fine for a short clip.
  • Queue everything that is missing - adds the missing sizes of older or migrated videos. A video whose file is not on this server is skipped.
  • Try every failed one again, Read missing lengths, Clear finished.

Admin → Videos has the same thing for chosen videos: the bulk action Make the missing resolutions. Members see the state in their Studio (Processing..., Waiting to process, Processing failed).

Keeping the queue moving

The one cron line from Admin → Cron jobs runs the Video conversion job every two minutes (see Scheduled jobs). The Media page says so too, and keeps only a web address with a key (Make a new key replaces it) for a host that runs nothing but web addresses and wants the encoder on a line of its own; with the main cron line in place you do not need it.

File server (FTP)

Video fills a web host quickly. Switch on Use a file server and every upload, thumbnail and encoded size is copied to an FTP server and served from there. It needs PHP's ftp extension.

SettingNotes
Address, Port, Username, PasswordAn empty password box keeps the saved one.
Folder on that serverWhere the uploads/ tree is created.
Web address of that folderWhat the player is given, e.g. https://files.example.com.
When a file is in both placesAlways use the file server or Use this server's copy first.
Folders to sendComma separated; default uploads/.
Passive mode, Secure (FTPS), TimeoutLeave passive on unless the server asks otherwise.
Keep a copy here tooOff deletes the local file once it is safely across.

Test the file server signs in, uploads a test file, reads it back and removes it. The original of a new upload is sent only when all its sizes are made. A file the server would not take plays from your own server until the File server, second tries job sends it (every 10 minutes).

With Keep a copy here too off, originals leave your server, so later re-encoding (Convert again, a new size) has nothing to work from.

A migrated site whose files still live on the old server uses Admin → Settings → Media → Media origin instead; see PlayTube Migration.

Chat with Faruk
Faruk's Assistant Online — AI Powered