Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
CLiF committed Apr 24, 2023
1 parent a81a22d commit bf4dc49
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
36 changes: 33 additions & 3 deletions ADOFAI_VideoVFX/ImageProcessing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,36 @@ namespace ImageProcessing {
video_fps = cap.get(CAP_PROP_FPS);
video_width = cap.get(CAP_PROP_FRAME_WIDTH);
video_height = cap.get(CAP_PROP_FRAME_HEIGHT);

cout << ";" << endl;
CONSOLE_SCREEN_BUFFER_INFO buffer_info = { 0 };
DWORD num_character_read = 0;
COORD first_char_to_read = { 0 };
char buffer[10000];
ReadConsoleOutputCharacterA(GetStdHandle(STD_OUTPUT_HANDLE), buffer, sizeof(buffer), first_char_to_read, &num_character_read);
for (int i = 0; i < 10000; i++) {
if (buffer[i] == ';') {
buffer[i] = '\0';
}
}

Mat frame;
cap.set(CAP_PROP_POS_FRAMES, video_frame_num - 1);
cap >> frame;
while (frame.empty()) {
video_frame_num--;
cap.set(CAP_PROP_POS_FRAMES, video_frame_num - 1);
cap >> frame;
}
cap.set(CAP_PROP_POS_FRAMES, video_frame_num);
cap >> frame;
while (!frame.empty()) {
cap >> frame;
video_frame_num++;
}

system("cls");
cout << buffer;
}

void SaveVideo(const string src_path, const string save_path, const int begin_frame, const int end_frame) {
Expand Down Expand Up @@ -114,9 +144,9 @@ namespace ImageProcessing {
CONSOLE_SCREEN_BUFFER_INFO buffer_info = { 0 };
DWORD num_character_read = 0;
COORD first_char_to_read = { 0 };
char buffer[100000];
char buffer[10000];
ReadConsoleOutputCharacterA(GetStdHandle(STD_OUTPUT_HANDLE), buffer, sizeof(buffer), first_char_to_read, &num_character_read);
for (int i = 0; i < 100000; i++) {
for (int i = 0; i < 10000; i++) {
if (buffer[i] == ';') {
buffer[i] = '\0';
}
Expand Down Expand Up @@ -162,7 +192,7 @@ namespace ImageProcessing {
cap.set(CAP_PROP_POS_FRAMES, frame_n);
}
cap >> frame;
if (!video_frames[i]) {
if (!video_frames[i] && !frame.empty()) {
resize(frame, frame, Size(960, 540));
{
cv::Mat roi = frame(Rect(0, 0, 960, 130));
Expand Down
2 changes: 1 addition & 1 deletion ADOFAI_VideoVFX/Source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int main() {

cout << "[ ADOFAI Video VFX - 얼불춤 영상 이펙트 ]" << endl << endl;
cout << "Developer : CLiF (https://www.youtube.com/@clif-1593)" << endl;
cout << "Version : v1.0" << endl << endl;
cout << "Version : v1.1" << endl << endl;

cout << "이 프로그램은 얼불춤 이펙트를 영상으로 치환함으로써 플레이 경험을 증진시키기 위해 제작되었습니다." << endl;
cout << "This program was developed to improve the game-playing experience by changing visual effects to video." << endl << endl;
Expand Down

0 comments on commit bf4dc49

Please sign in to comment.