Skip to content

Commit

Permalink
automatically change target filesize when uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
vladaad committed Dec 14, 2023
1 parent 954609c commit ec8350c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func init() {
forceContaine := flag.String("f", "", "Uses a specific container") // don't mind the cut off letters thanks
mixAudio := flag.Bool("mixaudio", false, "Mix together all audio tracks")
normAudio := flag.Bool("normaudio", false, "Normalize the audio volume")
upload := flag.Bool("upload", false, "Upload the video to the service defined in settings.json")
flag.Parse()

if len(flag.Args()) == 0 {
Expand All @@ -88,6 +89,9 @@ func init() {

// Load defaults
if *targetSizeMB == float64(-1) {
if *upload { // This is only set when the flag is used to ensure that TargetSizeMB in settings can still be used to compensate for overhead in some configs
*targetSizeMB = settings.General.UploadMaxMB
}
*targetSizeMB = settings.General.TargetSizeMB
}
targetSize = int(*targetSizeMB * 8388608) // 1024*1024*8 - in bits
Expand Down

0 comments on commit ec8350c

Please sign in to comment.