Audio/video desync during encoding

skysaberer

Junior Member
Apr 11, 2014
4
0
0
I am having audio/video desync issues where the video seems to lag behind the audio by a split second. It seems to occur after I encode the video. The encoded video file plays fine on VLC and a little out of sync on WMP. However, when I upload to Youtube or Vimeo, it gets much worse (particularly on Firefox, though Chrome isn't too much better).

https://vimeo.com/91603896

I have tried many tests, but nothing seems to fix it. I did notice however that Mediainfo is saying my compressed video has a variable bit rate, yet I specified constant bit rate (320kbs). When I look in Premiere at the length, the audio appears slightly longer than the video, Mediainfo says 8:15 video vs 8:16 audio. This occurs when I encode with X264/AAC using Avisynth/Megui or Handbrake and even straight from Premiere using H.264/AAC. If I try encoding with WMV or using AC-3 or MP3 as audio codecs, it stays solid CBR and it seems more in sync.

While this suggests that soemthing is wrong, I still have no idea what is causing the audio/video desync and it is extremely frustrating.

Details below:

Original source: 1280x720, 120fps from a video game, audio is from a range of sources (mostly 44100 khz but some higher/lower sample rates)

Premiere sequence settings: 1280x720, 59.97 fps, progressive, square pixels, 48000khz, stereo

Export settings: Uncompressed AVI, 1280x720, progressive, square pixels, 59.97 fps (for downloadable copy) or 29.97 fps (for Youtube/Vimeo), 48000khz, stereo, 16 bit sample type

Avisynth script:

AVISource("J:\Final Render\59.94 fps\Vimeo\Part 1\Film Sequence Part 1.avi", audio=false).AssumeFPS(30000,1001)
#deinterlace
#crop
#resize
#denoise
ConvertToYV12(matrix="rec601")

Final encode settings:

General
Complete name : J:\Final Render\59.94 fps\Vimeo\Part 1\SWR Ep1 P1.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 434 MiB
Duration : 8mn 16s
Overall bit rate mode : Variable
Overall bit rate : 7 344 Kbps
Encoded date : UTC 2014-04-09 05:54:02
Tagged date : UTC 2014-04-09 05:54:02

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings, CABAC : Yes
Format settings, ReFrames : 5 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 8mn 15s
Bit rate : 7 000 Kbps
Maximum bit rate : 29.7 Mbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 29.970 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.253
Stream size : 415 MiB (96%)
Writing library : x264 core 138 r2358 9e941d1
Encoding settings : cabac=1 / ref=5 / deblock=1:-1:0 / analyse=0x3:0x113 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-3 / threads=12 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=4 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=30 / keyint_min=15 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=2pass / mbtree=1 / bitrate=7000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
Encoded date : UTC 2014-04-09 05:48:58
Tagged date : UTC 2014-04-09 05:54:02

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 8mn 16s
Bit rate mode : Variable
Bit rate : 320 Kbps
Maximum bit rate : 328 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 18.9 MiB (4%)
Encoded date : UTC 2014-04-09 05:50:04
Tagged date : UTC 2014-04-09 05:54:02


What I've tried (all without success):

-- Tried exporting at 30 fps
-- Tried resampling some clips at 44100khz and exporting at 44100khz
-- Tried different sample types
-- Tried encoding with Handbrake instead of Megui

I'm looking for a solution to this problem, no matter how tedious. The release of this movie has completely stalled and I'm quite concerned because I have no idea what the cause of the problem is to fix it.
 

Virgorising

Diamond Member
Apr 9, 2013
4,470
0
0
I use VSO ConvertXtoDVD and this issue can be easily fixed within it. But it's not cheap.
 

Virgorising

Diamond Member
Apr 9, 2013
4,470
0
0
I have VSO ConvertxtoDVD 4. What could I do with it and how would it help?


Hi again. Glad you have it. I run a later build, but as I recall, they fixed audio synch issues in 4. Pretty sure.

Open Settings. >Audio. Put a check in the do not fix audio discontinuities.

Pls let us know the result.
 

skysaberer

Junior Member
Apr 11, 2014
4
0
0
I'm not sure I understand though. The video is for Vimeo, not DVD. Also, the video plays fine on my system/when I download from Vimeo, it's on Vimeo itself that the audio gets out of sync.
 

Virgorising

Diamond Member
Apr 9, 2013
4,470
0
0
I'm not sure I understand though. The video is for Vimeo, not DVD. Also, the video plays fine on my system/when I download from Vimeo, it's on Vimeo itself that the audio gets out of sync.

Hi.

Sorry, just came in and caught this. I was unfamiliar with Vimeo until just now.

Note: Your title says your issue occurs during ENCODING.

Are U saying, when you watch the file on Vimeo that audio/video are out of synch? And, when U download the file and play it on yr system it is normal?

I am now not sure if its your file you encoded for upload or someone else's file, forgive me.

Have you been able to play video files on Vimeo with no such issue before?

Is the file in question one someone else uploaded there? Or, is it YOUR file you are uploading to share there?
Has this issue presented before?
 
Last edited:

Virgorising

Diamond Member
Apr 9, 2013
4,470
0
0
I just found this from 4 years ago:

http://vimeo.com/forums/topic:22163

Sorry, I am still not clear on yr problem as posted above, but, if the issue is about your encoding one of your files, uploading it and finding the out of synch issue when trying to watch it on this site, then, the issue could be theirs, not yours.
_________________________________________
Edit:

Just found this, a newer discussion:
http://vimeo.com/forums/help/topic:71767

Sorry, I don't convert and upload videos to share, but, if I did, I would try to find a site less demanding (and, it appears, buggy) about such as compression fps issues, etc.

Since you pay money to be a member of this site and the privilege of what it affords, you might consider posting in their forum. Nobody should have to jump thru hoops, or waste lifeminutes trying to figure out why a file they convert and upload to a site they pay to be a member of of, play normally on their equipment, but doesn't play normally there. If, that is, that is the reality.
 
Last edited:

Virgorising

Diamond Member
Apr 9, 2013
4,470
0
0
Addendum: Sorry, I only just saw this issue presents when you upload to uTube as well.

And, using yr link in yr initial post, I tried to play the Revelations video, and could not. But I am not a member of that site.

Sorry I can't be of real help in this. I am still confused re yr title premise yr problem is in encoding.

Hopefully, someone else might understand this better and be truly helpful.
 

skysaberer

Junior Member
Apr 11, 2014
4
0
0
Thanks for your help Virgorising. We really do appreciate your looking into the isssue.:)

We have decided to abandon our attempts to host the video on Vimeo. All videos we upload are slightly out of sync with the audio after numerous tests and similar posts on other forums have suggested the problem is on Vimeo's end.

We are instead hosting the video on Youtube (which itself has issues with judder during camera movement for some viewers due to Flash) and providing LQ/HQ download links.
 

Virgorising

Diamond Member
Apr 9, 2013
4,470
0
0
Thanks for your help Virgorising. We really do appreciate your looking into the isssue.

Very kind of you, given my delving did not bring anything of real help.

We have decided to abandon our attempts to host the video on Vimeo. All videos we upload are slightly out of sync with the audio after numerous tests and similar posts on other forums have suggested the problem is on Vimeo's end.

Good decision! And ask for a refund. Nobody should have to waste lifeminutes figuring out proprietary/esoteric encoding minutae cause a hosting site demands it cause they didn't do things right at their end.

We are instead hosting the video on Youtube (which itself has issues with judder during camera movement for some viewers due to Flash) and providing LQ/HQ download links.

U think it's only about camera movement? U think it's flash? Tons of complains online about issues playing after uploading even there.

Good luck!