VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 44
Thread
  1. I can not sync the audio with the video in VirtualDub!

    Something goes wrong!
    I do not understand what's going on ...


    Every time I set sync repair for the audio in VirtualDub,
    So at the beginning of the video the audio really aligned with the video.
    But after a few minutes into the video, once again there is loss of sync.

    I can not understand how that happens.
    I fixes it but for some reason, the fix did not stay in the video.

    It's a mystery.


    The audio file I got from DGIndex together with the m2v file.
    It comes together ..

    But the audio file is mp2.
    So I had to convert it to wav to load it in VirtualDub.
    So I did the conversion with the software WavePad Sound Editor.

    help me please
    Quote Quote  
  2. Before you make any adjustments in vdub, is it a constant sync offset (e.g. always 500ms off) , or progressively worsening ?

    Does the mp2 demuxed filename from dgindex have a delay value written in?

    You can load the audio with the avs script as well
    Quote Quote  
  3. Ok.
    Now I see the time of the audio file(mp2) is: 00:13:01
    And the time of the video file(m2v) is: 00:12:54

    Why it happened I do not know. But that's what DGIndex gave me ..

    I do not really know what that means but it's a start ..

    Maybe the problem is the audio file to run faster?
    If so then I do not know how to fix it.
    Quote Quote  
  4. But how are you determining those times? What software?

    What does gspot say about the m2v ? and about the original MPEG2 video (audio & video). And what does mediainfo say?
    Quote Quote  
  5. Does the mp2 demuxed filename from dgindex have a delay value written in?
    YES.
    I do not know what to do with this information ..

    This is the name of the file MP2:
    part 1 Tc0 L2 2ch 48 256 DELAY 0ms.mp2

    Before you make any adjustments in vdub, is it a constant sync offset (e.g. always 500ms off) , or progressively worsening ?
    I did not understand the question ..

    But how are you determining those times? What software?
    I see the length of time in windows

    What does gspot say about the m2v ? and about the original MPEG2 video. And what does mediainfo say?
    Tell me what to photograph and where because I do not know where to get this information.
    Last edited by gil900; 7th Aug 2012 at 16:48.
    Quote Quote  
  6. Originally Posted by gil900 View Post

    But how are you determining those times? What software?
    I see the length of time in windows
    windows explorer isn't reliable for parsing elementary streams (wrong information)


    What does gspot say about the m2v ? and about the original MPEG2 video. And what does mediainfo say?
    Tell me what to photograph and where because I do not know where to get this information.[/QUOTE]

    Just print the window of gspot. For mediainfo (view=>text) and you can copy & paste the text view here
    Quote Quote  
  7. Originally Posted by gil900 View Post
    This is the name of the file MP2:
    part 1 Tc0 L2 2ch 48 256 DELAY 0ms.mp2
    It zero delay (it says DELAY 0ms) . Normally you would use that delay value to offset the video & audio stream, but since it's zero, you don't have to do anything

    Did you try loading the audio in avisynth ? (change paths & filenames to match)

    vid=MPEG2Source("file.d2v")
    aud=FFAudioSource("part 1 Tc0 L2 2ch 48 256 DELAY 0ms.mp2")
    AudioDub(vid,aud)
    Quote Quote  
  8. No but I will try ..
    Quote Quote  
  9. Ok I tried and it did not solve the problem
    Quote Quote  
  10. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    Why are you using mp2 audio? mp2 is not valid for DVD. Processing AVI video with mp2 attached will suffer severe quality loss because it is lossy compression that will be recompressed several times.

    I've seen complaints about the way DGIndex often handles video, and I had some difficulty with it. I almost always capture VHS to AVI with uncompressed PCM audio, rather than DVD. But I would not recommend your EasyCap for that method. With DVD (VOB) you shouldn't work with lossy compressed audio anyway. Here is how I sometimes save VOB audio as uncompressed .wav (this is only one of several methods):

    You need the VirtualDuib AC3 plugin, if you don't have it now. Get it here: http://home.comcast.net/~fcchandler/Plugins/AC3/index.html. Download the .zip file, unzip it, and copy "AC3plugin.vdf" into VirtualDub's plugins. Open the VOB directly in VirtualDub using "File..." and "Open video file...". When the VOB opens, do this:

    n VirtualDub's top menu, Click "Audio..." .
    Click "Full processing mode" on that Audio menu.
    In the Audio menu, Click "Compression...".
    Choose "<no compression (PCM)>", which is the default.
    Then in the "File...." menu, click "save WAV...". This saves audio only, no video.
    Give the audio the same name as your VOB, or whatever name you want. The file name should end with ".wav". You will have a .wav file in uncompressed PCM that contains all of the audio from your VOB.

    As poisondeathray suggests, when you create a .d2v and open it in Avisynth to process as AVI, you have to attach the audio -- unless you want to wait until you have processed the entire VOB. To join d2v video and its matching .wav audio in Avisynth:

    Code:
    # --- import the video ----
    video=MPEG2Source("drive:/folder path/videofile.d2v")  # <- or use "AviSource", etc.
    
    # --- import the audio ---- 
    audio=WAVSource("drive:/folder path/audiofile.wav")
    
    audio_dub(vid,aud)                                     #<- "audio_dub" joins audio and video 
    
    [start editing and processing at this point. . .] 
    [etc., to the end of the script]
    When the above file is processed and saved as AVI, the audio remains inside the AVI. If you make any video cuts in this script, such as using Trim() to save only a part of the clip, the audio will be trimmed with it and will remain in sync inside the saved AVI.
    Last edited by sanlyn; 23rd Mar 2014 at 06:27.
    Quote Quote  
  11. I will try what you say.

    But I have a problem with the new recording.
    The problem is that VirtualDub stuck When I load the new VOB file.

    That's why I create video M2V files from the VOB file. So I can work on video on VirtualDub With the M2V
    Quote Quote  
  12. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    If the "mp2" is the the audio from the separate capture you mentioned earlier, don't use it. You shouldn't combine audio from different captures. Use the audio from your VOB, not audio from a different capture.
    Last edited by sanlyn; 23rd Mar 2014 at 06:27.
    Quote Quote  
  13. VirtualDub does not stick (my mistake)
    But it does not show me all the video.
    It receives a small part from the video(vob file) of a few seconds!

    the vob file is 1.99GB
    It makes no sense
    Quote Quote  
  14. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    The usual length for a standard definition VOB from a DVD recording is 1-GB, not 1.99GB ? ? ?. Someone correct me if necessary. Did you start with multiple VOB's that you joined?
    Last edited by sanlyn; 23rd Mar 2014 at 06:27.
    Quote Quote  
  15. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    OK, looking into this I see that PAL can use MP2 audio, as well as AC# and PCM. You should convert the VOB's audio to PCM. Later, you can encode to MPEG in any of the three audio formats. In the world of NTSC, most NTSC players do not support MP2 becausse that format is not a requirement of NTSC. In any event, processing video files with audio is best done using PCM audio.

    Look at your DVD recording. We need to know the names of the VOB files on the DVD. Creating the separate audio file is not difficult, but we need to see how the original VOB's are arranged in your recording.
    Last edited by sanlyn; 23rd Mar 2014 at 06:27.
    Quote Quote  
  16. Member
    Join Date
    Feb 2004
    Location
    Australia
    Search Comp PM
    At the beginning

    Load file and choose a starting position midway and lock in ... go a few minutes further along and lock this frame in ... set video and audio compression as needed and output the new file ... now play this sample in ANY other video player OTHER THAN vdub to test sync issue.

    As most would know vdub in any form will lose audio sync after a short period and should not be used for preview playback purposes.
    Quote Quote  
  17. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    That's true, Bjs. VirtualDub is an editor and processor, not a player. I am still trying to determine if gil900 has used something to join VOB's, which I believe is the case.
    Last edited by sanlyn; 23rd Mar 2014 at 06:28.
    Quote Quote  
  18. But you do not understand!

    There's a reason why I started to cut the VOB file into small m2v pieces with DGIndex.

    The reason is that there is a bug in VirtualDub when I load the VOB file in the software.

    The bug is - VirtualDub identifies from the VOB file only a very small part of the whole video which takes only a few seconds.

    As if I did not catch anything.
    I can not work the way you suggest (to load the VOB file directly in VirtualDub) because of this bug.
    So I chose the program DGIndex (you recommendation to me about her) because the software performs no conversion so it did not lose quality.

    This bug occurs only in the new recording witch the DVD which it did a little differently.

    the difference is that I recorded with breaks -
    in the tape machine I played the tape as usual. And at the same time I recorded the tape on DVD.

    But this time - I stopped the recording and playback of the tape each time there is a transition. (I hope you understand this sentence)


    Then I played on DVD The last section was recorded to ensure that this part was recorded well.

    Then I continue to record the next part.

    And I did it until the end.

    The reason I chose to record this way is - the last recording of the DVD was not good.
    I recorded the video without breaks So that the DVD Recorded for hours without a break.

    I have no power to specify what was not good in the first recording But it was a serious problem.
    Quote Quote  
  19. That's true, Bjs. VirtualDub is an editor and processor, not a player. I am still trying to determine if gil900 has used something to join VOB's, which I believe is the case.
    First, i put all the VOB into DGIndex software:
    Click image for larger version

