1.0.1 • Published 1 month ago

node-sstv v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

node-sstv

(Another) SSTV image encoder for NodeJS. Inspired by echicken/node-sstv.

This library attempts to implement the encoding process of SSTV modes by following the Proposal for SSTV Mode Specifications paper by JL Barber, and echicken/node-sstv's repository as reference for the PCM generation and scanline sampling.

API

Refer to the generated documentation.

Examples

  • Creates a SSTV stream using mode Pakoson 7 into a file.

    const { SSTVStream, Mode, PCMFormat } = require('node-sstv')
    const fs = require('node:fs')
    
    new SSTVStream(Mode.PASOKON_7, 'cute_tako.png', {
        pcmFormat: PCMFormat.SIGNED_16_LE,
        sampleRate: 44100
    }).pipe(fs.createWriteStream('sstv_tako.pcm'))
  • Creates a SSTV stream and plays it out of the speakers (using ffplay)

    const { SSTVStream, Mode, PCMFormat } = require('node-sstv')
    const { spawn } = require('node:child_process')
    
    const ffplay = spawn('ffplay', [
        '-f', 's16le',
        '-ar', '44100',
        '-ac', '1',
        '-autoexit',
        '-'
    ])
    
    new SSTVStream(Mode.PASOKON_7, 'cute_tako.png', {
        pcmFormat: PCMFormat.SIGNED_16_LE,
        sampleRate: 44100
    }).pipe(ffplay.stdin)

Supported modes

ModeAlias
Scottie 1Mode.SCOTTIE_1
Scottie 2Mode.SCOTTIE_2
Scottie DXMode.SCOTTIE_DX
Martin 1Mode.MARTIN_1
Martin 2Mode.MARTIN_2
Robot Color 36Mode.ROBOT_36
Robot Color 72Mode.ROBOT_72
Wrasse SC2-180Mode.SC2_180
Pasokon 3Mode.PASOKON_3
Pasokon 5Mode.PASOKON_5
Pasokon 7Mode.PASOKON_7
PD50Mode.PD50
PD90Mode.PD90
PD120Mode.PD120
PD160Mode.PD160
PD180Mode.PD180
PD240Mode.PD240
PD290Mode.PD290
FAX480Mode.FAX480

License

MIT

1.0.1

1 month ago

1.0.0

1 month ago