moshy 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/moshy.rb +110 -0
- metadata +56 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 10b05cab4000093c123ded361c51188a2a35294a
|
4
|
+
data.tar.gz: 05b77cee5a180f285e48c97627626ba6190e1229
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ae34d58ed8350a14a71422a49283d99917a8f08e7b1698c867f73f859f94644720169d1f115bc2b8cd4e459587381fed7cc59b7fa7c80ec30a43397b578909d1
|
7
|
+
data.tar.gz: ff48178601ce668c27770ba535c431528c036a0ed9e20c9dcd865acdb49ada0915847c96ed8791819dda485c3dfaf16ea7d45e400cd61ce006a0cecca06f8c98
|
data/moshy.rb
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
require_relative 'lib/inspect'
|
2
|
+
require_relative 'lib/isplit'
|
3
|
+
require_relative 'lib/pdupe'
|
4
|
+
require_relative 'lib/bake'
|
5
|
+
require_relative 'lib/prep'
|
6
|
+
require_relative 'lib/ppulse'
|
7
|
+
require 'aviglitch'
|
8
|
+
require 'optparse'
|
9
|
+
require 'slop'
|
10
|
+
require 'av'
|
11
|
+
|
12
|
+
module Moshy
|
13
|
+
def self.top_level_help
|
14
|
+
$options = {
|
15
|
+
|
16
|
+
}
|
17
|
+
opts = OptionParser.new do |opts|
|
18
|
+
opts.banner = "
|
19
|
+
moshy, a Ruby utility for making it easier to datamosh AVI files. It has
|
20
|
+
multiple modes that can be run with the -m or --mode option.
|
21
|
+
|
22
|
+
MODES DETAILS
|
23
|
+
-------------
|
24
|
+
|
25
|
+
\"prep\"
|
26
|
+
------
|
27
|
+
Preps a video file for datamoshing with moshy by converting it
|
28
|
+
into an AVI with no B-Frames (they're not good for moshing), and placing as
|
29
|
+
few I-Frames as possible. Requires ffmpeg be installed locally.
|
30
|
+
|
31
|
+
\"isplit\"
|
32
|
+
--------
|
33
|
+
Extracts individual clips from an AVI where each clip is
|
34
|
+
separated by I-frames in the original AVI. Great for getting specific
|
35
|
+
clips out of a larger video and later doing I-frame moshing.
|
36
|
+
|
37
|
+
\"pdupe\"
|
38
|
+
-------
|
39
|
+
Duplicates a P-frame at a given frame a certain amount. To find
|
40
|
+
out which frames are P-frames, use software like avidemux to look at the
|
41
|
+
frame type. WARNING: This mode is a little glitchy. You may need to set
|
42
|
+
the interval 1 or 2 above or below the frame number you actually want to
|
43
|
+
duplicate. I'm not sure why this happens, but try it with a small
|
44
|
+
duplication amount first. NOTE: This can mode take a while to process
|
45
|
+
over 60-90 frame dupes.
|
46
|
+
|
47
|
+
\"ppulse\"
|
48
|
+
--------
|
49
|
+
Takes c number of frames and every n frames and duplicates them a
|
50
|
+
given amount, resulting in a consistent P-duplication datamosh that's
|
51
|
+
good for creating rhythmic effects. This was originally created to
|
52
|
+
create mosh effects in sync with a beat for a music video.
|
53
|
+
|
54
|
+
\"bake\"
|
55
|
+
------
|
56
|
+
\"Bakes\" your datamosh by creating a new video file from your
|
57
|
+
datamoshed .avi, causing the datamosh effects to be treated as the actual
|
58
|
+
content of the new video instead of an error. Requires ffmpeg to be
|
59
|
+
installed locally.
|
60
|
+
|
61
|
+
\"inspect\"
|
62
|
+
---------
|
63
|
+
Reads an .avi file and prints which video frames are keyframes
|
64
|
+
(I-Frames) and which frames are delta frames (P-frames or B-frames). moshy
|
65
|
+
cannot tell the difference between a P-frame or a B-frame, so you will want
|
66
|
+
to use avidemux or another program if you need to know.
|
67
|
+
|
68
|
+
Run moshy with mode -m <mode> --help to see options for individual modes.
|
69
|
+
"
|
70
|
+
end
|
71
|
+
|
72
|
+
begin
|
73
|
+
opts.parse
|
74
|
+
rescue OptionParser::InvalidOption, OptionParser::InvalidArgument
|
75
|
+
end
|
76
|
+
|
77
|
+
puts opts
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Because we have multiple modes, we do some initial basic arg checking
|
82
|
+
# to see if they specified a mode. If not, we show the top-level help menu.
|
83
|
+
result = Slop.parse suppress_errors: true do |o|
|
84
|
+
o.string '-m', '--mode'
|
85
|
+
end
|
86
|
+
|
87
|
+
mode_classes = {
|
88
|
+
"inspect" => Moshy::Inspect,
|
89
|
+
"isplit" => Moshy::ISplit,
|
90
|
+
"pdupe" => Moshy::PDupe,
|
91
|
+
"ppulse" => Moshy::PPulse,
|
92
|
+
"prep" => Moshy::Prep,
|
93
|
+
"bake" => Moshy::Bake
|
94
|
+
}
|
95
|
+
|
96
|
+
if mode_classes.has_key? result[:m]
|
97
|
+
# We need to strip out the "m" otherwise our other arg parsers
|
98
|
+
# will choke on the extra parameter
|
99
|
+
ARGV.each_with_index do |o, i|
|
100
|
+
if o == "-m" || o == "--m"
|
101
|
+
ARGV.delete_at(i + 1)
|
102
|
+
ARGV.delete_at(i)
|
103
|
+
break
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
mode_classes[result[:m]].new ARGV
|
108
|
+
else
|
109
|
+
Moshy.top_level_help
|
110
|
+
end
|
metadata
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: moshy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Way Spurr-Chen
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2010-09-12 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: |-
|
14
|
+
moshy is a datamoshing utility kit for AVI files, based heavily on [aviglitch](https://github.com/ucnv/aviglitch).
|
15
|
+
It's designed to make common datamoshing tasks easier from a command line interface
|
16
|
+
without having to open avidemux or other GUI tools. It lets you do stuff like:
|
17
|
+
|
18
|
+
- Convert video files into AVI video files with minimal I-Frames and no B-frames for ultimate moshability
|
19
|
+
- Create P-Frame duplication effects quickly
|
20
|
+
- Split a long video file into multiple clips based on its I-Frames
|
21
|
+
- "Bake" your datamoshed video, encoding the corruption as actual video content for uploading to video services or moshing even further!
|
22
|
+
- Identifying keyframe and deltaframe indexes in any AVI file
|
23
|
+
- ...and more!
|
24
|
+
|
25
|
+
See https://github.com/wayspurrchen/moshy for detailed documentation.
|
26
|
+
email: wayspurrchen@gmail.com
|
27
|
+
executables: []
|
28
|
+
extensions: []
|
29
|
+
extra_rdoc_files: []
|
30
|
+
files:
|
31
|
+
- moshy.rb
|
32
|
+
homepage: https://github.com/wayspurrchen/moshy
|
33
|
+
licenses:
|
34
|
+
- MIT
|
35
|
+
metadata: {}
|
36
|
+
post_install_message:
|
37
|
+
rdoc_options: []
|
38
|
+
require_paths:
|
39
|
+
- lib
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - '>='
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '0'
|
45
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
requirements: []
|
51
|
+
rubyforge_project:
|
52
|
+
rubygems_version: 2.2.2
|
53
|
+
signing_key:
|
54
|
+
specification_version: 4
|
55
|
+
summary: datamoshing utility kit for common tasks with AVI files
|
56
|
+
test_files: []
|