胡斌

rename pip.cpp to merge_pip.cpp

add ReadMe.txt
读入两个录像文件,合成画中画视频。合成的流程:
1. 读入recordfile1.txt,合成为音视频对齐的ts,生成record1_out.txt
2. 读入recordfile2.txt,合成为音视频对齐的ts,生成record2_out.txt
3. 读入record1_out.txt和record2_out.txt,生成 record1_record2.txt
例如:
命令:merge_pip uid_4165000_20180203013327202.txt uid_811375464_20180203013322272.txt
其中,uid_4165000_20180203013327202.txt 内容如下:
0.000 4165000_20180203013327202.aac create
0.410 4165000_20180203013327612.webm create
0.411 4165000_20180203013327612.webm info width=320 height=240 rotation=0
1418.961 4165000_20180203013327612.webm close
1433.849 4165000_20180203013327202.aac close
其中,uid_811375464_20180203013322272.txt 内容如下:
0.000 811375464_20180203013322272.aac create
1.154 811375464_20180203013323424.webm create
1.155 811375464_20180203013323424.webm info width=320 height=240 rotation=0
1520.126 811375464_20180203013323424.webm close
1535.109 811375464_20180203013322272.aac close
生成 uid_811375464_20180203013322272__uid_4165000_20180203013327202.txt,
uid_811375464_20180203013322272__uid_4165000_20180203013327202.txt内容如下:
0.000 1535.290 pip_811375464_20180203013322272.ts
配置文件,merge_pip.cfg:
如果要修改,windows下在merge_pip.exe同目录下新建merge_pip.cfg文本文件,第一行保存视频编码,第二行保存音频编码;linux 下,merge_pip.cfg保存在HOME目录下的merge_av目录。
第一行,音视频合并时缺省视频编码参数,缺省值为:-vcodec libx264 -level 3.1 -preset veryfast -g 100 -r 20 -bf 0 -vsync cfr
第一行,音视频合并时缺省音频编码参数,缺省值为:-acodec copy
第三行,合并画中画时的音视频编码参数,缺省值为:-acodec aac -vcodec libx264 -level 3.1 -preset veryfast -g 100 -r 20 -bf 0 -vsync cfr
第四行,合并画中画时音视频合并filter参数,缺省值为:-filter_complex "[1:v]scale=w=80:h=60:force_original_aspect_ratio=decrease[b];[0:v][b]overlay=x=0:y=0" -filter_complex amix=inputs=2:duration=first:dropout_transition=2,volume=1
... ...
... ... @@ -1440,7 +1440,7 @@ void get_outinfo_file_name(char * input)
int main(int argc, char * argv[])
{
if (argc < 3) {
printf(" pip 1.0.0\n");
printf(" merge_pip 1.0.0\n");
printf(" run ffmpeg to merge video files to one pip video according to record info file,\nusage:");
printf("\n %s record_info_filename1 record_filename2 [-p] [-k]", argv[0]);
printf("\n -p :only print the command,don't run ffmpeg");
... ...
... ... @@ -14,6 +14,7 @@
<ProjectGuid>{7D6B14AD-7FD2-45F1-A196-A2455406D4FB}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>pip</RootNamespace>
<ProjectName>merge_pip</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
... ... @@ -79,7 +80,7 @@
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="pip.cpp" />
<ClCompile Include="merge_pip.cpp" />
<ClCompile Include="tools.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
... ...
... ... @@ -18,10 +18,10 @@
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="pip.cpp">
<ClCompile Include="tools.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="tools.cpp">
<ClCompile Include="merge_pip.cpp">
<Filter>源文件</Filter>
</ClCompile>
</ItemGroup>
... ...