Skip to content

Instantly share code, notes, and snippets.

@lesniakania
Created July 17, 2014 06:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesniakania/a915d8f848b760db080f to your computer and use it in GitHub Desktop.
Save lesniakania/a915d8f848b760db080f to your computer and use it in GitHub Desktop.
def configure_panda(cloud_id) = nil​
Panda.configure do
access_key PANDA_ACCESS_KEY
secret_key PANDA_SECRET_KEY
cloud_id cloud_id if cloud_id
api_host PANDA_API_HOST
end
end
configure_panda
cloud = Panda::Cloud.create!(
:name => 'your-user-cloud-name',
:aws_access_key => 'your-user-s3-access-key',
:aws_secret_key => 'your-user-s3-secret-key',
:s3_videos_bucket => 'your-user-s3-bucket-name'
)
configure_panda(cloud.id)
profile = Panda::Profile.create!({
:name => "h264",
:extname => ".mp4",
:command => "ffmpeg -y -i $input_file$ -vcodec h264 -acodec libfaac -b:v 1100k -b:a 128k -vf scale=854:480 $output_file$"
})
Panda::Video.create!(:source_url => 'url-to-video-from-user')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment