flvedit 0.6.1

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.
Files changed (54) hide show
  1. data/CHANGELOG.rdoc +5 -0
  2. data/LICENSE +24 -0
  3. data/README.rdoc +90 -0
  4. data/Rakefile +137 -0
  5. data/VERSION.yml +4 -0
  6. data/bin/flvedit +14 -0
  7. data/lib/flv/audio.rb +66 -0
  8. data/lib/flv/base.rb +38 -0
  9. data/lib/flv/body.rb +57 -0
  10. data/lib/flv/edit/options.rb +162 -0
  11. data/lib/flv/edit/processor/add.rb +67 -0
  12. data/lib/flv/edit/processor/base.rb +209 -0
  13. data/lib/flv/edit/processor/command_line.rb +23 -0
  14. data/lib/flv/edit/processor/cut.rb +27 -0
  15. data/lib/flv/edit/processor/debug.rb +30 -0
  16. data/lib/flv/edit/processor/head.rb +16 -0
  17. data/lib/flv/edit/processor/join.rb +52 -0
  18. data/lib/flv/edit/processor/meta_data_maker.rb +127 -0
  19. data/lib/flv/edit/processor/print.rb +13 -0
  20. data/lib/flv/edit/processor/printer.rb +27 -0
  21. data/lib/flv/edit/processor/reader.rb +30 -0
  22. data/lib/flv/edit/processor/save.rb +28 -0
  23. data/lib/flv/edit/processor/update.rb +27 -0
  24. data/lib/flv/edit/processor.rb +3 -0
  25. data/lib/flv/edit/runner.rb +23 -0
  26. data/lib/flv/edit/version.rb +15 -0
  27. data/lib/flv/edit.rb +20 -0
  28. data/lib/flv/event.rb +40 -0
  29. data/lib/flv/file.rb +41 -0
  30. data/lib/flv/header.rb +37 -0
  31. data/lib/flv/packing.rb +140 -0
  32. data/lib/flv/tag.rb +62 -0
  33. data/lib/flv/timestamp.rb +124 -0
  34. data/lib/flv/util/double_check.rb +22 -0
  35. data/lib/flv/video.rb +73 -0
  36. data/lib/flv.rb +24 -0
  37. data/test/fixtures/corrupted.flv +0 -0
  38. data/test/fixtures/short.flv +0 -0
  39. data/test/fixtures/tags.xml +39 -0
  40. data/test/test_flv.rb +145 -0
  41. data/test/test_flv_edit.rb +32 -0
  42. data/test/test_flv_edit_results.rb +27 -0
  43. data/test/test_helper.rb +9 -0
  44. data/test/text_flv_edit_results/add_tags.txt +132 -0
  45. data/test/text_flv_edit_results/cut_from.txt +114 -0
  46. data/test/text_flv_edit_results/cut_key.txt +20 -0
  47. data/test/text_flv_edit_results/debug.txt +132 -0
  48. data/test/text_flv_edit_results/debug_limited.txt +18 -0
  49. data/test/text_flv_edit_results/debug_range.txt +32 -0
  50. data/test/text_flv_edit_results/join.txt +237 -0
  51. data/test/text_flv_edit_results/print.txt +16 -0
  52. data/test/text_flv_edit_results/stop.txt +38 -0
  53. data/test/text_flv_edit_results/update.txt +33 -0
  54. metadata +134 -0
