av-encoder
Encode & compress audio/video specifically for web.
encode-audio
: Takes a list of folders of audio files and converts them to .opus, .caf (opus codec), and .mp3.encode-video
: Takes a list of folders of video files (currently mp4 & mov) and outputs an mp4 for each, and optionally a .wav audio track.
Installation
npm install @andrewstart/av-encoder
Project Config file
You'll need to create a JSON5 or JSON formatted project config file, with the default name/location being ./ave-config.json5
.
{
audio: {
baseSrc: 'src/audio',
baseDest: 'assets/audio',
default: {
opusTargetBitrate: '32k',
mp3Quality: '9',
},
folders: [
{
src: 'sfx',
dest: 'sfx',
},
{
src: 'sfx/loops',
dest: 'sfx/loops',
opusTargetBitrate: '48k',
mp3Quality: '7'
},
{
src: 'vo',
dest: 'vo',
overrides: {
'intro.wav': {
opusTargetBitrate: '48k',
mp3Quality: '7'
}
}
},
],
},
video: {
baseSrc: 'src/video',
baseDest: 'assets/video',
default: {
quality: 28,
width: 1280,
audioOut: '../audio/vo'
},
folders: []
}
}
Project cache files
Files for audio & video caches to track which files need to be encoded and which don't will be created in your project. .aveaudiocache
and .avevidiocache
will be created when encoding audio and video, respectively. If your output files are tracked with version control, then these cache files should be tracked as well.