软件包安装
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;
}