lib/xmorph/kalpnik/kalpnik/transcode.rb in xmorph-0.1.2 vs lib/xmorph/kalpnik/kalpnik/transcode.rb in xmorph-0.1.3
- old
+ new
@@ -1,14 +1,12 @@
class Transcode < XMorph::Base
SCALE_TO_720p = "720"
- SCALE_TO_1080p = "1080"
def set_profiles
self.profiles = {
SCALE_TO_720p => "ffmpeg -y -i %{IN} -vf \"fps=fps=29.970000,scale=1280x720\" -pix_fmt yuv420p -vcodec h264 -g 13 -bf 2 -x264opts nal-hrd=cbr -profile:v high -vb 8000000 -minrate:v 8000000 -maxrate:v 8000000-bufsize:v 24000000 -ar 48000 -acodec libfdk_aac -profile:a aac_low -ab 192k -map 0:v -map 0:a:0 -muxrate 8600000 -streamid 0:2064 -streamid 1:2068 -vsync 1 -async 1 %{OUT}",
- SCALE_TO_1080p => "ffmpeg -y -i %{IN} -vf \"fps=fps=29.970000,scale=1280x720\" -pix_fmt yuv420p -vcodec h264 -g 13 -bf 2 -x264opts nal-hrd=cbr -profile:v high -vb 8000000 -minrate:v 8000000 -maxrate:v 8000000 -bufsize:v 24000000 -ar 48000 -acodec libfdk_aac -profile:a aac_low -ab 192k -map 0:v -map 0:a:0 -muxrate 8600000 -streamid 0:2064 -streamid 1:2068 -vsync 1 -async 1 %{OUT}",
}
end
def video_checks
{
@@ -33,16 +31,10 @@
# Classification is based on Height
# Videos with height greater than 720 are transcoded as 1920p
# Videos with height 720 or lesser are transcoded as 720p
def set_profile_name
- self.profile_name = nil
- self.error = nil
- mediainfo = self.mediainfo_output
- video_info = mediainfo["Video"]
- height = (video_info["Original_height"] || video_info["Height"]).split("pixels")[0].gsub(/ /,"").to_i
- XMorph::Base.logger.debug("XMorph#get_profile#kalpnik: Got Height: #{height}")
- self.profile_name = (height.to_i > 720)? "1080" : "720"
- XMorph::Base.logger.debug("XMorph#get_profile#kalpnik: using profile #{self.profile_name}") unless self.profile_name.nil?
+ self.profile_name = SCALE_TO_720p
+ XMorph::Base.logger.debug("XMorph#set_profile_name#kalpnik: using profile #{self.profile_name}") unless self.profile_name.nil?
return true
end
end
\ No newline at end of file