|
|
| Djard |
| Posted: Nov 26 2013, 05:45 AM |
 |
|
Member
 
Group: Members
Posts: 16
Member No.: 26022
Joined: 17-August 09

|
I have a movie that suffers audio drift. The AV sync is OK at the beginning but by the end of the movie, the audio trails the video by about 750 ms. Yet "File Information" states that the video length is 1:44:37.65 and the audio is 1:42:32.83.
When I set "Audio skew correction" to delay the audio track by "-750 ms," the end of the movie is in perfect sync, but then the audio plays too early at the start.
So I tried slowing down the framerate incrementally but could not get it right. I gave up on that option after an hour.
Then I used the "Change so video and audio duration match" feature to make the A & V the same length. The asynchrony became much worse. Setting the "Audio skew correction" to delay -3100 got the start in sync but then the rest got so far off that the audio disappeared.
Can give me a little guidance? |
 |
| dloneranger |
| Posted: Nov 26 2013, 06:11 AM |
 |
|
Moderator
  
Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07

|
Yeah, audio skew just moves the audio forwards or backward as a whole You need to slow down the video or shrink the audio
Try multiplying your fps by 1.0000047788583307447850708465748 and changing the frame rate to that Or you can stretch the audio instead using the advanced audio filters - add input, time stretch, output - set time stretch value to 0.99999522116450663302366479336315
To get those numbers I used your figure for the video 1:44:37.65 and the .75 difference at the end
x= 1*60*60 + 44*60 +37 +.65 = duration in seconds for avi y= duration in seconds for avi + .75
x/y = ratio of difference in length
[edit] Don't trust my maths here, it was way too early in the morning Use the answers from people below who seem to have actually been awake
-------------------- MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask Windows7/8 Codec Chooser All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3 |
 |
| malky |
| Posted: Nov 26 2013, 11:33 PM |
 |
|
Advanced Member
  
Group: Members
Posts: 290
Member No.: 22386
Joined: 6-November 07

|
Help, I keep getting the wrong answer.
x=6277.65 y=6278.4
x/y=0.99988054281345565749235474006116 |
 |
| meowmeow |
| Posted: Nov 27 2013, 01:09 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 98
Member No.: 37160
Joined: 21-September 13

|
No, its 41851/41856=0.9998805(428134556574923547400611620795107033639143730886850152905198776758409785932721712538226299694189602446483180)
Sometimes I just mux into .mkv and players sync films correctly. Not sure why. |
 |
| dloneranger |
| Posted: Nov 27 2013, 05:35 AM |
 |
|
Moderator
  
Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07

|
Am I being mocked? It looks like I'm being mocked I am, I'm being mocked!!!!
Maths in the morning before I go to work is harder than it looks 
If you'll both submit your papers (with all the workings out!) I'll have them graded by friday @malky you'll lose half a point for the woefully small amount of digits @meowmeow wolfram alpha????
-------------------- MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask Windows7/8 Codec Chooser All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3 |
 |
| meowmeow |
| Posted: Nov 28 2013, 02:18 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 98
Member No.: 37160
Joined: 21-September 13

|
| QUOTE (dloneranger @ Nov 27 2013, 05:35 AM) | | wolfram alpha???? |
GNU Basic Calculator
| QUOTE | c:\BC\bin>bc meow.bc bc 1.06 Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. scale=2 x= 1*60*60 + 44*60 +37 +.65 y=x+.75 scale=300 meow(x,y) 41851/41856=.9998805428134556574923547400611620795107033639143730886\ 85015290519877675840978593272171253822629969418960244648318042813455\ 65749235474006116207951070336391437308868501529051987767584097859327\ 21712538226299694189602446483180428134556574923547400611620795107033\ 639143730886850152905198776758409785932720 quit
c:\BC\bin> |
Contents of meow.bc
| CODE | # License: LGPLv2 Author: http://www.pixelbeat.org/scripts/bc define gcd(x,y) { if (y==0) return x return gcd(y,x%y) }
# License: SFBTL (steal fast before too late!) Author: meowmeow define meow(e,w){ s=scale; e*=10^s; w*=10^s; scale=0; o=gcd(e,w); e/o; " / "; w/o; " = "; scale=s; return(e/w) } |
This post has been edited by meowmeow on Nov 28 2013, 11:37 AM |
 |
| Djard |
| Posted: Nov 28 2013, 06:21 AM |
 |
|
Member
 
Group: Members
Posts: 16
Member No.: 26022
Joined: 17-August 09

|
Wow, my calculator doesn't support that many digits. I can calculate Newtonian formulas in my head, like S=ut+1/2at squared, but you folks blow me away. I solved my problem as follows, but I will study the interesting option you kindly share of crunching the numbers.
Since slowing the video down to have the audio sync at the beginning AND the end was unlikely without a lot of time-consuming experimentation, my initial objective was to slow the video (by lowering the framerate) until the video latency at the start is the same as at the end of the movie. Remember that the movie was OK at the start but the audio drifted, lagging more and more behind the video. So if I synchronized the end by slowing down the video, the video would naturally lag behind the audio at the beginning. After two trials, a framerate of 23.972 fps had the video about 1/4 sec. behind the audio at both points, start and end.
Since the procedure is one of direct stream copy with no loss of video quality, I used the "Audio skew correction" feature to deleay the audio by 250 ms. I had already disabled "Sync to Audio" and "Audio/Video interleaving." I'm happy withy the result, not able to notice if there is any asynchrony at the start or end. Yay! |
 |
| meowmeow |
| Posted: Nov 28 2013, 06:44 AM |
 |
|
Advanced Member
  
Group: Members
Posts: 98
Member No.: 37160
Joined: 21-September 13

|
| QUOTE (Djard @ Nov 28 2013, 06:21 AM) | | I had already disabled "Sync to Audio" and "Audio/Video interleaving." | Sync to audio disables forced sync in VD preview mode only. For vbr mp3 probably. Disabling interleaving actually disables AVI, writing audio in single block, making it unplayable for CD players I think. |
 |
| Djard |
| Posted: Nov 29 2013, 08:49 PM |
 |
|
Member
 
Group: Members
Posts: 16
Member No.: 26022
Joined: 17-August 09

|
Thanks for the help.
I get the sense that something is loose in packaging: after synchronizing the AV in VD, I played the movie with MPC. The start and end remained synchronized. I then corrected the DAR with XMediaRecode, choosing the MP4 format. After converting the movie to DVD with ConvertX, I noticed the audio was delayed by 175 ms. Aaargh! So I converted again, using ConvertX's "Offset" feature, set at -175 ms to correct the new skew. I then burned to a rewritable disc and viewed the start and end on my TV. I was thrilled to find no discernable asynchrony. I just wonder how a movie can be so messed up: out of sync and aspect ratio way off.
Regarding the disabling of audio interleaving, Mediainfo reports the following, with 2 minutes disparity between the audio and video, yet the AV is synchronized. My guess is that someone trimmed the start:
General Complete name : C:\DVD_TMP\My_Movie.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom File size : 1.88 GiB Duration : 1h 44mn Overall bit rate : 2 568 Kbps Encoded date : UTC 2013-11-28 01:53:44 Tagged date : UTC 2013-11-28 01:53:44 Writing application : Lavf55.19.100
Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : Main@L4.1 Format settings, CABAC : Yes Format settings, ReFrames : 2 frames Codec ID : avc1 Codec ID/Info : Advanced Video Coding Duration : 1h 44mn Bit rate : 2 437 Kbps Nominal bit rate : 2 600 Kbps Width : 720 pixels Height : 404 pixels Display aspect ratio : 16:9 Original display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 23.976 fps Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.349 Stream size : 1.78 GiB (95%) Writing library : x264 core 138 r2345 Encoding settings : cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x1:0x131 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=230 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=2600 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=69 / qpstep=4 / vbv_maxrate=24000 / vbv_bufsize=24000 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00 Language : English Encoded date : UTC 2013-11-28 01:53:44 Tagged date : UTC 2013-11-28 01:53:44
Audio ID : 2 Format : AC-3 Format/Info : Audio Coding 3 Mode extension : CM (complete main) Format settings, Endianness : Big Codec ID : ac-3 Duration : 1h 42mn Bit rate mode : Constant Bit rate : 128 Kbps Channel(s) : 6 channels Channel positions : Front: L C R, Side: L R, LFE Sampling rate : 48.0 KHz Bit depth : 16 bits Compression mode : Lossy Stream size : 93.9 MiB (5%) Language : English Encoded date : UTC 2013-11-28 01:53:44 Tagged date : UTC 2013-11-28 01:53:44 |
 |