From 04a8953f6ddb98df9fdcbcdf65e51e298692c828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Verstraeten?= Date: Fri, 5 May 2017 09:37:28 +0200 Subject: [PATCH 1/2] set content-type while uploading, default to video and lower resolution --- config/capture.xml | 16 ++++++++-------- config/config.xml | 8 ++++---- src/kerberos/cloud/S3.cpp | 14 +++++++++++++- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/config/capture.xml b/config/capture.xml index a43725a..272fae7 100755 --- a/config/capture.xml +++ b/config/capture.xml @@ -4,29 +4,29 @@ rtsp://admin:888888@192.168.0.13/tcp/av0_1 640 - 360 - 1000 + 480 + 500 0 - 800 - 640 + 640 + 480 0 500 0 - 1280 - 720 + 640 + 480 500 0 - 800 - 640 + 640 + 480 0 500 0 diff --git a/config/config.xml b/config/config.xml index 77fb86f..e6d16c2 100755 --- a/config/config.xml +++ b/config/config.xml @@ -1,6 +1,6 @@ - + frontdoor false @@ -11,8 +11,8 @@ DifferentialCollins Hull Sequence - Disk + Video S3 - - \ No newline at end of file + + diff --git a/src/kerberos/cloud/S3.cpp b/src/kerberos/cloud/S3.cpp index cb57d8c..52e407d 100644 --- a/src/kerberos/cloud/S3.cpp +++ b/src/kerberos/cloud/S3.cpp @@ -73,6 +73,18 @@ namespace kerberos // Date std::string date = getDate(); headers.push_back("Date: " + date); + + std::string contentType = "image/jpeg"; + + std::vector extensions; + helper::tokenize(fileName, extensions, "."); + std::string extension = helper::urlencode(extensions[extensions.size()-1]); + if(extension == "mp4") + { + contentType = "video/mp4"; + } + + headers.push_back("Content-Type: " + contentType); // folder std::string folder = (m_folder == "") ? "" : m_folder + "/"; @@ -80,7 +92,7 @@ namespace kerberos // Authorize request std::string request = "PUT\n"; request += "\n"; - request += "\n"; + request += contentType + "\n"; request += date + "\n"; request += "/" + m_bucket + "/" + folder + fileName; headers.push_back("Authorization: " + authorize(request)); From ef51d6a807dc173fb0e34e7b1efcc52d19d7454d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Verstraeten?= Date: Fri, 5 May 2017 09:41:52 +0200 Subject: [PATCH 2/2] upgrade version --- include/kerberos/Globals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/kerberos/Globals.h b/include/kerberos/Globals.h index bfe0173..274b923 100644 --- a/include/kerberos/Globals.h +++ b/include/kerberos/Globals.h @@ -17,7 +17,7 @@ #ifndef __Version_H_INCLUDED__ // if Version.h hasn't been included yet... #define __Version_H_INCLUDED__ // #define this so the compiler knows it has been included - #define VERSION "2.2.1" + #define VERSION "2.2.2" #define HADES "https://hades.kerberos.io" #define SYMBOL_DIRECTORY "/etc/opt/kerberosio/symbols/" #define CONFIGURATION_PATH "/etc/opt/kerberosio/config/config.xml"