Improved Log message Video recording

This commit is contained in:
Bruno
2021-08-11 22:17:43 +02:00
parent fe72c9b829
commit 79433dd45c
2 changed files with 7 additions and 9 deletions

View File

@@ -186,10 +186,7 @@ void FrameGrabbing::grabFrame(FrameBuffer *frame_buffer)
pbo_index_ = (pbo_index_ + 1) % 2;
// a frame was successfully grabbed
if (buffer != nullptr) {
if ( gst_buffer_get_size(buffer) == 0 )
g_print("Empty buffer");
if ( buffer != nullptr && gst_buffer_get_size(buffer) > 0) {
// give the frame to all recorders
std::list<FrameGrabber *>::iterator iter = grabbers_.begin();
@@ -364,7 +361,7 @@ void FrameGrabber::addFrame (GstBuffer *buffer, GstCaps *caps)
// enter buffering_full_ mode if the space left in buffering is for only few frames
// (this prevents filling the buffer entirely)
if ( buffering_size_ - gst_app_src_get_current_level_bytes(src_) < 3 * gst_buffer_get_size(buffer)) {
#ifndef _NDEBUG
#ifndef NDEBUG
Log::Info("Frame capture : Using %s of %s Buffer.",
BaseToolkit::byte_to_string(gst_app_src_get_current_level_bytes(src_)).c_str(),
BaseToolkit::byte_to_string(buffering_size_).c_str());
@@ -397,8 +394,8 @@ void FrameGrabber::addFrame (GstBuffer *buffer, GstCaps *caps)
// de-activate and re-send EOS
stop();
// inform
Log::Info("Frame capture : Unnexpected EOF signal (no space left on drive? File deleted?)");
Log::Warning("Frame capture : failed after %s.", GstToolkit::time_to_string(duration_, GstToolkit::TIME_STRING_READABLE).c_str());
Log::Info("Frame capture: no space left on drive ? / encoding buffer full.");
}
// terminate properly if finished
else

View File

@@ -252,7 +252,8 @@ void VideoRecorder::init(GstCaps *caps)
GError *error = NULL;
pipeline_ = gst_parse_launch (description.c_str(), &error);
if (error != NULL) {
Log::Warning("Video Recording : Could not construct pipeline %s:\n%s", description.c_str(), error->message);
Log::Info("Video Recording : Could not construct pipeline %s\n%s", description.c_str(), error->message);
Log::Warning("Video Recording : Failed to initiate GStreamer.");
g_clear_error (&error);
finished_ = true;
return;
@@ -303,7 +304,7 @@ void VideoRecorder::init(GstCaps *caps)
}
else {
Log::Warning("Video Recording : Could not configure source");
Log::Warning("Video Recording : Failed to configure frame grabber.");
finished_ = true;
return;
}
@@ -311,7 +312,7 @@ void VideoRecorder::init(GstCaps *caps)
// start recording
GstStateChangeReturn ret = gst_element_set_state (pipeline_, GST_STATE_PLAYING);
if (ret == GST_STATE_CHANGE_FAILURE) {
Log::Warning("Video Recording : Could not record %s", filename_.c_str());
Log::Warning("Video Recording : Failed to start frame grabber.");
finished_ = true;
return;
}