[FFmpeg-user] mp4 concatenation (muxer) problems -- invalid output?
erik.dobberkau at gmail.com
Mon Feb 20 08:56:41 EET 2017
just to make sure I get this right, are you trying to build an advanced
version of Vantage Camera Ingest? Have fun then... ;-)
Let's go trough this step by step to find out if your approach makes sense:
Obviously you're trying to concat recordings from a DSLR.
-> Why are there gaps in between? They shouldn't be there, if the camera is
continuously on record.
When done with the video, you want to replace the audio (of the loooong
video file) with a continuous mp3 audio track that is in sync all of the
You can only concat files with matching parameters (and different moov
atoms if they're not raw files, like transport streams) if you want to get
a decent result, which means you have to do the following:
- Get the exact timecode difference between each of the adjacent files ( ->
exiftool is your friend, use ffprobe and exiftool in a nice script to do
the math... )
- Based on that difference, create matching splice files from the first
frame of the "next" clip for each gap with matching video and audio
parameters to the source clips (-> use anullsrc to add blank audio to an
image). Your mileage will vary here because DSLR cameras use evil magic to
record video... your ffmeg cmd line will (need to) be much longer than it
- Concat everything
- Replace the audio (though I recommend transcoding the mp3 to aac before
and make sure it matches. And even if it does, I bet it won't be lip-sync
all the time, but it depends how perfect you need the result to be).
I don't think it's likely to get a single-line solution for your task.
More information about the ffmpeg-user