1.0.0 • Published 4 years ago

js-stream-packager v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

PackagerJS

A package that edits and packages your HLS and DASH videos

Getting Started

Make sure FFMpeg and Shaka Packager are installed and add to your path

Instalation

npm install js-stream-packager --save

Usage

const packager = require("packager")

const videopackager = new packager()
//To create DASH contents
videopackager().dash([{input:"/path/to/inputfile.mkv",duration:"59",output:'/path/to/outputfile.mp4'}],'/path/to/outputDASHManifest.mpd')

// To skip creating the steams and jump generate the manifest
// Note input files must be mp4
videopackager().dash([{input:"/path/to/inputfile.mp4",output:'/path/to/outputfile.mp4'}],'/path/to/outputDASHManifest.mpd',false)

//To create HLS contents
videopackager().hls([{input:"/path/to/inputfile.mkv",duration:"59",output:'/path/to/outputfile.mp4'}],'/path/to/outputHLSManifest.m3u8')

// To skip creating the steams and jump generate the manifest
// Note input files must be mp4
videopackager().dash([{input:"/path/to/inputfile.mp4",output:'/path/to/outputfile.mp4'}],'/path/to/outputHLSManifest.m3u8',false)

//Multiply video streams can be created to and edited with FFMPEG 
p.ffmpeg([{input:'/path/to/video.mp4',duration:'10',
size:'144x360',duration:'10',aspectRatio:'4:3',framerate:'10',output:'/path/to/outvideo.mp4'},
{input:'/path/to/video.mp4',duration:'10',startTime:'10',
size:'720x360',duration:'10',aspectRatio:'4:3',framerate:'10',output:'/path/to/video.mp4'}]
)

Built With

Contributing

GitHubhttps://github.com/Sectur1/pakager)

Authors

License

This project is licensed under the MIT License

Options

Video stream optionsUse
inputThe input (This can be on the input parameter to signify 1 stream or per stream)
sizeThe video's size for eg "720x360"
durationThe duration of the video eg "50" or "1:50"
aspectRatioThe video's aspect eg"16:9"
frameRateThe video's framerate eg "24" or "60"
bitsPerRawSampleThe video's Bit Per Sample
startTimeOffset time to the start the video
noVideoTo disenable the video
videoFiltersFFMPEG's video filter
videoBitRateThe video's bitrate
Audio optionsUse
aframesNumber of audio frames to output
qualityCodec specific audio quality
sampleAudio sample rate in Hz
channelsAudio channels in number
noAudioDisenables audio
audioCodecAudio codec to use
volumeSets the audio volume. It defaults to 256
audiFiltersFFMPEG's audio filter
General optionsUse
metadataFile metadata
fileSizeForce file size
framesNumber of frames to output eg 1 for a picture
timestampWhen the video was created defaults to now
toStop transcoding at set time eg 1:50