]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html
add description to transcoding profile selector
[github/Chocobozzz/PeerTube.git] / client / src / app / +admin / config / edit-custom-config / edit-custom-config.component.html
index 44de716a398a67455b9db4c851f5b0fffcc4a921..5f02d00e8070a7628d362815cd1b469294857d4a 100644 (file)
                 <label i18n for="instanceCategories">Main instance categories</label>
 
                 <div>
-                  <p-multiSelect
-                    inputId="instanceCategories" [options]="categoryItems" formControlName="categories" [showToggleAll]="false"
-                    [defaultLabel]="getDefaultCategoryLabel()" [selectedItemsLabel]="getSelectedCategoryLabel()"
-                    emptyFilterMessage="No results found" i18n-emptyFilterMessage
-                  ></p-multiSelect>
+                  <my-select-checkbox
+                    id="instanceCategories"
+                    formControlName="categories" [availableItems]="categoryItems"
+                    [selectableGroup]="false"
+                    i18n-placeholder placeholder="Add a new category"
+                  >
+                  </my-select-checkbox>
                 </div>
               </div>
 
                 <label i18n for="instanceLanguages">Main languages you/your moderators speak</label>
 
                 <div>
-                  <p-multiSelect
-                    inputId="instanceLanguages" [options]="languageItems" formControlName="languages" [showToggleAll]="false"
-                    [defaultLabel]="getDefaultLanguageLabel()" [selectedItemsLabel]="getSelectedLanguageLabel()"
-                    emptyFilterMessage="No results found" i18n-emptyFilterMessage
-                  ></p-multiSelect>
+                  <my-select-checkbox
+                    id="instanceLanguages"
+                    formControlName="languages" [availableItems]="languageItems"
+                    [selectableGroup]="false"
+                    i18n-placeholder placeholder="Add a new language"
+                  >
+                  </my-select-checkbox>
                 </div>
               </div>
 
             <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
 
               <div class="form-group">
-                <label i18n for="instanceAdministrator">Who is behind the instance?</label>
+                <label i18n for="instanceAdministrator">Who is behind the instance?</label><my-help helpType="markdownText"></my-help>
                 <div i18n class="label-small-info">A single person? A non-profit? A company?</div>
 
                 <my-markdown-textarea
-                  name="instanceAdministrator" formControlName="administrator" textareaMaxWidth="500px" textareaHeight="75px"
+                  name="instanceAdministrator" formControlName="administrator" textareaMaxWidth="500px"
                   [classes]="{ 'input-error': formErrors['instance.administrator'] }"
                 ></my-markdown-textarea>
 
               </div>
 
               <div class="form-group">
-                <label i18n for="instanceCreationReason">Why did you create this instance?</label>
+                <label i18n for="instanceCreationReason">Why did you create this instance?</label><my-help helpType="markdownText"></my-help>
                 <div i18n class="label-small-info">To share your personal videos? To open registrations and allow people to upload what they want?</div>
 
-                <textarea
-                  id="instanceCreationReason" formControlName="creationReason" class="small" class="form-control"
+                <my-markdown-textarea
+                  name="instanceCreationReason" formControlName="creationReason" textareaMaxWidth="500px"
                   [ngClass]="{ 'input-error': formErrors['instance.creationReason'] }"
-                ></textarea>
+                ></my-markdown-textarea>
                 <div *ngIf="formErrors.instance.creationReason" class="form-error">{{ formErrors.instance.creationReason }}</div>
               </div>
 
               <div class="form-group">
-                <label i18n for="instanceMaintenanceLifetime">How long do you plan to maintain this instance?</label>
+                <label i18n for="instanceMaintenanceLifetime">How long do you plan to maintain this instance?</label><my-help helpType="markdownText"></my-help>
                 <div i18n class="label-small-info">It's important to know for users who want to register on your instance</div>
 
-                <textarea
-                  id="instanceMaintenanceLifetime" formControlName="maintenanceLifetime" class="form-control small"
+                <my-markdown-textarea
+                  name="instanceMaintenanceLifetime" formControlName="maintenanceLifetime" textareaMaxWidth="500px"
                   [ngClass]="{ 'input-error': formErrors['instance.maintenanceLifetime'] }"
