]> git.plutz.net Git - viper/blob - plugins/v_lavc_lossless.py
implemeted most basic cropping controls
[viper] / plugins / v_lavc_lossless.py
1 #encoding: utf-8
2 #Copyright 2009 Paul Hänsch
3
4 #This file is part of Viper.
5
6 #Viper is free software: you can redistribute it and/or modify
7 #it under the terms of the GNU General Public License as published by
8 #the Free Software Foundation, either version 3 of the License, or
9 #(at your option) any later version.
10
11 #Viper is distributed in the hope that it will be useful,
12 #but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #GNU General Public License for more details.
15
16 #You should have received a copy of the GNU General Public License
17 #along with Viper.  If not, see <http://www.gnu.org/licenses/>
18
19 from plugin import *
20
21 class V_Ffv1(V_Plugin):
22     def build_dialog(self):
23         self.subgets['desc'] = Label(self, text =
24                                      'FFV1 is the lossless codec of the ffmpeg project.\n' +
25                                      'It compresses video data down to approximately 10% of ' + 
26                                      'its original size')
27         self.subgets['desc'].pack(side = TOP, expand = True, fill = BOTH)
28
29     def name(self):
30         return 'FFV1'
31
32     def subcommand(self):
33         return ['-ovc', 'lavc', '-lavcopts', 'vcodec=ffv1']
34
35     def is_available(self):
36         result = False
37         slave = os.popen2(['mencoder', '-ovc', 'help'])
38         line = '#'
39         while line != '':
40             line = slave[1].readline()
41             if line.lstrip().find('lavc') == 0:
42                 result = True
43         return result
44
45 class V_FfvHuff(V_Plugin):
46     def build_dialog(self):
47         self.subgets['desc'] = Label(self, text =
48                                      'Non standard modification of HuffYUV.\n' +
49                                      'About 20% smaller than HuffYUV.')
50         self.subgets['desc'].pack(side = TOP, expand = True, fill = BOTH)
51
52     def name(self):
53         return 'FfvHuff'
54
55     def subcommand(self):
56         return ['-ovc', 'lavc', '-lavcopts', 'vcodec=ffvhuff']
57
58     def is_available(self):
59         result = False
60         slave = os.popen2(['mencoder', '-ovc', 'help'])
61         line = '#'
62         while line != '':
63             line = slave[1].readline()
64             if line.lstrip().find('lavc') == 0:
65                 result = True
66         return result
67
68 class V_HuffYUV(V_Plugin):
69     def build_dialog(self):
70         self.subgets['desc'] = Label(self, text =
71                                      'Classical lossless HuffYUV codec.')
72         self.subgets['desc'].pack(side = TOP, expand = True, fill = BOTH)
73
74     def name(self):
75         return 'HuffYUV'
76
77     def subcommand(self):
78         return ['-ovc', 'lavc', '-lavcopts', 'vcodec=huffyuv']
79
80     def is_available(self):
81         result = False
82         slave = os.popen2(['mencoder', '-ovc', 'help'])
83         line = '#'
84         while line != '':
85             line = slave[1].readline()
86             if line.lstrip().find('lavc') == 0:
87                 result = True
88         return result
89
90 class V_LLSnow(V_Plugin):
91     def build_dialog(self):
92         self.subgets['desc'] = Label(self, text =
93                                      'Experimental wavelet based FFMPEG codec.\n' +
94                                      'This is the lossless version.')
95         self.subgets['desc'].pack(side = TOP, expand = True, fill = BOTH)
96
97     def name(self):
98         return 'Lossless Snow'
99
100     def subcommand(self):
101         return ['-ovc', 'lavc', '-lavcopts', 'vcodec=snow:vqscale=0']
102
103     def is_available(self):
104         result = False
105         slave = os.popen2(['mencoder', '-ovc', 'help'])
106         line = '#'
107         while line != '':
108             line = slave[1].readline()
109             if line.lstrip().find('lavc') == 0:
110                 result = True
111         return result
112
113 class V_Ljpeg(V_Plugin):
114     def build_dialog(self):
115         self.subgets['desc'] = Label(self, text = 'Lossless JPEG sequence.\n' +
116                                      'Compresses video data down to approximately 20% of '+
117                                      'its original size')
118         self.subgets['desc'].pack(side = TOP, expand = True, fill = BOTH)
119
120     def name(self):
121         return 'Lossless JPEG'
122
123     def subcommand(self):
124         return ['-ovc', 'lavc', '-lavcopts', 'vcodec=ljpeg']
125
126     def is_available(self):
127         result = False
128         slave = os.popen2(['mencoder', '-ovc', 'help'])
129         line = '#'
130         while line != '':
131             line = slave[1].readline()
132             if line.lstrip().find('lavc') == 0:
133                 result = True
134         return result