Explorar el Código

Update README and fix standalone script run.

Colby hace 4 años
padre
commit
1c23aa2ed5
Se han modificado 2 ficheros con 21 adiciones y 6 borrados
  1. 17 3
      README.md
  2. 4 3
      audio_to_visualization.py

+ 17 - 3
README.md

@@ -10,6 +10,20 @@ Install via pip:
 
 `pip install -r requirements.txt`
 
-## Future Works
-- Integration with YouTube
-- More visualization options
+## Run the script
+
+`python audio_to_visualization.py <arguments>`
+
+### Command line arguments
+
+| Argument | Description | Required | Default |
+|----------|-------------|----------|---------|
+| --audio | path to audio file to visualize | true | N/A |
+| --background | path to image to use for background | true | N/A |
+| --output | path and name of output file. Must end in .mp4 | true | N/a |
+| --vis-background-to-vid-ratio | ratio of visualization background height to input image height (0.0-1.0) | false | 0.2 |
+| --vis-waves-to-vid-ratio | ratio of visualization waves height to input image height (0.0-1.0) | false | 0.15 |
+| --vis-color | color for visualization waveforms. can be used multiple times | false | "0xffffff" |
+| --vis-color-opacity | opacity of vis colors (0.0-1.0) | false | 0.9 |
+| --background-color | background color for visualization waveforms | false | "0x000000" |
+| --background-color-opacity | opacity for visualization background color (0.0-1.0) | false | 0.5 |

+ 4 - 3
audio_to_visualization.py

@@ -39,9 +39,10 @@ def call_video_creator_with_args():
   parser.add_argument("--background-color-opacity", type=restricted_float, default=0.5,
                       help="opacity for visualization background color (0.0-1.0)", required=False)
 
-  args, _ = parser.parse_known_args(args.audio, args.background, args.output, args.vis_background_to_vid_ratio,
-                                    args.vis_waves_to_vid_ratio, args.vis_color, args.vis_color_opacity,
-                                    args.background_color, args.background_color_opacity)
+  args, _ = parser.parse_known_args()
+  create_vizualization(args.audio, args.background, args.output, args.vis_background_to_vid_ratio,
+                       args.vis_waves_to_vid_ratio, args.vis_color, args.vis_color_opacity,
+                       args.background_color, args.background_color_opacity)
 
 def create_vizualization(audio, background, output, vis_background_to_vid_ratio,
                          vis_waves_to_vid_ratio, vis_color, vis_color_opacity,