<commit_before>#include <cstdlib>
#include <iostream>
#include <string>
#include <stdio.h>

using namespace std;

string exec(const char* cmd) {
    FILE* pipe = popen(cmd, "r");
    if (!pipe) return "ERROR";
    char buffer[128];
    string result = "";
    while(!feof(pipe)) {
    	if(fgets(buffer, 128, pipe) != NULL)
    		result += buffer;
    }
    pclose(pipe);
    return result;
}

void directs (string _output) {
	system(output + "rm -r 720");
	system(output + "rm -r 360");
	system(output + "rm -r 240");

	system(output + "mkdir 720");
	system(output + "mkdir 360");
	system(output + "mkdir 240");
}

int convertVideo(int _time, string path, string output){
	
	directs (output);
	string command;
	const char * _c;

	command = "./ffprobe -show_format " + path + " | sed -n '/duration/s/.*=//p'";
	_c = command.c_str();

	string duration = exec(_c);
	cout << duration << endl;
	float temp = stof(duration) / _time;
	cout << temp << endl;
	int chunks = int(temp + 1);
	cout << chunks << endl;

	command = "./ffmpeg -i " + path + " -r 1 -t 1 -ss 00:00:05 " + output + "preview.jpeg";
	_c = command.c_str();
	system(_c);	<commit_msg>Solved some errors  with output ^^<commit_after>#include <cstdlib>
#include <iostream>
#include <string>
#include <stdio.h>

using namespace std;

string exec(const char* cmd) {
    FILE* pipe = popen(cmd, "r");
    if (!pipe) return "ERROR";
    char buffer[128];
    string result = "";
    while(!feof(pipe)) {
    	if(fgets(buffer, 128, pipe) != NULL)
    		result += buffer;
    }
    pclose(pipe);
    return result;
}

void directs (string _output) {
	system("rm -r " + _output + "720");
	system("rm -r " + _output + "360");
	system("rm -r " + _output + "240");

	system("mkdir " + _output + "720");
	system("mkdir " + _output + "360");
	system("mkdir " + _output + "240");
}

int convertVideo(int _time, string path, string output){
	
	directs (output);
	string command;
	const char * _c;

	command = "./ffprobe -show_format " + path + " | sed -n '/duration/s/.*=//p'";
	_c = command.c_str();

	string duration = exec(_c);
	cout << duration << endl;
	float temp = stof(duration) / _time;
	cout << temp << endl;
	int chunks = int(temp + 1);
	cout << chunks << endl;

	command = "./ffmpeg -i " + path + " -r 1 -t 1 -ss 00:00:05 " + output + "preview.jpeg";
	_c = command.c_str();
	system(_c);	
{'fraction_non_alphanumeric': 0.1836821870995301, 'fraction_numerical': 0.028193079880392994, 'mean_word_length': 3.313075506445672, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4378575', 'n_tokens_mistral': 927, 'n_tokens_neox': 846, 'n_words': 245}