You are not logged in.

#1 2021-07-25 20:00:51

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Options for a simple self-hosted video server (YouTube replacement)?

Hi, all! So, I had yet another home video deleted by Google after uploading it to YouTube. That, in addition to all the ads and the upcoming changes to "unlisted" videos, has made me decide I'm done with YouTube.

Is there a simple video streaming server software you recommend that I can host on my Arch Linux web server?

I have two other pieces of web server software running right now. I have WordPress hosting my blog, and Sigal hosting my photos. WordPress is very heavy, using SQL and PHP, whereas Sigal produces static HTML (updated every night in a cronjob).

I'm testing out Jellyfin and it works, but feels a bit heavy or "too much" for my needs. I may stick with it. But do you have a recommendation that is lighter, maybe statically generated?

My only requirements are that it allows anyone to stream videos it a modern web browser, and that it can serve lower-quality / smaller / faster copies of the videos. Because my server speed is garbage. XD

Thank you!

Offline

#2 2021-07-25 20:08:17

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Options for a simple self-hosted video server (YouTube replacement)?

What about uploads?  That's the hard part of such a site.  If you just want video playback, all you need is html with a <video> tag specifying the video url.  With html5 the browser then takes care of just about everything after that.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2021-07-25 20:54:15

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: Options for a simple self-hosted video server (YouTube replacement)?

and that it can serve lower-quality / smaller / faster copies of the videos. Because my server speed is garbage. XD

You have to sacrifice at least one thing:
Use more storage space and save all quality variants. (Here or here is some help to create the files. Then generate your static page around the result)
Use more processing power and do a live encoding.
Use more bandwidth and give everyone the the same good quality.
Use the least amound of storage, cpu, bandwidth and give everyone potato quality.

Last edited by progandy (2021-07-25 21:15:47)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2021-07-25 21:12:18

lothar_m
Member
From: Cyberspace
Registered: 2010-04-25
Posts: 32

Re: Options for a simple self-hosted video server (YouTube replacement)?

What about peertube for a self hosted youtube replacement?


“Clearly, Field Marshal Haig is about to make yet another gargantuan effort to move his drinks cabinet six inches closer to Berlin.”

Offline

#5 2021-07-26 06:52:17

alomsimoy
Member
Registered: 2013-06-03
Posts: 10

Re: Options for a simple self-hosted video server (YouTube replacement)?

If it's for personal use, I can recommend setting up a plex server. It even allows multiple users to share your content with. However, I don't think it allows to access to your videos anonymously (without signing in).

Offline

#6 2021-07-29 03:43:28

jonno2002
Member
Registered: 2016-11-21
Posts: 684

Re: Options for a simple self-hosted video server (YouTube replacement)?

seen this post the other day and started playing around making somthing for me. im definatly no expert with php so my code is probably terrible but it works.

here is a very cut down version of what im working on to give you an idea, you need a web server with php, and make sure php upload limits are set high, and just chuck these 3 files into a directory on your server with 1 sub directory name "vids" and all files+folder need to be writable by the webserver obviously.

NOTE: the html5 player only supports mp4,webm, and ogg

index.php

<?php 
session_name("vids");
session_start();
$path = "vids/";

if(isset($_POST['Submit'])){
	foreach ($_POST['delete'] as $key => $value) {
		unlink("$path"."$value");
	}
	header("location: index.php");
	exit;
}

if(isset($_POST['submit'])){
	$fileCount = count($_FILES['file']['name']);
	for($i = 0; $i < $fileCount; $i++){
		$file = $_FILES['file']['name'][$i];
		move_uploaded_file($_FILES['file']['tmp_name'][$i], $path.$file);
	}
	header("location: index.php");
	exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>vids</title>
 <link rel="stylesheet" type="text/css" href="style.css">
 <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h1>Video Upload Thing</h1>
<br>
<form action="" method="post" name="delete">
<?php
$files = glob("$path"."*");
$_SESSION['files'] = $files;
$files = str_replace("$path", "", $files);
foreach ($files as $key => $file) {
	echo "<a href='vid.php?id=$key'>$file</a>";
?>
<input type="checkbox" id="<?=$key?>" name="delete[<?=$key?>]" value="<?=$file?>">
<br>
<br>
<br>
<?php
}
?>
<input name="Submit" type="submit" value="delete selected files">
</form>
<p>---------------------------</p>
<form action="" method="post" enctype="multipart/form-data">
  <p>Upload files:</p>
  <br>
  <input type="file" name="file[]" id="file" multiple>
  <br>
  <input type="submit" value="Upload file" name="submit">
</form>
<p>---------------------------</p>
</body>
</html>

vid.php

<?php 
session_name("vids");
session_start();
$files = $_SESSION['files'];
$id = $_GET['id'];
?>
<!DOCTYPE html>
<html>
<head>
<title>vids</title>
 <link rel="stylesheet" type="text/css" href="style.css">
 <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<video width="75%" src="<?php echo $files[$id]; ?>" type="video/mp4" controls>
 <p>Your browser does not support the video tag.</p>
</video> 
</body>
</html>

style.css

body {
  background-color: #222222;
  color: #cccccc;
  text-align: center;
}

h1 {  
  text-decoration: underline;
  text-shadow: 4px 4px 10px #000000;
}

input[type=button], input[type=submit], input[type=reset]{
  background-color: #222222;
  border: 2px solid #cccccc;
  color: #cccccc;
  padding: 6px 10px;
  text-decoration: none;
  margin: 4px 2px;
  cursor: pointer;
}

video {
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
}

a:visited, a:link, a:hover, a:active {
  border: 2px solid #cccccc;
  color: #cccccc;
  padding: 6px 10px;
  text-decoration: none;
  margin: 4px 2px;
  cursor: pointer;
}

Last edited by jonno2002 (2021-07-29 03:49:31)

Offline

Board footer

Powered by FluxBB