-                ></textarea>
+                ></my-markdown-textarea>
                 <div *ngIf="formErrors.instance.maintenanceLifetime" class="form-error">{{ formErrors.instance.maintenanceLifetime }}</div>
               </div>
 
               <div class="form-group">
-                <label i18n for="instanceBusinessModel">How will you finance the PeerTube server?</label>
+                <label i18n for="instanceBusinessModel">How will you finance the PeerTube server?</label><my-help helpType="markdownText"></my-help>
                 <div i18n class="label-small-info">With your own funds? With user donations? Advertising?</div>
 
-                <textarea
-                  id="instanceBusinessModel" formControlName="businessModel" class="form-control small"
+                <my-markdown-textarea
+                  name="instanceBusinessModel" formControlName="businessModel" textareaMaxWidth="500px"
                   [ngClass]="{ 'input-error': formErrors['instance.businessModel'] }"
-                ></textarea>
+                ></my-markdown-textarea>
                 <div *ngIf="formErrors.instance.businessModel" class="form-error">{{ formErrors.instance.businessModel }}</div>
               </div>
 
                 <div i18n class="label-small-info">i.e. 2vCore 2GB RAM, a direct the link to the server you rent, etc.</div>
 
                 <my-markdown-textarea
-                  name="instanceHardwareInformation" formControlName="hardwareInformation" textareaMaxWidth="500px" textareaHeight="75px"
+                  name="instanceHardwareInformation" formControlName="hardwareInformation" textareaMaxWidth="500px"
                   [classes]="{ 'input-error': formErrors['instance.hardwareInformation'] }"
                 ></my-markdown-textarea>
 
         <div class="form-row mt-5"> <!-- appearance grid -->
           <div class="form-group col-12 col-lg-4 col-xl-3">
             <div i18n class="inner-form-title">APPEARANCE</div>
-            <div i18n class="inner-for-description">
+            <div i18n class="inner-form-description">
               Use <a routerLink="/admin/plugins">plugins & themes</a> for more involved changes, or <a routerLink="/admin/config/edit-custom" fragment="customizations" (click)="gotoAnchor()">add slight customizations</a>.
             </div>
           </div>
               <div class="peertube-select-container">
                 <select id="instanceDefaultClientRoute" formControlName="defaultClientRoute" class="form-control">
                   <option i18n value="/videos/overview">Discover videos</option>
-                  <option i18n value="/videos/trending">Trending videos</option>
-                  <option i18n value="/videos/most-liked">Most liked videos</option>
+                  <optgroup i18n-label label="Trending pages">
+                    <option i18n value="/videos/trending">Default trending page</option>
+                    <option i18n value="/videos/trending?alg=hot" [disabled]="!trendingVideosAlgorithmsEnabledIncludes('hot')">Hot videos</option>
+                    <option i18n value="/videos/trending?alg=most-viewed" [disabled]="!trendingVideosAlgorithmsEnabledIncludes('most-viewed')">Most viewed videos</option>
+                    <option i18n value="/videos/trending?alg=most-liked" [disabled]="!trendingVideosAlgorithmsEnabledIncludes('most-liked')">Most liked videos</option>
+                  </optgroup>
                   <option i18n value="/videos/recently-added">Recently added videos</option>
                   <option i18n value="/videos/local">Local videos</option>
                 </select>
               <div *ngIf="formErrors.instance.defaultClientRoute" class="form-error">{{ formErrors.instance.defaultClientRoute }}</div>
             </div>
 
+            <div class="form-group" formGroupName="trending">
+              <ng-container formGroupName="videos">
+                <ng-container formGroupName="algorithms">
+                  <label i18n for="trendingVideosAlgorithmsDefault">Default trending page</label>
+                  <div class="peertube-select-container">
+                    <select id="trendingVideosAlgorithmsDefault" formControlName="default" class="form-control">
+                      <option i18n value="hot">Hot videos</option>
+                      <option i18n value="most-viewed">Most viewed videos</option>
+                      <option i18n value="most-liked">Most liked videos</option>
+                    </select>
+                  </div>
+                  <div *ngIf="formErrors.trending.videos.algorithms.default" class="form-error">{{ formErrors.trending.videos.algorithms.default }}</div>
+                </ng-container>
+              </ng-container>
+            </div>
+
           </div>
         </div>
 
                 >
                   <ng-container ngProjectAs="description">
                     <span i18n>⚠️ This functionality requires a lot of attention and extra moderation.</span>
