c2c712da8c88f61423ef4cb99b31d77e35cbbffd
[meviz.git] / src / main / java / eu / svjatoslav / meviz / encoder / converters / Mts2Mp4.java
1 /*
2  * Meviz - Various tools collection to work with multimedia.
3  * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
4  * 
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of version 2 of the GNU General Public License
7  * as published by the Free Software Foundation.
8  */
9
10 package eu.svjatoslav.meviz.encoder.converters;
11
12 import java.io.File;
13
14 import eu.svjatoslav.meviz.encoder.EncodingOptions;
15
16 public class Mts2Mp4 implements Converter {
17
18         @Override
19         public String getCommand(final File inputFile, final File targetFile,
20                         final EncodingOptions options) {
21                 //
22                 // int videoBitrate;
23                 //
24                 // switch (options.videoBitrate) {
25                 // case LOW:
26                 // videoBitrate = 3000;
27                 // break;
28                 //
29                 // case MEDIUM:
30                 // videoBitrate = 7000;
31                 // break;
32                 //
33                 // case HIGH:
34                 // videoBitrate = 15000;
35                 // break;
36                 //
37                 // default:
38                 // throw new RuntimeException("Video bitrate: " + options.videoBitrate
39                 // + " is not supported.");
40                 // }
41
42                 // convert
43                 // final String codecParams =
44                 // "-acodec libmp3lame -vcodec libx264 -b 3500k -b:a 192k";
45
46                 // pass through
47                 final String codecParams = "-acodec copy -vcodec copy";
48
49                 return "avconv -i \"" + inputFile.getAbsolutePath() + "\" "
50                                 + codecParams + " \"" + targetFile.getAbsolutePath() + "\"";
51         }
52
53         @Override
54         public String getSourceFileExtension() {
55                 return "mts";
56         }
57
58         @Override
59         public String getTargetFileExtension() {
60                 return "mp4";
61         }
62
63         @Override
64         public boolean isTerminalMandatory() {
65                 return true;
66         }
67
68 }