for i in *.mov; do ffmpeg -i "$i" -vf scale=1080:1920 -pix_fmt yuv420p -y `basename "$i" .mp4`x.mp4; done
ffmpeg -y -i assets/%02d.png -c:v libx264 -vf "fps=30,format=yuv420p,pad=ceil(iw/2)*2:ceil(ih/2)*2" -b 1600k mov.mp4
path.join( process.cwd(), 'dist', 'json'); | |
// etc etc etc |
for i in *.mov; do ffmpeg -i "$i" -vf scale=1080:1920 -pix_fmt yuv420p -y `basename "$i" .mp4`x.mp4; done
ffmpeg -y -i assets/%02d.png -c:v libx264 -vf "fps=30,format=yuv420p,pad=ceil(iw/2)*2:ceil(ih/2)*2" -b 1600k mov.mp4
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa |
const scrollMania = () => { | |
const currentScroll = window.pageYOffset || document.documentElement.scrollTop | |
// a 100vh element minus the actual height of the window(aka viewport) | |
const testThreshold = heightRef.current.offsetHeight - window.innerHeight | |
const end = () => { | |
if(currentScroll !== scrollDelta) { | |
setScrollDelta(currentScroll) | |
} | |
return true |
This document contains some of the ffmpeg snippets I use most commonly, and typically in the context of converting research-related image data to video. It is not meant to be exhaustive.
/** | |
* useScroll React custom hook | |
* Usage: | |
* const { scrollX, scrollY, scrollDirection } = useScroll(); | |
*/ | |
import { useState, useEffect } from "react"; | |
export function useScroll() { | |
const [lastScrollTop, setLastScrollTop] = useState(0); |
import React from 'react'; | |
import styled from '@emotion/styled'; | |
import { css } from '@emotion/core'; | |
import { CSSTransition } from 'react-transition-group'; | |
const has = (key, obj) => Object.prototype.hasOwnProperty.call(obj, key); | |
const keyframes = [ | |
'appear', | |
'enter', |
const random = (min: number, max: number) => { | |
return Math.floor(Math.random() * (max - min + 1)) + min | |
} |
import React from "react"; | |
interface IProps { | |
className?: string; | |
} | |
const Logo: React.FC<IProps> = ({ className }) => { | |
return ( | |
<svg | |
xmlns="http://www.w3.org/2000/svg" |