use of org.fagu.fmv.mymedia.file.MovieFinder in project fmv by f-agu.
the class Bootstrap method main.
/**
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
File source = new File(args[0]);
File saveFile = new File(source, "movie.save");
File destFolder = new File(source.getParentFile(), source.getName() + "-mv-out");
Bootstrap bootstrap = new Bootstrap();
try (MovieFinder movieFinder = bootstrap.findMovie(saveFile, source)) {
Organizer<MovieFinder, Movie> organizer = new Organizer<>(Movie.class);
organizer.organize(destFolder, movieFinder);
}
}
use of org.fagu.fmv.mymedia.file.MovieFinder in project fmv by f-agu.
the class Bootstrap method findMovie.
// ---------------------------------------------------
/**
*/
private MovieFinder findMovie(File saveFile, File... srcFiles) throws IOException {
MovieFinder movieFinder = new MovieFinder(saveFile);
movieFinder.addInfoFile(new VolumeInfoFile());
movieFinder.addListener(new FileFinderListener<Movie>() {
private int count;
/**
* @see org.fagu.fmv.utils.file.FileFinderListener#eventFindPre(org.fagu.fmv.utils.file.FileFinder.FileFound)
*/
@Override
public void eventFindPre(FileFound fileFound) {
System.out.println(count + ": " + fileFound.getFileFound().getName());
++count;
}
/**
* @see org.fagu.fmv.utils.file.FileFinderListener#eventFindPost(FileFound, java.lang.Object)
*/
@Override
public void eventFindPost(FileFound fileFound, FileFinder<Movie>.InfosFile infosFile) {
Movie movie = infosFile.getMain();
MovieMetadatas videoMetadatas = movie.getMetadatas();
// Format format = videoMetadatas.getFormat();
VideoStream videoStream = videoMetadatas.getVideoStream();
Rotation rotate = videoStream.rotate();
// System.out.println(count + ": " + file.getName() + " " + infos); // .getFormat().creationDate()
System.out.println(" " + rotate + ", " + videoStream.handlerName());
}
});
for (File srcFile : srcFiles) {
movieFinder.find(srcFile);
}
return movieFinder;
}
Aggregations