Code :
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <string>
int main(int argc , char* argv[])
{
std::cout << "chrysl666 Instagram video converter STARTING" << std::endl;
if(argc < 3 )
{
std::cout << "need in and out names" << std::endl;
return 0 ;
}
std::cout << "number of arguments: "<< argc << std::endl;
std::string in = argv[1];
std::cout << "input file: "<< in << std::endl;
std::string out = argv[2];
std::cout << "output file: "<< out << std::endl;
std::string startMsg = "ffmpeg -i ";
std::string midMsg = " -vcodec libx264 -acodec aac ";
std::string finalCommand = startMsg + in + midMsg + out +".mp4" ;
std::cout << "convert command using ffmpeg: " << finalCommand << std::endl;
const char *systemchar = finalCommand.c_str() ;
std::cout << systemchar << std::endl;
system(systemchar);
return 0;
}