testing-repository/cpp/m4s_to_mp4.cpp

28 lines
816 B
C++
Raw Normal View History

#include <iostream>
2021-03-14 21:55:02 +08:00
#include <cstdio>
#include <thread>
#include <cstring>
#include <cstdlib>
int main(int argc,char *argv[]){
char command[10000],filename1[1000],filename2[1000],output[1000];
//Get file 1 filename
2021-03-14 21:55:02 +08:00
printf("Input file1 name:");
fflush(stdin);
std::cin.getline(filename1,sizeof(filename1));
//Get file 2 filename
2021-03-14 21:55:02 +08:00
printf("Input file2 name:");
fflush(stdin);
std::cin.getline(filename2,sizeof(filename2));
//Get output file name
2021-03-14 21:55:02 +08:00
printf("Input output name:");
fflush(stdin);
std::cin.getline(output,sizeof(output));
//Generate command and execute the command
2021-03-14 21:55:02 +08:00
sprintf(command,"ffmpeg -i \"%s\" -i \"%s\" -codec copy \"%s\"",filename1,filename2,output);
std::thread first (system,command);
first.detach();
getchar();
return 0;
}