Name:	89757608.jpg
Views:	942
Size:	62.5 KB
ID:	13388

    Then, DGIndex connected all video files to one video.

    Then I cut small parts from the video to this:
    Click image for larger version

Name:	84609141.jpg
Views:	406
Size:	70.7 KB
ID:	13389
    (I created the folders and that order)

    This simple idea came into my head ..
    I just think a lot more correct to work smaller parts.

    r0 - it means that this part is from the first recording(first DVD disk).
    v1, v2 ... - This means that it is the same section of the tape but which recorded again.
    Last edited by gil900; 8th Aug 2012 at 05:58.
    Quote Quote  
  20. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    What did you use to cut the video into small parts?
    Last edited by sanlyn; 23rd Mar 2014 at 06:28.
    Quote Quote  
  21. Originally Posted by sanlyn View Post
    What did you use to cut the video into small parts?
    For that VirtualDub will read it but YES,
    I cut into small parts to work more organized.

    Each part is actually another section on the tape.
    I made the cut at any point of transition between sections on the tape ...

    My work plan is to work on each part separately and then connect them to one video ..


    EDIT:
    This way easier to do your tip (which you say I may have to change the color settings and other settings in other parts of the tape) ..

    EDIT2:
    I also had to do that because if I would not do that then I would get one video with duplicate sections. (recorded a few sections on the tape several times)
    Last edited by gil900; 8th Aug 2012 at 06:15.
    Quote Quote  
  22. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    A) I am trying to follow the sequence, but you are getting ahead of us and omitting information. First, you listed several VOBs in DGIndex so that you could join them as one project. What was the next step? Did you create a .d2v project which would be an index to the joined VOB's, or did you demux all of the video into a single .m2v ?

    You appear to be saying that you made these small cuts by using the DGIndex preview window, setting start and stop points in DGindex, and saving these cuts as m2v files.

    B) When you say that the VOB is 1.99-GB, I think nyou mean that if join the small VOBs into one m2v file, the m2v is 1.99-GB . Is that how the number "1.99" was derived?
    Last edited by sanlyn; 23rd Mar 2014 at 06:28.
    Quote Quote  
  23. A) I am trying to follow the sequence, but you are getting ahead of us and omitting information. First, you listed several VOBs in DGIndex so that you could join them as one project. What was the next step? Did you create a .d2v project which would be an index to the joined VOB's, or did you demux all of the video into a single .m2v ?
    After that I did not created a one d2v file with one m2v file.
    I created it a few parts that each part is a folder which has a m2v file and d2v file and mp2 file .

    Like I said in the editing, I could NOT create one m2v file (with file d2v) that is all the video.
    Because i will get one video with duplicate sections because i recorded a few sections on the tape several times..

    You appear to be saying that you made these small cuts by using the DGIndex preview window, setting start and stop points in DGindex, and saving these cuts as m2v files.
    Yes, that's exactly what I say.

    B) When you say that the VOB is 1.99-GB, I think nyou mean that if join the small VOBs into one m2v file, the m2v is 1.99-GB . Is that how the number "1.99" was derived?
    Each VOB file really weighs 1.99GB.

    here Is a picture:
    Click image for larger version

