diff --git a/src/zm_file_camera.cpp b/src/zm_file_camera.cpp index feaad3fe0..05d639da0 100644 --- a/src/zm_file_camera.cpp +++ b/src/zm_file_camera.cpp @@ -69,6 +69,12 @@ void FileCamera::Initialise() { void FileCamera::Terminate() { } +int FileCamera::PrimeCapture() { + getVideoStream(); + Info("Priming capture from %s", path.c_str()); + return 1; +} + int FileCamera::PreCapture() { struct stat statbuf = {}; if (stat(path.c_str(), &statbuf) < 0) { @@ -87,6 +93,13 @@ int FileCamera::PreCapture() { } int FileCamera::Capture(std::shared_ptr &zm_packet) { + if (!zm_packet->image) { + zm_packet->image = new Image(width, height, colours, subpixelorder); + } + zm_packet->keyframe = 1; + zm_packet->codec_type = AVMEDIA_TYPE_VIDEO; + zm_packet->packet->stream_index = mVideoStreamId; + zm_packet->stream = mVideoStream; return zm_packet->image->ReadJpeg(path, colours, subpixelorder) ? 1 : -1; } diff --git a/src/zm_file_camera.h b/src/zm_file_camera.h index cc5d38acd..7579ca98d 100644 --- a/src/zm_file_camera.h +++ b/src/zm_file_camera.h @@ -43,6 +43,8 @@ class FileCamera : public Camera { void Initialise(); void Terminate(); + + int PrimeCapture() override; int PreCapture() override; int Capture(std::shared_ptr &p) override; int PostCapture() override;