3toast
10th January 2010, 10:26
I downloaded a video.mp4 clip where audio was behind video for about 0.5 seconds. I tried to fix it with "mp4box -delay" switch, but got annoyed, how players are handling delay.
I tried:
mp4box -add video.mp4 -delay 1=-580 -new out.mp4
Track#1 is the audio.
MS WMP12 ignores delay for mp4.
Quicktime plays correctly with pos or neg audio delay.
Kantaris plays correctly on positive audio delay, but ignores negative audio delay (such in my case). But you can adjust the audio sync manually.
Finally I used a straight forward approach to get the audio in sync, by cutting the audio and just using mp4box:
1) Get info: mp4box -info
Track # 1 Info - TrackID 1 - TimeScale 44100 - Duration 00:03:46.394
Media Info: Language "Undetermined" - Type "soun:mp4a" - 9750 samples
MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 44100
Track # 2 Info - TrackID 2 - TimeScale 24996 - Duration 00:03:46.396
Media Info: Language "Undetermined" - Type "vide:avc1" - 5659 samples
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 480 x 276 - Profile Baseline @ Level 2.1
Synchronized on stream 1
2) Split Video and Audio into separate mp4 files / DeMux:
mp4box -single 1 video.mp4 -out a
mp4box -single 2 video.mp4 -out v
3) Cut away 0.58 sec from beginning of audio:
mp4box -splitx 0.58:226.9 a.mp4 -out aa.mp4
4) Mux the video and the new audio file into a new mp4
mp4box -add v.mp4 -add aa.mp4 -new out.mp4
Now it plays in all players in sync...
3toast
I tried:
mp4box -add video.mp4 -delay 1=-580 -new out.mp4
Track#1 is the audio.
MS WMP12 ignores delay for mp4.
Quicktime plays correctly with pos or neg audio delay.
Kantaris plays correctly on positive audio delay, but ignores negative audio delay (such in my case). But you can adjust the audio sync manually.
Finally I used a straight forward approach to get the audio in sync, by cutting the audio and just using mp4box:
1) Get info: mp4box -info
Track # 1 Info - TrackID 1 - TimeScale 44100 - Duration 00:03:46.394
Media Info: Language "Undetermined" - Type "soun:mp4a" - 9750 samples
MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 44100
Track # 2 Info - TrackID 2 - TimeScale 24996 - Duration 00:03:46.396
Media Info: Language "Undetermined" - Type "vide:avc1" - 5659 samples
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 480 x 276 - Profile Baseline @ Level 2.1
Synchronized on stream 1
2) Split Video and Audio into separate mp4 files / DeMux:
mp4box -single 1 video.mp4 -out a
mp4box -single 2 video.mp4 -out v
3) Cut away 0.58 sec from beginning of audio:
mp4box -splitx 0.58:226.9 a.mp4 -out aa.mp4
4) Mux the video and the new audio file into a new mp4
mp4box -add v.mp4 -add aa.mp4 -new out.mp4
Now it plays in all players in sync...
3toast