Initialize peertube
Change the interface language
Click "root"-"interface" in the upper left corner:
In the next language selection box, select Simplified Chinese:
Several important options
Help share the video that is playing
This option will use webtorrent to store your video on a peertube server that is set up by someone else and has this option checked. In theory, other people can play this video from multiple sources, but after enabling this option, it may be slower than connecting to you directly, because it is very likely that you are the only one who has this source, so it is better to play it directly from you, so it is recommended not to check this option.
Enable Registration
If you want your peertube server to be available for other people to register and upload videos like youtube, you can turn on this option.
Video Import
If you need to import videos from other video sites using URLs, you need to check the relevant options here.
Search and Federation
Both of these options involve the relationship between your peertube and peertubes set up by other people. If you just want to be a quiet handsome man, then you should not choose these options.
Transcoding
The options here are more important. If the hardware for building peertube is not bad, it is recommended to enable transcoding. Otherwise, some browsers cannot play videos without installing the corresponding plug-in. I use an m1 macmini, and it feels like a 400MB mv can be converted in less than 10 minutes. Of course, it is hard to say how long it will take for a movie. It is recommended not to check the option to enable webtorrent. It is fastest to use HLS playback directly. As for the resolution below, I think 720p and 1080p are enough under normal circumstances. In this way, transcoding will only generate files with 2 resolutions and the time will be shorter.
I won't talk about the number of transcoding threads, it's clearly written. The "Enable remote runners for VOD" above is quite interesting. It means that you can help with decoding by running programs remotely. I'll study this when I have time.
Live Streaming
If you have this requirement, please study it yourself. I don’t have any requirement, so I won’t bother with it. However, this requires mapping port 1935 for rmtp to use.
Administration - Plugins/Themes
The two plugins that are actually quite useful are: "privacysettings" and "transcoding-custom-quality". The former can set all videos to be used on the site by default, and the latter can set the default quality of the default transcoded videos:
In fact, the default good is enough, so it doesn’t matter whether these two plug-ins are installed or not.
Publish a video
Note: For security reasons, do not use the root account to publish videos directly. Create a new account specifically for publishing videos.
CREATE NEW ACCOUNT
"Management" - "Overview" - "Create User":
The following interface appears:
Just fill in the relevant information according to the prompts. Pay attention to the channel name. Create a channel here first. The videos released subsequently must be in a channel. For example, I created an mv channel, and all the mvs released are in this channel.
Note the option "User bypasses video validation by moderators" in the red box below. By default, this option is not checked, which means that all videos posted by this user need to be reviewed by the administrator. If you are the only one and there is no need for review, just check this option. Finally, click the "Create User" button at the bottom.
Start publishing
Log out of the root account and log in with the newly created account. First change the language to Chinese and remove the "Help share video option":
Then click "Publish" in the upper right corner:
The following interface appears. Select the channel you created when creating a new account. Select the privacy method according to your needs, and then click the button in the red box to upload the file:
After selecting, click Open in the lower right corner and the following interface will appear:
There are 5 options for privacy:
You can choose according to your needs.
If you select Include sensitive content, the settings for sensitive content in the previous video section will be used:
If you choose to publish after transcoding, then the video will not be published before the transcoding is successful. Everyone uploads the video first and then transcodes it together. In this case, do not check this option.
There is also an option in the advanced settings to allow downloading. If it is not allowed, do not check to allow downloading:
After setting, click the publish button in the lower right corner to publish.
Here's a tip. Log in as root and go to "Management" - "Overview" - "Video". You can see all videos uploaded by users, their privacy settings, and whether the files are transcoded and what format they are transcoded into:
And you can select one or more files and choose to transcode:
However, normally, if the transcoding function is enabled in the options, transcoding will be automatically performed after publishing is completed, even if you do not select the option to publish after transcoding when publishing.
Effect display
Final result:
And the address can be shared directly with others without requiring them to log in (provided that the video privacy is set to public):
You can also share a link to a video:
You can also directly generate a QR code for sharing, the most important thing is embedding:
The embedded code generated directly can be placed directly in the WordPress page or article.
A few words: The biggest advantage of peertube is that you can host your own videos and embed them on your own website without relying on those video hosting platforms, which is not subject to censorship restrictions. Of course, if it is for traffic, the video must still be placed on those big platforms, but if there is no such demand and you just want to put it on your own website, then peertube is the best choice.
At the same time, you can also set all videos to private, then create a playlist, add videos to the playlist and set the playlist to public to publish videos. This can ensure that the videos cannot be seen during anonymous access, but you can also choose to publish the videos you want to publish by sharing the playlist, killing two birds with one stone. For specific effects, you can refer to the blog's "Film and Television World" - "Invincible MV Playlist", or directly click the following link:Invincible MV playlist.
Note: If you use nginx as a reverse proxy for peertube, you may encounter playback issues. For specific issues and solutions, see:Use Pagoda Panel (nginx) to configure peertube (HLS) reverse proxy
Boss, is this your own machine?
I plan to build one on my own machine.
Almost all the applications I build are built on my own machines, including peertube.