Hi, i have a video file and an audio file but after i mux them they are not in sync
I tried to guess the delay but it is not working. Any idea how to determine the delay in ms ?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 8 of 8
Thread
-
Last edited by Kand; 15th Jul 2017 at 07:27.
-
There isn't an automated way that I'm aware. Just best guess, and keeping increasing/decreasing until you don't notice it.
Google is your Friend -
I do this in my NLE (Vegas). It provides a waveform display for the audio. I try to find a visual cue that will sync to the sound. The audio clap board used in the movies provides a spike in the waveform that happens at the exact moment the hinged stick hits the board.That is the ultimate, and it is trivial to get sync. Lacking that, you can look at people's lips when they come together to form plossive sounds like words beginning with "p". You get a spike in the waveform at that point, so you move forward on the timeline to where their lips come together, and then move the audio waveform spike under that frame. There are hundreds of other examples, like a car door slam, that will get you to the same place.
If your NLE lets you slide the audio forward/backward in time while continuously looping a segment of video, you can keep looping while playing until you sense that he audio is in sync. It is a little like "racking focus" when you manually focus a camera while looking at the image on the ground glass of the camera. You intentionally go way past the focus point, on either side and then, by racking back and forth you begin to physically as well as visually sense the exact center point of the focus. -
You could also use a video player like MPC-HC and adjust the sync manually,
then use the resulting offset number to correct the sync in an video editor.
This only works where the sync error stays the same throughout the playback.
If the sync error changes, then often the length of the audio and video are different. -
-
Looks like MPC-HC is the way to go for ease of operation but for a visual display, I often use 2 different ffmpeg methods. For anyone interested in a programmatical method:
1. Create a line graph video of the audio and compare them
Code:ffmpeg -f lavfi -ss 00:00:00.000 -i "amovie='C\:\\Users\\Bud\\Desktop\\Various test Formats\\[dp]Manjandani-1.mp4',asplit[out0],showwaves=r=23.976:s=704x320:mode=line[out1]" -r 23.976 -s 704x320 -vcodec libx264 -vsync 1 -y "C:\Users\Bud\Desktop\Various test Formats\[dp]Manjandani-1LAV_line.MP4"
v1=DirectShowSource(("C:\Users\Bud\Desktop\Various test Formats\[dp]Manjandani-1.mp4"), Pixel_Type="yuy2").Crop(0,0,-0,-0)
v2=DirectShowSource(("C:\Users\Bud\Desktop\Various test Formats\[dp]Manjandani-1LAV_line.mp4"), Pixel_Type="yuy2").Crop(0,0,-0,-0)
stackvertical(v2, v1)
Subtitle("C:\Users\Bud\Desktop\Various test Formats\[dp]Manjandani-1LAV_line.mp4", font="Arial", size=24, text_color=$ff0000, align=6)
Subtitle("C:\Users\Bud\Desktop\Various test Formats\[dp]Manjandani-1.mp4", font="Arial", size=24, text_color=$ff0000, align=3)
ShowFrameNumber(scroll=true, x=10, y=27, font="Arial", size=24, text_color=$ff0000)
ShowTime(x=72, y=44, font="Arial", size=24, text_color=$ff0000)
ShowSMPTE(fps=23.976, x=68, y=61, font="Arial", size=24, text_color=$ff0000)
2. Use Audiograph to display overlay of audio
Code:DirectShowSource(("C:\Users\Bud\Desktop\Various test Formats\[dp]Manjandani-1.mp4"), Pixel_Type="yuy2").Crop(0,0,-0,-0).DelayAudio(-0.0).AudioGraph(2) LanczosResize(864,368) ShowFrameNumber(scroll=true, x=10, y=27, font="Arial", size=24, text_color=$ff0000) ShowTime(x=72, y=44, font="Arial", size=24, text_color=$ff0000)
Similar Threads
-
how do i determine what format a video is encoded to ?
By vhelp in forum ProgrammingReplies: 8Last Post: 31st Aug 2015, 17:38 -
AnyDVD sound delay for a Blu Ray
By Patapin in forum Blu-ray RippingReplies: 7Last Post: 10th May 2014, 04:05 -
I can't determine proper size of video in MeGUI
By TeNSoR in forum Newbie / General discussionsReplies: 6Last Post: 27th Mar 2014, 15:03 -
Determine if video is grayscale/black and white
By skribby in forum Newbie / General discussionsReplies: 16Last Post: 23rd Sep 2013, 08:57 -
Need help to determine the best way to make a time lapse video
By snafubaby in forum Newbie / General discussionsReplies: 2Last Post: 3rd Jun 2013, 10:22