streamio-ffmpeg 0.6.8.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.7.0 2010-07-07
2
+
3
+ * Support for ffpresets through video_preset, audio_preset and file_preset encoding options
4
+ * Added encoding option video_bitrate_tolerance
5
+
1
6
  == 0.6.8.1 2010-07-06
2
7
 
3
8
  * Bugfix - aspect ratio was not calculated properly on movies with no DAR
data/README.rdoc CHANGED
@@ -54,7 +54,7 @@ Give custom command line options with a string.
54
54
 
55
55
  Use the EncodingOptions parser for humanly readable transcoding options. Below you'll find most of the supported options. Note that the :custom key will be used as is without modification so use it for any tricky business you might need.
56
56
 
57
- options = {:video_codec => "libx264", :frame_rate => 10, :resolution => "320x240", :video_bitrate => 300,
57
+ options = {:video_codec => "libx264", :frame_rate => 10, :resolution => "320x240", :video_bitrate => 300, :video_bitrate_tolerance => 100,
58
58
  :croptop => 60, :cropbottom => 60, :cropleft => 10, :cropright => 10, :aspect => 1.333333,
59
59
  :audio_codec => "libfaac", :audio_bitrate => 32, :audio_sample_rate => 22050, :audio_channels => 1,
60
60
  :threads => 2,
@@ -87,7 +87,12 @@ Preserve aspect ratio on width or height by using the preserve_aspect_ratio tran
87
87
  For constant bitrate encoding use video_min_bitrate and video_max_bitrate with buffer_size.
88
88
 
89
89
  options = {:video_min_bitrate => 600, :video_max_bitrate => 600, :buffer_size => 2000}
90
- movie.transcode("movie.mp4", options)
90
+ movie.transcode("movie.flv", options)
91
+
92
+ Use ffpreset files to avoid headaches when encoding with libx264 (http://www.ffmpeg.org/ffmpeg-doc.html#SEC13).
93
+
94
+ options = {:video_codec => "libx264", :video_preset => "medium"} # audio_preset and file_preset also availible
95
+ movie.transcode("movie.mp4", options) # encodes video using libx264-medium.ffpreset
91
96
 
92
97
  == Copyright
93
98
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.8.1
1
+ 0.7.0
@@ -99,10 +99,26 @@ module FFMPEG
99
99
  "-bufsize #{k_format(value)}"
100
100
  end
101
101
 
102
+ def convert_video_bitrate_tolerance(value)
103
+ "-bt #{k_format(value)}"
104
+ end
105
+
102
106
  def convert_threads(value)
103
107
  "-threads #{value}"
104
108
  end
105
109
 
110
+ def convert_video_preset(value)
111
+ "-vpre #{value}"
112
+ end
113
+
114
+ def convert_audio_preset(value)
115
+ "-apre #{value}"
116
+ end
117
+
118
+ def convert_file_preset(value)
119
+ "-fpre #{value}"
120
+ end
121
+
106
122
  def convert_custom(value)
107
123
  value
108
124
  end
@@ -78,6 +78,10 @@ module FFMPEG
78
78
  EncodingOptions.new(:video_min_bitrate => 600).to_s.should == "-minrate 600k"
79
79
  end
80
80
 
81
+ it "should convert video bitrate tolerance" do
82
+ EncodingOptions.new(:video_bitrate_tolerance => 100).to_s.should == "-bt 100k"
83
+ end
84
+
81
85
  it "should convert buffer size" do
82
86
  EncodingOptions.new(:buffer_size => 2000).to_s.should == "-bufsize 2000k"
83
87
  end
@@ -86,6 +90,18 @@ module FFMPEG
86
90
  EncodingOptions.new(:threads => 2).to_s.should == "-threads 2"
87
91
  end
88
92
 
93
+ it "should convert video preset" do
94
+ EncodingOptions.new(:video_preset => "max").to_s.should == "-vpre max"
95
+ end
96
+
97
+ it "should convert audio preset" do
98
+ EncodingOptions.new(:audio_preset => "max").to_s.should == "-apre max"
99
+ end
100
+
101
+ it "should convert file preset" do
102
+ EncodingOptions.new(:file_preset => "max.ffpreset").to_s.should == "-fpre max.ffpreset"
103
+ end
104
+
89
105
  it "should convert a lot of them simultaneously" do
90
106
  converted = EncodingOptions.new(:video_codec => "libx264", :audio_codec => "aac", :video_bitrate => "1000k").to_s
91
107
  converted.should match(/-acodec aac/)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{streamio-ffmpeg}
8
- s.version = "0.6.8.1"
8
+ s.version = "0.7.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David Backeus"]
12
- s.date = %q{2010-07-06}
12
+ s.date = %q{2010-07-07}
13
13
  s.description = %q{Simple wrapper around ffmpeg to get metadata from movies and do transcoding}
14
14
  s.email = %q{duztdruid@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: streamio-ffmpeg
3
3
  version: !ruby/object:Gem::Version
4
- hash: 93
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 6
9
- - 8
10
- - 1
11
- version: 0.6.8.1
8
+ - 7
9
+ - 0
10
+ version: 0.7.0
12
11
  platform: ruby
13
12
  authors:
14
13
  - David Backeus
@@ -16,7 +15,7 @@ autorequire:
16
15
  bindir: bin
17
16
  cert_chain: []
18
17
 
19
- date: 2010-07-06 00:00:00 +02:00
18
+ date: 2010-07-07 00:00:00 +02:00
20
19
  default_executable:
21
20
  dependencies:
22
21
  - !ruby/object:Gem::Dependency