我目前正在尝试将转换后的 mp4 文件合并为 1 个 mp4 文件,但效果并不理想。要查看我之前的问题(其中包括一些与过滤器和设置相关的实际问题),请参阅这个问题。
我目前正在执行的步骤是:
步骤 1:缩放标题视频
avconv -i "templates/v2/wiebenik-v2.mov" -filter:v "scale=iw*min(1920/iw\,1080/ih):ih*min(1920/iw\,1080/ih), pad=1920:1080:(1920-iw*min(1920/iw\,1080/ih))/2:(1080-ih*min(1920/iw\,1080/ih))/2" -aspect "16:9" -profile:v high -level 42 -c:a copy -y "templates/v2/wiebenik-v2_libx264.mp4"
第 2 步:标准化标题视频的音频
avconv -i "templates/v2/wiebenik-v2_libx264.mp4" -c:v libx264 -c:a libmp3lame -b:a 128k -ac 2 -ar 48000 -profile:v high -level 42 -aspect "16:9" templates/v2/wiebenik-v2_libx264_normalized.mp4
步骤 3&4:缩放并规范化用户的视频
avconv -i "44_0.98330200-14823142026903.mp4" -filter:v "scale=iw*min(1920/iw\,1080/ih):ih*min(1920/iw\,1080/ih), pad=1920:1080:(1920-iw*min(1920/iw\,1080/ih))/2:(1080-ih*min(1920/iw\,1080/ih))/2" -profile:v high -level 42 -c:a copy -aspect "16:9" -y "videos/test.mp4"
avconv -i "videos/test.mp4" -c:v libx264 -c:a libmp3lame -b:a 128k -ac 2 -ar 48000 -aspect "16:9" test_normalized.mp4
步骤 5:合并视频
MP4Box templates/v2/wiebenik-v2_libx264_normalized.mp4 -cat test_normalized.mp4 -out test_video.mp4
这将返回错误:
WARNING: Concatenating track ID 1 with different SPS - result file might be broken
我也尝试以不同的方式编译视频,如下面的列表所示:
avconv -i "videos/templates/v2/wiebenik-v2.mov" -filter:v "scale=iw*min(1920/iw\,1080/ih):ih*min(1920/iw\,1080/ih), pad=1920:1080:(1920-iw*min(1920/iw\,1080/ih))/2:(1080-ih*min(1920/iw\,1080/ih))/2" -profile:v high -level 42 -c:a copy -y "videos/templates/v2/wiebenik-v2.mp4"
avconv -i "videos/templates/v2/wiebenik-v2.mp4" -c:v copy -c:a libmp3lame -b:a 128k -ac 2 -ar 48000 videos/templates/v2/wiebenik-v2_normalized.mp4
avconv -i 33_0.57471800-14821542544448.mp4 -filter:v "scale=iw*min(1920/iw\,1080/ih):ih*min(1920/iw\,1080/ih), pad=1920:1080:(1920-iw*min(1920/iw\,1080/ih))/2:(1080-ih*min(1920/iw\,1080/ih))/2" -profile:v high -level 42 -c:a copy tmp_ruud_1.mp4
avconv -i tmp_ruud_1.mp4 -c:v copy -c:a libmp3lame -b:a 128k -ac 2 -ar 48000 tmp_ruud_1_normalized.mp4
MP4Box wiebenik-v6_normalized.mp4 -cat tmp_ruud_1_normalized.mp4 -out test_video2.mp4
对于 iPhone 7 视频,它确实有效(有点……它在 iPhone 上中途冻结,但在 Android 设备上有效)。Android 在尝试转换时仍会出错。这将返回错误:
WARNING: Concatenating track ID 1 with different SPS - result file might be broken
Error appending tmp_44_0_normalized.mp4: Bad Parameter
但奇怪的是,MP4Box -info <filename>
两次尝试都返回相同的 SPS 设置。经过两周的斗争,我希望找到解决方案。
- 仍在等待答复