photoprism/internal/commands/show_video_sizes.go
Michael Mayer 3cf1c699df Video: Refactor FFmpeg Transcoding Size Limit #3466 #3498 #3549
Signed-off-by: Michael Mayer <michael@photoprism.app>
2023-07-18 15:15:04 +02:00

30 lines
690 B
Go

package commands
import (
"fmt"
"github.com/urfave/cli"
"github.com/photoprism/photoprism/internal/thumb"
"github.com/photoprism/photoprism/pkg/report"
)
// ShowVideoSizesCommand configures the command name, flags, and action.
var ShowVideoSizesCommand = cli.Command{
Name: "video-sizes",
Usage: "Displays supported standard video sizes",
Flags: report.CliFlags,
Action: showVideoSizesAction,
}
// showVideoSizesAction displays supported standard video sizes.
func showVideoSizesAction(ctx *cli.Context) error {
rows, cols := thumb.Report(thumb.VideoSizes, true)
result, err := report.RenderFormat(rows, cols, report.CliFormat(ctx))
fmt.Println(result)
return err
}