It is possible to join H.264/AAC video files without re-enconding, if you convert them to an MPEG transport stream (TS). This format supports concatenation. Of course, the video files need to have the same height and width, aspect ratio,…
Using ffmpeg
:
ffmpeg -i 01.m4v -c copy -bsf:v h264_mp4toannexb 01.ts ffmpeg -i 02.m4v -c copy -bsf:v h264_mp4toannexb 02.ts ffmpeg -i concat:"01.ts|02.ts" -c copy -bsf:a aac_adtstoasc join.m4v rm 01.ts 02.ts |
The bitstream filters take care of container requirements.
Pingback: Splitting and merging of .m4v video files with ffmpeg | Thinking too much