+
+                    <div class="alert alert-info alert-signup" *ngIf="signupAlertMessage">{{ signupAlertMessage }}</div>
                   </ng-container>
                   <ng-container ngProjectAs="extra">
                     <my-peertube-checkbox [ngClass]="{ 'disabled-checkbox-extra': !isSignupEnabled() }"
 
                     <div [ngClass]="{ 'disabled-checkbox-extra': !isSignupEnabled() }" class="mt-3">
                       <label i18n for="signupLimit">Signup limit</label>
-                      <input
-                        type="number" min="-1" id="signupLimit" class="form-control"
-                        formControlName="limit" [ngClass]="{ 'input-error': formErrors['signup.limit'] }"
-                      >
+                      <div class="number-with-unit">
+                        <input
+                          type="number" min="-1" id="signupLimit" class="form-control"
+                          formControlName="limit" [ngClass]="{ 'input-error': formErrors['signup.limit'] }"
+                        >
+                        <span i18n>{form.value['signup']['limit'], plural, =1 {user} other {users}}</span>
+                      </div>
                       <div *ngIf="formErrors.signup.limit" class="form-error">{{ formErrors.signup.limit }}</div>
                       <small *ngIf="form.value['signup']['limit'] === -1" class="text-muted">Signup won't be limited to a fixed number of users.</small>
                     </div>
                 <div class="form-group" formGroupName="http">
                   <my-peertube-checkbox
                     inputName="importVideosHttpEnabled" formControlName="enabled"
-                    i18n-labelText labelText="Allow import with HTTP URL (i.e. YouTube)"
+                    i18n-labelText labelText="Allow import with HTTP URL (e.g. YouTube)"
                   ></my-peertube-checkbox>
                 </div>
 
                     i18n-labelText labelText="Allow users to do remote URI/handle search"
                   >
                     <ng-container ngProjectAs="description">
-                      <span i18n>Allow <strong>your users</strong> to look up remote videos/actors by their URI, that may not be federated with your instance</span>
+                      <span i18n>Allow <strong>your users</strong> to look up remote videos/actors that may not be federated with your instance</span>
                     </ng-container>
                   </my-peertube-checkbox>
                 </div>
                     i18n-labelText labelText="Allow anonymous to do remote URI/handle search"
                   >
                     <ng-container ngProjectAs="description">
-                      <span i18n>Allow <strong>anonymous users</strong> to look up remote videos/actors by their URI, that may not be federated with your instance</span>
+                      <span i18n>Allow <strong>anonymous users</strong> to look up remote videos/actors that may not be federated with your instance</span>
                     </ng-container>
                   </my-peertube-checkbox>
                 </div>
           </div>
         </div>
 
-      </ng-template>
-    </ng-container>
-
-    <ng-container ngbNavItem="services">
-      <a ngbNavLink i18n>Services</a>
-
-      <ng-template ngbNavContent>
-
-        <div class="form-row mt-5"> <!-- twitter grid -->
+        <div class="form-row mt-4"> <!-- Twitter grid -->
           <div class="form-group col-12 col-lg-4 col-xl-3">
             <div i18n class="inner-form-title">TWITTER</div>
             <div i18n class="inner-form-description">
-              Optional. If any, provide the Twitter account representing your instance to improve link previews.
+              Provide the Twitter account representing your instance to improve link previews.
+              If you don't have a Twitter account, just leave the default value.
             </div>
           </div>
 
                     <ng-template ptTemplate="help">
                       <ng-container i18n>
                         If your instance is explicitly allowed by Twitter, a video player will be embedded in the Twitter feed on PeerTube video share.<br />
