ffmpeg 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (154) hide show
  1. data/.gitignore +4 -0
  2. data/LICENSE +20 -0
  3. data/README.textile +45 -0
  4. data/Rakefile +45 -0
  5. data/VERSION.yml +5 -0
  6. data/features/ffmpeg.feature +9 -0
  7. data/features/steps/ffmpeg_steps.rb +0 -0
  8. data/features/support/env.rb +11 -0
  9. data/ffmpeg.gemspec +86 -0
  10. data/lib/ffmpeg.rb +121 -0
  11. data/lib/ffmpeg/audio_options.rb +47 -0
  12. data/lib/ffmpeg/class_methods.rb +18 -0
  13. data/lib/ffmpeg/ffmpeg_command.rb +25 -0
  14. data/lib/ffmpeg/file_extensions.rb +150 -0
  15. data/lib/ffmpeg/helper_methods.rb +8 -0
  16. data/lib/ffmpeg/main_options.rb +165 -0
  17. data/lib/ffmpeg/meta_data.rb +22 -0
  18. data/lib/ffmpeg/video_advanced_options.rb +275 -0
  19. data/lib/ffmpeg/video_options.rb +197 -0
  20. data/rdoc/classes/FFMpeg.html +250 -0
  21. data/rdoc/classes/FFMpeg.src/M000005.html +27 -0
  22. data/rdoc/classes/FFMpeg.src/M000006.html +29 -0
  23. data/rdoc/classes/FFMpeg.src/M000007.html +18 -0
  24. data/rdoc/classes/FFMpeg.src/M000008.html +24 -0
  25. data/rdoc/classes/FFMpeg/AudioOptions.html +269 -0
  26. data/rdoc/classes/FFMpeg/AudioOptions.src/M000093.html +18 -0
  27. data/rdoc/classes/FFMpeg/AudioOptions.src/M000094.html +18 -0
  28. data/rdoc/classes/FFMpeg/AudioOptions.src/M000095.html +18 -0
  29. data/rdoc/classes/FFMpeg/AudioOptions.src/M000096.html +18 -0
  30. data/rdoc/classes/FFMpeg/AudioOptions.src/M000097.html +18 -0
  31. data/rdoc/classes/FFMpeg/AudioOptions.src/M000098.html +18 -0
  32. data/rdoc/classes/FFMpeg/AudioOptions.src/M000099.html +18 -0
  33. data/rdoc/classes/FFMpeg/AudioOptions.src/M000100.html +18 -0
  34. data/rdoc/classes/FFMpeg/ClassMethods.html +131 -0
  35. data/rdoc/classes/FFMpeg/ClassMethods.src/M000049.html +18 -0
  36. data/rdoc/classes/FFMpeg/HelperMethods.html +131 -0
  37. data/rdoc/classes/FFMpeg/HelperMethods.src/M000074.html +19 -0
  38. data/rdoc/classes/FFMpeg/MainOptions.html +494 -0
  39. data/rdoc/classes/FFMpeg/MainOptions.src/M000075.html +18 -0
  40. data/rdoc/classes/FFMpeg/MainOptions.src/M000076.html +18 -0
  41. data/rdoc/classes/FFMpeg/MainOptions.src/M000077.html +18 -0
  42. data/rdoc/classes/FFMpeg/MainOptions.src/M000078.html +18 -0
  43. data/rdoc/classes/FFMpeg/MainOptions.src/M000079.html +18 -0
  44. data/rdoc/classes/FFMpeg/MainOptions.src/M000080.html +18 -0
  45. data/rdoc/classes/FFMpeg/MainOptions.src/M000081.html +18 -0
  46. data/rdoc/classes/FFMpeg/MainOptions.src/M000082.html +18 -0
  47. data/rdoc/classes/FFMpeg/MainOptions.src/M000083.html +18 -0
  48. data/rdoc/classes/FFMpeg/MainOptions.src/M000084.html +18 -0
  49. data/rdoc/classes/FFMpeg/MainOptions.src/M000085.html +18 -0
  50. data/rdoc/classes/FFMpeg/MainOptions.src/M000086.html +18 -0
  51. data/rdoc/classes/FFMpeg/MainOptions.src/M000087.html +18 -0
  52. data/rdoc/classes/FFMpeg/MainOptions.src/M000088.html +18 -0
  53. data/rdoc/classes/FFMpeg/MainOptions.src/M000089.html +18 -0
  54. data/rdoc/classes/FFMpeg/MainOptions.src/M000090.html +18 -0
  55. data/rdoc/classes/FFMpeg/MainOptions.src/M000091.html +18 -0
  56. data/rdoc/classes/FFMpeg/MetaData.html +151 -0
  57. data/rdoc/classes/FFMpeg/MetaData.src/M000092.html +24 -0
  58. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.html +924 -0
  59. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000009.html +18 -0
  60. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000010.html +18 -0
  61. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000011.html +18 -0
  62. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000012.html +18 -0
  63. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000013.html +18 -0
  64. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000014.html +18 -0
  65. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000015.html +18 -0
  66. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000016.html +18 -0
  67. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000017.html +18 -0
  68. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000018.html +18 -0
  69. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000019.html +18 -0
  70. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000020.html +18 -0
  71. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000021.html +18 -0
  72. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000022.html +18 -0
  73. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000023.html +18 -0
  74. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000024.html +18 -0
  75. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000025.html +18 -0
  76. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000026.html +18 -0
  77. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000027.html +18 -0
  78. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000028.html +18 -0
  79. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000029.html +18 -0
  80. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000030.html +18 -0
  81. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000031.html +18 -0
  82. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000032.html +18 -0
  83. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000033.html +18 -0
  84. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000034.html +18 -0
  85. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000035.html +18 -0
  86. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000036.html +18 -0
  87. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000037.html +18 -0
  88. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000038.html +18 -0
  89. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000039.html +18 -0
  90. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000040.html +18 -0
  91. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000041.html +18 -0
  92. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000042.html +18 -0
  93. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000043.html +18 -0
  94. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000044.html +18 -0
  95. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000045.html +18 -0
  96. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000046.html +22 -0
  97. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000047.html +18 -0
  98. data/rdoc/classes/FFMpeg/VideoAdvancedOptions.src/M000048.html +18 -0
  99. data/rdoc/classes/FFMpeg/VideoOptions.html +630 -0
  100. data/rdoc/classes/FFMpeg/VideoOptions.src/M000050.html +18 -0
  101. data/rdoc/classes/FFMpeg/VideoOptions.src/M000051.html +18 -0
  102. data/rdoc/classes/FFMpeg/VideoOptions.src/M000052.html +18 -0
  103. data/rdoc/classes/FFMpeg/VideoOptions.src/M000053.html +18 -0
  104. data/rdoc/classes/FFMpeg/VideoOptions.src/M000054.html +18 -0
  105. data/rdoc/classes/FFMpeg/VideoOptions.src/M000055.html +18 -0
  106. data/rdoc/classes/FFMpeg/VideoOptions.src/M000056.html +18 -0
  107. data/rdoc/classes/FFMpeg/VideoOptions.src/M000057.html +18 -0
  108. data/rdoc/classes/FFMpeg/VideoOptions.src/M000058.html +18 -0
  109. data/rdoc/classes/FFMpeg/VideoOptions.src/M000059.html +18 -0
  110. data/rdoc/classes/FFMpeg/VideoOptions.src/M000060.html +18 -0
  111. data/rdoc/classes/FFMpeg/VideoOptions.src/M000061.html +18 -0
  112. data/rdoc/classes/FFMpeg/VideoOptions.src/M000062.html +18 -0
  113. data/rdoc/classes/FFMpeg/VideoOptions.src/M000063.html +18 -0
  114. data/rdoc/classes/FFMpeg/VideoOptions.src/M000064.html +18 -0
  115. data/rdoc/classes/FFMpeg/VideoOptions.src/M000065.html +18 -0
  116. data/rdoc/classes/FFMpeg/VideoOptions.src/M000066.html +18 -0
  117. data/rdoc/classes/FFMpeg/VideoOptions.src/M000067.html +18 -0
  118. data/rdoc/classes/FFMpeg/VideoOptions.src/M000068.html +18 -0
  119. data/rdoc/classes/FFMpeg/VideoOptions.src/M000069.html +18 -0
  120. data/rdoc/classes/FFMpeg/VideoOptions.src/M000070.html +18 -0
  121. data/rdoc/classes/FFMpeg/VideoOptions.src/M000071.html +18 -0
  122. data/rdoc/classes/FFMpeg/VideoOptions.src/M000072.html +18 -0
  123. data/rdoc/classes/FFMpeg/VideoOptions.src/M000073.html +18 -0
  124. data/rdoc/classes/FFMpegCommand.html +176 -0
  125. data/rdoc/classes/FFMpegCommand.src/M000001.html +18 -0
  126. data/rdoc/classes/FFMpegCommand.src/M000002.html +18 -0
  127. data/rdoc/classes/FFMpegCommand.src/M000003.html +18 -0
  128. data/rdoc/classes/FFMpegCommand.src/M000004.html +22 -0
  129. data/rdoc/classes/FileExtensions.html +118 -0
  130. data/rdoc/created.rid +1 -0
  131. data/rdoc/files/README_textile.html +171 -0
  132. data/rdoc/files/lib/ffmpeg/audio_options_rb.html +101 -0
  133. data/rdoc/files/lib/ffmpeg/class_methods_rb.html +101 -0
  134. data/rdoc/files/lib/ffmpeg/ffmpeg_command_rb.html +101 -0
  135. data/rdoc/files/lib/ffmpeg/file_extensions_rb.html +101 -0
  136. data/rdoc/files/lib/ffmpeg/helper_methods_rb.html +101 -0
  137. data/rdoc/files/lib/ffmpeg/main_options_rb.html +101 -0
  138. data/rdoc/files/lib/ffmpeg/meta_data_rb.html +101 -0
  139. data/rdoc/files/lib/ffmpeg/video_advanced_options_rb.html +101 -0
  140. data/rdoc/files/lib/ffmpeg/video_options_rb.html +101 -0
  141. data/rdoc/files/lib/ffmpeg_rb.html +116 -0
  142. data/rdoc/fr_class_index.html +36 -0
  143. data/rdoc/fr_file_index.html +36 -0
  144. data/rdoc/fr_method_index.html +126 -0
  145. data/rdoc/index.html +24 -0
  146. data/rdoc/rdoc-style.css +208 -0
  147. data/spec/audio_options_spec.rb +72 -0
  148. data/spec/ffmpeg_spec.rb +161 -0
  149. data/spec/files/terminal.mpg +0 -0
  150. data/spec/meta_spec.rb +15 -0
  151. data/spec/spec_helper.rb +11 -0
  152. data/spec/video_advanced_options_spec.rb +349 -0
  153. data/spec/video_options_spec.rb +200 -0
  154. metadata +213 -0
