I'm currently trying to combine converted mp4 files into 1 mp4 file but it's not going that great. To see my previous question, which includes some real struggle with filters and settings, see this question.
The steps I'm currently doing are:
Step 1: Scale the title video
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"
Step 2: Normalize the audio for the title video
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
Step 3&4: scale and normalize the video from the user
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
Step 5: combine the videos
MP4Box templates/v2/wiebenik-v2_libx264_normalized.mp4 -cat test_normalized.mp4 -out test_video.mp4
This'll return the error:
WARNING: Concatenating track ID 1 with different SPS - result file might be broken
I've also tried to compile the video's differently, as shown in the following list:
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
Which did work, for iPhone 7 videos (kind of.. it froze halfway on an iPhone but worked on an android device). Android will still break its head while trying to convert it. That'll return the error:
WARNING: Concatenating track ID 1 with different SPS - result file might be broken
Error appending tmp_44_0_normalized.mp4: Bad Parameter
The thing that's weird though is that MP4Box -info <filename>
both returns the same SPS settings for both attempts. I would love to get a solution after 2 weeks of fighting with this.
- Still waiting for an answer