From 4c9e8e38ff03f635e870886243fdbcbce73bd3cb Mon Sep 17 00:00:00 2001 From: Jan Grewe Date: Mon, 15 Jun 2020 10:44:52 +0200 Subject: [PATCH] [writer] fixes --- writer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/writer.cpp b/writer.cpp index f358725..3b8f049 100644 --- a/writer.cpp +++ b/writer.cpp @@ -10,7 +10,7 @@ void Writer::setVideoSpecs(VideoSpecs specs) { void Writer::run() { size_t count = 0; - size_t chunksize = 1024; + size_t chunksize = 256; if (valid) { stop_request = false; @@ -22,8 +22,10 @@ void Writer::run() { nix::File nix_file =nix::File::open(videoSpecs.filename + ".nix", nix::FileMode::Overwrite, "hdf5", nix::Compression::DeflateNormal); nix::Block b = nix_file.createBlock("Recording", "nix.recording"); nix::Section s = nix_file.createSection("Recroding", "nix.recording"); + nix::Value v(nix::util::timeToStr(std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()))); s.createProperty("date", v); + nix::Value fn(videoSpecs.filename); s.createProperty("moviefile", fn); nix::Section sw_sec = s.createSection("PylonRecorder", "nix.software"); @@ -31,10 +33,9 @@ void Writer::run() { nix::Section hw_sec = s.createSection("Basler ACE", "nix.hardware.camera"); hw_sec.createProperty("type", nix::Value("monochrome")); - nix::Property p = hw_sec.createProperty("framerate", nix::DataType::Int16); - nix::Value fr(videoSpecs.fps); + + nix::Property p = hw_sec.createProperty("framerate", nix::Value(static_cast(videoSpecs.fps))); p.unit("Hz"); - p.values({v}); nix::NDSize initial_shape(1, chunksize); nix::DataArray frametimes = b.createDataArray("frametimes", "nix.imaging.frametimes", nix::DataType::String, initial_shape); @@ -49,7 +50,6 @@ void Writer::run() { nix::NDSize offset(1, 0); nix::NDSize current_shape(initial_shape); nix::NDSize chunk_shape(1, chunksize); - MyImage img; while ((!stop_request || buffer->bufferLoad() > 0) && !stopNow) { if (buffer->bufferLoad() > 0 ) {