正在显示
4 个修改的文件
包含
42 行增加
和
4 行删除
pip/ReadMe.txt
0 → 100644
| 1 | +读入两个录像文件,合成画中画视频。合成的流程: | ||
| 2 | +1. 读入recordfile1.txt,合成为音视频对齐的ts,生成record1_out.txt | ||
| 3 | +2. 读入recordfile2.txt,合成为音视频对齐的ts,生成record2_out.txt | ||
| 4 | +3. 读入record1_out.txt和record2_out.txt,生成 record1_record2.txt | ||
| 5 | +例如: | ||
| 6 | +命令:merge_pip uid_4165000_20180203013327202.txt uid_811375464_20180203013322272.txt | ||
| 7 | + | ||
| 8 | +其中,uid_4165000_20180203013327202.txt 内容如下: | ||
| 9 | +0.000 4165000_20180203013327202.aac create | ||
| 10 | +0.410 4165000_20180203013327612.webm create | ||
| 11 | +0.411 4165000_20180203013327612.webm info width=320 height=240 rotation=0 | ||
| 12 | +1418.961 4165000_20180203013327612.webm close | ||
| 13 | +1433.849 4165000_20180203013327202.aac close | ||
| 14 | + | ||
| 15 | + | ||
| 16 | +其中,uid_811375464_20180203013322272.txt 内容如下: | ||
| 17 | +0.000 811375464_20180203013322272.aac create | ||
| 18 | +1.154 811375464_20180203013323424.webm create | ||
| 19 | +1.155 811375464_20180203013323424.webm info width=320 height=240 rotation=0 | ||
| 20 | +1520.126 811375464_20180203013323424.webm close | ||
| 21 | +1535.109 811375464_20180203013322272.aac close | ||
| 22 | + | ||
| 23 | + | ||
| 24 | +生成 uid_811375464_20180203013322272__uid_4165000_20180203013327202.txt, | ||
| 25 | +uid_811375464_20180203013322272__uid_4165000_20180203013327202.txt内容如下: | ||
| 26 | +0.000 1535.290 pip_811375464_20180203013322272.ts | ||
| 27 | + | ||
| 28 | +配置文件,merge_pip.cfg: | ||
| 29 | +如果要修改,windows下在merge_pip.exe同目录下新建merge_pip.cfg文本文件,第一行保存视频编码,第二行保存音频编码;linux 下,merge_pip.cfg保存在HOME目录下的merge_av目录。 | ||
| 30 | + | ||
| 31 | +第一行,音视频合并时缺省视频编码参数,缺省值为:-vcodec libx264 -level 3.1 -preset veryfast -g 100 -r 20 -bf 0 -vsync cfr | ||
| 32 | +第一行,音视频合并时缺省音频编码参数,缺省值为:-acodec copy | ||
| 33 | +第三行,合并画中画时的音视频编码参数,缺省值为:-acodec aac -vcodec libx264 -level 3.1 -preset veryfast -g 100 -r 20 -bf 0 -vsync cfr | ||
| 34 | +第四行,合并画中画时音视频合并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 | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + |
| @@ -1440,7 +1440,7 @@ void get_outinfo_file_name(char * input) | @@ -1440,7 +1440,7 @@ void get_outinfo_file_name(char * input) | ||
| 1440 | int main(int argc, char * argv[]) | 1440 | int main(int argc, char * argv[]) |
| 1441 | { | 1441 | { |
| 1442 | if (argc < 3) { | 1442 | if (argc < 3) { |
| 1443 | - printf(" pip 1.0.0\n"); | 1443 | + printf(" merge_pip 1.0.0\n"); |
| 1444 | printf(" run ffmpeg to merge video files to one pip video according to record info file,\nusage:"); | 1444 | printf(" run ffmpeg to merge video files to one pip video according to record info file,\nusage:"); |
| 1445 | printf("\n %s record_info_filename1 record_filename2 [-p] [-k]", argv[0]); | 1445 | printf("\n %s record_info_filename1 record_filename2 [-p] [-k]", argv[0]); |
| 1446 | printf("\n -p :only print the command,don't run ffmpeg"); | 1446 | printf("\n -p :only print the command,don't run ffmpeg"); |
| @@ -14,6 +14,7 @@ | @@ -14,6 +14,7 @@ | ||
| 14 | <ProjectGuid>{7D6B14AD-7FD2-45F1-A196-A2455406D4FB}</ProjectGuid> | 14 | <ProjectGuid>{7D6B14AD-7FD2-45F1-A196-A2455406D4FB}</ProjectGuid> |
| 15 | <Keyword>Win32Proj</Keyword> | 15 | <Keyword>Win32Proj</Keyword> |
| 16 | <RootNamespace>pip</RootNamespace> | 16 | <RootNamespace>pip</RootNamespace> |
| 17 | + <ProjectName>merge_pip</ProjectName> | ||
| 17 | </PropertyGroup> | 18 | </PropertyGroup> |
| 18 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | 19 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
| 19 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> | 20 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
| @@ -79,7 +80,7 @@ | @@ -79,7 +80,7 @@ | ||
| 79 | <Text Include="ReadMe.txt" /> | 80 | <Text Include="ReadMe.txt" /> |
| 80 | </ItemGroup> | 81 | </ItemGroup> |
| 81 | <ItemGroup> | 82 | <ItemGroup> |
| 82 | - <ClCompile Include="pip.cpp" /> | 83 | + <ClCompile Include="merge_pip.cpp" /> |
| 83 | <ClCompile Include="tools.cpp" /> | 84 | <ClCompile Include="tools.cpp" /> |
| 84 | </ItemGroup> | 85 | </ItemGroup> |
| 85 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | 86 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> |
| @@ -18,10 +18,10 @@ | @@ -18,10 +18,10 @@ | ||
| 18 | <Text Include="ReadMe.txt" /> | 18 | <Text Include="ReadMe.txt" /> |
| 19 | </ItemGroup> | 19 | </ItemGroup> |
| 20 | <ItemGroup> | 20 | <ItemGroup> |
| 21 | - <ClCompile Include="pip.cpp"> | 21 | + <ClCompile Include="tools.cpp"> |
| 22 | <Filter>源文件</Filter> | 22 | <Filter>源文件</Filter> |
| 23 | </ClCompile> | 23 | </ClCompile> |
| 24 | - <ClCompile Include="tools.cpp"> | 24 | + <ClCompile Include="merge_pip.cpp"> |
| 25 | <Filter>源文件</Filter> | 25 | <Filter>源文件</Filter> |
| 26 | </ClCompile> | 26 | </ClCompile> |
| 27 | </ItemGroup> | 27 | </ItemGroup> |
-
请 注册 或 登录 后发表评论