Skip to content

Instantly share code, notes, and snippets.

@drale2k
Created August 30, 2012 12:58
Show Gist options
  • Save drale2k/3528007 to your computer and use it in GitHub Desktop.
Save drale2k/3528007 to your computer and use it in GitHub Desktop.
Zencoder::Job.create({
:input => video.video,
:region => "europe",
:test => !Rails.env.production?,
:output => [
{
:type => "segmented",
:base_url => base_url,
:filename => "#{video.id}_low.m3u8".downscore,
:format => "ts",
:width => 1024,
:video_bitrate => 750,
:audio_bitrate => 56,
:decoder_bitrate_cap => 1125,
:decoder_buffer_size => 3000,
:audio_sample_rate => 22050,
:public => 1,
:notifications => [
{
:url => notification_url,
:format => "json"
}
]
},
{
:type => "segmented",
:base_url => base_url,
:filename => "#{video.id}_high.m3u8".downscore,
:format => "ts",
:width => 1024,
:video_bitrate => 1200,
:audio_bitrate => 112,
:decoder_bitrate_cap => 1800,
:decoder_buffer_size => 4800,
:audio_sample_rate => 44100,
:public => 1,
:notifications => [
{
:url => notification_url,
:format => "json"
}
]
},
{
:base_url => base_url,
:label => "playlist",
:filename => "playlist.m3u8",
:public => 1,
:type => "playlist",
:streams => [
{
:bandwidth => 640,
:path => "#{video.id}_low.m3u8".downscore
},
{
:bandwidth => 1400,
:path => "#{video.id}_high.m3u8".downscore
}
],
:notifications => [
{
:url => notification_url,
:format => "json"
}
]
}
]
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment