If your camera saved one event as two MP4 files, compare their tracks before you join them. When the clips have matching streams, FFmpeg can read them in order and copy the compressed video and audio into a new MP4. Keep the originals, including any files that came with the camera recording. Use this procedure on complete, independently playable clips.
Check the two inputs
Put working copies named part1.mp4 and part2.mp4 in the same folder. Run this command once for each filename. The stream index tells you the order of the tracks, and time_base is the unit used for their timestamps.
ffprobe -v error -show_entries stream=index,codec_type,codec_name,profile,width,height,pix_fmt,time_base,avg_frame_rate,sample_rate,channels,channel_layout:format=duration -of json part1.mp4
Compare the lists side by side. Look for the same number and order of tracks, codecs and time bases. For video, also check picture dimensions, pixel format and frame rate. For audio, check sample rate and channel layout. Two clips can both say “H.264” while one contains an extra microphone track. Matching these fields makes a pair worth testing. The cut itself still needs a check. FFmpeg concat demuxer · ffprobe reference
| Observation | What to do with your copies |
|---|---|
| Both clips have one matching video track and one matching audio track. | Try the two-track join below. |
| Both have multiple audio or subtitle tracks. | Identify the tracks you need before choosing output mappings. The example below keeps only the first video and first audio. See the audio and subtitle inventory guide. |
| Only one clip has sound, or the picture size, codec or audio layout changes. | Keep the clips separate, or make new copies with a common set of tracks and settings first. Decide whether a silent interval is wanted if a clip has no audio. |
| A clip ends early, fails to decode or reports a duration that disagrees with playback. | Check that individual source first. The join uses each file’s duration to place the next one on the timeline. |
List the clips in recording order
In the same folder, save a plain-text file named clips.txt with the two lines below. Use the simple relative names shown and save as UTF-8 without a byte-order mark. Check the last scene of part 1 and the first scene of part 2 if your camera restarted its file numbering.
file 'part1.mp4'
file 'part2.mp4'
Run this from that folder with a fresh output name:
ffmpeg -n -f concat -i clips.txt -map 0:v:0 -map 0:a:0 -c copy joined.mp4
The list becomes one virtual input. The two mappings select its first video and first audio streams. -c copy skips re-encoding, and -n stops if the output file already exists. If you want a fade, a change in picture size or a mix between two microphones, use an editing workflow that can process the decoded frames or sound. FFmpeg stream copy
If a clip should open on a particular gesture or word, check the first frame of the trimmed MP4 before adding it to the list.
Check the moment where the clips meet
Probe joined.mp4 with the same command. Check the selected tracks and compare the output duration with the sum of the input durations. Then start playback a few seconds before the end of part 1 and let it run into part 2. Check the last action or spoken word on each side, listen for a click or a silent gap, and seek near the end of the new file. A plausible total duration can hide a bad cut. If you find one, compare the same moments in the originals before trying a new encode. The backup verification guide includes a full decode check.
In our synthetic example, a red clip with a 440 Hz tone lasted 2.022 seconds and a blue clip with an 880 Hz tone lasted 3.022 seconds. Both used 640 × 360 H.264 at 24 fps and 48 kHz stereo AAC. The joined MP4 measured 5.044 seconds and decoded through all 120 video frames. We matched a decoded picture from each section to its source and checked a short audio sample on each side. These spot checks establish clip order. Listen through the transition on the player you intend to use.
A third sample was 320 × 240 at 25 fps with 44.1 kHz mono audio. We stopped at the input comparison and kept that clip out of the join. If your joined viewing copy plays locally but takes a long time to start after upload, check the MP4 playback index.