VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 30 of 30
Thread
  1. Member
    Join Date
    Dec 2011
    Location
    England
    Search PM
    Hey everyone,

    So I'm having the most irritating problem with Youtube. No matter what I do, everything I upload is about 1 frame out of sync (specifically the audio is 1 frame late). I'm exporting in h.264 and I've trawled dozens of forums (surprisingly little info on this) and tried everything I can think of:

    Using CBR for both the video and the audio.
    Changing the audio frequency to match Youtube standard.
    Converting with Sorenson Squeeze and Handbrake instead of the Adobe Media Encoder (including using Sorensen's built-in Youtube preset).
    Converting using Quicktime and a .mov container.
    Re-muxing the audio in Virtualdub and exporting to AVI via direct sream copy, (using a WAV, an mp3, and an audacity-made ACC).

    I've also run Mediainfo on my files to check for any offset in milliseconds between the audio and the video, there is none.

    In every case I've downloaded the mp4 from Youtube and matched waveforms in Premiere to check (though I can easily tell by ear that it's off), and it's consistently 1 frame out.

    My very last resort is to deliberately offset the audio before I export, but I really don't want to do that as I know Youtube periodically re-encodes things and/or changes it's format settings, and if they do something that fixes the problem I'm left with unfixable audio that comes early instead of late.

    1 frame might not sound like a big deal... but when you edit for people who play fast music, and everything is multicam synced to beats, it really can be. :S

    Any help anyone could give would be GREATLY appreciated.

    Many Thanks
    Quote Quote  
  2. Member
    Join Date
    Jun 2003
    Location
    United Kingdom
    Search Comp PM
    If you're only 1 frame out on your audio-to-video on YouTube, Thank Your Lucky Stars!
    Quote Quote  
  3. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    I can think of only one possible explanation: YouTube's AAC encoder has become worse than Nero, regarding the audio delay thing

    You can try to minimize/eliminate the problem by uploading the *original* UN-compressed audio

    ( N.B., IF the original audio was lossily-compressed already, then this trick WILL NOT work,
    unless you manually remove the encoder audio delay ).
    Quote Quote  
  4. Member
    Join Date
    Dec 2011
    Location
    England
    Search PM
    I tried muxing it with a WAV rendered from the timeline... and it was actually more in-sync with the timeline than any of my h.264s (which are all out by 0.5 of a frame anyway, god knows why :S). Youtube still put it a frame out though.

    Edit: Basically from the timeline I export to h.264 with ACC audio, which then puts the audio out by +0.5 frames, I then upload to youtube which adds another +1 frame delay, so the total delay is +1.5 frames from the timeline OR I export to h.264 + wav and mux them together which eliminates the 0.5 frame delay then upload to Youtube which adds it's customary + 1 frame delay, so it's still out by 1 frame total.

    The fact that compressing to h.264 alone puts it out by +0.5 frames is is a different issue though, unrelated to Youtube (not that I would mind knowing why that happens either. :S)

    Also to Kbeee, arf XD I am definitely getting that impression already. :P
    Last edited by Locke; 18th Jul 2013 at 16:40.
    Quote Quote  
  5. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Originally Posted by Locke View Post
    I tried muxing it with a WAV rendered from the timeline... and it was actually more in-sync with the timeline than any of my h.264s (which are all out by 0.5 of a frame anyway, god knows why :S).

    .......

    The fact that compressing to h.264 alone puts it out by +0.5 frames is is a different issue though
    So the problem must be in the APPLICATION that you're using --- apparently it adds an unnecessary audio delay during the multiplexing process
    Quote Quote  
  6. Member
    Join Date
    Dec 2011
    Location
    England
    Search PM
    I've used Sorenson, AME and Handbrake, and they all add it. :S Anyway that's still completely separate from Youtube moving everything off an extra frame.
    Quote Quote  
  7. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    How about a link to one of your creations ?

    I bet that few could distinguish an audio delay of one frame. One second sure. But one frame ?
    Quote Quote  
  8. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Originally Posted by Locke View Post
    I've used Sorenson, AME and Handbrake, and they all add it.
    I wasn't aware of that Fortunately I use only Avisynth, VirtualDub, x264.exe, wvc1enc, HCenc, ffmpeg, etc
    Quote Quote  
  9. Most audio codecs I've used add a small delay to the audio.
    Quote Quote  
  10. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Originally Posted by jagabo View Post
    Most audio codecs I've used add a small delay to the audio.
    Very true --- however in my first reply I didn't consider the O.P. might be unaware of the problem

    Lossy audio compression schemes that are based on overlapping time/frequency transforms add a small amount of padding silence to the beginning and end of each track. These silences increase the playtime of the compressed audio data. If not trimmed off upon playback, the two silences played consecutively over a track boundary will appear as a pause in the original audio content. Lossless formats are not prone to this problem.

    For some audio formats (e.g. Ogg Vorbis), where the start and end are precisely defined, the padding is implicitly trimmed off in the decoding process. Other formats may require extra metadata for the player to achieve the same. The popular MP3 format defines no way to record the amount of delay or padding for later removal. Also, the encoder delay may vary from encoder to encoder, making automatic removal difficult. Even if two tracks are decompressed and merged into a single track, a pause will usually remain between them.
    {
    http://en.wikipedia.org/wiki/Gapless_playback#Compression_artifacts
    }
    Quote Quote  
  11. Member
    Join Date
    Dec 2011
    Location
    England
    Search PM
    Ah, so it's an intrinsic part of the compression process for audio, ok. Yah sorry, I didn't realize that, though I was guessing it might be something of that nature. Sorry, I think I misunderstood your point about applications and multiplexing. I did try converting the wav in audacity to various formats, and delay was added just to the audio stream every time, but not much, quite likely as you say just part of the process.

    That tiny tiny 0.5 bit of padding I can live with though, it's just Youtube's 1 frame offset that bugs me. :S

    There may be no solution... it might just be the best it's gonna get via Youtube, but I dunno, one frame sounds silly but when you're editing something like a music video, you really do work to get it frame perfect for the cuts, especially if it's fast and has a lot of beats... it's subtle but it is noticeable. :S
    Quote Quote  
  12. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    It does not 'sound' silly. It is silly.

    But if you will not refernce to actual samples - maybe original and yt version - then what hope do you have.
    Quote Quote  
  13. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    To my un-trained ear and dodgy eyes, I could not detect any issues. It is also quite a short sample so might not be the best to compare.

    I am a little concerned about the original vid with an odd interleave pattern >> 1.2 frames and a preload of 500 ms. These might be confusing the yt converter
    Quote Quote  
  14. Rewrap it into mkv before uploading (e.g. use mkvtoolnix) , and you will reduce the audio offset delay

    Right now the YT downloaded version is about 60-70ms , If you upload it as mkv, the YT downloaded version will be about 30-40ms
    Quote Quote  
  15. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Originally Posted by DB83 View Post
    .......
    I am a little concerned about the original vid with an odd interleave pattern >> 1.2 frames and a preload of 500 ms. These might be confusing the yt converter
    Well-spotted, DB83 Here is a previous example of how "stupid" YouTube's compressor may go:

    https://forum.videohelp.com/threads/357071-Video-Resolution?p=2251741&viewfull=1#post2251741

    And just for a comparison, a MediaInfo about one of my typical Youtube uploads:

    Code:
    Complete name                            : W:\YouTube\OKs\kisarah-vs-king.avi
    Format                                   : AVI
    Format/Info                              : Audio Video Interleave
    File size                                : 67.7 MiB
    Duration                                 : 2mn 23s
    Overall bit rate                         : 3 951 Kbps
    Writing library                          : VirtualDub build 32842/release
    
    Video
    ID                                       : 0
    Format                                   : VC-1
    Codec ID                                 : WMV3
    Codec ID/Info                            : Windows Media Video 9
    Codec ID/Hint                            : WMV3
    Duration                                 : 2mn 23s
    Bit rate                                 : 2 527 Kbps
    Width                                    : 640 pixels
    Height                                   : 480 pixels
    Display aspect ratio                     : 4:3
    Frame rate                               : 30.000 fps
    Bit depth                                : 8 bits
    Compression mode                         : Lossy
    Bits/(Pixel*Frame)                       : 0.274
    Stream size                              : 43.3 MiB (64%)
    
    Audio
    ID                                       : 1
    Format                                   : PCM
    Format settings, Endianness              : Little
    Format settings, Sign                    : Signed
    Codec ID                                 : 1
    Duration                                 : 2mn 23s
    Bit rate mode                            : Constant
    Bit rate                                 : 1 411.2 Kbps
    Channel(s)                               : 2 channels
    Sampling rate                            : 44.1 KHz
    Bit depth                                : 16 bits
    Stream size                              : 24.2 MiB (36%)
    Interleave, duration                     : 33 ms (1.00 video frame)
    Interleave, preload duration             : 500 ms
    Quote Quote  
  16. Member
    Join Date
    Dec 2011
    Location
    England
    Search PM
    I will try the MKV thing - many thanks. Is there any way to alter the interleave pattern and preload? I'm afraid that's beyond my technical knowledge. :S

    Also thanks for the ideas thus far.
    Quote Quote  
  17. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Originally Posted by Locke View Post
    Is there any way to alter the interleave pattern and preload?
    Yes$S, just use a decent AVI multiplexer, such as VirtualDub or AVI-Mux GUI
    Image Attached Images  
    Quote Quote  
  18. Member
    Join Date
    Dec 2011
    Location
    England
    Search PM
    I tried that, even with 1 frame selected, it was interleaving every 45ms (1.12 frames), so I forced it to interleave every 40ms, and still no difference until I removed the preload as well... but still the same effect from Youtube.
    Quote Quote  
  19. Member DB83's Avatar
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    I may be clutching at straws here but when I ran the original vid through mediainfo it was reported as NTSC despite 25 fps. Now we all know that NTSC is 30 fps (rounded up) so if you are attempting a conversion from NTSC to PAL you could end up with this odd interleave where the .2 of the frame is an attempt at a correction from 30 fps down to 25 fps.

    The original source is Brazil ? Yes. That is neither pure NTSC or pure PAL. So I just wonder if that is where the problem lies.
    Quote Quote  
  20. Member
    Join Date
    Dec 2011
    Location
    England
    Search PM
    The stuff I'm filming is Brazilian music, but that intro was made from scratch by me, so there was no conversion anywhere in the workflow. =( That being said... I have no idea why it's reporting it as NTSC. o.O I made it in AE with the HDV 720/25fps setting. I tried the MKV thing as well, and even that made no difference... what the hell Youtube. xD
    Quote Quote  
  21. Originally Posted by Locke View Post
    I tried the MKV thing as well, and even that made no difference...
    It makes a difference of about 20ms .

    40ms is 1 frame for 25fps video

    But typical human might not be able to detect 20-40ms differences (of course it varies widely) .

    Click image for larger version

