VideoHelp Forum
+ Reply to Thread
Results 1 to 14 of 14
Thread
  1. 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-

    I trimmed the file using ffmpeg -i "input.dv" -c copy -ss 00:30:00 -t 00:25:00 extract25min.dv Guess what - sync issue appeared in full force. This really got me...

    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.
    Quote Quote  
  2. 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.
    Quote Quote  
  3. 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)
    Quote Quote  
  4. Not doing anything else in iMovie whatsoever.

    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.
    Quote Quote  
  5. What's the audio sample rate before and after? If you don't know, check in MediaInfo. Like pdr, I suspect the problem is the audio.
    Quote Quote  
  6. 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.
    Quote Quote  
  7. And here is mediainfo on the original DV file (the one I've most recently been testing on).

    Format :
    DV
    Commercial name :
    DVCPRO
    File size :
    12.1 GiB
    Duration :
    1 h 0 min
    Overall bit rate mode :
    Constant
    Overall bit rate :
    28.8 Mb/s

    Video
    Format :
    DV
    Commercial name :
    DVCPRO
    Duration :
    1 h 0 min
    Bit rate mode :
    Constant
    Bit rate :
    24.4 Mb/s
    Width :
    720 pixels
    Height :
    480 pixels
    Display aspect ratio :
    4:3
    Frame rate mode :
    Constant
    Frame rate :
    29.970 (29970/1000) FPS
    Standard :
    NTSC
    Chroma subsampling :
    4:1:1
    Bit depth :
    8 bits
    Scan type :
    Interlaced
    Scan order :
    Bottom Field First
    Compression mode :
    Lossy
    Bits/(Pixel*Frame) :
    2.357
    Stream size :
    10.2 GiB (85%)

    Audio
    ID :
    0
    Format :
    PCM
    Duration :
    1 h 0 min
    Bit rate mode :
    Constant
    Bit rate :
    1 536 kb/s
    Encoded bit rate :
    0 b/s
    Channel(s) :
    2 channels
    Sampling rate :
    48.0 kHz
    Bit depth :
    16 bits
    Stream size :
    660 MiB (5%)

    Prior to this I also tested with camcorder on 12 bit which yields different audio settings in the captured DV file. Example of one of those:

    General
    Format :
    DV
    Commercial name :
    DVCPRO
    File size :
    18.7 GiB
    Duration :
    1 h 33 min
    Overall bit rate mode :
    Constant
    Overall bit rate :
    28.8 Mb/s

    Video
    Format :
    DV
    Commercial name :
    DVCPRO
    Duration :
    1 h 33 min
    Bit rate mode :
    Constant
    Bit rate :
    24.4 Mb/s
    Width :
    720 pixels
    Height :
    480 pixels
    Display aspect ratio :
    4:3
    Frame rate mode :
    Constant
    Frame rate :
    29.970 (29970/1000) FPS
    Standard :
    NTSC
    Chroma subsampling :
    4:1:1
    Bit depth :
    8 bits
    Scan type :
    Interlaced
    Scan order :
    Bottom Field First
    Compression mode :
    Lossy
    Bits/(Pixel*Frame) :
    2.357
    Stream size :
    15.9 GiB (85%)

    Audio #1
    ID :
    0
    Format :
    PCM
    Duration :
    1 h 33 min
    Bit rate mode :
    Constant
    Bit rate :
    768 kb/s
    Encoded bit rate :
    0 b/s
    Channel(s) :
    2 channels
    Sampling rate :
    32.0 kHz
    Bit depth :
    12 bits
    Stream size :
    512 MiB (3%)

    Audio #2
    ID :
    1
    Format :
    PCM
    Duration :
    1 h 33 min
    Bit rate mode :
    Constant
    Bit rate :
    768 kb/s
    Encoded bit rate :
    0 b/s
    Channel(s) :
    2 channels
    Sampling rate :
    32.0 kHz
    Bit depth :
    12 bits
    Stream size :
    512 MiB (3%)
    Quote Quote  
  8. UPDATE -

    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.

    I still want to know what is going on if anyone knows!
    Quote Quote  
  9. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    You could use a byte editor to inspect the data in the MOV file. Perhaps there is a squirrely value in the audio header that some programs ignore/fix and others accept verbatim.

    https://developer.apple.com/standards/qtff-2001.pdf
    Quote Quote  
  10. Member
    Join Date
    May 2019
    Location
    Midwest USA
    Search Comp PM
    I've experienced a similar issue on long converted videos, where toward the end of the video it's out of sync. I found that increasing the bitrate to a very high number during the conversion step was the solution. Maybe give that a try, if you haven't. I haven't done it with Handbrake, though (I use Aiseesoft HD Converter, and set the bitrate to 18,000 kbps).
    Last edited by bloodmark; 29th May 2019 at 06:25.
    Quote Quote  
  11. Originally Posted by bloodmark View Post
    I've experienced a similar issue on long converted videos, where toward the end of the video it's out of sync. I found that increasing the bitrate to a very high number during the conversion step was the solution. Maybe give that a try, if you haven't. I haven't done it with Handbrake, though (I use Aiseesoft HD Converter, and set the bitrate to 18,000 kbps).
    Thanks for that info.

    I've completely changed my workflow since I started out a few months ago and with the current way I'm doing things, I'm not experiencing the sync issue anymore. I never identified exactly where the sync issue was occurring (i.e. if it was a problem with the source or the conversion process or software, although the source files always seemed to play in sync...). What I am doing now is using Final Cut 7's Log and Capture to capture one long DV clip, then doing some minor titling and editing (nothing more than cuts and fades generally) on the timeline, "Save As" a Quicktime Movie, which doesn't do any converting or further loss of quality and outputs a MOV file. With that file I've successfully been able to convert using either Compressor or Handbrake with no sync issues.

    I've also decided to cut my long tapes (which are all personal home movies) into smaller files for the end result, so if I have a 2 hour tape, I might create anywhere from 2-6 files depending on the content of the tape. I found that this was better once it came to actually watching them, rather than sifting through hours of content to find something specific or sitting and watching everything beginning to end. Point being, I'm wondering if I had spliced up my movies from the beginning, if I would have even noticed a sync issue since it seemed to only be noticeable at about an hour in. That said, I am not experiencing any sync issues even on clips that are an hour+ using the current method, so if it aint broke...
    Quote Quote  
  12. Member
    Join Date
    Mar 2020
    Location
    Germany
    Search Comp PM
    I fixed ca. 50 DV files and could correct the sync problem in Linux with following bash script:

    !/bin/bash
    SRC="/home/brian/Desktop/audio_shift"
    set -f
    for FILE in $(find "$SRC" -name *.dv)
    do
    echo "Konvertiere $FILE "
    dvgrab -input $FILE -f dv2 -s 0 -t
    done

    This generates an avi file (DV2 format) per each dv file in the current folder which can further converted without any audio sync problem (e.g. to mp4).
    Quote Quote  
  13. In my opinion it is always a good idea to treat the tracks individually and then remux them
    Quote Quote  



Similar Threads

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