photoprism/internal/ffmpeg/config_test.go

30 lines
572 B
Go
Raw Normal View History

2023-07-20 19:17:45 +02:00
package ffmpeg
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestOptions_VideoFilter(t *testing.T) {
Options := &Options{
Bin: "",
Encoder: "intel",
Size: 1500,
Bitrate: "50M",
2023-07-20 19:17:45 +02:00
MapVideo: "",
MapAudio: "",
}
t.Run("rgb32", func(t *testing.T) {
r := Options.VideoFilter("rgb32")
assert.Contains(t, r, "format=rgb32")
assert.Contains(t, r, "min(1500, iw)")
})
t.Run("empty format", func(t *testing.T) {
r := Options.VideoFilter("")
assert.NotContains(t, r, "format")
assert.Contains(t, r, "min(1500, iw)")
})
}