Skip to content

Commit

Permalink
fixed old bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lostjared committed Aug 31, 2020
1 parent 0f1a1e4 commit 9dec4bb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions acidcam/acidcam-cli-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,10 @@ int main(int argc, char **argv) {
std::cout << argv[0] << ": invalid fourcc...\n";
exit(EXIT_FAILURE);
}
cmd::four_cc_str = value;
cmd::cur_codec = 3;
cmd::four_cc = cv::VideoWriter::fourcc(value[0], value[1], value[2], value[3]);
program.setCodecMode(3);
}
break;
case 'h':
Expand Down
5 changes: 4 additions & 1 deletion acidcam/acidcam-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ namespace cmd {
using namespace cv;
int cur_codec = 0;
int four_cc = 0;
std::string four_cc_str = "avc1";
// Function below from Stack Overflow
// https://stackoverflow.com/questions/28562401/resize-an-image-to-a-square-but-keep-aspect-ratio-c-opencv
cv::Mat resizeKeepAspectRatio(const cv::Mat &input, const cv::Size &dstSize, const cv::Scalar &bgcolor) {
Expand Down Expand Up @@ -96,7 +97,6 @@ namespace cmd {

std::ostream &operator<<(std::ostream &out, const File_Type &type) {
if(type == File_Type::MOV) {
out << "MPEG-4";
switch(cur_codec) {
case 0:
break;
Expand All @@ -106,6 +106,9 @@ namespace cmd {
case 2:
out << "HEVC";
break;
case 3:
out << four_cc_str;
break;
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion acidcam/acidcam-cli.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@


namespace cmd {

extern std::string four_cc_str;
cv::Mat resizeKeepAspectRatio(const cv::Mat &input, const cv::Size &dstSize, const cv::Scalar &bgcolor);

enum class File_Type { MOV, AVI };
Expand Down

0 comments on commit 9dec4bb

Please sign in to comment.