1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
|
//
// C++ Implementation: k9videocodecs
//
// Description:
//
//
// Author: Jean-Michel PETIT <k9copy@free.fr>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "k9videocodecs.h"
#include <tqstringlist.h>
class _k9VideoCodec
{
public:
_k9VideoCodec():name(""),fourcc(""),optPass1(""),optPass2(""),optOnePass(""){};
_k9VideoCodec(TQString _name,TQString _fourcc,TQString _optOnePass,TQString _optPass1,TQString _optPass2) {
name=_name;
fourcc=_fourcc;
optOnePass=_optOnePass;
optPass1=_optPass1;
optPass2=_optPass2;
}
TQString name;
TQString fourcc;
TQString optOnePass;
TQString optPass1;
TQString optPass2;
};
k9VideoCodecs::k9VideoCodecs(TQObject *tqparent, const char *name)
: TQObject(tqparent, name)
{
m_config=new k9Config();
TQStringList slLabels=m_config->getCodecLabels();
TQStringList slCodecs=m_config->getCodecVideo();
bool bReset;
bReset=slLabels.count()==0;
if (!bReset)
bReset=slCodecs.count() != slLabels.count()*4;
//adds default codecs
if (bReset) {
reset();
m_config=new k9Config();
slLabels=m_config->getCodecLabels();
slCodecs=m_config->getCodecVideo();
}
TQStringList::iterator c=slCodecs.begin();
int cpt=0;
for (TQStringList::iterator i=slLabels.begin();i!=slLabels.end() ;++i) {
TQString fourcc=(*c);
c++;
TQString o1=(*c);
c++;
TQString o2=(*c);
c++;
TQString o3=(*c);
c++;
m_codecs[cpt++]=_k9VideoCodec((*i),fourcc,o1,o2,o3);
}
delete m_config;
}
void k9VideoCodecs::reset() {
m_codecs[0]=_k9VideoCodec("copy","","-ovc copy","-ovc copy","-ovc copy");
m_codecs[1]=_k9VideoCodec("XviD","","-ovc xvid -xvidencopts bitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc xvid -xvidencopts bitrate=$VIDBR:turbo:pass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc xvid -xvidencopts bitrate=$VIDBR:turbo:pass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[2]=_k9VideoCodec("x264","","-ovc x264 -x264encopts bitrate=$VIDBR:threads=0 -vf scale=$WIDTH:$HEIGHT","-ovc x264 -x264encopts bitrate=$VIDBR:turbo=1:pass=$PASS:threads=0 -vf scale=$WIDTH:$HEIGHT","-ovc x264 -x264encopts bitrate=$VIDBR:turbo=1:pass=$PASS:threads=0 -vf scale=$WIDTH:$HEIGHT");
m_codecs[3]=_k9VideoCodec("MJPEG","","-ovc lavc -lavcopts vcodec=mjpeg:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mjpeg:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mjpeg:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[4]=_k9VideoCodec("LJPEG","","-ovc lavc -lavcopts vcodec=ljpeg:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=ljpeg:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=ljpeg:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[5]=_k9VideoCodec("H261","","-ovc lavc -lavcopts vcodec=h261:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=h261:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=h261:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[6]=_k9VideoCodec("H263","","-ovc lavc -lavcopts vcodec=h263:vhq:v4mv:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=h263:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=h263:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[7]=_k9VideoCodec("H263+","","-ovc lavc -lavcopts vcodec=h263p:vhq:v4mv:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=h263p:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=h263p:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[8]=_k9VideoCodec("MPEG-4 (DivX 4/5)","DIVX","-ovc lavc -lavcopts vcodec=mpeg4:vhq:v4mv:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mpeg4:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mpeg4:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[9]=_k9VideoCodec("MS MPEG-4 (DivX 3)","DIVX","-ovc lavc -lavcopts vcodec=msmpeg4:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=msmpeg4:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=msmpeg4:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[10]=_k9VideoCodec("MS MPEG-4 v2","","-ovc lavc -lavcopts vcodec=msmpeg4v2:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=msmpeg4v2:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=msmpeg4v2:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[11]=_k9VideoCodec("WMV7","","-ovc lavc -lavcopts vcodec=wmv1:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=wmv1:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=wmv1:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[12]=_k9VideoCodec("WMV8","","-ovc lavc -lavcopts vcodec=wmv2:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=wmv2:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=wmv2:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[13]=_k9VideoCodec("RealVideo","","-ovc lavc -lavcopts vcodec=rv10:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=rv10:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=rv10:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[14]=_k9VideoCodec("MPEG-1 Video","","-ovc lavc -lavcopts vcodec=mpeg1video:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mpeg1video:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mpeg1video:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[15]=_k9VideoCodec("MPEG-2 Video","","-ovc lavc -lavcopts vcodec=mpeg2video:vhq:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mpeg2video:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=mpeg2video:vhq:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[16]=_k9VideoCodec("Huffmann yuv","","-ovc lavc -lavcopts vcodec=huffyuv:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:format=422p -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=huffyuv:vhq:v4mv:vqmin=2:vbitrate=$VIDBR::format=422p:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=huffyuv:vhq:v4mv:vqmin=2:vbitrate=$VIDBR::format=422p:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[17]=_k9VideoCodec("ffv Huffmann","","-ovc lavc -lavcopts vcodec=ffvhuff:vhq:v4mv:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=ffvhuff:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=ffvhuff:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[18]=_k9VideoCodec("ASUS v1","","-ovc lavc -lavcopts vcodec=asv1:vhq:v4mv:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=asv1:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=asv1:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[19]=_k9VideoCodec("ASUS v2","","-ovc lavc -lavcopts vcodec=asv2:vhq:v4mv:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=asv2:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=asv2:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
m_codecs[20]=_k9VideoCodec("flv","","-ovc lavc -lavcopts vcodec=flv:vhq:v4mv:vqmin=2:vbitrate=$VIDBR -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=flv:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT","-ovc lavc -lavcopts vcodec=flv:vhq:v4mv:vqmin=2:vbitrate=$VIDBR:turbo:vpass=$PASS -vf scale=$WIDTH:$HEIGHT");
save();
}
void k9VideoCodecs::save() {
m_config=new k9Config();
TQStringList labels;
TQStringList options;
for (TQMap<int,_k9VideoCodec>::iterator i=m_codecs.begin();i!=m_codecs.end();++i) {
labels << i.data().name;
options << i.data().fourcc;
options << i.data().optOnePass;
options << i.data().optPass1;
options << i.data().optPass2;
}
m_config->setCodecLabels(labels);
m_config->setCodecVideo(options);
m_config->save();
delete m_config;
}
int k9VideoCodecs::count() {
return m_codecs.count();
}
void k9VideoCodecs::setFourcc(int _num,TQString _value) {
m_codecs[_num].fourcc=_value;
}
void k9VideoCodecs::setOptions0(int _num,TQString _value) {
m_codecs[_num].optOnePass=_value;
}
void k9VideoCodecs::setOptions1(int _num,TQString _value) {
m_codecs[_num].optPass1=_value;
}
void k9VideoCodecs::setOptions2(int _num,TQString _value) {
m_codecs[_num].optPass2=_value;
}
void k9VideoCodecs::setCodecName(int _num,TQString _value) {
m_codecs[_num].name=_value;
}
TQString k9VideoCodecs::getFourcc(int _num) {
return m_codecs[_num].fourcc;
}
TQString k9VideoCodecs::getOptions0(int _num) {
return m_codecs[_num].optOnePass;
}
TQString k9VideoCodecs::getOptions1(int _num) {
return m_codecs[_num].optPass1;
}
TQString k9VideoCodecs::getOptions2(int _num) {
return m_codecs[_num].optPass2;
}
TQString k9VideoCodecs::getCodecName(int _num) {
return m_codecs[_num].name;
}
void k9VideoCodecs::remove(int _num) {
int nb=count();
if (nb>0) {
for(int i=_num;i<nb-1;i++) {
m_codecs[i]=m_codecs[i+1];
}
m_codecs.remove(nb-1);
}
}
k9VideoCodecs::~k9VideoCodecs()
{
}
#include "k9videocodecs.moc"
|