[writer] fixes

This commit is contained in:
Jan Grewe 2020-06-15 10:44:52 +02:00
parent a27908adda
commit 4c9e8e38ff

View File

@ -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<int>(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 ) {