bakape / thumbnailer

Go media thumbnailer
MIT License
153 stars 36 forks source link

unknown thumbnailing error #13

Closed cedricve closed 6 years ago

cedricve commented 6 years ago

Thank you for your hard work, I'm trying to use your thumbnail library on OSX but I keep getting an error "unknown thumbnailing error" while trying to generate from a mp4. Any ideas?

bakape commented 6 years ago

Can you upload the file causing this?

cedricve commented 6 years ago
import "encoding/base64"
import (
    "fmt"
    "os"
    "github.com/bakape/thumbnailer"
)

func main() {
    fmt.Println("yolo")
    options := thumbnailer.Options{
        ThumbDims: thumbnailer.Dims {
            Width: 10,
            Height: 10,
        },
    }

    file, _ := os.Open("/Users/cedricverst/Desktop/no_sound.mp4")
    src, thumb, err := thumbnailer.Process(file, options)
    fmt.Println(err)
    imgData := thumb.Image.Data
    str := base64.StdEncoding.EncodeToString(imgData)
    fmt.Println(str)
}
cedricve commented 6 years ago

@bakape not sure how you installed FFMPEG and Imagemagick on Linux, but I'm getting pkg errors.

 Package libavcodec was not found in the pkg-config search path.
 Perhaps you should add the directory containing `libavcodec.pc'
 to the PKG_CONFIG_PATH environment variable
bakape commented 6 years ago

Yeah, you are missing libraries. No clue how to install those on OS X.

cedricve commented 6 years ago

Thanks @bakape, well I also tried to install it on a Ubuntu VPS, using the default apt-repo libraries. Not sure what's the best way is to install ffmpeg/imagemagick, so it works with your library.

bakape commented 6 years ago

Are you sure you installed them all? Should be something like pkg-config libpth-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libgraphicsmagick1-dev on Ubuntu.

cedricve commented 6 years ago

hey, i tried it on a centos7 machine and all works as expected. Thanks.