Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
6th January 2016, 22:55 | #1 | Link |
Registered User
Join Date: Jan 2008
Posts: 4
|
Concatenation Conundrum - Apple Media Handler mp4
My attempt to concatenate some web clips (mp4 format, Apple Media Handler) appears to be initially successful - whether using ffmpeg, mkvmerge, or other tools.
The clips do concatenate and the a/v is in sync. However, if the raw elementary h.264/aac streams are demuxed (for example, with mp4box) from the concatenated file - and then remuxed, the a/v sync is lost in the newly remuxed file (after the first concatenation point, and more noticeably after the third concatenation point). My question is why is the a/v sync lost through a demux/remux step? I suppose that I could just not demux/remux, but one of my device players deals better with a mp4box muxed mp4. |
6th January 2016, 23:02 | #2 | Link |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
The sync can be lost because:
- different fps not accounted for - video and audio of a given clip are of different lenths. E.g. video is 60 seconds, audio is 59 seconds. If you try to demux and append the single streams you will create a 1 second desync. |
8th January 2016, 03:37 | #3 | Link | |
Registered User
Join Date: Jan 2008
Posts: 4
|
Quote:
So, what keeps the initial concatenation in sync? Only if I demux the initial concatenation and then remux the raw streams is the sync lost. What is lost in that process that is present in the initial concatenation? I notice that if I use ffmpeg (with the initial concatenated file as the input) to transcode only the video but stream copy the audio, then the raw streams can be remuxed with full sync. Is there another way around this issue without transcoding? |
|
8th January 2016, 17:52 | #4 | Link | |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
Quote:
I don't understand. You already know how: |
|
11th January 2016, 14:21 | #5 | Link |
Angel of Night
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
|
You have to extract the timecodes and remux with them. (Shifting and concatenating all the timecodes to match your merged tracks, of course.) Unfortunately, while this is relatively straightforward for video, it's not something anyone's made for audio -- and whichever track is shorter needs the timestamps.
Can you just concatenate with ffmpeg, then remux that with mp4box? Seems like that would be enough. |
Tags |
concatenation |
|
|