Name:	compare.png
Views:	195
Size:	31.4 KB
ID:	18941
    Quote Quote  
  22. Member
    Join Date
    Dec 2011
    Location
    England
    Search PM
    I loaded the avi into mkvmerge and re-wrapped it to MKV... and I also tried it with the mp4 and the WAV seperated... but I don't get the same result as you there, it's still a whole frame off. I might be being very silly somewhere and doing it wrong?
    Quote Quote  
  23. Originally Posted by Locke View Post
    I loaded the avi into mkvmerge and re-wrapped it to MKV... and I also tried it with the mp4 and the WAV seperated... but I don't get the same result as you there, it's still a whole frame off. I might be being very silly somewhere and doing it wrong?

    It doubt you're doing anything wrong.

    Look at the waveforms. It's still about 35ms off. Recall 40ms is 1 frame for 25fps video. So it should be about 1 frame off

    It's just that 35ms off is better than 70ms off (about 1.75 frames)
    Quote Quote  
  24. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Just another wild guess (and actually a not so minor possibility), YouTube may have designed itself for being picky against "H264 in AVI" Technically there is NOTHING wrong with H264-in-AVI, but considering Google and YouTube are programmed mainly by Linux trolls (but I'm serious, I mean it).
    Quote Quote  
  25. Member
    Join Date
    Dec 2011
    Location
    England
    Search PM
    I did check the waveforms, I uploaded the MKV, downloaded it again, did likewise with the AVI and... exactly the same, not even 1/2 frame of difference, unfortunately. They are both offset from the original file by exactly 1 frame.

    Edit: Wait a second... where did you get the 1.75 frames out figure from? Aah ok, I think we have the same offset in our MKVs, but for some reason you got a larger offset in your AVI test, that's really weird.

    El Heggunte - Also possible, but I did many many tests with MP4s before I tried the AVI. =( I read somewhere else that VBR audio was a likely candidate, so I tried with CBR video + CBR audio and still no joy.
    Last edited by Locke; 19th Jul 2013 at 19:13.
    Quote Quote  
  26. Originally Posted by Locke View Post
    I did check the waveforms, I uploaded the MKV, downloaded it again, did likewise with the AVI and... exactly the same, not even 1/2 frame of difference, unfortunately. They are both offset from the original file by exactly 1 frame.

    Edit: Wait a second... where did you get the 1.75 frames out figure from? Aah ok, I think we have the same offset in our MKVs, but for some reason you got a larger offset in your AVI test, that's really weird.

    The 1.75 is a calculation from your YT video ; 70ms/40ms per frame = 1.75 frames - that was an approximation just looking at the audio waveform in audacity . I'm looking at the difference between the beginning of the waveform compared to the original's waveform . e.g. if the original waveform starts at 0.25 seconds, and your youtube version starts at 0.32 seconds, the difference is 0.07seconds, or 70ms.

    Different decoders might compensate slightly (e.g. it might be a few ms different in flash, vs . premiere, vs. audacity vs. some other program or media player) , but there is definitely a difference, and the relative trend will still be there (ie YT version slightly worse the the re-wrapped MKV YT version)

    Here is the file I re-wrapped (I used an older mkvmerge version v5.4, but I doubt it makes a difference - I have no idea why you're getting different results, but you can find old versions here https://www.videohelp.com/tools/MKVtoolnix/old-versions#download )
    "1.mkv"

    Here is the MKV rewrapped download from YT (using IDM)
    "1 - YouTube.mp4"


    Same trend in premiere
    track 1 is your YT version or "Clube do Choro UK - Clube do Choro UK Intro 25 fps wav [H.264 720p].mp4"
    track 2 is the MKV rewrapped YT download or "1 - YouTube.mp4"
    track 3 is the original or "Clube do Choro UK Intro - 25 fps Muxed WAV.avi"

    Click image for larger version

Name:	premiere.jpg
Views:	3014
Size:	69.9 KB
ID:	18948
    Image Attached Files
    Last edited by poisondeathray; 19th Jul 2013 at 19:55.
    Quote Quote  
  27. Member
    Join Date
    Dec 2011
    Location
    England
    Search PM
    Ah yes ok I see the same thing now.

    http://www.harmonyinautumn.com/Sync/Clube%20do%20Choro%20UK%20-%20Clube%20do%20Choro%2...%20720p%5d.mp4

    This is a newer AVI exported from Virtualdub and then downloaded from Youtube - I've managed to get my AVI files to also eliminate the extra. Everything is +/1 one frame now, is why I was confused for a bit.

    It's definitely closer.

    I really appreciate your efforts on this. =)

    That very last frame of delay... I'm beginning to think it is an unavoidable part of Youtube's conversion process at this point.
    Quote Quote  
  28. Member turk690's Avatar
    Join Date
    Jul 2003
    Location
    ON, Canada
    Search Comp PM
    Originally Posted by Locke View Post
    So I'm having the most irritating problem with Youtube. No matter what I do, everything I upload is about 1 frame out of sync (specifically the audio is 1 frame late)...
    I regularly edit and author programs ultimately intended to be put on blu-ray disc, DVD & YouTube that include multi-cam sources and audio sources, all independent, no professional common sync gen; I also use material that may have different frame rates and audio sampling rates coming from elsewhere. The potential for video not in sync with audio is ever present along the way: from actual shoot to NLE to encoding to authoring. It takes great imagination as well as some professional trickery to keep audio and video in sync for final output. I have never received a complaint yet about out-of-sync on the discs I made, and have noted that
    • The vast majority of viewers are not sensitive to video out-of-sync with audio if it's just 1 frame (just over 30ms)
    • Out-of-sync starts to get bothersome for most once it gets above 4 or 5 frames worth (>100ms)
    • Viewers who are gluttons for punishment can actually withstand >10frames delay (>300ms) before they get antsy
    • There can indeed be out-of-sync situations on some clips or portions of the whole edited program, but IMHO they are not worth making a fuss over if they occur on such parts like credits at the end of the program, incidental music accompanying a clip, etc.
    In the two to three-hour long programs I make, at various few points in them there can be at most 2 frames worth of out-of-sync. They are hardly noticeable while watching the disc, but just the same, it's easy to mask these portions by
    • not using a close-up video clip with its corresponding audio at that point, especially if it involves talking or singing, leaving the audio in place on the NLE but replacing the clip with another related video (of long shots, audience reactions shots, background shots)
    • using music or other effects in place of the original audio at the out-of-sync point
    I would be thankful, YouTube notwithstanding, if all I ever had to contend with was a wretched delay of 1 frame.
    Last edited by turk690; 20th Jul 2013 at 00:54.
    For the nth time, with the possible exception of certain Intel processors, I don't have/ever owned anything whose name starts with "i".
    Quote Quote  
  29. Originally Posted by Locke View Post
    That very last frame of delay... I'm beginning to think it is an unavoidable part of Youtube's conversion process at this point.
    That was pretty conclusively established in post #10.

    Lossy audio compression schemes that are based on overlapping time/frequency transforms add a small amount of padding silence to the beginning and end of each track.
    Quote Quote  



Similar Threads