I am working on converting old VHS tapes. I am having the most puzzling issue happen and while I have found threads related to this and spent countless hours researching, I still have not found the solution for me.

My setup is is as follows:

VCR -> Sony TRV530 Camcorder as Passthrough (A/V cable) -> iMac (firewire with thunderbolt adapter) -> Capture to DV.
I don't know if it matters but in the camcorder settings, I have it set to 16bit and TBC on.

I'm capturing long tapes into one DV file, maybe hour or 90 minutes long. When I play the DV file, whether it's in Quicktime, or VLC, everything is good! Audio is in sync all the way through. I have tried capturing with Vidi and iMovie 6 and I get the same results from both. So far so good.

My problem started when converting to mp4 with Handbrake - I got an audio drift (audio started out in sync but became AHEAD of the video by a few ms the further you went along... i.e. you heard the audio, then you saw the video). So I assumed there was an issue with the codecs, containers, framerates, sample rates, etc..

I researched this to death and tried a million different settings in Handbrake and ffmpeg... I won't go into that here. But what I found NOW is that it seems that the issue may not have to do with the reencoding process after all... It seems there is an issue with the original DV file that only appears once I touch/modify the file in any way (even without re-encoding).

Here are a few examples of what I mean by "touch/modify without re-encoding", that I did to troubleshoot the issue:

I am on a Mac so I tested in iMovie (10). I pulled in the original seemingly in-sync DV file into the timeline. It plays in sync. (Actually if I export to mp4 from iMovie, it stays in sync, but I refuse to use iMovie to accomplish this because of other settings I can't control and the way it does file handling.) Separately, I used VLC to extract the Audio from the same DV file to a wav file (I selected "keep original audio track" so it would not re-encode). When I bring in this wav file (which was not compressed or re-encoded) into iMovie and place it directly under the dv file that is in sync, it has the sync problem! You can see on the timeline, the separated wav audio track ends just before the video track and doesn't line up with the audio track "attached" to the dv file on the timelime. If you stretch the audio track in iMovie so it meets the video, it actually is very close to being in sync, but this isn't really an acceptable solution to me. I really want to understand why this is happening.

Figuring maybe iMovie is doing something weird due to timeline settings you can't see, and the fact that the audio and video tracks when separated seemed to be slightly different lengths (although staying in sync while playing the original dv file) I thought maybe if I trimmed the DV file and took a section from the middle, it would eliminate the chance of the streams actually being different lengths, if that is even a thing. Then I could convert that to mp4 and test. BUT-

PS. The first test I did before the 2 examples above was bring my converted mp4 file from handbrake (which had the sync issue) into iMovie timeline, then detach the audio and delete it.. Then drag down the original DV file (which has both audio and video streams in it) and place it on the timeline under the mp4 video. iMovie treats this like it's just audio and places the audio from that stream under the mp4 video track, and - IT'S IN SYNC. WHAT!!? That led me to believe the issue was in the re-encoding of the audio track, which is why I started experimenting with extracting audio from the dv file and trying to place the PCM track with the mp4 video-only file, but as you know as soon as I "touched" the PCM track (i.e. removed it from dv container without encoding it to something else), it gets messed up. It is like there is something inside the dv container telling them how to stay in sync that gets wiped out if you separate the audio and video and try to put them back together.

This is where I am at now. I am beyond confused and I was really trying to use what I have and not go rebuild a windows computer, or buy a USB analog to digital converter off amazon that converts straight to mp4. Although, unless there is a DV genius here who can help me figure out what is going on, that may be my only option, or give in to using iMovie to do everything (please, no). If iMovie can handle it, something else must be able to as well!!

THANK YOU TO ANYONE WHO TOOK THE TIME TO READ THROUGH ALL THIS! I'm going nuts and appreciate any help you can provide.

Also I am new here (to posting, but not to browsing) and I wanted to add that I'm just someone converting my own memories, not doing this for work or for other people, looking for the best solution using the equipment I have to do it myself. I posted a new thread because the other audio drift issues I've read seem to be the opposite problem, meaning the video dropped frames and the audio gets behind the video. And also because the original dv file untouched plays in sync. Is this normal? I know this can be a tough crowd sometimes... I thank you again in advance and hopefully someone can at least explain to me WHY this is happening even if I can't do anything about it.

Are you doing anything in imovie ? editing ? effects ? some other operations ?

Did you try converting with VLC, since it's in sync there ? You should have some options to convert , maybe even an intermediate if you needed something not offered by VLC

Can you export interlaced prores in sync from imovie ? Or audio separately from imovie? Actually it doesn't really matter - all you need is the audio processed by imovie that is magically in sync (since your imovie MP4 export is in sync, the assumption is other types of exports should be in sync) . Your observations suggest the video isn't the problem . You can swap the video track later , and/or re-encode the audio, or stream copy the audio (if using , say AAC from imovie and that was your desired final format anyways)

I havenít tried converting with VLC, only handbrake and ffmpeg. Once I started seeing the issue in the raw dv file I figured converting with any of those tools would yield the same result. I have no idea what iMovie does differently but I can try VLC too. Thanks for suggesting that.

I donít think you can export from iMovie in prores and even the mp4 options are limited. I hadnít thought of exporting the mp4 and using just the audio from it with the handbrake mp4 video - Iíd be curious to try that, although itís so much extra work and filespace. (iMovie only lets you do 16:9 projects now which is another annoying thing). I just hate to use iMovie because it COPIES the dv files from their source folder and puts them ďinĒ the iMovie package contents of the app. Itís just so clunky and unnecessary.

The audio sample rate is 48hz before and after but the puzzling part is that in the case where all I did was extract 25 minutes from the dv file, I didnít re-encode anything. The audio is the raw PCM 16 bit stream 48Hz in both, unchanged, but becomes out of sync after.

I did some more reading last night about dv regarding different codecs for DV (mine is DVCPRO) and how that behaves and locked/unlocked audio. It sounds like there may actually be something in the original DV file telling it how to stay in sync, that gets destroyed once I modify the file.

If I use Quicktime to Extract Audio only from the DV file as an m4a file (AAC codec, 48Hz - there is no way to change any export settings) and then use ffmpeg to join it with my mp4 video-only file created using handbrake with the settings I want, IT WORKS!!!

This is probably the best and fastest solution I've come across so far but I still really want to understand why this is happening and see if there is a better way, understand why Handbrake and all the other encoders can't do it but Apple products (Quicktime and iMovie) can. I also tried exporting the whole av stream with Quicktime as a .mov file and that worked as well but it gave me no control over the quality and the video looked horrible. It doesn't look like Quicktime gives you any control over export settings unless I am missing it.

I just tried converting with VLC too using some default settings and that ALSO kept things in sync - I am shocked. However it did some other weird things to the file (created a Green bar down the video on the right side). Default VLC settings used mp3 for audio in a m4v container and so the audio sounded bad (tinny) and I also need to do some research on m4v vs mp4. I will do some more experimenting with VLC's converter and if all else fails, I will do the quicktime audio conversion + Handbrake mp4 video.