I have 2 source videos which i have to merge
Source 1 - good video/bad audio in .mkv format ..... i want to use video stream of this source [h265]
Source 2 - bad video/good audio in .mkv format ..... i want to use audio of this source
now when i mux the 2 source in mkvmerge then the audio is 5 min. less in length so to varify i have demuxed the source 2 and found that the audio was timed in source 2 to get the synced result
Now my question is
Q1. how do i mux video of source 1 with timed audio of source 2
Q2. is there any software to check the exact split timing [millisecond] of the source 2 audio
+ Reply to Thread
Results 1 to 15 of 15
-
-
In a media player use the shift audio function (usually it's the +/- keys), when it's in sync write down the value e.g. it might be -200ms
In mkvtoolnix, highlight audio track, format specific options tab, enter that delay value, push start muxing
Another method is to use avidemux's audio shift (video=> copy, audio=>copy and enter shift value, format=>mkv)
Note this only works if there is a constant sync delay offset, not progressively worsening .
the audio is 5 min. less in length -
-
You stretch/ shrink either the video or audio to match by the ratio (PAL and NTSC film have set fps 25fps and 24000/1001 fps).
If it's different cut, you cannot sync it easily because there are different scenes, so you're either missing audio or video -
thx, which tools do you recomend for that?
i mean for streching/shrinking and matching the fps. -
for audio you can use any audio editor eg. audacity
for video you can change the fps right in mkvtoolnix
Note this only works if they are exact film to PAL conversion or viceversa . You're just reversing what was done in the first place -
Assuming the audio was stretched in some way when added to the original MKV and both MKVs are the same in duration and frame rate etc..... so all you should need to do is take the audio stream from one MKV and add it to another....
Try using MKVCleaver to extract the audio time codes from the original MKV file. When you add the audio to the second MKV, also use the audio timecodes you extracted from the first MKV. It's been a long time but I think they're just extracted as a text file. The timecodes file can be added to the second MKV using MKVMergeGUI and the General Track Options tab. It's the second bottom field, the one just above the output file name. Of course make sure you add the extracted audio timecodes to the audio stream and not the video. -
In a media player use the shift audio function (usually it's the +/- keys), when it's in sync write down the value e.g. it might be -200ms
In mkvtoolnix, highlight audio track, format specific options tab, enter that delay value, push start muxing
Another method is to use avidemux's audio shift (video=> copy, audio=>copy and enter shift value, format=>mkv)
Note this only works if there is a constant sync delay offset, not progressively worsening .
the audio is 5 min. less in length
Since the audio durations are different for you, you cannot use this method . It might be a PAL/NTSC conversion (speedup or slowdown), or different movie theatrical cuts
You stretch/ shrink either the video or audio to match by the ratio (PAL and NTSC film have set fps 25fps and 24000/1001 fps).
If it's different cut, you cannot sync it easily because there are different scenes, so you're either missing audio or video
Assuming the audio was stretched in some way when added to the original MKV and both MKVs are the same in duration and frame rate etc..... so all you should need to do is take the audio stream from one MKV and add it to another....
Try using MKVCleaver to extract the audio time codes from the original MKV file. When you add the audio to the second MKV, also use the audio timecodes you extracted from the first MKV. It's been a long time but I think they're just extracted as a text file. The timecodes file can be added to the second MKV using MKVMergeGUI and the General Track Options tab. It's the second bottom field, the one just above the output file name. Of course make sure you add the extracted audio timecodes to the audio stream and not the video.
anyways thanks for the help guys
P.S. the movie have few explicit scenes thats the reason my preffered audio have 5 min. of less time -
this time i have the same problem but instead of mkv the source is in avi format. Is there any tool to extract audio time code for avi source
P.S. mkvcleaver does not work with avi file -
Damn..... after my post a few posts down I refreshed the page and it looked like I'd double posted, so I deleted this one, but it was yesterday's post.
Oh well, that'll teach me to post when I'm half asleep.Last edited by hello_hello; 1st Aug 2012 at 17:08.
-
tried to remux the avi to mkv but the audio was not sync as i can see that avi have around 800ms of delays and a preload as well while remuxed mkv didnt had any delay. it was just muxed as a plain streams
secondly tried avidemux and it worked up to some extent but still not upto the mark
SOURCE
Interleave, duration : 738 ms (18.46 video frames)
Interleave, preload duration : 216 ms
OUTPUT Through AVIDEMUX
Interleave, duration : 40 ms (1.01 video frame) -
Interleaving has nothing to do with the audio delay relative to the video. It's to do with how the audio and video are "interleaved". If the AVI uses an audio delay, MediaInfo should tell you what it is and it'll appear under "Delay relative to video". Like this:
Compression mode : Lossy
Delay relative to video : 168ms
Stream size : 22.7 MiB (8%)
Alignment : Aligned on interleaves
Interleave, duration : 67 ms (2.00 video frames)
Interleave, preload duration : 504 ms
The program which originally created your AVI interleaved the audio with the video every 738ms, AviDemux probably defaults to 40ms and in the example above I told VirtualDubMod to interleave it every 2 video frames.
I don't fully understand the "interleave preload duration" value as I've not thought about it before. VirtualDubMod says it's the amount of audio which is preloaded before the video starts, but I'm not sure how the audio delay factors in.
Normally when remuxing AVIs to MKV any audio delay is handled correctly. I've remuxed quite a few of them in the past. The only time you should have to worry, is if MKVMerge offers a warning regarding deleting junk data from the audio stream while remuxing, in which case it "might" cause an audio sync issue, but if there's no warning the audio sync shouldn't be effected.
As it turn out, I used the AVI above as a "test remux" as I knew it used an audio delay because I took the audio from a different AVI and added it to mine today. When remuxing it as an MKV though, MKVMergeGUI offered a warning that the first 504ms was just junk data which it deleted while adding a 504ms delay to compensate. This is nothing new so it suprised me when it threw the audio out of sync. I guess VirtualDubMod compensated the first time (it keeps junk data) which then caused MKVMergeGUI to get it wrong. As manually adding a -336ms delay put the audio back in sync (504ms added by MKVMergeGUI less 168ms added by VirtualDubMod) it kind of makes sense. I guess it served as a reminder.... look out for those "removed junk data" warnings when remuxing.
Similar Threads
-
Mux audio with video on the Mac
By Sakuya in forum AudioReplies: 1Last Post: 18th Mar 2012, 01:39 -
ASF2VC1 & transcode the audio WMA to AC3, then mux video VC-1 and audio
By tigerb in forum Newbie / General discussionsReplies: 0Last Post: 9th Jan 2010, 08:02 -
What will mux Divx video with OGG audio?
By bizzybody in forum Newbie / General discussionsReplies: 2Last Post: 16th May 2009, 18:05 -
How to mux Quicktime video and audio together?
By jmcyang in forum Newbie / General discussionsReplies: 2Last Post: 3rd Nov 2008, 13:10 -
mux new audio for VIDEO_TS without video loss
By cleantone in forum ffmpegX general discussionReplies: 2Last Post: 17th Oct 2007, 21:22