Skip to content

zenzig/checkStream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

checkStream

GitHub code size in bytes GitHub package.json version npm

checkStream is an async function that determines if an RTSP stream is running by using the ffprobe command to check for codec and duration information.

Installation

To use checkStream you must have nodejs and ffprobe installed on your system.

NPM

$ npm i @zenzig/checkstream

Usage

const checkStream = require('checkstream');

async function main() {
  try {
    const result = await checkStream('rtsp://demo:[email protected]:5541/onvif-media/media.amp?profile=profile_1_h264&sessiontimeout=60&streamtype=unicast');
    console.log(result);
  } catch (error) {
    console.error(error);
  }
}

main();

Output

If codec and duration information is found in the stream, checkStream will return true. If the information is not found, or if the ffprobe command times out, checkStream will return false or throw an error, respectively.

License

This project is licensed under the MIT License.

About

checkStream is an async function that determines if an RTSP stream is running by using the ffprobe command to check for codec and duration information.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors