Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun
commit
07124d2124
@ -0,0 +1,5 @@
|
||||
class AddTranscodedToVideo < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :videos, :transcoded, :boolean, default: false
|
||||
end
|
||||
end
|
@ -0,0 +1,12 @@
|
||||
#coding=utf-8
|
||||
namespace :video_transcode do
|
||||
desc "视频转码成h264"
|
||||
task :submit => :environment do
|
||||
Video.find_each do |v|
|
||||
if v.uuid && !v.transcoded && !v.file_url.include?('.mp4') && !AliyunVod::Service.get_meta_code_info(v.uuid).start_with?("h264", "h265")
|
||||
p "--- Start submit video trans code #{v.uuid}"
|
||||
AliyunVod::Service.submit_transcode_job(v.uuid, 'a0277c5c0c7458458e171b0cee6ebf5e')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in new issue