Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fab8dd4
commit 3a9eed7
Showing
18 changed files
with
259 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
*.gem | ||
*.rbc | ||
.bundle | ||
.config | ||
.yardoc | ||
Gemfile.lock | ||
InstalledFiles | ||
_yardoc | ||
coverage | ||
doc/ | ||
lib/bundler/man | ||
pkg | ||
rdoc | ||
spec/reports | ||
test/tmp | ||
test/version_tmp | ||
tmp | ||
*.bundle | ||
*.so | ||
*.o | ||
*.a | ||
mkmf.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
ruby '2.0.0' | ||
source 'http://rubygems.org' | ||
source 'https://rubygems.org' | ||
|
||
gem 'aviglitch' | ||
gem 'slop' | ||
gem 'av' | ||
# Specify your gem's dependencies in moshy.gemspec | ||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,21 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
moshy (0.1.0) | ||
aviglitch | ||
slop | ||
|
||
GEM | ||
remote: http://rubygems.org/ | ||
remote: https://rubygems.org/ | ||
specs: | ||
activesupport (4.2.4) | ||
i18n (~> 0.7) | ||
json (~> 1.7, >= 1.7.7) | ||
minitest (~> 5.1) | ||
thread_safe (~> 0.3, >= 0.3.4) | ||
tzinfo (~> 1.1) | ||
av (0.9.0) | ||
cocaine (~> 0.5.3) | ||
aviglitch (0.1.5) | ||
climate_control (0.0.3) | ||
activesupport (>= 3.0) | ||
cocaine (0.5.7) | ||
climate_control (>= 0.0.3, < 1.0) | ||
i18n (0.7.0) | ||
json (1.8.3) | ||
minitest (5.8.0) | ||
rake (10.4.2) | ||
slop (4.2.0) | ||
thread_safe (0.3.5) | ||
tzinfo (1.2.2) | ||
thread_safe (~> 0.1) | ||
|
||
PLATFORMS | ||
ruby | ||
x86-mingw32 | ||
|
||
DEPENDENCIES | ||
av | ||
aviglitch | ||
slop | ||
bundler (~> 1.6) | ||
moshy! | ||
rake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Copyright (c) 2015 Way Spurr-Chen <wayspurrchen@gmail.com> <http://wayspurrchen.com/> | ||
|
||
MIT License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,29 @@ | ||
# moshy | ||
# Moshy | ||
|
||
moshy is a datamoshing utility kit for AVI files, based heavily on [aviglitch](https://github.com/ucnv/aviglitch). | ||
It's designed to make common datamoshing tasks easier from a command line interface | ||
without having to open avidemux or other GUI tools. It lets you do stuff like: | ||
TODO: Write a gem description | ||
|
||
- Convert video files into AVI video files with minimal I-Frames and no B-frames for ultimate moshability | ||
- Create P-Frame duplication effects quickly | ||
- Split a long video file into multiple clips based on its I-Frames | ||
- "Bake" your datamoshed video, encoding the corruption as actual video content for uploading to video services or moshing even further! | ||
- Identifying keyframe and deltaframe indexes in any AVI file | ||
- ...and more! | ||
## Installation | ||
|
||
## Get it! | ||
Add this line to your application's Gemfile: | ||
|
||
gem 'moshy' | ||
|
||
And then execute: | ||
|
||
## What's it do? | ||
$ bundle | ||
|
||
## This is cool | ||
Or install it yourself as: | ||
|
||
WIP | ||
$ gem install moshy | ||
|
||
(note: to use `prep` you must have ffmpeg installed) | ||
## Usage | ||
|
||
TODO: | ||
TODO: Write usage instructions here | ||
|
||
stitch | ||
## Contributing | ||
|
||
i1 | ||
|
||
i2 | ||
|
||
b1 e1 | ||
|
||
b2 e2 | ||
|
||
o | ||
1. Fork it ( https://github.com/[my-github-username]/moshy/fork ) | ||
2. Create your feature branch (`git checkout -b my-new-feature`) | ||
3. Commit your changes (`git commit -am 'Add some feature'`) | ||
4. Push to the branch (`git push origin my-new-feature`) | ||
5. Create a new Pull Request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require "bundler/gem_tasks" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require 'optparse' | ||
require 'slop' | ||
require 'moshy' | ||
|
||
module Moshy | ||
def self.top_level_help | ||
$options = { | ||
|
||
} | ||
opts = OptionParser.new do |opts| | ||
opts.banner = " | ||
moshy, a Ruby utility for making it easier to datamosh AVI files. It has | ||
multiple modes that can be run with the -m or --mode option. | ||
MODES DETAILS | ||
------------- | ||
\"prep\" | ||
------ | ||
Preps a video file for datamoshing with moshy by converting it | ||
into an AVI with no B-Frames (they're not good for moshing), and placing as | ||
few I-Frames as possible. Requires ffmpeg be installed locally. | ||
\"isplit\" | ||
-------- | ||
Extracts individual clips from an AVI where each clip is | ||
separated by I-frames in the original AVI. Great for getting specific | ||
clips out of a larger video and later doing I-frame moshing. | ||
\"pdupe\" | ||
------- | ||
Duplicates a P-frame at a given frame a certain amount. To find | ||
out which frames are P-frames, use software like avidemux to look at the | ||
frame type. WARNING: This mode is a little glitchy. You may need to set | ||
the interval 1 or 2 above or below the frame number you actually want to | ||
duplicate. I'm not sure why this happens, but try it with a small | ||
duplication amount first. NOTE: This can mode take a while to process | ||
over 60-90 frame dupes. | ||
\"ppulse\" | ||
-------- | ||
Takes c number of frames and every n frames and duplicates them a | ||
given amount, resulting in a consistent P-duplication datamosh that's | ||
good for creating rhythmic effects. This was originally created to | ||
create mosh effects in sync with a beat for a music video. | ||
\"bake\" | ||
------ | ||
\"Bakes\" your datamosh by creating a new video file from your | ||
datamoshed .avi, causing the datamosh effects to be treated as the actual | ||
content of the new video instead of an error. Requires ffmpeg to be | ||
installed locally. | ||
\"inspect\" | ||
--------- | ||
Reads an .avi file and prints which video frames are keyframes | ||
(I-Frames) and which frames are delta frames (P-frames or B-frames). moshy | ||
cannot tell the difference between a P-frame or a B-frame, so you will want | ||
to use avidemux or another program if you need to know. | ||
Run moshy with mode -m <mode> --help to see options for individual modes. | ||
" | ||
end | ||
|
||
begin | ||
opts.parse | ||
rescue OptionParser::InvalidOption, OptionParser::InvalidArgument | ||
end | ||
|
||
puts opts | ||
end | ||
end | ||
|
||
# Because we have multiple modes, we do some initial basic arg checking | ||
# to see if they specified a mode. If not, we show the top-level help menu. | ||
result = Slop.parse suppress_errors: true do |o| | ||
o.string '-m', '--mode' | ||
end | ||
|
||
mode_classes = { | ||
"inspect" => Moshy::Inspect, | ||
"isplit" => Moshy::ISplit, | ||
"pdupe" => Moshy::PDupe, | ||
"ppulse" => Moshy::PPulse, | ||
"prep" => Moshy::Prep, | ||
"bake" => Moshy::Bake | ||
} | ||
|
||
if mode_classes.has_key? result[:m] | ||
# We need to strip out the "m" otherwise our other arg parsers | ||
# will choke on the extra parameter | ||
ARGV.each_with_index do |o, i| | ||
if o == "-m" || o == "--m" | ||
ARGV.delete_at(i + 1) | ||
ARGV.delete_at(i) | ||
break | ||
end | ||
end | ||
|
||
mode_classes[result[:m]].new.cli ARGV | ||
else | ||
Moshy.top_level_help | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require_relative "moshy/version" | ||
require_relative "moshy/inspect" | ||
require_relative "moshy/isplit" | ||
require_relative "moshy/pdupe" | ||
require_relative "moshy/bake" | ||
require_relative "moshy/prep" | ||
require_relative "moshy/ppulse" | ||
|
||
module Moshy | ||
# Empty skeleton - just used to include the others | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.