idanm19
16th May 2003, 01:37
I think someone I read a comment about that subtitles auto-split freature isn't implemented is that it calcs the cut point in frames (which can be found on the log file) and not in format of hh:mm:ss.ms. so I wrote a simple c++ program that calcs the apropriate string, and then running a bach is needed to perform the cutting, something like:
rundll32 vobsub.dll,Cutter %SUB_SRC% temp1 0 0:0:0.0 %CUT_POS%
rundll32 vobsub.dll,Cutter %SUB_SRC% temp2 1 %CUT_POS%
#include <iostream.h>
void int2str(int num, int digits_no, char* str)
{
int i, temp;
temp=num;
for (i=1; i<=digits_no; i++)
{
str[digits_no-i]=temp%10+'0';
temp=temp/10;
}
str[digits_no]=0;
}
void main()
{
long int frames_no;
float fps;
char str[14];
int hh,mm,ss,ms;
cout<<"please enter the frames number and the frame rate: ";
cin>>frames_no>>fps;
ss=(int)(((float)frames_no)/fps);
mm=ss/60;
hh=mm/60;
ms=((((float)frames_no)/fps)-ss)*1000;
ss=ss-mm*60;
mm=mm-hh*60;
cout<<hh<<":"<<mm<<":"<<ss<<"."<<ms<<endl;
int2str(hh,2,str);
int2str(mm,2,str+3);
int2str(ss,2,str+6);
int2str(ms,3,str+9);
str[2]=':';
str[5]=':';
str[8]='.';
cout<<str<<endl;
}
is it so difficult to make this feature work ?
rundll32 vobsub.dll,Cutter %SUB_SRC% temp1 0 0:0:0.0 %CUT_POS%
rundll32 vobsub.dll,Cutter %SUB_SRC% temp2 1 %CUT_POS%
#include <iostream.h>
void int2str(int num, int digits_no, char* str)
{
int i, temp;
temp=num;
for (i=1; i<=digits_no; i++)
{
str[digits_no-i]=temp%10+'0';
temp=temp/10;
}
str[digits_no]=0;
}
void main()
{
long int frames_no;
float fps;
char str[14];
int hh,mm,ss,ms;
cout<<"please enter the frames number and the frame rate: ";
cin>>frames_no>>fps;
ss=(int)(((float)frames_no)/fps);
mm=ss/60;
hh=mm/60;
ms=((((float)frames_no)/fps)-ss)*1000;
ss=ss-mm*60;
mm=mm-hh*60;
cout<<hh<<":"<<mm<<":"<<ss<<"."<<ms<<endl;
int2str(hh,2,str);
int2str(mm,2,str+3);
int2str(ss,2,str+6);
int2str(ms,3,str+9);
str[2]=':';
str[5]=':';
str[8]='.';
cout<<str<<endl;
}
is it so difficult to make this feature work ?