Name:	62444379.jpg
Views:	422
Size:	102.7 KB
ID:	13390

    Windus also writes that this VOB file has only a few minutes.
    so it really happens even with VirtualDub - I see only a few minutes of the video in this software..
    But it is wrong.

    I just checked only this VOB file in DGIndex and saw that has a lot more than 4 minutes ..
    Not for nothing that weighs 1.99GB.


    Sorry if I'm not always clear ..
    I just write every word through google translate and corrects some errors of google translate if needed ..
    But not always easy for me to write anything ..


    EDIT:
    now when I look at the picture, I see I was wrong.
    Each VOB file weighs 0.99GB..

    I was wrong.

    EDIT2
    If I painted something in red or blue or another color - it means it's something I added or edited.
    Last edited by gil900; 8th Aug 2012 at 07:09.
    Quote Quote  
  24. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    Yes, that is a better explanation. Thank you.

    The way you are making these cuts could possibly work, but it is a more difficult way of breaking a video apart. Also note, if you are repairing frames and doing other work in Avisynth, all of these cuts are going to be AVI eventually. As I said earlier, I had trouble with audio timing in DGIndex when cutting video in this manner, and so have other users. In any case, this seems to be a difficult way of doing it.

    Also notice that the images above show the file names, but no other information. The image below shows more information of the VOB files that I copied to my hard drive from a DVD recording that I made. The files in RED are files that I selected with the mouse:

    Image
    [Attachment 13391 - Click to enlarge]


    The 4 files above the VOBs were created by DGIndex. The file "ALL_VOB.d2v" is the first thing I created with SGIndex. The d2v is a project filoe created by clicking "Save Project". The d2v is an index to all of the joined VOBs. True, there are sections of video inside the project taht I might use or might discard, but the d2v is an index to the entire video.

    The next thing that I did was to demux the video for only one of the VOBs. That file was "VTS_01_1 T80 2_0ch 192Kbps.ac3". The file name reads "ac3 because this DVD was recorded with AC3 audio. Your video used mp2. mp2 is OK for PAL, but many NTSC players don't recognize mp2. PAL is different.

    Creating a separate mp2 for each m2v cut is likely the source of the playback problems. In any case, it would be better to open the d2v project, and then demux audio for the ENTIRE group of VOBs -- that is, a single audio demux for the entire video. This audio file will be much smaller than the joined VOBs.

    If you want, you can make an m2v of ALL the VOBs, instyead of a d2v. The size of that m2v would be near 4-GB. But that would be a waste of space because you are cut the m2v into smaller pieces anyway, so much of the m2v would be discarded. Besides, if I were cutting a video into pieces to be repaired or to perform color work, I would break the video into small AVIs and imbed the audio into each AVI as uncompressed PCM audio. This would avoid quality loss which occurs by processing with mp2 or ac3. Besdies, PCM (a .wav file) is universally recognized by most applications. In the end, you will have to join your smaller cuts together into a single MPEG2 to make a DVD, and the audio could be re- converted to AC3 or mp2 with very little quality loss.

    I see that you created a demuxed mp2 audio file for the entire video. Likely, you should join the audio and video BEFORE making cuts. If you do so, the audio and video will stay together for each cut. poisondeathray proposed one way of doing it. There are other methods, but the script requires that you download and install ffmpeg codecs to use mp2 audio. If I found myself hemmed in by a video that did not use audio I could save as a .wav file, it would simply make the process more difficult and complicated.

    Wait a short while. I am converting the audio in my sample VOB project from Ac3 to mp2. Will return shortly.
    Last edited by sanlyn; 23rd Mar 2014 at 06:28.
    Quote Quote  
  25. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    You can make this conversion in VirtualDub, but it's clumsy. You would need the AC3 converter plugin that I mentioned earlier in post #10. That plugin can actually read mp2 audio files, even if the designer forgot to include that file format in the readout text for VirtualDub. But there is an easier way. You need a copy of the older VirtualDubMPEG2. Get it here:
    http://home.comcast.net/~fcchandler/stable/VirtualDub-MPEG2.zip

    Create a folder for that zip file. Name the folder "VirtualDubMPEG2". Unzip the zip file inside that folder. When the file is unzipped, look at the files inside. Heavens, most of the files look like those in your regular VirtualDub folder! The names are similar, but the files inside are not EXACTLY like those in VirtualDub. But running VirtualDubMPEG2 has no effect on your other VirtualDub settings. VDubMPEG2 maintains its own settings.

    Don't execute the program yet. First, copy the AC3 and MPEG plugins from your old VirtualDub folder into the plugins folder for VirtualDubMPEG2. In many cases, you will find VirtualDubMPEG2 to be a handy tool. Make certain the MPEG and AC3 plugins are inside the plugins folder for VirtualDubMPEG2. You can also copy other plugins into VirtualDubMPEG2....however, remember that this is an older version, and some newer plugins might not work. Nevertheless, you will find many uses for this older version of VirtualDub.

    Now, in the folder where you keep your VOBs, you should have two files that you created with DGindex. One would be a .d2v project file for ALL the VOBs (the entire video). The other should be your .mp2 audio file for ALL the VOBs (the entire audio track). These are the two files you will use to make a .wav audio file. Later, you can make your cuts.

    You will need this avs script (change the path names and file names to match your d2v file and location):

    Code:
    MPEG2Source("drive:/folder path/video.d2v")
    That's all you need. Save the script as an .avs file in the folder with your VOBs. This script opens your d2v project. It performs no other processing.

    Now, go to the VirtualDubMPEG2 folder. Find "virtualdub.exe" in that folder and double-click. This will start VirtualDubMPEG2, which has an interface similar to your "other" VirtualDub.
    - Click "File...", then click "open video file...", just as in VirtualDub .
    - Find your new .avs script, select it, then click OPEN or OK. The video will open in VirtualDubMPEG2. At first, no audio.
    In The VDUbMPEG2 top menu, click "Audio"
    In the Audio menu, click "Full processing mode"
    In the Audio menu, click "Compression" and choose "<no compression (PCM)>". Close that window.
    In the Audio menu, Click "Browse for audio..."
    Be sure you are looking at the folder with your d2v and VOB's. You will see your mp2 file listed.
    Select that mp2 file to open it.

    If you play the video in VDUbMPEG2, you will hear the audio.
    In the VDubMPEG2 "File" menu, click "Save WAV..."
    Save the .wav file in the folder with your VOBs. Give it a name that ends with ".wav" .
    It will take a few minutes to save the audio portion as a .wav file. This saves ONLY the audio. It does nothing to the video.

    You should make your cuts in Avisynth, and save the cuts as Lagarith YV12 . Yes, you will have a lot of AVi's. You make cuts in Avisynth using the Trim() command. When those cuts are made, you will be able to save the audio and video together.

    Now, you can open that same d2v in Avisynth with this script, and join video and audio:

    Code:
    vid=MPEG2Source("path/file.d2v") 
    aud=WAVsource("path/audio.wav")
    AudioDub(vid,aud)
    
    Trim(0,2054)    # <- frame numbers depend on where you want to cut. 
    # (Perform other processing if you desire. . )
    You can use this script again and again. Change the frame numbers in the Trim() statement for each cut you want to make. You can disable the Trim statement by typing "#" at the beginning of that line. A "#" character indicates a comment, which is not executed. This will allow you to open the avs in VirtualDub and scroll through the video to determine the frame numbers you want to include in your cut. The .wav file will have the same timing as your d2v project file, and each cut will have audio and video together. After you create an AVI in this manner, you will no longer need to refer to the .wav file. The AVI you create in this manner will always have the audio imbedded when you open or process that AVI. Save each cut as a Lagarith YV12 AVI for processing.

    There are other ways to do this. I have always found this to be the most reliable.

    Suggestions welcome.
    Last edited by sanlyn; 23rd Mar 2014 at 06:29.
    Quote Quote  
  26. Member 2Bdecided's Avatar
    Join Date
    Nov 2007
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by sanlyn View Post
    OK, looking into this I see that PAL can use MP2 audio, as well as AC# and PCM. You should convert the VOB's audio to PCM.
    If I'm doing a restoration without edits (i.e. improving the video, but not editing it), I keep the original mp2 audio that was spat out by DGindex and re-mux it with the restored video at the end.

    Same thing for converting HDV to DVD without edits - downsize the video using AVIsynth, encode to m2v using HcEnc, then mux the original mp2 audio back in.


    I don't do this often, because it's rare to not want to edit the video, and rare to not want to change the audio. But sometimes it happens, and then it's quick and easy. I enter any non-zero delay values (in the mp2 filename) into muxman when muxing. It seems to be foolproof


    I've no idea what the OP is doing. When VirtualDUB only loads part of a VOB, it's usually because it has multiple chapters in it (it'll only load the first one), or because it's corrupt (lots of DVD recorders create corrupt VOBs; VirtualDub will choke at the first error). But being forced to DGIndex, surely the whole thing will then work in one go through AVIsynth? Never had problems there (other than stream errors which DGIndex chokes on - and tell you about!).

    Cheers,
    David.
    Quote Quote  
  27. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    I suspect you're correct about playing the VOB. The start-and-stop procedure might have created problems. It appears that when the O.P. opens the video as d2v, the whole thing plays (no problems were mentioned about playing the d2v). It's possible that when DGindex makes the d2v, it performs some corrections. (?)

    What he is doing is using DGIndex as a cut-and-edit app to make many smaller m2v's, and trying to join mp2 audio to each cut. Each m2v is going to be AVI anyway for repairing bad frames, so why bother with all those m2v's? True, cutting into AVI will generate a lot of large files, but that would happen anyway because the bad frame problem also involves fixing interlace artifacts.

    There is another way to run this .mp2 -> WAV process in good ole VirtualDub, without using VDubMPEG2. If the O.P. has the MPEG and AC3 plugins in VirtualDub, he could change the file name from "mp2" to "mp3". Open the d2v, associate the mp3 with the video, then save the WAV. I tried it both ways. The problem with "regular" VirtualDub is that VDub pops up a dialog asking about the audio file's structure (whether it is VBR or CBR). I chose the top choice, which is to let VDub decide.

    I always capture to AVI/PCM anyway, not DVD. But the O.P. doesn't have a good capture card.
    Last edited by sanlyn; 23rd Mar 2014 at 06:29.
    Quote Quote  
  28. https://forum.videohelp.com/threads/348261-audio-sync-problem-with-DGIndex-and-VirtualD...=1#post2178754

    Thank you very much.
    Because I have already cuted video files, I prefer to do some of what you wrote. and it is to extract only the audio from VirtualDub ..
    I mean - to cut audio files for my m2v parts.
    For each m2v file I will cut in your way a audio file which adapts to the mtv file.

    Your full way you're telling me to do a conversion. And conversion is not good because it loses quality
    Quote Quote  
  29. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    I don't think you understand. m2v and AC3 are very similar. Both are lossy compression. PCM is lossless.

    Do you mean to say that you are going to process your video as m2v? You will lose quality everywhere.
    Last edited by sanlyn; 23rd Mar 2014 at 06:29.
    Quote Quote  
  30. Originally Posted by sanlyn View Post
    I don't think you understand. m2v and AC3 are very similar. Both are lossy compression. PCM is lossless.

    Do you mean to say that you are going to process your video as m2v? You will lose quality everywhere.
    You should make your cuts in Avisynth, and save the cuts as Lagarith YV12 . Yes, you will have a lot of AVi's. You make cuts in Avisynth using the Trim() command. When those cuts are made, you will be able to save the audio and video together.

    It means to do a conversion.
    And I know that a conversion is losing quality ..

    and you said that DGIndex Performs no conversion.
    So why not use the m2v files?
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!