alpha patterns
This commit is contained in:
+13
-1
@@ -48,6 +48,7 @@ type appArgs struct {
|
||||
videoFPS string
|
||||
videoUUID string
|
||||
noVideo bool
|
||||
videoAlpha bool
|
||||
videoBackend string
|
||||
|
||||
audioChannels uint8
|
||||
@@ -173,6 +174,12 @@ func validateMediaSelection(args appArgs) error {
|
||||
if args.noVideo && args.audioFlowDefFile == "" && args.audioChannels == 0 {
|
||||
return fmt.Errorf("--no-video requires audio enabled with --channel or --audio")
|
||||
}
|
||||
if args.videoAlpha && args.noVideo {
|
||||
return fmt.Errorf("--alpha cannot be used with --no-video")
|
||||
}
|
||||
if args.videoAlpha && args.videoFlowDefFile != "" {
|
||||
return fmt.Errorf("--alpha cannot be used with --video; set media_type to %q in the flow definition", flowdef.MediaTypeV210A)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -287,6 +294,7 @@ func addFlags(fs *pflag.FlagSet, args *appArgs) {
|
||||
fs.StringVar(&args.videoFPS, "fps", "25", "Video pattern FPS")
|
||||
fs.StringVar(&args.videoUUID, "video-id", "", "Video UUID. Will be created, if not provided")
|
||||
fs.BoolVar(&args.noVideo, "no-video", false, "Disable video generation; audio must be enabled")
|
||||
fs.BoolVar(&args.videoAlpha, "alpha", false, "Generate video/v210a with a moving transparent square")
|
||||
fs.StringVar(&args.videoBackend, "backend", string(video.BackendAuto), "Video generator backend: auto, gpu or cpu")
|
||||
// Audio pattern flags
|
||||
fs.Uint8VarP(&args.audioChannels, "channel", "c", 0, "Amount of audio channels. Each channel: num * 1kHz")
|
||||
@@ -370,7 +378,11 @@ func buildVideoConfig(args appArgs) (*video.Config, error) {
|
||||
}
|
||||
|
||||
var err error
|
||||
definition, err = flowdef.NewV210Video(
|
||||
newVideo := flowdef.NewV210Video
|
||||
if args.videoAlpha {
|
||||
newVideo = flowdef.NewV210AVideo
|
||||
}
|
||||
definition, err = newVideo(
|
||||
args.videoUUID,
|
||||
args.videoWidth,
|
||||
args.videoHeight,
|
||||
|
||||
Reference in New Issue
Block a user