aviglitch 0.1.6 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +5 -21
- data/.gitignore +1 -0
- data/ChangeLog.md +14 -0
- data/Gemfile +5 -0
- data/LICENSE +1 -1
- data/README.md +0 -4
- data/aviglitch.gemspec +1 -2
- data/bin/datamosh +13 -3
- data/lib/aviglitch/avi.rb +557 -0
- data/lib/aviglitch/base.rb +31 -59
- data/lib/aviglitch/frame.rb +20 -0
- data/lib/aviglitch/frames.rb +187 -185
- data/lib/aviglitch.rb +12 -5
- data/spec/avi2_spec.rb +41 -0
- data/spec/aviglitch_spec.rb +20 -18
- data/spec/datamosh_spec.rb +4 -14
- data/spec/frames_spec.rb +39 -28
- data/spec/spec_helper.rb +45 -0
- metadata +7 -6
- data/spec/files/sample.avi +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d39333c753326230a28e3ecde64dfee176af851c53fd1b185a10797e90bbdd0
|
4
|
+
data.tar.gz: dfb9e4b6613a38c7da422ac82ebf100c12bf84fee40cfc44d899950e547f13d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9df626227e793840d861bd26510323d315024278bfd4dedc7a4d5a147aef2e92ccd5d7cb0564ad8b743e6c1d2c5fea70f9858c86fcefa4f2434869169df1a2c2
|
7
|
+
data.tar.gz: de1adf2790a8c7250e2db4f73bf45b7884b1f1797069ba05899b1f3cb5cd0930d89698ba7d9959099e73e15cd937f83bf3f86939528bdc4310cb4e3c6c82880e
|
data/.github/workflows/ruby.yml
CHANGED
@@ -1,35 +1,19 @@
|
|
1
|
-
# This workflow uses actions that are not certified by GitHub.
|
2
|
-
# They are provided by a third-party and are governed by
|
3
|
-
# separate terms of service, privacy policy, and support
|
4
|
-
# documentation.
|
5
|
-
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
-
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
-
|
8
1
|
name: test
|
9
|
-
|
10
2
|
on:
|
11
3
|
push:
|
12
4
|
branches: [ master ]
|
13
5
|
pull_request:
|
14
6
|
branches: [ master ]
|
15
|
-
|
16
7
|
jobs:
|
17
8
|
test:
|
18
|
-
|
19
9
|
runs-on: ubuntu-latest
|
20
10
|
strategy:
|
21
11
|
matrix:
|
22
|
-
ruby-version: ['
|
23
|
-
|
12
|
+
ruby-version: ['3.3']
|
24
13
|
steps:
|
25
|
-
- uses: actions/checkout@
|
26
|
-
-
|
27
|
-
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
28
|
-
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
29
|
-
# uses: ruby/setup-ruby@v1
|
30
|
-
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
14
|
+
- uses: actions/checkout@v4
|
15
|
+
- uses: ruby/setup-ruby@v1
|
31
16
|
with:
|
32
17
|
ruby-version: ${{ matrix.ruby-version }}
|
33
|
-
bundler-cache: true
|
34
|
-
-
|
35
|
-
run: bundle exec rake
|
18
|
+
bundler-cache: true
|
19
|
+
- run: bundle exec rake
|
data/.gitignore
CHANGED
data/ChangeLog.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
### 0.2.2 / 2024-07-20
|
2
|
+
|
3
|
+
* Added option to set a custom directory for temporary files that internally duplicate input files.
|
4
|
+
* Also added an option for the custom temp directory in the datamosh cli.
|
5
|
+
* Some improvements regarding internal temporary files.
|
6
|
+
|
7
|
+
### 0.2.0 / 2021-09-13
|
8
|
+
|
9
|
+
* Support for AVI2.0 formatted files. Now this library can handle files larger than 1GB.
|
10
|
+
* Added methods to Frames, including #index, #rindex, #first_of, and #last_of
|
11
|
+
* Removed warnings for the file size getting large.
|
12
|
+
* Added the class AviGlitch::Avi which manages binary RIFF-AVI data.
|
13
|
+
* A lot of internal changes.
|
14
|
+
|
1
15
|
### 0.1.6 / 2021-08-21
|
2
16
|
|
3
17
|
* Removed obsolete dependencies.
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -44,10 +44,6 @@ For more practical usages, please check <https://github.com/ucnv/aviglitch-utils
|
|
44
44
|
gem install aviglitch
|
45
45
|
```
|
46
46
|
|
47
|
-
## Known issues
|
48
|
-
|
49
|
-
- This library doesn't support AVI2 format spec. This means that it will not work as expected for files larger than 1GB.
|
50
|
-
|
51
47
|
## License
|
52
48
|
|
53
49
|
This library is distributed under the terms and conditions of the [MIT license](LICENSE).
|
data/aviglitch.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["ucnvvv@gmail.com"]
|
11
11
|
spec.summary = %q{A Ruby library to destroy your AVI files.}
|
12
12
|
spec.description = spec.summary
|
13
|
-
spec.homepage = "
|
13
|
+
spec.homepage = "https://github.com/ucnv/aviglitch"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
@@ -18,7 +18,6 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.has_rdoc = true
|
22
21
|
spec.extra_rdoc_files = ["README.md", "LICENSE"]
|
23
22
|
spec.rdoc_options << "-m" << "README.md"
|
24
23
|
|
data/bin/datamosh
CHANGED
@@ -8,6 +8,7 @@ require 'aviglitch'
|
|
8
8
|
output = './out.avi'
|
9
9
|
all = false
|
10
10
|
fake = false
|
11
|
+
tmpdir = nil
|
11
12
|
|
12
13
|
opts = OptionParser.new do |opts|
|
13
14
|
opts.banner = "datamosh - AviGlitch's datamoshing video generator."
|
@@ -28,10 +29,14 @@ opts = OptionParser.new do |opts|
|
|
28
29
|
exit
|
29
30
|
end
|
30
31
|
end
|
32
|
+
opts.on("--tmpdir [DIR]", "Specify the temporary directory") do |dir|
|
33
|
+
tmpdir = dir
|
34
|
+
end
|
31
35
|
opts.on_tail("-h", "--help", "Show this message") do
|
32
36
|
puts opts
|
33
37
|
exit
|
34
38
|
end
|
39
|
+
opts.version = AviGlitch::VERSION
|
35
40
|
end
|
36
41
|
|
37
42
|
input = opts.parse!
|
@@ -48,16 +53,21 @@ else
|
|
48
53
|
end
|
49
54
|
end
|
50
55
|
|
51
|
-
a = AviGlitch.open input.shift
|
56
|
+
a = AviGlitch.open input.shift, tmpdir: tmpdir
|
52
57
|
unless fake
|
53
58
|
a.glitch_with_index :keyframe do |frame, i|
|
54
59
|
(!all && i == 0) ? frame : "" # keep the first frame
|
55
60
|
end
|
56
61
|
end
|
57
|
-
|
62
|
+
if !all && !fake
|
63
|
+
first = a.frames.index(a.frames.first_of(:keyframe))
|
64
|
+
a.mutate_keyframes_into_deltaframes! (first + 1)..a.frames.size
|
65
|
+
else
|
66
|
+
a.mutate_keyframes_into_deltaframes!
|
67
|
+
end
|
58
68
|
|
59
69
|
input.each do |file|
|
60
|
-
b = AviGlitch.open file
|
70
|
+
b = AviGlitch.open file, tmpdir: tmpdir
|
61
71
|
unless fake
|
62
72
|
b.glitch :keyframe do |frame|
|
63
73
|
""
|