muvy 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86d7b6a8c11d0ce8195f6d35bf9400028771c85a
4
- data.tar.gz: a8c38340f7e011b1821f89f0e6ce7f040382dfd9
3
+ metadata.gz: a44e17f601ba5559adfa1cebee0d1757e2082e1d
4
+ data.tar.gz: 141c334bd2267b497661995dc933cb587bf674bf
5
5
  SHA512:
6
- metadata.gz: 209b168a3b90bd569a48504295a4a745adbaf4e08c46d742d73b9027d12624fa6327dc9369fe738fbaf8a65f27f4d8668b048279eefb7723c4bd930397677122
7
- data.tar.gz: 9bbcaa4a1ff2a929d2d1983d493e387b3f9124c104a9e74e6c9b5b84c6670e6266eed611b69fad1097873c4d009b473a1c99214df8cdae231f8a11f6d62859d4
6
+ metadata.gz: e171597cfd11434abd8adb192cbf1e4fa7d0fd1046b57b41f8c1087a87b57e6460e1d4d751b8996bd5e8da4bf9b29dd8f7ba8e2c7fcca7c68ce3d2f36a391f68
7
+ data.tar.gz: e8a6c56db10846b47697691e13abaad4b692a2acb1c48d5f421ccad96791a2c4cd616c34424ca015491c02de125fd3cd63b7c82770d3edec5795d704c94ade70
data/README.md CHANGED
@@ -1,4 +1,8 @@
1
- ![muvy-header](https://i.imgur.com/Akc3Fh9.png)
1
+ <p align="center">
2
+
3
+ <img src="https://i.imgur.com/Akc3Fh9.png" alt="muvy-header" />
4
+
5
+ </p>
2
6
 
3
7
  **muvy** is a simple Ruby movie barcode generator.
4
8
  You can feed it a youtube video, phone gallery, or any locally stored video files. It pulls most of the frames out, moves around the colors, and throws them back together in a neat montage.
@@ -12,6 +16,7 @@ You can feed it a youtube video, phone gallery, or any locally stored video file
12
16
  * [Options](#options)
13
17
  * [Features](#features)
14
18
  * [Examples](#examples)
19
+ * [Troubleshooting](#troubleshooting)
15
20
  * [Links](#links)
16
21
  ------
17
22
 
@@ -19,14 +24,16 @@ You can feed it a youtube video, phone gallery, or any locally stored video file
19
24
 
20
25
  ### Notes
21
26
 
22
- * Currently version 0.2.0, with many [features still planned](#features).
27
+ * Currently version 0.1.2, with many [features still planned](#features).
28
+ * Not optimized for sites other than YouTube
23
29
 
24
30
  ### Getting Started
25
31
 
26
32
  #### macOS
27
- If you don't already have FFmpeg, ImageMagick, or youtube-dl installed, you can download all of them with [Homebrew](https://brew.sh/). You can use `ffmpeg -v`, `convert -v`, or `youtube-dl --version` at the terminal to check if you've already got them.
33
+ You can use `ffmpeg -v`, `convert -v`, or `youtube-dl --version` at the terminal to check if you already have the binaries.
34
+
35
+ If you don't already have FFmpeg, ImageMagick, or youtube-dl installed, you can download all of them with [Homebrew](https://brew.sh/). With Homebrew, just bring up a terminal session and type:
28
36
 
29
- With Homewbrew, just bring up a terminal session and type:
30
37
  ```sh
31
38
  $ brew install ffmpeg
32
39
  $ brew install imagemagick
@@ -36,12 +43,16 @@ $ gem install muvy
36
43
 
37
44
  #### Windows
38
45
  1. You can [download Ruby here](https://rubyinstaller.org/).
39
- 2. Then you can grab [FFmpeg here](http://ffmpeg.zeranoe.com/builds/).
40
- 3. ..and then download [ImageMagick here](https://www.imagemagick.org/script/download.php#windows), **noting**:
41
- * On the nth installation window, you need to check 2 boxes:
42
- * [x] Add folder to your path variable
43
- * [x] Download legacy binaries
44
- 4. And finally get [youtube-dl here](https://rg3.github.io/youtube-dl/download.html).
46
+ 2. You can download Windows binaries for [ImageMagick here](https://www.imagemagick.org/script/download.php#windows), **noting**:
47
+ On the third installation window, [you need to check 2 boxes](https://i.imgur.com/d46sn8a.png):
48
+ - [x] Add application directory to your system path
49
+ - [x] Install legacy utilities (e.g. convert)
50
+ - [ ] Keep 'Install FFmpeg' unchecked - IM's bundle doesn't include `ffprobe` & `ffplay`
51
+ 2. Grab [FFmpeg here](http://ffmpeg.zeranoe.com/builds/).
52
+ 3. You'll have to manually edit your PATH environment variable [like in this tutorial](https://www.wikihow.com/Install-FFmpeg-on-Windows).
53
+ Once you set up FFmpeg in the PATH, you need to move the ImageMagick folder from 'User Variables' to the first entry in the 'System Variables' PATH variable so that Windows prefers ImageMagick `convert` over its own 'convert.exe'. [Here's an image showing that process](https://i.imgur.com/cf4HvCb.png).
54
+ ImageMagick 7 replaced `convert` with `magick` on Windows, but this gem can't make use of that yet.
55
+ 4. Get [youtube-dl here](https://rg3.github.io/youtube-dl/download.html).
45
56
  5. Then, you can install any gem like so:
46
57
  ```sh
47
58
  $ gem install muvy
@@ -54,7 +65,7 @@ $ gem install muvy
54
65
 
55
66
  | Type | Command: `muvy [Type] [Options]` | Support |
56
67
  |--------|--------------------------------------------|-----------------------------------------------------------------------------------------------|
57
- | URL | `muvy https://someVideoSite.com/someVidID` | [youtube-dl supported sites](https://rg3.github.io/youtube-dl/supportedsites.html) |
68
+ | URL | `muvy https://youtube.com/someVidID` | [youtube-dl sites](https://rg3.github.io/youtube-dl/supportedsites.html), but most fail |
58
69
  | Local | `muvy /Documents/Fave-Films/movie.mp4` | [FFmpeg supported formats](https://www.ffmpeg.org/general.html#File-Formats) |
59
70
  | Folder | `muvy /Downloads/Phone-Backup-1/Photos` | [ImageMagick supported formats](https://www.imagemagick.org/script/formats.php) |
60
71
 
@@ -66,40 +77,32 @@ Optionally specify the path where your final image will be saved.
66
77
  **Default**: your present working directory
67
78
 
68
79
  #### `-s, --style`
69
- Optionally specify currently supported styles: [solid](link) or [stretch](link).
80
+ Optionally specify currently supported styles: solid, stretch.
70
81
  **Default**: solid
71
82
 
72
83
  #### `-g, --gradient`
73
- Optionally add a gradient on top of the final image.
74
-
75
- Choose one:
84
+ Optionally add a gradient on top of the final image. You can choose one:
76
85
  ```
77
86
  black:heavy black:medium black:light
78
87
  white:heavy white:medium white:light
79
88
  ```
80
89
  **Default**: none
81
90
 
82
- [See examples](link)
83
-
84
91
  #### `--arc`
85
- Pass `--arc` to wrap all of the lines around a center point.
86
-
87
- [See examples](link)
92
+ Pass `--arc` to wrap all of the lines around a center point. [See examples](#examples)
88
93
 
89
94
  #### `--rotate`
90
95
  Pass `--rotate` to rotate the final image 90 degrees, i.e. to draw horizontal lines,
91
96
  where the top is the 'start' of your media file.
92
- TODO - check if the last sentence is true
93
97
 
94
98
  #### `-h, --height`
95
99
  Optionally specify a custom height for the output image.
96
100
 
97
101
  #### `--format`
98
102
  Optionally force the download quality for `youtube-dl`.
103
+ This command is currently best-suited to youtube. To see possible formats for other sites, type `youtube-dl -F <URL>` or see [youtube-dl docs on format selection](https://github.com/rg3/youtube-dl/blob/master/README.md#format-selection); however, even when specifying a suitable format, the script might fail to run.
99
104
  This determines the height of your image when using `-s stretch` only if you didn't specify --height.
100
- **Default**: 135 *(854x480 DASH at 24fps)*
101
-
102
- See [youtube-dl docs on format selection](https://github.com/rg3/youtube-dl/blob/master/README.md#format-selection).
105
+ **Default**: 135 *(854x480 DASH at 24fps)*.
103
106
 
104
107
  #### `--frame_rate`
105
108
  Optionally specify the amount of frames to extract per second from the media.
@@ -107,7 +110,7 @@ This determines the width of the image.
107
110
 
108
111
  You should run `muvy [..]` without this option once and check the stats printout
109
112
  to get an idea of a better number.
110
- For example, if the stats printout used "1.6 fps," passing `--frame_rate 3.2`
113
+ For example, if the stats printout readsM "1.6 fps," passing `--frame_rate 3.2`
111
114
  would double the amount of frames, lines, and subsequently the width.
112
115
 
113
116
  > Setting this to an unreasonable number might cause hundreds of thousands
@@ -115,36 +118,216 @@ of files to be temporarily created in your system's temp files.
115
118
 
116
119
  #### `--start` and `--end`
117
120
  Optionally specify starting and ending times for processing videos.
118
- If you only specify one of them, the other will default to the start/end.
121
+ If you only specify one, the other will default (e.g. if you only give --end, start -> 0).
119
122
 
120
- [Examples](link)
121
123
 
122
124
  ### Features
123
- - [x] Accepting image galleries, local videos, and online videos
124
- - [x] Specifying start & end times for frame extraction
125
- - [x] Vertical lines
126
- - [x] Horizontal lines
127
- - [x] Stretched output (average of each line of pixels)
128
- - [x] Arc distortion
129
- - [ ] Spotmap output ('QR' code)
130
- - [ ] Slit scan output
131
- - [ ] 'Bedforms' output
132
- - [ ] Dominant color algorithms
133
- - [ ] via ImageMagick histograms
134
- - [ ] via k-means clustering
135
- - [ ] Fade to black or white on edges
136
- - [ ] Pixel thickness control
137
- - [ ] Colorspace adjustments
138
- - [ ] Accept music files
139
- - [ ] Generate audio waveforms
140
- - [ ] Randomize waveform colors
141
- - [ ] Presets
125
+ - Formats
126
+ - [x] Accepts image galleries, local videos, and online videos
127
+ - [ ] Works with *any* youtube-dl supported site
128
+ - [x] Specify start & end times for frame extraction
129
+ - [ ] Accept music files
130
+ - [ ] Generate audio waveforms
131
+ - [ ] Randomize waveform colors
132
+ - Image Output
133
+ - [x] Vertical lines
134
+ - [x] Horizontal lines
135
+ - [x] 'Stretched' output, taking average of each line of pixels
136
+ - [x] Arc distortion
137
+ - [ ] Spotmap output, akin to 'QR' code
138
+ - [ ] Slit scan output
139
+ - [ ] 'Bedforms' output
140
+ - [ ] Stacked lines output, inspired by [Sol Lewitt's work](https://www.google.com/search?q=sol+lewitt&rlz=1C5CHFA_enUS757US757&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjLjP7y5unWAhWb0YMKHcNQBhcQ_AUICigB&biw=1276&bih=680)
141
+ - [ ] Choose inset borders
142
+ - [ ] Curvature
143
+ - [ ] Crosshatch lines output
144
+ - Image adjustments
145
+ - [x] Fade to black or white on edges
146
+ - [ ] Pixel thickness control
147
+ - [ ] Colorspace changes
148
+ - Generation
149
+ - [ ] Dominant color algorithms
150
+ - [ ] via ImageMagick histograms
151
+ - [ ] via k-means clustering
152
+ - Compatibility
153
+ - [ ] Use `popen3` since current gem wrappers are outdated (TODO)
142
154
 
143
155
  ## Examples
144
156
 
157
+ ### Films
158
+
159
+ <div align="center">
160
+ <img src="https://i.imgur.com/FpERYDO.png" />
161
+ <h4>Spirited Away (2001)</h4>
162
+ `muvy film.mkv -h 300`
163
+ 0.27 frames per second on 125 minutes
164
+ final resolution 2027x300
165
+ </div>
166
+
167
+ <br><br>
168
+
169
+ <div align="center">
170
+ <img src="https://i.imgur.com/dpyoILD.png" />
171
+ <h4>Mad Max: Fury Road (2015)</h4>
172
+ `muvy madden.mkv --end 01:52:50 -h 300`
173
+ 0.276 frames per second on 120 minutes
174
+ final resolution 1868x300
175
+ </div>
176
+
177
+ <br><br>
178
+
179
+ <div align="center">
180
+ <img src="https://i.imgur.com/ahDpJms.png" />
181
+ <h4>The Grand Budapest Hotel (2014)</h4>
182
+ `muvy "grand.avi" --end 01:33:40 --gradient black:medium --height 600`
183
+ 0.303 frames per second on 100 minutes
184
+ final resolution 1703x600
185
+ </div>
186
+
187
+ <br><br>
188
+
189
+ <div align="center">
190
+ <img src="https://i.imgur.com/pov6s07.png" />
191
+ <h4>Her (2013)</h4>
192
+ `muvy film.mp4 -g black:medium -h 720`
193
+ 0.269 frames per second on 126 minutes
194
+ final resolution 1919x720
195
+ </div>
196
+
197
+ <br><br>
198
+
199
+ <div align="center">
200
+ <img src="https://i.imgur.com/JEHqHoG.png" />
201
+ <h4>Melancholia (2011)</h4>
202
+ `muvy film.mp4 --gradient black:medium`
203
+ 0.277 frames per second on 136 minutes
204
+ final resolution 2158x720
205
+ </div>
206
+
207
+ <br><br>
208
+
209
+ <div align="center">
210
+ <img src="https://i.imgur.com/Up9SWKm.png" />
211
+ <h4>Kagemusha (1980)</h4>
212
+ `muvy film.mp4 --style stretch --gradient black:medium`
213
+ 0.225 frames per second on 162 minutes
214
+ final resolution 2439x688
215
+ </div>
216
+
217
+ <br><br>
218
+
219
+ <div align="center">
220
+ <img src="https://i.imgur.com/j9yNVdN.png" />
221
+ <img src="https://i.imgur.com/OgOgnz0.png" />
222
+ <h4>Samsara (2011)</h4>
223
+ (1) `muvy film.avi --end 01:35:00 -s stretch -g black:medium`
224
+ (2) `muvy "Samsara 2011 BRRip XviD AC3 - HDSi.avi" --height 150 --end 01:35:00`
225
+ 0.3 frames per second on 95 minutes
226
+ </div>
227
+
228
+ <br><br>
229
+
230
+ <div align="center">
231
+ <img src="https://i.imgur.com/7b7MWHX.png" />
232
+ <h4>Baraka (1992)</h4>
233
+ `muvy film.avi --height 150 --end 01:30:30`
234
+ 0.3 frames per second on 90 minutes
235
+ final resolution 1663x150
236
+ </div>
237
+
238
+ <br><br>
239
+
240
+ <div align="center">
241
+ <img src="https://i.imgur.com/Q3ETqJT.png" />
242
+ <h4>It's Such A Beautiful Day (2012)</h4>
243
+ `muvy film.mkv --height 200`
244
+ 0.4843 frames per second on 62 minutes
245
+ final resolution 1780x720
246
+ </div>
247
+
248
+ <br><br>
249
+
250
+ ### YouTube
251
+
252
+ <div align="center">
253
+ <img src="https://i.imgur.com/V0ecs7s.png" />
254
+ <h4>Holi by Variable</h4>
255
+ `muvy https://www.youtube.com/watch?v=r64Xk7c4Mr4 --frame_rate 10 --style stretch`
256
+ slow-motion youtube video
257
+ 10 frames per second on 1 minute 47 seconds
258
+ final resolution 1073x480
259
+ </div>
260
+
261
+ <br><br>
262
+
263
+ <div align="center">
264
+ <img src="https://i.imgur.com/F00eot2.png" />
265
+ <img src="https://i.imgur.com/rA2Ugr1.png" />
266
+ <h4>Mahalia - Sober by COLORS</h4>
267
+ (1) `muvy https://www.youtube.com/watch?v=QK7JQl9jNzM --frame_rate 7.5 --start 0:05 --end 3:23 -h 200`
268
+ (2) `muvy https://www.youtube.com/watch?v=QK7JQl9jNzM --frame_rate 7.5 --start 0:05 --end 3:23 -s stretch`
269
+ 7.5 frames per second on 3 minutes 36 seconds
270
+ </div>
271
+
272
+ <br><br>
273
+
274
+ <div align="center">
275
+ <img src="https://i.imgur.com/OMR4ffy.png?1" />
276
+ <h4>The Banach–Tarski Paradox by Vsauce</h4>
277
+ `muvy https://www.youtube.com/watch?v=s86-Z-CbaHA`
278
+ 0.62 frames per second on 24 minutes 14 seconds
279
+ final resolution 898x720
280
+ </div>
281
+
282
+ <br><br>
283
+
284
+ <div align="center">
285
+ <img src="https://i.imgur.com/pdHnMQQ.png" />
286
+ <h4>Colors In Macro by Macro Room</h4>
287
+ `muvy https://www.youtube.com/watch?v=gNbSjMFd7j4 --start 0:16 --end 2:07 --style stretch --frame_rate 10`
288
+ 10 frames per second on ~ 2 minutes
289
+ final resolution 1110x480
290
+ </div>
291
+
292
+ <br><br>
293
+
294
+ <div align="center">
295
+ <img src="https://image.ibb.co/g4WEVb/3.png" width="350" height="350" hspace="20" />
296
+ <img src="https://image.ibb.co/eLRsGG/2.png" width="350" height="350" />
297
+ <h4>Ink In Motion by Macro Room</h4>
298
+ (1) `muvy https://www.youtube.com/watch?v=BmBh0NNEm00 --start 0:37 --end 1:20 --frame_rate 10 -r -s stretch`
299
+ (2) `muvy https://www.youtube.com/watch?v=BmBh0NNEm00 --start 0:37 --end 1:20 --frame_rate 10 -r --arc`
300
+ </div>
301
+
302
+ <br><br>
303
+
304
+ <div align="center">
305
+ <img src="https://preview.ibb.co/e49VLb/muvy_11_10_031219.png" width="300" height="300" />
306
+ <h4>BBC Planet Earth II Episode 1</h4>
307
+ `muvy episode.mp4 --arc -g black:light`
308
+ 0.413 frames per second on 58 minutes
309
+ final resolution 1176x1176
310
+
311
+ <br><br>
312
+
313
+ <img src="https://image.ibb.co/b2GmbG/muvy_11_10_042756.png" width="300" height="300" />
314
+ <h4>Speed Drawing</h4>
315
+ `muvy https://www.youtube.com/watch?v=P3UozWhL6A0 --start 0:04 --end 04:45 --arc`
316
+ 1.7185 frames per second
317
+ final resolution 872x872
318
+ </div>
319
+
320
+ <br><br>
321
+
322
+ ### DCIM
323
+
324
+ TODO
325
+
145
326
  ## Troubleshooting
146
327
 
147
- Make sure you can access `ffmpeg -v`, `magick -v`, and `youtube-dl --version` on the command line. If you can't, you likely have to update your existing PATH environment variable [like this](https://video.stackexchange.com/questions/20495/how-do-i-set-up-and-use-ffmpeg-in-windows).
328
+ Make sure you can access `ffmpeg -v`, `magick -v`, and `youtube-dl --version` on the command line. If you can't, you likely have to update your existing PATH environment variable to include the folder holding the relevant binaries. If you're on Windows and you are unsure how to add FFmpeg to path, you can try any of these links: [1](https://github.com/adaptlearning/adapt_authoring/wiki/Installing-FFmpeg), [2](https://video.stackexchange.com/questions/20495/how-do-i-set-up-and-use-ffmpeg-in-windows), [3](https://www.wikihow.com/Install-FFmpeg-on-Windows).
329
+
330
+ If you're on Windows and *very* recently made changes, you probably have to reopen a command prompt window or restart for those changes to take effect.
148
331
 
149
332
  You might also want to update all three binaries.
150
333
 
@@ -158,8 +341,8 @@ If it's not working out, [I've linked more generators](#links) and methods that
158
341
  * Other Works & Inspirations
159
342
  * [Zach Whalen's Barcoder](http://zachwhalen.net/pg/barcoder/)
160
343
  * [arcanesanctum generator](http://arcanesanctum.net/movie-barcode-generator/)
161
- * [moviebarcode on tumblr](http://moviebarcode.tumblr.com/)
162
344
  * [/u/etherealpenguin on reddit](https://www.reddit.com/r/dataisbeautiful/comments/3rb8zi/the_average_color_of_every_frame_of_a_given_movie/)
345
+ * [moviebarcode on tumblr](http://moviebarcode.tumblr.com/)
163
346
  * [Colors of Motion](http://thecolorsofmotion.com/films)
164
347
  * Slit scanning
165
348
  * [informal catalogue of research on this topic by Levin](http://www.flong.com/texts/lists/slit_scan/)
@@ -55,7 +55,8 @@ module Muvy
55
55
  format: 135,
56
56
  output: "#{options[:tmp_dir]}/" +
57
57
  Time.now.strftime("%d-%m-%Y-%H%M%S") +
58
- ".mp4"
58
+ ".mp4",
59
+ no_warnings: true
59
60
  }
60
61
 
61
62
  @settings = defaults.merge!(options.select { |k, v| defaults.key?(k) && v })
@@ -22,14 +22,11 @@ module Muvy
22
22
  end
23
23
 
24
24
  def average
25
- # Store the average photos here
26
- Dir.mkdir("#{options[:tmp_dir]}/muvy-img-folder/")
27
-
28
25
  photos.each_with_index do |photo, i|
29
26
  MiniMagick::Tool::Convert.new do |convert|
30
27
  convert << photo
31
28
  convert.resize("1x#{height}!")
32
- convert << "#{options[:tmp_dir]}/muvy-img-folder/thumb#{i.to_s.rjust(6, '0')}.png"
29
+ convert << "#{options[:tmp_dir]}/thumb#{i.to_s.rjust(6, '0')}.png"
33
30
  end
34
31
  end
35
32
  end
@@ -50,7 +47,7 @@ module Muvy
50
47
  end
51
48
 
52
49
  def send_thumbs
53
- Image.new("#{options[:tmp_dir]}/muvy-img-folder", options).run
50
+ Image.new(options[:tmp_dir], options).run
54
51
  end
55
52
  end
56
53
  end
@@ -1,3 +1,3 @@
1
1
  module Muvy
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muvy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - agarun
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-11 00:00:00.000000000 Z
11
+ date: 2017-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: youtube-dl.rb