@@ -0,0 +1,237 @@
1
+ *** command:
2
+ --Join ./test/fixtures/short.flv --Debug
3
+ *** result:
4
+ Header| ./test/fixtures/short.flv
5
+ | extra :
6
+ | has_audio : true
7
+ | has_video : true
8
+ | version : 1
9
+ 0.000 | FLV::Event tag
10
+ | event : onMetaData
11
+ | audiocodecid : 2
12
+ | audiodatarate : 16
13
+ | audiodelay : 0
14
+ | canSeekToEnd : 1
15
+ | creationdate : Fri Feb 03 122553 2006\n
16
+ | duration : 16.9
17
+ | framerate : 10
18
+ | height : 154
19
+ | videocodecid : 4
20
+ | videodatarate : 40
21
+ | width : 192
22
+ 0.000 | FLV::Audio tag
23
+ | channel : mono
24
+ | codec_id : 2
25
+ | format : MP3
26
+ | rate : 11000
27
+ | sample_size : 16
28
+ 0.000 | FLV::Video tag (keyframe)
29
+ | codec : on2_vp6
30
+ | codec_id : 4
31
+ | dimensions : nil
32
+ 0.052 | FLV::Audio tag
33
+ 0.100 | FLV::Video tag (interframe)
34
+ 0.104 | FLV::Audio tag
35
+ 0.156 | FLV::Audio tag
36
+ 0.200 | FLV::Video tag (keyframe)
37
+ 0.208 | FLV::Audio tag
38
+ 0.261 | FLV::Audio tag
39
+ 0.300 | FLV::Video tag (interframe)
40
+ 0.313 | FLV::Audio tag
41
+ 0.365 | FLV::Audio tag
42
+ 0.400 | FLV::Video tag (interframe)
43
+ 0.417 | FLV::Audio tag
44
+ 0.470 | FLV::Audio tag
45
+ 0.500 | FLV::Video tag (interframe)
46
+ 0.522 | FLV::Audio tag
47
+ 0.574 | FLV::Audio tag
48
+ 0.600 | FLV::Video tag (interframe)
49
+ 0.626 | FLV::Audio tag
50
+ 0.679 | FLV::Audio tag
51
+ 0.700 | FLV::Video tag (interframe)
52
+ 0.731 | FLV::Audio tag
53
+ 0.783 | FLV::Audio tag
54
+ 0.800 | FLV::Video tag (interframe)
55
+ 0.835 | FLV::Audio tag
56
+ 0.888 | FLV::Audio tag
57
+ 0.900 | FLV::Video tag (interframe)
58
+ 0.940 | FLV::Audio tag
59
+ 0.992 | FLV::Audio tag
60
+ 1.000 | FLV::Video tag (interframe)
61
+ 1.044 | FLV::Audio tag
62
+ 1.097 | FLV::Audio tag
63
+ 1.100 | FLV::Video tag (interframe)
64
+ 1.149 | FLV::Audio tag
65
+ 1.200 | FLV::Video tag (interframe)
66
+ 1.201 | FLV::Audio tag
67
+ 1.253 | FLV::Audio tag
68
+ 1.300 | FLV::Video tag (interframe)
69
+ 1.306 | FLV::Audio tag
70
+ 1.358 | FLV::Audio tag
71
+ 1.400 | FLV::Video tag (interframe)
72
+ 1.410 | FLV::Audio tag
73
+ 1.462 | FLV::Audio tag
74
+ 1.500 | FLV::Video tag (interframe)
75
+ 1.515 | FLV::Audio tag
76
+ 1.567 | FLV::Audio tag
77
+ 1.600 | FLV::Video tag (interframe)
78
+ 1.619 | FLV::Audio tag
79
+ 1.671 | FLV::Audio tag
80
+ 1.700 | FLV::Video tag (interframe)
81
+ 1.724 | FLV::Audio tag
82
+ 1.776 | FLV::Audio tag
83
+ 1.800 | FLV::Video tag (interframe)
84
+ 1.828 | FLV::Audio tag
85
+ 1.880 | FLV::Audio tag
86
+ 1.900 | FLV::Video tag (interframe)
87
+ 1.933 | FLV::Audio tag
88
+ 1.985 | FLV::Audio tag
89
+ 2.000 | FLV::Video tag (interframe)
90
+ 2.037 | FLV::Audio tag
91
+ 2.089 | FLV::Audio tag
92
+ 2.100 | FLV::Video tag (interframe)
93
+ 2.142 | FLV::Audio tag
94
+ 2.194 | FLV::Audio tag
95
+ 2.200 | FLV::Video tag (interframe)
96
+ 2.246 | FLV::Audio tag
97
+ 2.298 | FLV::Audio tag
98
+ 2.300 | FLV::Video tag (interframe)
99
+ 2.351 | FLV::Audio tag
100
+ 2.400 | FLV::Video tag (interframe)
101
+ 2.403 | FLV::Audio tag
102
+ 2.455 | FLV::Audio tag
103
+ 2.500 | FLV::Video tag (interframe)
104
+ 2.507 | FLV::Audio tag
105
+ 2.559 | FLV::Audio tag
106
+ 2.600 | FLV::Video tag (interframe)
107
+ 2.612 | FLV::Audio tag
108
+ 2.664 | FLV::Audio tag
109
+ 2.700 | FLV::Video tag (interframe)
110
+ 2.716 | FLV::Audio tag
111
+ 2.768 | FLV::Audio tag
112
+ 2.800 | FLV::Video tag (interframe)
113
+ 2.821 | FLV::Audio tag
114
+ 2.873 | FLV::Audio tag
115
+ 2.900 | FLV::Video tag (interframe)
116
+ 2.925 | FLV::Audio tag
117
+ 2.977 | FLV::Audio tag
118
+ 3.000 | FLV::Video tag (interframe)
119
+ 3.030 | FLV::Audio tag
120
+ 3.082 | FLV::Audio tag
121
+ 3.100 | FLV::Video tag (interframe)
122
+ 3.134 | FLV::Audio tag
123
+ 3.186 | FLV::Audio tag
124
+ 3.200 | FLV::Video tag (interframe)
125
+ 3.239 | FLV::Audio tag
126
+ 3.291 | FLV::Audio tag
127
+ 3.300 | FLV::Video tag (interframe)
128
+ 3.343 | FLV::Audio tag
129
+ 3.395 | FLV::Audio tag
130
+ 3.400 | FLV::Video tag (interframe)
131
+ 3.448 | FLV::Audio tag
132
+ 3.500 | FLV::Video tag (interframe)
133
+ 3.500 | FLV::Event tag
134
+ | event : onNextSegment
135
+ | file : short.flv
136
+ 3.600 | FLV::Video tag (keyframe)
137
+ 3.652 | FLV::Audio tag
138
+ 3.700 | FLV::Video tag (interframe)
139
+ 3.704 | FLV::Audio tag
140
+ 3.756 | FLV::Audio tag
141
+ 3.800 | FLV::Video tag (keyframe)
142
+ 3.808 | FLV::Audio tag
143
+ 3.861 | FLV::Audio tag
144
+ 3.900 | FLV::Video tag (interframe)
145
+ 3.913 | FLV::Audio tag
146
+ 3.965 | FLV::Audio tag
147
+ 4.000 | FLV::Video tag (interframe)
148
+ 4.017 | FLV::Audio tag
149
+ 4.070 | FLV::Audio tag
150
+ 4.100 | FLV::Video tag (interframe)
151
+ 4.122 | FLV::Audio tag
152
+ 4.174 | FLV::Audio tag
153
+ 4.200 | FLV::Video tag (interframe)
154
+ 4.226 | FLV::Audio tag
155
+ 4.279 | FLV::Audio tag
156
+ 4.300 | FLV::Video tag (interframe)
157
+ 4.331 | FLV::Audio tag
158
+ 4.383 | FLV::Audio tag
159
+ 4.400 | FLV::Video tag (interframe)
160
+ 4.435 | FLV::Audio tag
161
+ 4.488 | FLV::Audio tag
162
+ 4.500 | FLV::Video tag (interframe)
163
+ 4.540 | FLV::Audio tag
164
+ 4.592 | FLV::Audio tag
165
+ 4.600 | FLV::Video tag (interframe)
166
+ 4.644 | FLV::Audio tag
167
+ 4.697 | FLV::Audio tag
168
+ 4.700 | FLV::Video tag (interframe)
169
+ 4.749 | FLV::Audio tag
170
+ 4.800 | FLV::Video tag (interframe)
171
+ 4.801 | FLV::Audio tag
172
+ 4.853 | FLV::Audio tag
173
+ 4.900 | FLV::Video tag (interframe)
174
+ 4.906 | FLV::Audio tag
175
+ 4.958 | FLV::Audio tag
176
+ 5.000 | FLV::Video tag (interframe)
177
+ 5.010 | FLV::Audio tag
178
+ 5.062 | FLV::Audio tag
179
+ 5.100 | FLV::Video tag (interframe)
180
+ 5.115 | FLV::Audio tag
181
+ 5.167 | FLV::Audio tag
182
+ 5.200 | FLV::Video tag (interframe)
183
+ 5.219 | FLV::Audio tag
184
+ 5.271 | FLV::Audio tag
185
+ 5.300 | FLV::Video tag (interframe)
186
+ 5.324 | FLV::Audio tag
187
+ 5.376 | FLV::Audio tag
188
+ 5.400 | FLV::Video tag (interframe)
189
+ 5.428 | FLV::Audio tag
190
+ 5.480 | FLV::Audio tag
191
+ 5.500 | FLV::Video tag (interframe)
192
+ 5.533 | FLV::Audio tag
193
+ 5.585 | FLV::Audio tag
194
+ 5.600 | FLV::Video tag (interframe)
195
+ 5.637 | FLV::Audio tag
196
+ 5.689 | FLV::Audio tag
197
+ 5.700 | FLV::Video tag (interframe)
198
+ 5.742 | FLV::Audio tag
199
+ 5.794 | FLV::Audio tag
200
+ 5.800 | FLV::Video tag (interframe)
201
+ 5.846 | FLV::Audio tag
202
+ 5.898 | FLV::Audio tag
203
+ 5.900 | FLV::Video tag (interframe)
204
+ 5.951 | FLV::Audio tag
205
+ 6.000 | FLV::Video tag (interframe)
206
+ 6.003 | FLV::Audio tag
207
+ 6.055 | FLV::Audio tag
208
+ 6.100 | FLV::Video tag (interframe)
209
+ 6.107 | FLV::Audio tag
210
+ 6.159 | FLV::Audio tag
211
+ 6.200 | FLV::Video tag (interframe)
212
+ 6.212 | FLV::Audio tag
213
+ 6.264 | FLV::Audio tag
214
+ 6.300 | FLV::Video tag (interframe)
215
+ 6.316 | FLV::Audio tag
216
+ 6.368 | FLV::Audio tag
217
+ 6.400 | FLV::Video tag (interframe)
218
+ 6.421 | FLV::Audio tag
219
+ 6.473 | FLV::Audio tag
220
+ 6.500 | FLV::Video tag (interframe)
221
+ 6.525 | FLV::Audio tag
222
+ 6.577 | FLV::Audio tag
223
+ 6.600 | FLV::Video tag (interframe)
224
+ 6.630 | FLV::Audio tag
225
+ 6.682 | FLV::Audio tag
226
+ 6.700 | FLV::Video tag (interframe)
227
+ 6.734 | FLV::Audio tag
228
+ 6.786 | FLV::Audio tag
229
+ 6.800 | FLV::Video tag (interframe)
230
+ 6.839 | FLV::Audio tag
231
+ 6.891 | FLV::Audio tag
232
+ 6.900 | FLV::Video tag (interframe)
233
+ 6.943 | FLV::Audio tag
234
+ 6.995 | FLV::Audio tag
235
+ 7.000 | FLV::Video tag (interframe)
236
+ 7.048 | FLV::Audio tag
237
+ 7.100 | FLV::Video tag (interframe)
@@ -0,0 +1,16 @@
1
+ *** command:
2
+ --Print
3
+ *** result:
4
+ 0.000 | FLV::Event tag
5
+ | event : onMetaData
6
+ | audiocodecid : 2
7
+ | audiodatarate : 16
8
+ | audiodelay : 0
9
+ | canSeekToEnd : 1
10
+ | creationdate : Fri Feb 03 122553 2006\n
11
+ | duration : 16.9
12
+ | framerate : 10
13
+ | height : 154
14
+ | videocodecid : 4
15
+ | videodatarate : 40
16
+ | width : 192
@@ -0,0 +1,38 @@
1
+ *** command:
2
+ -n 10 --Debug
3
+ *** result:
4
+ Header| ./test/fixtures/short.flv
5
+ | extra :
6
+ | has_audio : true
7
+ | has_video : true
8
+ | version : 1
9
+ 0.000 | FLV::Event tag
10
+ | event : onMetaData
11
+ | audiocodecid : 2
12
+ | audiodatarate : 16
13
+ | audiodelay : 0
14
+ | canSeekToEnd : 1
15
+ | creationdate : Fri Feb 03 122553 2006\n
16
+ | duration : 16.9
17
+ | framerate : 10
18
+ | height : 154
19
+ | videocodecid : 4
20
+ | videodatarate : 40
21
+ | width : 192
22
+ 0.000 | FLV::Audio tag
23
+ | channel : mono
24
+ | codec_id : 2
25
+ | format : MP3
26
+ | rate : 11000
27
+ | sample_size : 16
28
+ 0.000 | FLV::Video tag (keyframe)
29
+ | codec : on2_vp6
30
+ | codec_id : 4
31
+ | dimensions : nil
32
+ 0.052 | FLV::Audio tag
33
+ 0.100 | FLV::Video tag (interframe)
34
+ 0.104 | FLV::Audio tag
35
+ 0.156 | FLV::Audio tag
36
+ 0.200 | FLV::Video tag (keyframe)
37
+ 0.208 | FLV::Audio tag
38
+ 0.261 | FLV::Audio tag
@@ -0,0 +1,33 @@
1
+ *** command:
2
+ --Update --Print
3
+ *** result:
4
+ 0.000 | FLV::Event tag
5
+ | event : onMetaData
6
+ | audiocodecid : 2
7
+ | audiodatarate : 15.7066666666667
8
+ | audiodelay : 0.0
9
+ | audiosamplerate: 11000
10
+ | audiosamplesize: 16
11
+ | audiosize : 7805
12
+ | canSeekToEnd : false
13
+ | cuePoints : []
14
+ | datasize : 25001
15
+ | duration : 3.6
16
+ | filesize : 25430
17
+ | framerate : 10.0
18
+ | hasAudio : true
19
+ | hasCuePoints : false
20
+ | hasKeyframes : true
21
+ | hasMetadata : true
22
+ | hasVideo : true
23
+ | height : 154
24
+ | keyframes : {filepositions=>[846, 1968], times=>[0.0, 0.2]}
25
+ | lastkeyframetimestamp: 0.2
26
+ | lasttimestamp : 3.5
27
+ | metadatacreator: flvedit........................................................
28
+ | metadatadate : Sat Dec 20 000000 UTC 2008
29
+ | stereo : false
30
+ | videocodecid : 4
31
+ | videodatarate : 35.7577777777778
32
+ | videosize : 16487
33
+ | width : 192
metadata ADDED
@@ -0,0 +1,134 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: flvedit
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.6.1
5
+ platform: ruby
6
+ authors:
7
+ - "Marc-Andr\xC3\xA9 Lafortune"
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-04-21 00:00:00 -04:00
13
+ default_executable: flvedit
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: packable
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "1.2"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: backports
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ description: "flvedit allows you to: * compute metadata for FLV files * merge, split or cut FLVs * insert / remote cue points or other events flvedit is meant as a replacement for FLVTool2, FLVMeta, FLVTool++ It can be used as a command line tool or as a Ruby library."
36
+ email: github@marc-andre.ca
37
+ executables:
38
+ - flvedit
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - LICENSE
43
+ - README.rdoc
44
+ files:
45
+ - CHANGELOG.rdoc
46
+ - LICENSE
47
+ - README.rdoc
48
+ - Rakefile
49
+ - VERSION.yml
50
+ - bin/flvedit
51
+ - lib/flv.rb
52
+ - lib/flv/audio.rb
53
+ - lib/flv/base.rb
54
+ - lib/flv/body.rb
55
+ - lib/flv/edit.rb
56
+ - lib/flv/edit/options.rb
57
+ - lib/flv/edit/processor.rb
58
+ - lib/flv/edit/processor/add.rb
59
+ - lib/flv/edit/processor/base.rb
60
+ - lib/flv/edit/processor/command_line.rb
61
+ - lib/flv/edit/processor/cut.rb
62
+ - lib/flv/edit/processor/debug.rb
63
+ - lib/flv/edit/processor/head.rb
64
+ - lib/flv/edit/processor/join.rb
65
+ - lib/flv/edit/processor/meta_data_maker.rb
66
+ - lib/flv/edit/processor/print.rb
67
+ - lib/flv/edit/processor/printer.rb
68
+ - lib/flv/edit/processor/reader.rb
69
+ - lib/flv/edit/processor/save.rb
70
+ - lib/flv/edit/processor/update.rb
71
+ - lib/flv/edit/runner.rb
72
+ - lib/flv/edit/version.rb
73
+ - lib/flv/event.rb
74
+ - lib/flv/file.rb
75
+ - lib/flv/header.rb
76
+ - lib/flv/packing.rb
77
+ - lib/flv/tag.rb
78
+ - lib/flv/timestamp.rb
79
+ - lib/flv/util/double_check.rb
80
+ - lib/flv/video.rb
81
+ - test/fixtures/corrupted.flv
82
+ - test/fixtures/short.flv
83
+ - test/fixtures/tags.xml
84
+ - test/test_flv.rb
85
+ - test/test_flv_edit.rb
86
+ - test/test_flv_edit_results.rb
87
+ - test/test_helper.rb
88
+ - test/text_flv_edit_results/add_tags.txt
89
+ - test/text_flv_edit_results/cut_from.txt
90
+ - test/text_flv_edit_results/cut_key.txt
91
+ - test/text_flv_edit_results/debug.txt
92
+ - test/text_flv_edit_results/debug_limited.txt
93
+ - test/text_flv_edit_results/debug_range.txt
94
+ - test/text_flv_edit_results/join.txt
95
+ - test/text_flv_edit_results/print.txt
96
+ - test/text_flv_edit_results/stop.txt
97
+ - test/text_flv_edit_results/update.txt
98
+ has_rdoc: true
99
+ homepage: http://github.com/marcandre/flvedit
100
+ post_install_message:
101
+ rdoc_options:
102
+ - --charset=UTF-8
103
+ - --title
104
+ - FLV::Edit
105
+ - --main
106
+ - README.rdoc
107
+ - --line-numbers
108
+ - --inline-source
109
+ require_paths:
110
+ - lib
111
+ required_ruby_version: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: "0"
116
+ version:
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: "0"
122
+ version:
123
+ requirements: []
124
+
125
+ rubyforge_project: flvedit
126
+ rubygems_version: 1.3.1
127
+ signing_key:
128
+ specification_version: 2
129
+ summary: Command line tool & library to handle FLV files
130
+ test_files:
131
+ - test/test_flv.rb
132
+ - test/test_flv_edit.rb
133
+ - test/test_flv_edit_results.rb
134
+ - test/test_helper.rb