Skip to content

Instantly share code, notes, and snippets.

@leogdion
Last active Jul 20, 2019
Embed
What would you like to do?
An example of turning podcast clip into a video clip for empowerapps.show
# Created by https://www.gitignore.io/api/macos
# Edit at https://www.gitignore.io/?templates=macos
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# End of https://www.gitignore.io/api/macos
.temp
empower*
#!/bin/bash
for script in ./Empower*.sh; do "$script" & done
wait
#!/bin/bash
FONT="/Users/leo/Library/Fonts/skyfonts-google/Cardo 700.ttf"
SHOW_NAME="empowerapps.show"
FCLIP_NAME=${CLIP_NAME//,}
LOGO_PATH=brightdigit.png
ANIMATED_LOGO_FORMAT=Logo-%d.png
mkdir -p .temp
yes | convert -gravity East -font "$FONT" -pointsize 48 label:"$SHOW_NAME" -pointsize 32 label:"episode $EPISODE_NO" -pointsize 52 label:"$EPISODE_NAME" -pointsize 42 label:"$GUEST_APPEND" -pointsize 56 label:"$CLIP_NAME" -append ".temp/$SHOW_NAME.$EPISODE_NO.$EPISODE_NAME.$FCLIP_NAME.text.16x9.png"
yes | convert -size 1920x1080 xc:white -gravity SouthEast -draw "image over 200,100, 0,0, '$LOGO_PATH'" -gravity NorthEast -draw "image over 200,100, 0,0, '.temp/$SHOW_NAME.$EPISODE_NO.$EPISODE_NAME.$FCLIP_NAME.text.16x9.png'" ".temp/$SHOW_NAME.$EPISODE_NO.$EPISODE_NAME.$FCLIP_NAME.background.16x9.png"
yes | ffmpeg -loop 1 -framerate 1 -i ".temp/$SHOW_NAME.$EPISODE_NO.$EPISODE_NAME.$FCLIP_NAME.background.16x9.png" -framerate 1 -f image2 -i $ANIMATED_LOGO_FORMAT -filter_complex "[1:v]scale=iw/2:ih/2 [ovrl],[0:v][ovrl] overlay=200:(H-h)/2:shortest=1,format=yuv420p" -vcodec libx264 -crf 25 -pix_fmt yuv420p -r 60 ".temp/$SHOW_NAME.$EPISODE_NO.$EPISODE_NAME.$FCLIP_NAME.loop.16x9.mp4"
ffmpeg -i "$AUDIO_FILE" -filter_complex movie=".temp/$SHOW_NAME.$EPISODE_NO.$EPISODE_NAME.$FCLIP_NAME.loop.16x9.mp4":loop=0,setpts=N/FRAME_RATE/TB -shortest "$SHOW_NAME.$EPISODE_NO.$EPISODE_NAME.$FCLIP_NAME.16x9.mp4"
yes | convert -gravity East -font "$FONT" -pointsize 36 label:"$SHOW_NAME" -pointsize 28 label:"episode $EPISODE_NO" -pointsize 36 label:"$EPISODE_NAME" -pointsize 32 label:"$GUEST_APPEND" -pointsize 52 label:"$CLIP_NAME" -append ".temp/$SHOW_NAME.$EPISODE_NO.$EPISODE_NAME.$FCLIP_NAME.text.1x1.png"
yes | convert -size 1080x1080 xc:white -gravity SouthEast -draw "image over 100,100, 0,0, '$LOGO_PATH'" -gravity NorthEast -gravity NorthEast -draw "image over 100,100, 0,0, '.temp/$SHOW_NAME.$EPISODE_NO.$EPISODE_NAME.$FCLIP_NAME.text.1x1.png'" ".temp/$SHOW_NAME.$EPISODE_NO.$EPISODE_NAME.$FCLIP_NAME.background.1x1.png"
yes | ffmpeg -loop 1 -framerate 1 -i ".temp/$SHOW_NAME.$EPISODE_NO.$EPISODE_NAME.$FCLIP_NAME.background.1x1.png" -framerate 1 -f image2 -i $ANIMATED_LOGO_FORMAT -filter_complex "[1:v]scale=iw/3:ih/3 [ovrl],[0:v][ovrl] overlay=(W-w)/2:(H-h)/2+50:shortest=1,format=yuv420p" -vcodec libx264 -crf 25 -pix_fmt yuv420p -r 60 ".temp/$SHOW_NAME.$EPISODE_NO.$EPISODE_NAME.$FCLIP_NAME.loop.1x1.mp4"
ffmpeg -i "$AUDIO_FILE" -filter_complex movie=".temp/$SHOW_NAME.$EPISODE_NO.$EPISODE_NAME.$FCLIP_NAME.loop.1x1.mp4":loop=0,setpts=N/FRAME_RATE/TB -shortest "$SHOW_NAME.$EPISODE_NO.$EPISODE_NAME.$FCLIP_NAME.1x1.mp4"
#!/bin/bash
EPISODE_NO=17
EPISODE_NAME="Subcontracting"
GUEST_APPEND=" with Joe Cieplinski"
CLIP_NAME="Communication and Relationships"
AUDIO_FILE="Empower Apps 17 quote 1.mp3"
. ./podcast_video_clips.sh
@leogdion

This comment has been minimized.

Copy link
Owner Author

@leogdion leogdion commented May 28, 2019

fixed audio issue with twitter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment