// Path: src/main/java/nodebox/Log.java
// public class Log {
//     private static final Logger LOGGER = java.util.logging.Logger.getGlobal();
// 
//     static {
//         try {
//             // Initialize logging directory
//             AppDirs.ensureUserLogDir();
//             File logDir = AppDirs.getUserLogDir();
// 
//             // Initialize file logging
//             FileHandler handler = new FileHandler(logDir.getAbsolutePath() + "/nodebox-%u.log");
//             handler.setFormatter(new SimpleFormatter());
//             LOGGER.addHandler(handler);
//         } catch (IOException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     public static void info(String message) {
//         LOGGER.log(Level.INFO, message);
//     }
// 
//     public static void warn(String message) {
//         LOGGER.log(Level.WARNING, message);
//     }
// 
//     public static void warn(String message, Throwable t) {
//         LOGGER.log(Level.WARNING, message, t);
//     }
// 
//     public static void error(String message) {
//         LOGGER.log(Level.SEVERE, message);
//     }
// 
//     public static void error(String message, Throwable t) {
//         LOGGER.log(Level.SEVERE, message, t);
//     }
// 
// }


import nodebox.Log;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.io.*;
import java.util.ArrayList;
import java.util.Random;
package nodebox.movie;



public class Movie {

    private static final File FFMPEG_BINARY;
    private static final String TEMPORARY_FILE_PREFIX = "sme";

    public static final ArrayList<VideoFormat> VIDEO_FORMATS;
    public static final VideoFormat DEFAULT_FORMAT = MP4VideoFormat.HighFormat;

    static {
        String osName = System.getProperty("os.name").split("\\s")[0];
        // If we provide a binary for this system, use it. Otherwise, see if a default "ffmpeg"  binary exists.
        String binaryName = "ffmpeg";
        if (osName.equals("Windows"))
            binaryName = "ffmpeg.exe";
        File packagedBinary = nodebox.util.FileUtils.getApplicationFile(String.format("bin/%s", binaryName));
        if (packagedBinary.exists()) {
            FFMPEG_BINARY = packagedBinary;
        } else {
// Path: src/main/java/nodebox/Log.java
// public class Log {
//     private static final Logger LOGGER = java.util.logging.Logger.getGlobal();
// 
//     static {
//         try {
//             // Initialize logging directory
//             AppDirs.ensureUserLogDir();
//             File logDir = AppDirs.getUserLogDir();
// 
//             // Initialize file logging
//             FileHandler handler = new FileHandler(logDir.getAbsolutePath() + "/nodebox-%u.log");
//             handler.setFormatter(new SimpleFormatter());
//             LOGGER.addHandler(handler);
//         } catch (IOException e) {
//             e.printStackTrace();
//         }
//     }
// 
//     public static void info(String message) {
//         LOGGER.log(Level.INFO, message);
//     }
// 
//     public static void warn(String message) {
//         LOGGER.log(Level.WARNING, message);
//     }
// 
//     public static void warn(String message, Throwable t) {
//         LOGGER.log(Level.WARNING, message, t);
//     }
// 
//     public static void error(String message) {
//         LOGGER.log(Level.SEVERE, message);
//     }
// 
//     public static void error(String message, Throwable t) {
//         LOGGER.log(Level.SEVERE, message, t);
//     }
// 
// }


// Path: src/main/java/nodebox/movie/Movie.java
import nodebox.Log;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.io.*;
import java.util.ArrayList;
import java.util.Random;

package nodebox.movie;



public class Movie {

    private static final File FFMPEG_BINARY;
    private static final String TEMPORARY_FILE_PREFIX = "sme";

    public static final ArrayList<VideoFormat> VIDEO_FORMATS;
    public static final VideoFormat DEFAULT_FORMAT = MP4VideoFormat.HighFormat;

    static {
        String osName = System.getProperty("os.name").split("\\s")[0];
        // If we provide a binary for this system, use it. Otherwise, see if a default "ffmpeg"  binary exists.
        String binaryName = "ffmpeg";
        if (osName.equals("Windows"))
            binaryName = "ffmpeg.exe";
        File packagedBinary = nodebox.util.FileUtils.getApplicationFile(String.format("bin/%s", binaryName));
        if (packagedBinary.exists()) {
            FFMPEG_BINARY = packagedBinary;
        } else {
            Log.warn(String.format("Could not find packaged ffmpeg %s", packagedBinary));