ToolExample

From Hackers & Designers
Revision as of 19:30, 16 January 2020 by Karl (talk | contribs)
MainNavigation No

Jeoren's syntax: {{#github:readme.md|hackersanddesigners/hdsa2019doc}}

Karl's syntax: <tool repo="REPONAME" file="FILENAME"></tool>


<div class="position-relative js-header-wrapper ">
  <a href="#start-of-content" data-skip-target-assigned="false" class="px-2 py-4 color-bg-accent-emphasis color-fg-on-emphasis show-on-focus js-skip-to-content">Skip to content</a>

  <span data-view-component="true" class="progress-pjax-loader Progress position-fixed width-full">
<span style="width: 0%;" data-view-component="true" class="Progress-item progress-pjax-loader-bar left-0 top-0 color-bg-accent-emphasis"></span>






Navigation Menu


   Toggle navigation
 


     
       
   
     


       
         Sign in
       
     


         
   
           
           
 












       Search or jump to...
         
           





Search code, repositories, users, issues, pull requests...




       Search
     
     
         
           
   
         
       
         
         
           
           
         
       
         Clear
           
   








































































































       
         
   
       
       
   
   


           
             Search syntax tips








Provide feedback






We read every piece of feedback, and take your input very seriously.


         Include my email address so I can be contacted


                   Cancel
             Submit feedback






Saved searches

Use saved searches to filter your results more quickly










           Name
           
             
             
           
         


           Query
           
         

To see all available qualifiers, see our documentation.





                   Cancel
             Create saved search





           
             Sign in
           
         
           
             Sign up
           
       
     
   
 


  <div hidden="hidden" data-view-component="true" class="js-stale-session-flash stale-session-flash flash flash-warn flash-full mb-3">

    <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
<path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

<button id="icon-button-ed993d3b-4831-4196-9a3f-95ee396ae17c" aria-labelledby="tooltip-683932c5-53c7-4053-a3ad-d5478dcc9d5a" type="button" data-view-component="true" class="Button Button--iconOnly Button--invisible Button--medium flash-close js-flash-close">  <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-x Button-visual">
<path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path>

Dismiss alert



<div id="js-flash-container" class="flash-container" data-turbo-replace>






     {{ message }}



<include-fragment class="js-notification-shelf-include-fragment" data-base-src="https://github.com/notifications/beta/shelf"></include-fragment>














   
     
       hackersanddesigners

   /
   
     hdsa2019doc
   
   Public
 










Additional navigation options





















Files

 master

Breadcrumbs

  1. hdsa2019doc
/

readme.md

Blame Blame

Latest commit

 

History

History87 lines (63 loc) · 2.63 KB master

Breadcrumbs

  1. hdsa2019doc
/

readme.md

Top

File metadata and controls

  • Preview
  • Code
  • Blame
87 lines (63 loc) · 2.63 KBRaw

HDSA 2019 videodoc generator

Description

This script takes all the videos in a specified folder and uses parts of these videos to generate a random video of the specified length.

Installation

Not necessary but preferred. Create a environment for this project. I use conda:

conda create -n hdsa19doc python=3.7.3
conda activate hdsa19doc

Then install moviePy and GamePy (for sound or previews I think)

pip install moviepy gamepy

Input videos go in /input. Allowed types: .mov, .m4v, .mp4 Run the script:

python generate.py
optional arguments:
  -h, --help            show this help message and exit
  -d DURATION, --duration DURATION
                        Duration of output file
  -m MAX_SEG_LENGTH, --max_seg_length MAX_SEG_LENGTH
                        Max segment length
  -o, --open            Open the output file on finish.
  -t TEXTFILE, --textfile TEXTFILE
                        Path to textfile. Overlay the video with lines from
                        input text file.
  -b BRANDING, --branding BRANDING
                        Path to video. A part of this video will be overlaid
                        on the main composition.
  --title TITLE         Path to video/gif. Title overlay.
  --logo LOGO           Path to video/gif. Corner logo overlay.

Example:

python generate.py --duration 60 --max_seg_length 10 --open --textfile words.txt  --branding branding/Short\ movie\ 16x9.mov --title images/opening.gif --font KronaOne 

Links

Other references:

Other interesting video libraries/languages:

To get MoviePy/imagemagick to recognize your fonts on Mac I had to modify this script a bit: https://github.com/testdouble/imagemagick-macos-font-setup First install the script with: npm i -g imagemagick-macos-font-setup Then:

#!/usr/bin/env bash
# Find our path via npm because BASH_SOURCE won't work under npm scripts… ಠ_ಠ
DIR="$(npm ls --global --parseable imagemagick-macos-font-setup)"
TYPE_GEN_SCRIPT="$DIR/vendor/imagemagick_type_gen"
echo "<----- Ensuring $HOME/.config/ImageMagick exists"
mkdir -p "$HOME/.config/ImageMagick"
echo "<----- Writing font definition to $HOME/.config/ImageMagick/type.xml"
find "$HOME/Library/Fonts" -type f -name '*.ttf' | "$TYPE_GEN_SCRIPT" -f - > "$HOME/.config/ImageMagick/type.xml"

Save the above as a .sh script and run it to create a Font list in ~/.config/ImageMagick/type.xml

To see which fonts ImageMagick recognizes: convert -list font








      <footer class="footer pt-8 pb-6 f6 color-fg-muted p-responsive" role="contentinfo" >

Footer


     
       
   

     
       © 2024 GitHub, Inc.
     
   


Footer navigation


<ghcc-consent id="ghcc" class="position-fixed bottom-0 left-0" style="z-index: 999999" data-initial-cookie-consent-allowed="" data-cookie-consent-required="true"></ghcc-consent>






   You can’t perform that action at this time.
 
<template id="site-details-dialog">







<div class="Popover js-hovercard-content position-absolute" style="display: none; outline: none;" tabindex="0">



<template id="snippet-clipboard-copy-button">













</div>

<div id="js-global-screen-reader-notice" class="sr-only" aria-live="polite" aria-atomic="true" ></div>
<div id="js-global-screen-reader-notice-assertive" class="sr-only" aria-live="assertive" aria-atomic="true"></div>

To-Do for Article Pages

  • CSS
    • define a max height → expandable to full height
    • cute styling ◕3◕
  • HTML
    • external link to github

To-Do for Tools Page

  • CSS
    • max height + width
  • HTML
    • if #github embed in article then create same embed in tools
    • external link to github
    • internal link to article (only in tools page)