Created
July 17, 2014 06:55
-
-
Save lesniakania/a915d8f848b760db080f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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