Registered User
Join Date: Sep 2020
Posts: 15
|
i wanted to convert my video collection, but i have a lot of videos, so i made them all 16:9 aspect ratio, 1920, 1080, then i had to make the avs files.
So i automated making the avs files, this mapes .mp4 files, change the extension to avs. heres how to make the files in c++ first:
Code:
/// using ofstream constructors.
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <stdio.h>
#include <dirent.h>
using namespace std;
int main(void) {
DIR *dr;
struct dirent *en;
dr = opendir("E:/"); //open all or present directory
if (dr) {
while ((en = readdir(dr)) != NULL) {
printf("%s\n", en->d_name); //print all directory name
std::ofstream outfile (en->d_name);
outfile <<
"video = LSMASHVideoSource(\"E:\\" << en->d_name << "\").Crop(0, 0, 0, 0).ConvertToYV12(interlaced = false)\n"
<<
"audio = LSMASHAudioSource(\"E:\\" << en->d_name << "\")\n"
<<
"AudioDubStep = AudioDub(video, audio)\n"
<<
"top_left = LSFmod(AudioDubStep, strength = 200).crop(0, 0, -960, -540).Spline64Resize(900, 800).AddBorders(380,0,0,0) \# top left\n"
<<
"top_right = LSFmod(AudioDubStep, strength = 200).crop(960, 0, 0, -540).Spline64Resize(900, 800).AddBorders(0,0,380,0) \# top right\n"
<<
"bottom_left = LSFmod(AudioDubStep, strength = 200).crop(0, 540, -960, 0).Spline64Resize(900, 800).AddBorders(380,0,0,0) \# bottom left\n"
<<
"bottom_right = LSFmod(AudioDubStep, strength = 200).crop(960, 540, 0, 0).Spline64Resize(900, 800).AddBorders(0,0,380,0) \# bottom right\n"
<<
"blank = BlankClip(AudioDubStep).crop(960, 540, 0, 0).Spline64Resize(1280, 800)\n"
<<
"blankHalf = BlankClip(bottom_right).crop(0, 360, 0, 0)\n"
<<
"blankFill = BlankClip(bottom_right)#.crop(0, 400, 0, 0)\n"
<<
"blankquarter = BlankClip(blankHalf).crop(0, 220, 0, 0)\n"
<<
"blankCorner = BlankClip(top_left)\n"
<<
"column1 = StackVertical(blankquarter, blankquarter, blank, blank, blank, blank, blankquarter, blankquarter) \# half the width\n"
<<
"column2 = StackVertical(blankquarter, blankquarter, blankCorner, top_left, bottom_left, blankCorner, blankquarter, blankquarter)\n"
<<
"column3 = StackVertical(blankquarter, blankquarter, blankCorner, top_right, bottom_right, blankCorner, blankquarter, blankquarter)\n"
<<
"column6 = StackVertical(blankquarter, blankquarter, blank, blank, blank, blank, blankquarter, blankquarter).crop(400,0,0,0) \#800\n"
<<
"column5 = StackVertical(blankquarter, blankquarter, blank, blank, blank, blank, blankquarter, blankquarter).crop(0,0,-240,0) \#480\n"
<<
"step5 = StackHorizontal(column6, column1, column2, column3, column1, column5)\n"
<<
"return (step5)\n";
outfile.close();
}
closedir(dr); //close all directory
}
return(0);
}
here's how to change the files extension:
open cmd, go to directory type: "cd /D folder-location", in folder type "ren *.mp4 *.avs"
|