spec/ffmpeg/encoding_options_spec.rb in streamio-ffmpeg-0.6.7 vs spec/ffmpeg/encoding_options_spec.rb in streamio-ffmpeg-0.6.8
- old
+ new
@@ -68,12 +68,32 @@
it "should convert audio channels" do
EncodingOptions.new(:audio_channels => 2).to_s.should == "-ac 2"
end
+ it "should convert maximum video bitrate" do
+ EncodingOptions.new(:video_max_bitrate => 600).to_s.should == "-maxrate 600k"
+ end
+
+ it "should convert mininimum video bitrate" do
+ EncodingOptions.new(:video_min_bitrate => 600).to_s.should == "-minrate 600k"
+ end
+
+ it "should convert buffer size" do
+ EncodingOptions.new(:buffer_size => 2000).to_s.should == "-bufsize 2000k"
+ end
+
+ it "should convert threads" do
+ EncodingOptions.new(:threads => 2).to_s.should == "-threads 2"
+ end
+
it "should convert a lot of them simultaneously" do
converted = EncodingOptions.new(:video_codec => "libx264", :audio_codec => "aac", :video_bitrate => "1000k").to_s
converted.should match(/-acodec aac/)
+ end
+
+ it "should ignore options with nil value" do
+ EncodingOptions.new(:video_codec => "libx264", :frame_rate => nil).to_s.should == "-vcodec libx264 "
end
end
end
end