Can I use Amazon Elastic Transcoder to only create thumbnails?

我与影子孤独终老i 提交于 2019-12-23 08:28:28

问题


I have a Rails app using Paperclip to upload and store videos on Amazon S3. I'm not particularly interested converting the video files into another format, or adding watermarks, nothing fancy. I just want to create thumbnails from the videos to use as poster images on my video players.

I see that Amazon Elastic Transcoder allows for free thumbnail creation (or rather, they don't charge for thumbnail creation), and since I'm already using Amazon services, I wanted to see if I can use this for my thumbnails.

Does anyone know how to set the input/output options such that no file is generated aside from thumbnails? Could I just do the following?

transcoder = AWS::ElasticTranscoder::Client.new
transcoder.create_job(
  pipeline_id: APP_CONFIG[Rails.env][:pipeline_id],
  input: {
    key: VIDEOPATH,
    frame_rate: 'auto',
    resolution: 'auto',
    aspect_ratio: 'auto',
    interlaced: 'auto',
    container: 'auto'
      },
       output: {
       key: , #LEAVE THIS BLANK TOO?
        preset_id: , #LEAVE THIS BLANK?
        thumbnail_pattern: "thumbnail", 
        rotate: '0'
      }
    )

回答1:


No.

There are no functions for creating only thumbnails.

It also is not possible to create a new transcoding job without actually transcoding anything. The input parameters require, at minimum, the name of an input video. The output parameters require, at minimum, the name of the output file and a preset ID. Parameters are checked prior to starting the job, and there are no options which would prevent the job from executing while creating a thumbnail.

You can read about all of the available functions here:

http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/api-reference.html

Give ffmpeg a look. It can be a little bit of a hassle to install, but it can create thumbnails from videos.




回答2:


Amazon Elastic Transcoder does provide functionality for thumbnails. http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/preset-settings.html#preset-settings-thumbnails

It looks like you do indeed have to transcode a video file in order to get thumbnails though.



来源:https://stackoverflow.com/questions/17604916/can-i-use-amazon-elastic-transcoder-to-only-create-thumbnails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!