-                        If the instance is not, we use an image link card that will redirect on your PeerTube instance.<br /><br />
+                        If the instance is not, we use an image link card that will redirect to your PeerTube instance.<br /><br />
                         Check this checkbox, save the configuration and test with a video URL of your instance (https://example.com/videos/watch/blabla) on
                         <a target='_blank' rel='noopener noreferrer' href='https://cards-dev.twitter.com/validator'>https://cards-dev.twitter.com/validator</a>
                         to see if you instance is allowed.
       </ng-template>
     </ng-container>
 
-    <ng-container ngbNavItem="advanced-configuration">
-      <a ngbNavLink i18n>Advanced configuration</a>
+    <ng-container ngbNavItem="transcoding">
+      <a ngbNavLink i18n>VOD Transcoding</a>
 
       <ng-template ngbNavContent>
 
-        <div class="form-row mt-5"> <!-- transcoding grid -->
+        <div class="form-row mt-4"> <!-- transcoding grid -->
+          <div class="form-group col-12 col-lg-4 col-xl-3"></div>
+          <div class="form-group form-group-right col-12 col-lg-8">
+
+            <div class="callout callout-info">
+              <span i18n>
+                Estimating a server's capacity to transcode and stream videos isn't easy and we can't tune PeerTube automatically.
+              </span>
+              <span i18n>
+                However, you may want to read our guidelines before tweaking the following values.
+              </span>
+
+              <div class="callout-container">
+                <a class="callout-link" target="_blank" rel="noopener noreferrer" href="https://docs.joinpeertube.org/#/admin-configuration?id=transcoding" i18n>Read guidelines</a>
+              </div>
+            </div>
+
+
+          </div>
+        </div>
+
+        <div class="form-row mt-2"> <!-- transcoding grid -->
           <div class="form-group col-12 col-lg-4 col-xl-3">
             <div i18n class="inner-form-title">TRANSCODING</div>
             <div i18n class="inner-form-description">
 
             <ng-container formGroupName="transcoding">
 
-              <div class="form-group">
-                <my-peertube-checkbox inputName="transcodingEnabled" formControlName="enabled">
+              <div class="form-group mb-0 col-12 col-xl-11">
+                <my-peertube-checkbox inputName="transcodingEnabled" formControlName="enabled" [recommended]="true">
                   <ng-template ptTemplate="label">
                     <ng-container i18n>Transcoding enabled</ng-container>
                   </ng-template>
 
-                  <ng-template ptTemplate="help">
-                    <ng-container i18n>If you disable transcoding, many videos from your users will not work!</ng-container>
-                  </ng-template>
-
                   <ng-container ngProjectAs="extra">
 
-                    <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
-                      <my-peertube-checkbox
-                        inputName="transcodingAllowAdditionalExtensions" formControlName="allowAdditionalExtensions"
-                        i18n-labelText labelText="Allow additional extensions"
-                      >
-                        <ng-container ngProjectAs="description">
-                          <span i18n>Allows users to upload .mkv, .mov, .avi and .flv videos.</span>
-                        </ng-container>
-                      </my-peertube-checkbox>
-                    </div>
-
-                    <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
-                      <my-peertube-checkbox
-                        inputName="transcodingAllowAudioFiles" formControlName="allowAudioFiles"
-                        i18n-labelText labelText="Allow audio files upload"
-                      >
-                        <ng-container ngProjectAs="description">
-                          <span i18n>Allows users to upload audio files that will be merged with the preview file on upload.</span>
-                        </ng-container>
-                      </my-peertube-checkbox>
-                    </div>
+                    <div class="callout callout-light pt-2 pb-0">
+                      <label i18n>Input formats</label>
 
-                    <ng-container formGroupName="webtorrent">
                       <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
                         <my-peertube-checkbox
-                          inputName="transcodingWebTorrentEnabled" formControlName="enabled"
-                          i18n-labelText labelText="WebTorrent support enabled"
+                          inputName="transcodingAllowAdditionalExtensions" formControlName="allowAdditionalExtensions"
+                          i18n-labelText labelText="Allow additional extensions"
                         >
-                          <ng-template ptTemplate="help">
-                            <ng-container i18n>
-                              <strong>Experimental, we suggest you to not disable webtorrent support for now</strong>
-
-                              <p>If you also enabled HLS support, it will multiply videos storage by 2</p>
-
-                              <br />
-
-                              <strong>If disabled, breaks federation with PeerTube instances < 2.1</strong>
-                            </ng-container>
-                          </ng-template>
+                          <ng-container ngProjectAs="description">
+                            <span i18n>Allows users to upload .mkv, .mov, .avi, .wmv, .flv, .f4v, .3g2, .3gp, .mts, .m2ts, .mxf, or .nut videos.</span>
+                          </ng-container>
                         </my-peertube-checkbox>
                       </div>
-                    </ng-container>
 
-                    <ng-container formGroupName="hls">
                       <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
                         <my-peertube-checkbox
-                          inputName="transcodingHlsEnabled" formControlName="enabled"
-                          i18n-labelText labelText="HLS support enabled"
+                          inputName="transcodingAllowAudioFiles" formControlName="allowAudioFiles"
+                          i18n-labelText labelText="Allow audio files upload"
                         >
-                          <ng-template ptTemplate="help">
-                            <ng-container i18n>
-                              <strong>Requires ffmpeg >= 4.1</strong>
-
-                              <p>Generate HLS playlists and fragmented MP4 files resulting in a better playback than with the current default player:</p>
-                              <ul>
-                                <li>Resolution change is smoother</li>
-                                <li>Faster playback in particular with long videos</li>
-                                <li>More stable playback (less bugs/infinite loading)</li>
-                              </ul>
-
-                              <p>If you also enabled WebTorrent support, it will multiply videos storage by 2</p>
-                            </ng-container>
-                          </ng-template>
+                          <ng-container ngProjectAs="description">
+                            <div i18n>Allows users to upload .mp3, .ogg, .wma, .flac, .aac, or .ac3 audio files.</div>
+                            <div i18n>The file will be merged in a still image video with the preview file on upload.</div>
+                          </ng-container>
                         </my-peertube-checkbox>
                       </div>
-                    </ng-container>
+                    </div>
+
+                    <div class="callout callout-light pt-2 mt-2 pb-0">
+                      <label i18n>Output formats</label>
+
+                      <ng-container formGroupName="webtorrent">
+                        <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
+                          <my-peertube-checkbox
+                            inputName="transcodingWebTorrentEnabled" formControlName="enabled"
+                            i18n-labelText labelText="WebTorrent enabled"
+                          >
+                            <ng-template ptTemplate="help">
+                              <ng-container i18n>
+                                <p>If you also enabled HLS support, it will multiply videos storage by 2</p>
+
+                                <br />
+
+                                <strong>If disabled, breaks federation with PeerTube instances < 2.1</strong>
+                              </ng-container>
+                            </ng-template>
+                          </my-peertube-checkbox>
+                        </div>
+                      </ng-container>
+
+                      <ng-container formGroupName="hls">
+                        <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
+                          <my-peertube-checkbox
+                            inputName="transcodingHlsEnabled" formControlName="enabled"
+                            i18n-labelText labelText="HLS with P2P support enabled"
+                            [recommended]="true"
+                          >
+                            <ng-template ptTemplate="help">
+                              <ng-container i18n>
+                                <strong>Requires ffmpeg >= 4.1</strong>
+
+                                <p>Generate HLS playlists and fragmented MP4 files resulting in a better playback than with plain WebTorrent:</p>
+                                <ul>
+                                  <li>Resolution change is smoother</li>
+                                  <li>Faster playback especially with long videos</li>
+                                  <li>More stable playback (less bugs/infinite loading)</li>
+                                </ul>
+
+                                <p>If you also enabled WebTorrent support, it will multiply videos storage by 2</p>
+                              </ng-container>
+                            </ng-template>
+                          </my-peertube-checkbox>
+                        </div>
+                      </ng-container>
+
+                      <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
+                        <label i18n>Resolutions to generate per enabled format</label>
+
+                        <div class="ml-2 mt-2 d-flex flex-column">
+                          <ng-container formGroupName="resolutions">
+                            <div class="form-group" *ngFor="let resolution of resolutions">
+                              <my-peertube-checkbox
+                                [inputName]="getResolutionKey(resolution.id)" [formControlName]="resolution.id"
+                                labelText="{{ resolution.label }}"
+                              >
+                                <ng-template *ngIf="resolution.description" ptTemplate="help">
+                                  <div [innerHTML]="resolution.description"></div>
+                                </ng-template>
+                              </my-peertube-checkbox>
+                            </div>
+
+                            <span class="mb-2 text-muted" i18n>
+                              The original file resolution will be the default target if no option is selected.
+                            </span>
+                          </ng-container>
+                        </div>
+                      </div>
+                    </div>
 
                   </ng-container>
                 </my-peertube-checkbox>
               </div>
 
-              <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
+              <div class="form-group mt-4" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
                 <label i18n for="transcodingThreads">Transcoding threads</label>
+                <span class="text-muted ml-1">
+                  <ng-container *ngIf="getTotalTranscodingThreads().atMost" i18n>will claim at most {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with live transcoding</ng-container>
+                  <ng-container *ngIf="!getTotalTranscodingThreads().atMost" i18n>will claim at least {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with live transcoding</ng-container>
+                </span>
+
                 <div class="peertube-select-container">
                   <select id="transcodingThreads" formControlName="threads" class="form-control">
                     <option *ngFor="let transcodingThreadOption of transcodingThreadOptions" [value]="transcodingThreadOption.value">
-                      {{ transcodingThreadOption.label }}
+                      {{ transcodingThreadOption.label }} {transcodingThreadOption.value, plural, =0 {} =1 {thread} other {threads}}
                     </option>
                   </select>
                 </div>
                 <div *ngIf="formErrors.transcoding.threads" class="form-error">{{ formErrors.transcoding.threads }}</div>
               </div>
 
-              <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
+              <div class="form-group mt-4" [ngClass]="{ 'disabled-checkbox-extra': !isTranscodingEnabled() }">
+                <label i18n for="transcodingProfile">Transcoding profile</label>
+                <span class="text-muted ml-1" i18n>new transcoding profiles can be added by PeerTube plugins</span>
+
+                <ng-select
+                  id="transcodingProfile"
+                  formControlName="profile"
+                  [items]="getAvailableTranscodingProfile('vod')"
+                  [clearable]="false"
+                >
+                  <ng-template ng-option-tmp let-item="item" let-index="index">
+                    {{ item }}
+                    <ng-container *ngIf="item === 'default'">
+                      <br>
+                      <span class="text-muted">x264, targeting maximum device compatibility</span>
+                    </ng-container>
+                  </ng-template>
+                </ng-select>
+                <div *ngIf="formErrors.transcoding.profile" class="form-error">{{ formErrors.transcoding.profile }}</div>
+              </div>
+
+            </ng-container>
+
+          </div>
+        </div>
+
+      </ng-template>
+    </ng-container>
+
+    <ng-container ngbNavItem="live">
+      <a ngbNavLink i18n>Live streaming</a>
+
+      <ng-template ngbNavContent>
+
+        <div class="form-row mt-5">
+          <div class="form-group col-12 col-lg-4 col-xl-3">
+            <div i18n class="inner-form-title">LIVE</div>
+            <div i18n class="inner-form-description">
+              Enable users of your instance to stream live.
+            </div>
+          </div>
+
+          <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
+
+            <ng-container formGroupName="live">
+
+              <div class="form-group">
+                <my-peertube-checkbox inputName="liveEnabled" formControlName="enabled">
+                  <ng-template ptTemplate="label">
+                    <ng-container i18n>Allow live streaming</ng-container>
+                  </ng-template>
+
+                  <ng-container ngProjectAs="description">
+                    <div i18n>⚠️ Enabling live streaming requires trust in your users and extra moderation work</div>
+                    <div i18n>If enabled, your server needs to accept incoming TCP traffic on port {{ liveRTMPPort }}</div>
+                  </ng-container>
 
-                <label i18n for="transcodingThreads">Resolutions to generate</label>
+                  <ng-container ngProjectAs="extra">
 
-                <div class="ml-2 mt-2 d-flex flex-column">
-                  <ng-container formGroupName="resolutions">
-                    <div class="form-group" *ngFor="let resolution of resolutions">
+                    <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }">
                       <my-peertube-checkbox
-                        [inputName]="getResolutionKey(resolution.id)" [formControlName]="resolution.id"
-                        labelText="{{resolution.label}}"
+                        inputName="liveAllowReplay" formControlName="allowReplay"
+                        i18n-labelText labelText="Allow your users to automatically publish a replay of their live"
                       >
-                        <ng-template *ngIf="resolution.description" ptTemplate="help">
-                          <div [innerHTML]="resolution.description"></div>
-                        </ng-template>
+                        <ng-container ngProjectAs="description" i18n>
+                          If the user quota is reached, PeerTube will automatically terminate the live streaming
+                        </ng-container>
                       </my-peertube-checkbox>
                     </div>
+
+                    <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }">
+                      <label i18n for="liveMaxInstanceLives">Max simultaneous lives created on your instance <span class="text-muted">(-1 for "unlimited")</span></label>
+                      <div class="number-with-unit">
+                        <input type="number" name="liveMaxInstanceLives" formControlName="maxInstanceLives" />
+                        <span i18n>{form.value['live']['maxInstanceLives'], plural, =1 {live} other {lives}}</span>
+                      </div>
+                    </div>
+
+                    <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }">
+                      <label i18n for="liveMaxUserLives">Max simultaneous lives created per user <span class="text-muted">(-1 for "unlimited")</span></label>
+                      <div class="number-with-unit">
+                        <input type="number" name="liveMaxUserLives" formControlName="maxUserLives" />
+                        <span i18n>{form.value['live']['maxUserLives'], plural, =1 {live} other {lives}}</span>
+                      </div>
+                    </div>
+
+                    <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }">
+                      <label i18n for="liveMaxDuration">Max live duration</label>
+
+                      <ng-select
+                        labelForId="liveMaxDuration" [items]="liveMaxDurationOptions" formControlName="maxDuration"
+                        bindLabel="label" bindValue="value" [clearable]="false" [searchable]="false"
+                      ></ng-select>
+                    </div>
+
                   </ng-container>
+                </my-peertube-checkbox>
+              </div>
+            </ng-container>
+          </div>
+        </div>
+
+        <div class="form-row"> <!-- transcoding live streams grid -->
+          <div class="form-group col-12 col-lg-4 col-xl-3">
+            <div i18n class="inner-form-title">TRANSCODING</div>
+            <div i18n class="inner-form-description">
+              Same as VOD transcoding, transcoding live streams so that they are in a streamable form that any device can play. Requires a beefy CPU, and then some.
+            </div>
+          </div>
+
+          <div class="form-group form-group-right col-12 col-lg-8 col-xl-9">
+
+            <ng-container formGroupName="live">
+              <ng-container formGroupName="transcoding">
+
+                <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() }">
+                  <my-peertube-checkbox
+                    inputName="liveTranscodingEnabled" formControlName="enabled"
+                  >
+                    <ng-template ptTemplate="label">
+                      <ng-container i18n>Transcoding enabled for live streams</ng-container>
+                    </ng-template>
+                  </my-peertube-checkbox>
                 </div>
 
-              </div>
+                <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() || !isLiveTranscodingEnabled() }">
+                  <label i18n for="liveTranscodingThreads">Live resolutions to generate</label>
+
+                  <div class="ml-2 mt-2 d-flex flex-column">
+                    <ng-container formGroupName="resolutions">
+                      <div class="form-group" *ngFor="let resolution of liveResolutions">
+                        <my-peertube-checkbox
+                          [inputName]="getResolutionKey(resolution.id)" [formControlName]="resolution.id"
+                          labelText="{{resolution.label}}"
+                        >
+                          <ng-template *ngIf="resolution.description" ptTemplate="help">
+                            <div [innerHTML]="resolution.description"></div>
+                          </ng-template>
+                        </my-peertube-checkbox>
+                      </div>
+                    </ng-container>
+                  </div>
+                </div>
+
+                <div class="form-group" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() || !isLiveTranscodingEnabled() }">
+                  <label i18n for="liveTranscodingThreads">Live transcoding threads</label>
+                  <span class="text-muted ml-1">
+                    <ng-container *ngIf="getTotalTranscodingThreads().atMost" i18n>will claim at most {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with VOD transcoding</ng-container>
+                    <ng-container *ngIf="!getTotalTranscodingThreads().atMost" i18n>will claim at least {{ getTotalTranscodingThreads().value }} {{ getTotalTranscodingThreads().unit }} with VOD transcoding</ng-container>
+                  </span>
+
+                  <div class="peertube-select-container">
+                    <select id="liveTranscodingThreads" formControlName="threads" class="form-control">
+                      <option *ngFor="let transcodingThreadOption of transcodingThreadOptions" [value]="transcodingThreadOption.value">
+                        {{ transcodingThreadOption.label }} {transcodingThreadOption.value, plural, =0 {} =1 {thread} other {threads}}
+                      </option>
+                    </select>
+                  </div>
+                  <div *ngIf="formErrors.live.transcoding.threads" class="form-error">{{ formErrors.live.transcoding.threads }}</div>
+                </div>
+
+                <div class="form-group mt-4" [ngClass]="{ 'disabled-checkbox-extra': !isLiveEnabled() || !isLiveTranscodingEnabled() }">
+                  <label i18n for="liveTranscodingProfile">Live transcoding profile</label>
+                  <span class="text-muted ml-1" i18n>New live transcoding profiles can be added by PeerTube plugins</span>
 
+                  <div class="peertube-select-container">
+                    <select id="liveTranscodingProfile" formControlName="profile" class="form-control">
+                      <option *ngFor="let liveTranscodingProfileOption of getAvailableTranscodingProfile('live')" [value]="liveTranscodingProfileOption">
+                        {{ liveTranscodingProfileOption }}
+                      </option>
+                    </select>
+                  </div>
+                  <div *ngIf="formErrors.live.transcoding.profile" class="form-error">{{ formErrors.live.transcoding.profile }}</div>
+                </div>
+
+              </ng-container>
             </ng-container>
 
           </div>
         </div>
 
-        <div class="form-row mt-4"> <!-- cache grid -->
+      </ng-template>
+    </ng-container>
+
+    <ng-container ngbNavItem="advanced-configuration">
+      <a ngbNavLink i18n>Advanced configuration</a>
+
+      <ng-template ngbNavContent>
+
+        <div class="form-row mt-5"> <!-- cache grid -->
           <div class="form-group col-12 col-lg-4 col-xl-3">
             <div i18n class="inner-form-title">CACHE</div>
             <div i18n class="inner-form-description">
             <ng-container formGroupName="cache">
               <div class="form-group" formGroupName="previews">
                 <label i18n for="cachePreviewsSize">Number of previews to keep in cache</label>
-                <input
-                  type="number" min="0" id="cachePreviewsSize" class="form-control"
-                  formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.previews.size'] }"
-                >
+                <div class="number-with-unit">
+                  <input
+                    type="number" min="0" id="cachePreviewsSize" class="form-control"
+                    formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.previews.size'] }"
+                  >
+                  <span i18n>{form.value['cache']['previews']['size'], plural, =1 {cached image} other {cached images}}</span>
+                </div>
                 <div *ngIf="formErrors.cache.previews.size" class="form-error">{{ formErrors.cache.previews.size }}</div>
               </div>
 
               <div class="form-group" formGroupName="captions">
                 <label i18n for="cacheCaptionsSize">Number of video captions to keep in cache</label>
-                <input
-                  type="number" min="0" id="cacheCaptionsSize" class="form-control"
-                  formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.captions.size'] }"
-                >
+                <div class="number-with-unit">
+                  <input
+                    type="number" min="0" id="cacheCaptionsSize" class="form-control"
+                    formControlName="size" [ngClass]="{ 'input-error': formErrors['cache.captions.size'] }"
+                  >
+                  <span i18n>{form.value['cache']['captions']['size'], plural, =1 {cached image} other {cached images}}</span>
+                </div>
                 <div *ngIf="formErrors.cache.captions.size" class="form-error">{{ formErrors.cache.captions.size }}</div>
               </div>
             </ng-container>
   <div class="form-row mt-4"> <!-- submit placement block -->
     <div class="col-md-7 col-xl-5"></div>
     <div class="col-md-5 col-xl-5">
-      <span class="form-error submit-error" i18n *ngIf="!form.valid">It seems like the configuration is invalid. Please search for potential errors in the different tabs.</span>
+      <span class="form-error submit-error" i18n *ngIf="!form.valid">
+        It seems like the configuration is invalid. Please search for potential errors in the different tabs.
+      </span>
+
+      <span class="form-error submit-error" i18n *ngIf="!hasLiveAllowReplayConsistentOptions()">
+        You cannot allow live replay if you don't enable transcoding.
+      </span>
 
-      <input (click)="formValidated()" type="submit" i18n-value value="Update configuration" [disabled]="!form.valid">
+      <input (click)="formValidated()" type="submit" i18n-value value="Update configuration" [disabled]="!form.valid || !hasConsistentOptions()">
     </div>
   </div>
 </form>