Check audio files for audio track

This commit is contained in:
Alex Eidt 2022-04-08 15:26:09 -07:00
parent abdeecf6e4
commit b07339a04c
3 changed files with 49 additions and 42 deletions

View file

@ -93,8 +93,13 @@ func NewVideoWriter(filename string, width, height int, options *Options) *Video
if options.audio != "" {
if !exists(options.audio) {
panic("Audio file does not exist.")
panic("Audio file " + options.audio + " does not exist.")
}
if len(ffprobe(options.audio, "a")) == 0 {
panic("Given \"audio\" file " + options.audio + " has no audio.")
}
writer.audio = options.audio
if options.audio_codec == "" {