| | |
| | | #include <unistd.h> |
| | | #include <chrono> |
| | | |
| | | #include <sys/stat.h> |
| | | |
| | | extern "C"{ |
| | | #include <libavcodec/avcodec.h> |
| | | } |
| | |
| | | logIt("start record h264 file: %s", file_path_.c_str()); |
| | | return 0; |
| | | }else{ |
| | | file_path_ = "./" + filename; |
| | | ret = out_->JustWriter(v, a, file_path_.c_str()); |
| | | std::string backup_dir("./video"); |
| | | mkdir(backup_dir.c_str(), 0777); |
| | | file_path_ = backup_dir + "/" + filename; |
| | | |
| | | logIt("failed in dir %s, try file %s to start record file", dir_.c_str(), file_path_.c_str()); |
| | | ret = out_->JustWriter(v, a, file_path_.c_str()); |
| | | if (ret){ |
| | | logIt("start record h264 file: %s", file_path_.c_str()); |
| | | return 0; |
| | |
| | | |
| | | fp_ = fopen(file_path_.c_str(), "wb"); |
| | | if (!fp_){ |
| | | file_path_ = "./" + filename; |
| | | std::string backup_dir("./video"); |
| | | mkdir(backup_dir.c_str(), 0777); |
| | | file_path_ = backup_dir + "/" + filename; |
| | | |
| | | logIt("failed in dir %s, try file %s to start record hevc file", dir_.c_str(), file_path_.c_str()); |
| | | fp_ = fopen(file_path_.c_str(), "wb"); |
| | | if (!fp_){ |