@@ -0,0 +1,161 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe "FFMpeg" do
4
+ before(:each) do
5
+ @from_file, @to_file = "~/Desktop/avi/test.avi", "~/Desktop/avi/test2.avi"
6
+ @to_file_from_mp4_shortcut = "~/Desktop/avi/test.mp4"
7
+ FFMpegCommand.clear
8
+ end
9
+
10
+ it "should generate a valid command" do
11
+ convert @from_file, :to => @to_file
12
+
13
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} #{@to_file}")
14
+ end
15
+
16
+ it "should generate a valid command when fed an empty block" do
17
+ convert(@from_file, :to => @to_file) {}
18
+
19
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} #{@to_file}")
20
+ end
21
+
22
+ it "should generate a valid command when fed only an extensions as :to" do
23
+ convert @from_file, :to => :mp4
24
+
25
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} #{@to_file_from_mp4_shortcut}")
26
+ end
27
+
28
+ it "should generate a valid command without specifying :to" do
29
+ convert @from_file
30
+
31
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file}")
32
+ end
33
+
34
+ end
35
+
36
+ describe "FFMpeg Main Options" do
37
+ before(:each) do
38
+ @from_file, @to_file = "~/Desktop/test.avi", "~/Desktop/test2.flv"
39
+ FFMpegCommand.clear
40
+ end
41
+
42
+ it "should overwrite existing files" do
43
+ convert @from_file, :to => @to_file do
44
+ overwrite_existing_file
45
+ end
46
+
47
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -y -i #{@from_file} #{@to_file}")
48
+ end
49
+
50
+ it "should set a duration" do
51
+ convert @from_file, :to => @to_file do
52
+ duration "00:03:01"
53
+ end
54
+
55
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} -t 00:03:01 #{@to_file}")
56
+ end
57
+
58
+ it "should set a file size limit" do
59
+ convert @from_file, :to => @to_file do
60
+ file_size_limit 104_857_600
61
+ end
62
+
63
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} -fs 104857600 #{@to_file}")
64
+ end
65
+
66
+ it "should seek to the specified time position" do
67
+ convert @from_file, :to => @to_file do
68
+ seek "00:03:01"
69
+ end
70
+
71
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} -ss 00:03:01 #{@to_file}")
72
+ end
73
+
74
+ it "should the input time offset" do
75
+ convert @from_file, :to => @to_file do
76
+ offset "00:03:01"
77
+ end
78
+
79
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} -itsoffset 00:03:01 #{@to_file}")
80
+ end
81
+
82
+ it "should the title" do
83
+ convert @from_file, :to => @to_file do
84
+ title "Some Title"
85
+ end
86
+
87
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} -title 'Some Title' #{@to_file}")
88
+ end
89
+
90
+ it "should the author" do
91
+ convert @from_file, :to => @to_file do
92
+ author "PMH"
93
+ end
94
+
95
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} -author 'PMH' #{@to_file}")
96
+ end
97
+
98
+ it "should the copyright" do
99
+ convert @from_file, :to => @to_file do
100
+ copyright "(c) Patrik Hedman 2009"
101
+ end
102
+
103
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} -copyright '(c) Patrik Hedman 2009' #{@to_file}")
104
+ end
105
+
106
+ it "should the comment" do
107
+ convert @from_file, :to => @to_file do
108
+ comment "Some Comment"
109
+ end
110
+
111
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} -comment 'Some Comment' #{@to_file}")
112
+ end
113
+
114
+ it "should the album" do
115
+ convert @from_file, :to => @to_file do
116
+ album "An awesome album"
117
+ end
118
+
119
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} -album 'An awesome album' #{@to_file}")
120
+ end
121
+
122
+ it "should the track" do
123
+ convert @from_file, :to => @to_file do
124
+ track 1
125
+ end
126
+
127
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} -track 1 #{@to_file}")
128
+ end
129
+
130
+ it "should the year" do
131
+ convert @from_file, :to => @to_file do
132
+ year 1985
133
+ end
134
+
135
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} -year 1985 #{@to_file}")
136
+ end
137
+
138
+ it "should the target" do
139
+ convert @from_file, :to => @to_file do
140
+ target "vcd"
141
+ end
142
+
143
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} -target vcd #{@to_file}")
144
+ end
145
+
146
+ it "should the number of frames to record" do
147
+ convert @from_file, :to => @to_file do
148
+ frames_to_record 50
149
+ end
150
+
151
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} -dframes 50 #{@to_file}")
152
+ end
153
+
154
+ it "should set the subtitle codec" do
155
+ convert @from_file, :to => @to_file do
156
+ subtitle_codec 'copy'
157
+ end
158
+
159
+ FFMpegCommand.command("ffmpeg").should eql("ffmpeg -i #{@from_file} -scodec copy #{@to_file}")
160
+ end
161
+ end
Binary file
@@ -0,0 +1,15 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe "Video Meta Data" do
4
+
5
+ before(:each) do
6
+ @from_file = File.join(Dir.pwd, 'spec/files/terminal.mpg')
7
+ end
8
+
9
+ it "should get meta data" do
10
+ convert @from_file, :to => :mp4 do
11
+ meta[:file_name].should eql("terminal.mpg")
12
+ end
13
+ end
14
+
15
+ end
@@ -0,0 +1,11 @@
1
+ require 'rubygems'
2
+ require 'spec'
3
+
4
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
5
+
6
+ require 'ffmpeg'
7
+ include FFMpeg
8
+
9
+ Spec::Runner.configure do |config|
10
+
11
+ end
@@ -0,0 +1,349 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe "FFMpeg Video Advanced Options" do
4
+ before(:each) do
5
+ @from_file, @to_file = "~/Desktop/test.avi", "~/Desktop/test2.avi"
6
+ FFMpegCommand.clear
7
+ end
8
+
9
+ it "should set the pixel format" do
10
+ convert @from_file, :to => @to_file do
11
+ pixel_format 'list'
12
+ end
13
+
14
+ FFMpegCommand.command("ffmpeg").should match(/-pix_fmt list/)
15
+ end
16
+
17
+ it "should set the SwScaler flags" do
18
+ convert @from_file, :to => @to_file do
19
+ swscaler_flags 'flag'
20
+ end
21
+
22
+ FFMpegCommand.command("ffmpeg").should match(/-sws_flags flag/)
23
+ end
24
+
25
+ it "should set the group of pictures size" do
26
+ convert @from_file, :to => @to_file do
27
+ group_of_pictures_size 200
28
+ end
29
+
30
+ FFMpegCommand.command("ffmpeg").should match(/-g 200/)
31
+ end
32
+
33
+ it "should set to use only intra frames" do
34
+ convert @from_file, :to => @to_file do
35
+ use_only_intra_frames
36
+ end
37
+
38
+ FFMpegCommand.command("ffmpeg").should match(/-intra/)
39
+ end
40
+
41
+ it "should set the discard threshold" do
42
+ convert @from_file, :to => @to_file do
43
+ video_discard_threshold 20
44
+ end
45
+
46
+ FFMpegCommand.command("ffmpeg").should match(/-vdt 20/)
47
+ end
48
+
49
+ it "should set to use a fixed video quantizer scale" do
50
+ convert @from_file, :to => @to_file do
51
+ video_quantizer_scale 10
52
+ end
53
+
54
+ FFMpegCommand.command("ffmpeg").should match(/-qscale 10/)
55
+ end
56
+
57
+ it "should set the minimum video quantizer scale" do
58
+ convert @from_file, :to => @to_file do
59
+ video_minimum_quantizer_scale 10
60
+ end
61
+
62
+ FFMpegCommand.command("ffmpeg").should match(/-qmin 10/)
63
+ end
64
+
65
+ it "should set the maximum video quantizer scale" do
66
+ convert @from_file, :to => @to_file do
67
+ video_maximum_quantizer_scale 10
68
+ end
69
+
70
+ FFMpegCommand.command("ffmpeg").should match(/-qmax 10/)
71
+ end
72
+
73
+ it "should set the maximum video quantizer difference" do
74
+ convert @from_file, :to => @to_file do
75
+ video_maximum_quantizer_difference 10
76
+ end
77
+
78
+ FFMpegCommand.command("ffmpeg").should match(/-qdiff 10/)
79
+ end
80
+
81
+ it "should set the video quantizer scale blur" do
82
+ convert @from_file, :to => @to_file do
83
+ video_quantizer_scale_blur 0.6
84
+ end
85
+
86
+ FFMpegCommand.command("ffmpeg").should match(/-qblur 0.6/)
87
+ end
88
+
89
+ it "should set the video quantizer scale compression" do
90
+ convert @from_file, :to => @to_file do
91
+ video_quantizer_scale_compression 0.7
92
+ end
93
+
94
+ FFMpegCommand.command("ffmpeg").should match(/-qcomp 0.7/)
95
+ end
96
+
97
+ it "should set the minimum video lagrange factor" do
98
+ convert @from_file, :to => @to_file do
99
+ video_minimum_lagrange_factor 10
100
+ end
101
+
102
+ FFMpegCommand.command("ffmpeg").should match(/-lmin 10/)
103
+ end
104
+
105
+ it "should set the maximum video lagrange factor" do
106
+ convert @from_file, :to => @to_file do
107
+ video_maximum_lagrange_factor 10
108
+ end
109
+
110
+ FFMpegCommand.command("ffmpeg").should match(/-lmax 10/)
111
+ end
112
+
113
+ it "should set the minimum video macroblock quantizer scale" do
114
+ convert @from_file, :to => @to_file do
115
+ video_minimum_macroblock_scale 10
116
+ end
117
+
118
+ FFMpegCommand.command("ffmpeg").should match(/-mblmin 10/)
119
+ end
120
+
121
+ it "should set the maximum video macroblock quantizer scale" do
122
+ convert @from_file, :to => @to_file do
123
+ video_maximum_macroblock_scale 10
124
+ end
125
+
126
+ FFMpegCommand.command("ffmpeg").should match(/-mblmax 10/)
127
+ end
128
+
129
+ it "should set the initial complexity for single pass encoding" do
130
+ convert @from_file, :to => @to_file do
131
+ initial_complexity 5
132
+ end
133
+
134
+ FFMpegCommand.command("ffmpeg").should match(/-rc_init_cplx 5/)
135
+ end
136
+
137
+ it "should set the qp factor between P-frames and B-frames" do
138
+ convert @from_file, :to => @to_file do
139
+ b_frame_factor 10
140
+ end
141
+
142
+ FFMpegCommand.command("ffmpeg").should match(/-b_qfactor 10/)
143
+ end
144
+
145
+ it "should set the qp factor between P-frames and I-frames" do
146
+ convert @from_file, :to => @to_file do
147
+ i_frame_factor 10
148
+ end
149
+
150
+ FFMpegCommand.command("ffmpeg").should match(/-i_qfactor 10/)
151
+ end
152
+
153
+ it "should set the qp offset between P-frames and B-frames" do
154
+ convert @from_file, :to => @to_file do
155
+ b_frame_offset 10
156
+ end
157
+
158
+ FFMpegCommand.command("ffmpeg").should match(/-b_qoffset 10/)
159
+ end
160
+
161
+ it "should set the qp offset between P-frames and I-frames" do
162
+ convert @from_file, :to => @to_file do
163
+ i_frame_offset 10
164
+ end
165
+
166
+ FFMpegCommand.command("ffmpeg").should match(/-i_qoffset 10/)
167
+ end
168
+
169
+
170
+ it "should set the rate control equation" do
171
+ convert @from_file, :to => @to_file do
172
+ rate_control_equation "tex^qComp"
173
+ end
174
+
175
+ FFMpegCommand.command("ffmpeg").should match(/-rc_eq string/)
176
+ end
177
+
178
+ it "should set the rate control override" do
179
+ convert @from_file, :to => @to_file do
180
+ rate_control_override 10
181
+ end
182
+
183
+ FFMpegCommand.command("ffmpeg").should match(/-rc_override 10/)
184
+ end
185
+
186
+ it "should set the motion estimation method" do
187
+ convert @from_file, :to => @to_file do
188
+ motion_estimation_method "hex"
189
+ end
190
+
191
+ FFMpegCommand.command("ffmpeg").should match(/-me_method hex/)
192
+ end
193
+
194
+ it "should set the DCT algorithm" do
195
+ convert @from_file, :to => @to_file do
196
+ dct_algorithm 5
197
+ end
198
+
199
+ FFMpegCommand.command("ffmpeg").should match(/-dct_algo 5/)
200
+ end
201
+
202
+ it "should set the IDCT algorithm" do
203
+ convert @from_file, :to => @to_file do
204
+ idct_algorithm 8
205
+ end
206
+
207
+ FFMpegCommand.command("ffmpeg").should match(/-idct_algo 8/)
208
+ end
209
+
210
+ it "should set error resilience" do
211
+ convert @from_file, :to => @to_file do
212
+ error_resilience 2
213
+ end
214
+
215
+ FFMpegCommand.command("ffmpeg").should match(/-er 2/)
216
+ end
217
+
218
+ it "should set error concealment" do
219
+ convert @from_file, :to => @to_file do
220
+ error_concealment 1
221
+ end
222
+
223
+ FFMpegCommand.command("ffmpeg").should match(/-ec 1/)
224
+ end
225
+
226
+ it "should set to use B-frames" do
227
+ convert @from_file, :to => @to_file do
228
+ b_frames 15
229
+ end
230
+
231
+ FFMpegCommand.command("ffmpeg").should match(/-bf 15/)
232
+ end
233
+
234
+ it "should set macroblock decision mode" do
235
+ convert @from_file, :to => @to_file do
236
+ macroblock_decision_mode 1
237
+ end
238
+
239
+ FFMpegCommand.command("ffmpeg").should match(/-mbd 1/)
240
+ end
241
+
242
+ it "should use four motion vector by macroblock" do
243
+ convert @from_file, :to => @to_file do
244
+ use_four_motion_vector
245
+ end
246
+
247
+ FFMpegCommand.command("ffmpeg").should match(/-4mv/)
248
+ end
249
+
250
+ it "should set to use data partitioning" do
251
+ convert @from_file, :to => @to_file do
252
+ use_data_partitioning
253
+ end
254
+
255
+ FFMpegCommand.command("ffmpeg").should match(/-part/)
256
+ end
257
+
258
+ # `-bug param'
259
+ # Work around encoder bugs that are not auto-detected.
260
+
261
+ it "should set how strictly to follow standards" do
262
+ convert @from_file, :to => @to_file do
263
+ strictness 3
264
+ end
265
+
266
+ FFMpegCommand.command("ffmpeg").should match(/-strict 3/)
267
+ end
268
+
269
+ it "should enable advanced intra coding" do
270
+ convert @from_file, :to => @to_file do
271
+ enable_advanced_intra_coding
272
+ end
273
+
274
+ FFMpegCommand.command("ffmpeg").should match(/-aic/)
275
+ end
276
+
277
+ it "should enable unlimited motion vector" do
278
+ convert @from_file, :to => @to_file do
279
+ enable_unlimited_motion_vector
280
+ end
281
+
282
+ FFMpegCommand.command("ffmpeg").should match(/-umv/)
283
+ end
284
+
285
+ it "should deinterlace pictures" do
286
+ convert @from_file, :to => @to_file do
287
+ deinterlace
288
+ end
289
+
290
+ FFMpegCommand.command("ffmpeg").should match(/-deinterlace/)
291
+ end
292
+
293
+ it "should force interlacing support in encoder" do
294
+ convert @from_file, :to => @to_file do
295
+ interlacing_support
296
+ end
297
+
298
+ FFMpegCommand.command("ffmpeg").should match(/-ilme/)
299
+ end
300
+
301
+ it "should calculate PSNR of compressed frames" do
302
+ convert @from_file, :to => @to_file do
303
+ calculate_psnr
304
+ end
305
+
306
+ FFMpegCommand.command("ffmpeg").should match(/-psnr/)
307
+ end
308
+
309
+ it "should dump video coding statistic to log file" do
310
+ convert @from_file, :to => @to_file do
311
+ dump_video_statistics
312
+ end
313
+
314
+ FFMpegCommand.command("ffmpeg").should match(/-vstats/)
315
+ end
316
+
317
+ it "should dump video statistics to named file" do
318
+ convert @from_file, :to => @to_file do
319
+ dump_video_statistics "video_stats.log"
320
+ end
321
+
322
+ FFMpegCommand.command("ffmpeg").should match(/-vstats_file video_stats.log/)
323
+ end
324
+
325
+ # `-top n'
326
+ # top=1/bottom=0/auto=-1 field first
327
+
328
+ # `-dc precision'
329
+ # Intra_dc_precision.
330
+
331
+ # `-vtag fourcc/tag'
332
+ # Force video tag/fourcc.
333
+
334
+ it "should show QP histogram" do
335
+ convert @from_file, :to => @to_file do
336
+ show_qp_histogram
337
+ end
338
+
339
+ FFMpegCommand.command("ffmpeg").should match(/-qphist/)
340
+ end
341
+
342
+ it "should set the video bitstream filter" do
343
+ convert @from_file, :to => @to_file do
344
+ video_bitstream_filter "dump_extra"
345
+ end
346
+
347
+ FFMpegCommand.command("ffmpeg").should match(/-vbsf dump_extra/)
348
+ end
349
+ end