This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on the command used in https://askubuntu.com/a/1462885 | |
# | |
# ffmpeg -i screencast.webm -filter:v "scale=trunc(iw/2)*2:trunc(ih/2)*2,fps=30" screencast.mp4 | |
# | |
# Easily call this lengthy command with webm2mp4 filename.webm | |
# | |
# Add this to your ~/.bashrc file to easily access | |
#function to convert webm to mp4 via ffmpeg | |
function webm2mp4() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on: https://stackoverflow.com/a/46814952/283851 | |
/** | |
* Create a Base64 Image URL, with rotation applied to compensate for EXIF orientation, if needed. | |
* | |
* Optionally resize to a smaller maximum width - to improve performance for larger image thumbnails. | |
*/ | |
export async function getImageUrl(file: File, maxWidth: number|undefined) { | |
return readOrientation(file).then(orientation => applyRotation(file, orientation || 1, maxWidth || 999999)); | |
} |