"Not Found" when generating thumbnail
|
|
I’m trying to generate a thumbnail like so: HeyWatch::EncodedVideo.find("284387").thumbnail :start => 2, :width => 640, :height => 480
When doing that, Rails throws a “Not Found” error. Just doing |
|
|
As an update to this, when doing File.open on the .thumbnail generation I get: A Errno::ENOENT occurred in ping#encode: No such file or directory - ÿØÿþ |
|
|
With your browser, go to http://heywatch.com/encoded_video/284387.jpg?start=2&width=640&height=480 What is the response? |
|
|
That works, but when I try to do that with File.open I get a 401 Unauthorized message. |
|
|
Hmm, the thumbnail method returns binary data directly. What is your code? You should do this:
thumb = HeyWatch::EncodedVideo.find("284387").thumbnail :start => 2, :width => 640, :height => 480
File.open("thumb.jpg", "wb") {|f| f.write(thumb) }
|
|
|
What does “thumb.jpg” reference? I’m trying to upload the generated thumbnail to S3 like so:
@videothumb = HeyWatch::EncodedVideo.find("284387").thumbnail :start => 2, :width => 640, :height => 480
S3Object.store(
"video/#{@item.id}/#{@item.key}.jpg",
File.open(@videothumb, "r"),
"media.pugspot.com",
:access => :public_read
)
|
|
|
It’s not correct since @videothumb is not a file but binary data.
@videothumb = HeyWatch::EncodedVideo.find("284387").thumbnail :start => 2, :width => 640, :height => 480
S3Object.store(
"video/#{@item.id}/#{@item.key}.jpg",
@videothumb,
"media.pugspot.com",
:access => :public_read
)
|
|
|
Ah, there we go. :) That worked. Thanks Bruno! |