// // Load images from network video, timestamp image, write to MP4 file // int main( int argc, const char *argv[] ) { debugInitialise( "example3", "", 0 ); Info( "Starting" ); avInit(); Application app; //RemoteVideoInput input( "rtsp://*****:*****@axis207.home/mpeg4/media.amp" ); NetworkAVInput input( "input1", "rtsp://*****:*****@webcam.com/mpeg4/media.amp" ); app.addThread( &input ); ImageTimestamper timestamper( input.cname() ); app.addThread( ×tamper ); VideoParms videoParms( 640, 480 ); AudioParms audioParms; MovieFileOutput output( input.cname(), "/tmp", "mp4", 300, videoParms, audioParms ); output.registerProvider( timestamper ); app.addThread( &output ); app.run(); }
// // Load images from network stream, run motion detection, write to MP4 files and trap and print notifications // WARNING - This example can write lots of files, some large, to /tmp (or wherever configured) // int main( int argc, const char *argv[] ) { debugInitialise( "example9", "", 0 ); Info( "Starting" ); avInit(); Application app; NetworkAVInput input( "input", "rtsp://170.93.143.139:1935/rtplive/0b01b57900060075004d823633235daa" ); app.addThread( &input ); MotionDetector motionDetector( "detector" ); motionDetector.registerProvider( input ); app.addThread( &motionDetector ); VideoParms videoParms( 640, 480 ); AudioParms audioParms; VideoRecorder recorder( "recorder" , "/transfer", "mp4", videoParms, audioParms ); //MovieFileOutput recorder( "recorder" , "/tmp", "mp4", 300, videoParms, audioParms ); recorder.registerProvider( motionDetector ); app.addThread( &recorder ); NotifyOutput notifier( "notifier" ); notifier.registerProvider( recorder ); app.addThread( ¬ifier ); app.run(); }
// // Capture from local V4L2 device and write to ZM V2 compatible shared memory // int main( int argc, const char *argv[] ) { debugInitialise( "example1", "", 5 ); Info( "Starting" ); avInit(); Application app; LocalVideoInput input( "input1", "/dev/video0" ); app.addThread( &input ); MemoryOutput memoryOutput( input.cname(), "/dev/shm", 10 ); memoryOutput.registerProvider( input ); app.addThread( &memoryOutput ); app.run(); }
// // Run motion detection on a saved file, provide debug images in matrix mode over HTTP // int main( int argc, const char *argv[] ) { debugInitialise( "example6", "", 5 ); Info( "Starting" ); avInit(); Application app; NetworkAVInput input( "input", "/tmp/movie.mp4" ); app.addThread( &input ); MotionDetector motionDetector( "modect" ); motionDetector.registerProvider( input ); //EventRecorder eventRecorder( "/transfer/ozx" ); app.addThread( &motionDetector ); MatrixVideo matrixVideo( "matrix", PIX_FMT_YUV420P, 640, 480, FrameRate( 1, 10 ), 2, 2 ); matrixVideo.registerProvider( *motionDetector.refImageSlave() ); matrixVideo.registerProvider( *motionDetector.compImageSlave() ); matrixVideo.registerProvider( *motionDetector.deltaImageSlave() ); matrixVideo.registerProvider( *motionDetector.varImageSlave() ); app.addThread( &matrixVideo ); Listener listener; app.addThread( &listener ); HttpController httpController( "p8080", 8080 ); listener.addController( &httpController ); httpController.addStream( "file", input ); httpController.addStream( "debug", SlaveVideo::cClass() ); httpController.addStream( "debug", matrixVideo ); httpController.addStream( "debug", motionDetector ); app.run(); }