add 540p and 360p options

This commit is contained in:
Carl Pearson
2025-02-20 06:00:41 -07:00
parent 6995da6d5d
commit c4e325a23c
3 changed files with 5 additions and 4 deletions

View File

@@ -510,7 +510,7 @@ func processOriginal(originalID uint) {
}
// create video transcodes
for _, targetHeight := range []uint{480, 240, 144} {
for _, targetHeight := range []uint{540, 480, 360, 240, 144} {
if targetHeight <= video.Height {
newVideoTranscode(video.ID, originalID, targetHeight, video.FPS)
break

View File

@@ -47,6 +47,7 @@
<option value="240">240p</option>
<option value="360">360p</option>
<option value="480">480p</option>
<option value="540">540p</option>
<option value="720">720p</option>
<option value="1080">1080p</option>
<option value="2160">2160p</option>

View File

@@ -49,9 +49,9 @@ func videoToVideo(sem chan struct{}, transID uint, srcFilepath string) {
// FIXME: ignoring any requested audio bitrate
// determine audio bitrate
var audioBitrate uint = 160
if trans.Height <= 144 {
if trans.Height <= 240 {
audioBitrate = 64
} else if trans.Height <= 480 {
} else if trans.Height <= 540 {
audioBitrate = 96
} else if trans.Height < 720 {
audioBitrate = 128
@@ -276,7 +276,7 @@ func cleanupTranscodes() {
var trans transcodes.Transcode
err := db.Where("status = ?", "pending").
Order("CASE " +
"WHEN dst_kind = 'video' AND height = 480 THEN 0 " +
"WHEN dst_kind = 'video' AND height = 540 THEN 0 " +
"WHEN dst_kind = 'audio' AND rate = 96 THEN 0 " +
"ELSE 1 END").First(&trans).Error
// err := db.First(&trans, "status = ?", "pending").Error