Browse Source

Updating docs, closing #26

Noah 7 years ago
parent
commit
56e2195f4c
4 changed files with 47 additions and 17 deletions
  1. 21 1
      DEVELOPERS.md
  2. 2 2
      INSTALL.md
  3. 6 9
      README.md
  4. 18 5
      THEMES.md

+ 21 - 1
DEVELOPERS.md View File

@@ -1,6 +1,6 @@
1 1
 Audiogram was developed for our particular needs but hopefully it should be reasonably hackable besides the options provided.  Here are some examples of possible customization that involve writing/editing the code and notes on how you could get started.
2 2
 
3
-## Use different animations besides the wave/bars
3
+## Use different animations besides the wave/bars/bricks
4 4
 
5 5
 The code that handles drawing a waveform involves three pieces:
6 6
 
@@ -55,6 +55,26 @@ The `node-canvas` step that draws an individual image for each frame accounts fo
55 55
 
56 56
 The FFmpeg step accounts for most of the remaining rendering time, and is defined in `audiogram/combine-frames.js`. If you're an FFmpeg expert and have thoughts on how to more intelligently render the final video, please let us know! You may at least be able to see some improvements by forcing FFmpeg to use several threads with the `-threads` flag on a multicore machine.
57 57
 
58
+## Extend themes
59
+
60
+The current renderer (in `renderer/`) looks for certain theme settings defined in `settings/themes.json` when it's drawing the frames for a video.  You could extend a theme with your own option names, and then reference them in the renderer.
61
+
62
+As an example, if you wanted to fill the wave with a gradient instead of a solid color, you could add the new option `waveColor2` to a theme and add this bit of extra logic into `renderer/patterns.js`:
63
+
64
+```js
65
+// If there's a second wave color, use a gradient instead
66
+if (options.waveColor2) {
67
+  var gradient = context.createLinearGradient(0, 0, options.width, 0);
68
+
69
+  gradient.addColorStop(0, options.waveColor);
70
+  gradient.addColorStop(1, options.waveColor2);
71
+
72
+  context.fillStyle = gradient;
73
+  context.strokeStyle = gradient;
74
+
75
+}
76
+```
77
+
58 78
 ## Use different dimensions besides 1280x720
59 79
 
60 80
 The width and height for a video are defined in `settings/themes.json`.  If you change them there, you will get a video of the appropriate size.  The simplest way to handle multiple sizes would be to define multiple themes:

+ 2 - 2
INSTALL.md View File

@@ -17,7 +17,7 @@ You can skip almost all of the installation if you use [Docker](#docker-installa
17 17
 
18 18
 ## Ubuntu 14.04+ installation
19 19
 
20
-Note: if you're using something with very little memory, like a Digital Ocean micro droplet, it might cause an installation problem on the last step. See [Linux troubleshooting](INSTALL.md#linux-troubleshooting) below for how to fix it.
20
+Note: if you're using something with < 1GB of RAM, like a Digital Ocean micro droplet, it might cause an installation problem on the last step. See [Linux troubleshooting](INSTALL.md#linux-troubleshooting) below for how to fix it.
21 21
 
22 22
 An example bootstrap script for installing Audiogram on Ubuntu looks like this:
23 23
 
@@ -111,7 +111,7 @@ npm install
111 111
 
112 112
 ## Windows installation
113 113
 
114
-Installing these dependencies on Windows is pretty dicey.  If you're running Windows 10, you'll probably have better luck installing [Docker for Windows](https://docs.docker.com/docker-for-windows/) and then following the [Docker instructions](INSTALL.md#docker-installation) below. Otherwise your best bet is probably to [install it on a remote Linux server](SERVER.md#im-the-only-one-using-it-and-installing-it-on-macwindows-was-a-real-drag).
114
+Installing these dependencies on Windows is an uphill battle.  If you're running Windows 10, you'll probably have better luck installing [Docker for Windows](https://docs.docker.com/docker-for-windows/) and then following the [Docker instructions](INSTALL.md#docker-installation) below. Otherwise your best bet is probably to [install it on a remote Linux server](SERVER.md#im-the-only-one-using-it-and-installing-it-on-macwindows-was-a-real-drag).
115 115
 
116 116
 ## Docker installation
117 117
 

File diff suppressed because it is too large
+ 6 - 9
README.md


+ 18 - 5
THEMES.md View File

@@ -17,7 +17,7 @@ The best way to get a feel for this is probably to look at the included themes f
17 17
 
18 18
 ### Required options
19 19
 
20
-The following options are required (they aren't required for every theme, as long as they're present in `default`):
20
+The following options are required (they aren't required for every theme as long as they're present in `default`):
21 21
 
22 22
 * `width` - desired video width in pixels (e.g. `1280`)
23 23
 * `height` - desired video height in pixels (e.g. `720`)
@@ -75,10 +75,6 @@ You can set both a `backgroundColor` and a `backgroundImage`, in which case the
75 75
 
76 76
 After you've edited `settings/themes.json`, you'll want to run either `npm run rebuild` or `npm start` to rebundle the new themes for the editor.
77 77
 
78
-### A note about layout
79
-
80
-When designing your own themes, keep in mind that web browsers and social apps put a variety of overlays on videos when they're paused or playing, like a progress bar at the bottom or a fat play button in the middle. Try to space things out so that important parts of your design aren't obscured.
81
-
82 78
 ### A note about fonts
83 79
 
84 80
 By default, Audiogram will already have access to fonts on your system.  This might be fine for local use, but it will become a problem on a server without the fonts you're used to, or if you want to use a specific font across lots of installations.
@@ -107,3 +103,20 @@ The bad news is that the font handling in the library Audiogram relies on has a
107 103
 2. Ensure that the font name defined in the font file's metadata matches the font name you're using (e.g. if your font definition says "32px Gotham", make sure that when you open your font file in something like Font Forge and look at the metadata, the font name is also "Gotham" and not some variant.
108 104
 
109 105
 3. Use TrueType fonts (.ttf) rather than other formats.
106
+
107
+
108
+### A note about layout
109
+
110
+When designing your own themes, keep in mind that web browsers and social apps put a variety of overlays on videos when they're paused or playing, like a progress bar at the bottom or a fat play button in the middle. Try to space things out so that important parts of your design aren't obscured.
111
+
112
+These diagrams show you what gets covered up in various web players for a 1280x720 video (the in-app players are generally more minimalistic):
113
+
114
+![Facebook - embedded, hovering](https://cloud.githubusercontent.com/assets/2120446/17449695/3f1e008a-5b2a-11e6-8a5a-f30b80141f7e.png)
115
+
116
+![Facebook - embedded, paused](https://cloud.githubusercontent.com/assets/2120446/17449742/7b547bec-5b2a-11e6-9107-ee79620c7612.png)
117
+
118
+![Facebook - in feed, hovering](https://cloud.githubusercontent.com/assets/2120446/17449722/5e841f5e-5b2a-11e6-9cca-e4072b6f3eb7.png)
119
+
120
+![Twitter - in feed, hovering](https://cloud.githubusercontent.com/assets/2120446/17449733/70d706b2-5b2a-11e6-9bbf-3659c36a4f41.png)
121
+
122
+![Tumblr - hovering](https://cloud.githubusercontent.com/assets/2120446/17449725/6637ff5e-5b2a-11e6-90bc-62743b13860a.png)