Check audio files for audio track
This commit is contained in:
parent
abdeecf6e4
commit
b07339a04c
3 changed files with 49 additions and 42 deletions
|
@ -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 == "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue