IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    Ubuntu下flv合并

    Ivan Cai发表于 2014-04-25 17:31:00
    love 0

    软件包安装

    sudo apt-get install ffmpeg mkvtoolnix gpac mencoder mediainfo

    合并flv

    mencoder -oac pcm -ovc copy -idx -o output.flv x.flv y.flv z.flv

    视频信息查看

    mediainfo file

    通过flvcd生成的m3u列表下载youku视频并合并的C++代码(Linux可用 需要axel)

    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    using namespace std;
    ifstream fin;
    ofstream fout;
    stringstream ss;
    int main()
    {
        string m3u_filename,lst_filename,downloadurl;
        string command="chmod +x ",mergecommand="mencoder -oac pcm -ovc copy -idx -o output.flv ",tempstr;
        int counter=0,i;
        cout<<"Enter filename of m3u"<<endl;
        cin>>m3u_filename;
        cout<<"Enter filename of download script"<<endl;
        cin>>lst_filename;
        fin.open(m3u_filename.c_str());
        fout.open(lst_filename.c_str());
        fin>>downloadurl;
        while(fin>>downloadurl)
        {
            counter++;
            fout<<"axel --output "<<counter<<".flv "<<downloadurl<<endl;
        }
        command.append(lst_filename);
        for (i=1;i<=counter;i++)
        {
            ss.str("");
            ss.clear();
            tempstr="";
            ss<<i;
            ss>>tempstr;
            mergecommand.append(tempstr);
            mergecommand.append(".flv ");
        }
        fout<<mergecommand;
        system(command.c_str());
        fin.close();
        fout.close();
        return 0;
    }
    


沪ICP备19023445号-2号
友情链接