Video 服务器端视频转换器

Video 服务器端视频转换器,video,server-side,flv,converter,mp4,Video,Server Side,Flv,Converter,Mp4,我正在设置一个内置于PHP的CMS,现在我需要添加一个部分,用户可以将视频从FLV转换为MP4格式。我已经搜索了脚本和解决方案,但没有任何效果。我已经准备好为软件付费,但“Aviberry”软件的价格为5000美元,“sothinkmedia”在Linux服务器上无法正常工作。如果有人有一些可以肯定有效的建议,我将不胜感激。MPlayer的一部分应该能够做到这一点,或者尝试一下。两者都可以从命令行(或脚本)调用以进行转换。尝试使用java代码中的ffmpeg命令,或者其他解决方案使用Xugler

我正在设置一个内置于PHP的CMS,现在我需要添加一个部分,用户可以将视频从FLV转换为MP4格式。我已经搜索了脚本和解决方案,但没有任何效果。我已经准备好为软件付费,但“Aviberry”软件的价格为5000美元,“sothinkmedia”在Linux服务器上无法正常工作。如果有人有一些可以肯定有效的建议,我将不胜感激。

MPlayer的一部分应该能够做到这一点,或者尝试一下。两者都可以从命令行(或脚本)调用以进行转换。

尝试使用java代码中的ffmpeg命令,或者其他解决方案使用Xugler API进行转换 任何扩展名的视频文件

/* Sample Code For converting Videos in server side */

import java.io.*;
import java.io.BufferedReader;
import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;


public class Quality {

public static void main(String args[]) {

    String s = null;

    try {

    // run the Unix "ps -ef" command
        // using the Runtime exec method:
        Process p = Runtime.getRuntime().exec("ffmpeg -i /home/praveen/videos/Oracle.mp4 
-vcodec libvpx -acodec libvorbis -f webm /home/praveen/videos/Oracle.webm");
        //Process p = Runtime.getRuntime().exec("ffmpeg -i /home/praveen/resize
 images/Videos/RaymondMadetoMeasure.mp4 -vcodec libvpx -acodec libvorbis -f webm 
 /home/praveen/resize images/Videos/Raymond.webm");

        BufferedReader stdInput = new BufferedReader(new 
             InputStreamReader(p.getInputStream()));

        BufferedReader stdError = new BufferedReader(new 
             InputStreamReader(p.getErrorStream()));

        // read the output from the command
        System.out.println("Here is the standard output of the command:\n");
        while ((s = stdInput.readLine()) != null) {
            System.out.println(s);
        }

        // read any errors from the attempted command
        System.out.println("Here is the standard error of the command (if any):\n");
        while ((s = stdError.readLine()) != null) {
            System.out.println(s);
        }

        System.exit(0);
    }
    catch (IOException e) {
        System.out.println("exception happened - here's what I know: ");
        e.printStackTrace();
        System.exit(-1);
    }
 }
 }
.