Docker series builds a private video sharing platform based on peertube (Part 2)
本文最后更新于 362 天前,其中的信息可能已经有所发展或是发生改变,如有失效可到评论区留言。

Initialize peertube

Change the interface language

Click "root"-"interface" in the upper left corner:

image.png

In the next language selection box, select Simplified Chinese:
image.png

Several important options

Help share the video that is playing

image.png

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

image.png

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

image.png

If you need to import videos from other video sites using URLs, you need to check the relevant options here.

Search and Federation

image.png

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

image.png

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.
image.png

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

image.png

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

image.png

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:
image.png

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":

image.png

The following interface appears:
image.png

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":

image.png

Then click "Publish" in the upper right corner:
image.png

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:
image.png

image.png

After selecting, click Open in the lower right corner and the following interface will appear:
image.png

There are 5 options for privacy:
image.png

image.png

You can choose according to your needs.
image.png

If you select Include sensitive content, the settings for sensitive content in the previous video section will be used:
image.png

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:

image.png

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:

image.png

And you can select one or more files and choose to transcode:
image.png

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:

image.png

And the address can be shared directly with others without requiring them to log in (provided that the video privacy is set to public):

image.png

You can also share a link to a video:
image.png

You can also directly generate a QR code for sharing, the most important thing is embedding:
image.png

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

The content of the blog is original. Please indicate the source when reprinting! For more blog articles, you can go toSitemapUnderstand. The RSS address of the blog is:https://blog.tangwudi.com/feed, welcome to subscribe; if necessary, you can joinTelegram GroupDiscuss the problem together.

Comments

  1. Passing by is a good thing
    Windows Edge 131.0.0.0
    3 months ago
    2024-10-26 13:47:02

    Boss, is this your own machine?
    I plan to build one on my own machine.

    • Owner
      Passing by is a good thing
      Macintosh Chrome 130.0.0.0
      3 months ago
      2024-10-26 13:49:38

      Almost all the applications I build are built on my own machines, including peertube.

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠(ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ°Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
Emoticons
Emoji
Little Dinosaur
flower!
Previous
Next
       
error:
en_US
Spring Festival
hapiness