예제 #1
0
        void CreateVideo()
        {
            StringBuilder command = new StringBuilder();

            Debug.Log("firstImgFilePath: " + firstImgFilePath);
            Debug.Log("soundPath: " + soundPath);
            Debug.Log("outputVideoPath: " + outputVideoPath);

            //Input Image sequence params
            command.
            Append("-y -framerate ").
            Append(actualFPS.ToString()).
            Append(" -f image2 -i ").
            Append(AddQuotation(firstImgFilePath));

            //Input Audio params
            if (recAudioSource != RecAudioSource.None)
            {
                command.
                Append(" -i ").
                Append(AddQuotation(soundPath)).
                Append(" -ss 0 -t ").
                Append(totalTime);
            }

            //Output Video params
            command.
            Append(" -vcodec libx264 -crf 25 -pix_fmt yuv420p ").
            Append(AddQuotation(outputVideoPath));

            Debug.Log(command.ToString());

            FFmpegCommands.DirectInput(command.ToString());
        }
예제 #2
0
        void CreateVideo()
        {
            StringBuilder command = new StringBuilder();

            command.
            Append("-y -framerate ").
            Append(actualFPS.ToString()).
            Append(" -f image2 -i ").
            Append(firstImgFilePathEnclosed).
            Append(" -vcodec libx264 -crf 25 -pix_fmt yuv420p ").
            Append(outputVideoPath);

            Debug.Log(command.ToString());

            FFmpegCommands.DirectInput(command.ToString());
        }
예제 #3
0
    public static void Convert(string audio, string video, string output, ref bool done)
    {
        var inputPath  = Application.persistentDataPath + "/" + video;
        var soundPath  = Application.persistentDataPath + "/" + audio;
        var outputPath = Application.persistentDataPath + "/" + output;

        FFmpegParser.Handler = new FFmpegHandler(output);

        // -t seconds?
        FFmpegCommands.DirectInput(
            //"-re -f lavfi -i \"movie=\\'" + inputPath + "\\':loop=0, setpts=N/(FRAME_RATE*TB)\" -i '" + soundPath + "' -map 0:v:0 -map 1:a:0 -shortest " + outputPath
            "-y -i \"C:/Users/Bjorn/AppData/LocalLow/Totsj/mp4Converter/VideoBackground.mov\" \"C:/Users/Bjorn/AppData/LocalLow/Totsj/mp4Converter/out.mp4\" \"C:/Users/Bjorn/AppData/LocalLow/Totsj/mp4Converter/Crusade Runner.mp4\""
            );

        /*DecodeEncodeData config = new DecodeEncodeData();
         * config.fps = 1;
         * config.inputPath = inputPath;
         * config.soundPath = soundPath;
         * config.outputPath = outputPath;
         *
         * FFmpegCommands.Encode(config);*/
    }
예제 #4
0
        //------------------------------

        public void OnDirectInput(string commands)
        {
            FFmpegCommands.DirectInput(commands);
        }