digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Restore, Filter, Improve Quality (https://www.digitalfaq.com/forum/video-restore/)
-   -   Audio desync in Hybrid encoding with ffmpeg? (https://www.digitalfaq.com/forum/video-restore/14856-audio-desync-hybrid.html)

oddmykyta 12-26-2024 07:26 AM

Audio desync in Hybrid encoding with ffmpeg?
 
I guess its a question right away to Selur but maybe someone did deal with that.
Now with my workflow created in Hybrid the only problem that appears is bad audio sync with larger files after processing in hybrid. For example - 10-20 min video sample can work flawlessly, but when it comes to processing the whole tape - 1 hour .avi to prores with the spectre of filtering its just doesnt work well. i cant upload samples because the files are too large. I guess its due to a slight frames loss but mediadata doesnt show that. Maybe the solution would be to cut to shorter clips but i dont know how do i do this loselessly - Vdub directly? I dont wanna capture again. Thanks in advance.

Selur 12-26-2024 12:09 PM

Try, whether it helps to enable:
  • Config->Input->Decoding->CFR output
  • if you have a vfw decoder for your source try AviSource (Filtering->Vapoursynth->Misc->Source->Prefer AviSource for .avi input) as source filter (also try other source filters)
  • 'Config->Internals->Automation->Always extract timecodes from input' + disable 'only some'
You could also enable 'Config->Containers->General->Keep intermediate files' this way you can check whether the extracted audio has the correct length. You might also want to check the Vapoursynth Preview to see whether everything gets decoded propers.

Cu Selur

oddmykyta 12-26-2024 12:13 PM

used avisynth for everything. length is same, the preview code looks ok, will attach it later. thank u

Selur 12-27-2024 07:17 AM

Quote:

used avisynth for everything
Why?
Quote:

the preview code looks ok
Does the preview too?
Quote:

will attach it later.
don't bother for me, since I will not look at the script (since it doesn't hold all the additional info a debug output holds)

Cu Selur

oddmykyta 12-27-2024 04:34 PM

1 Attachment(s)
tried again, seems to be not that bad but there are still problems with sync. its not about the length - but frame dropping i believe. attaching the debug output now. (Im using avysynth since one part of the process cant be done with vps)

ThumperStrauss 01-05-2025 12:50 PM

In the past, my H.264 (mp4) files have an audio skew over time. But when I switched to ProRes (mov) the problem disappeared. It was a few versions ago, so I don't think I get this issue anymore. But in general, I like outputing to ProRes as I sometimes import the video into DaVince Resolve for color work before outputing to H.264.

Selur 01-09-2025 09:43 AM

About out of order or missing frames with avi(lagaright): try using AviSource, assuming you have a 64bit vfw decoder in your system.

About the not possible in Vapoursynth:

Your Avisynth code:
Code:

last=clp
U = UtoY() # separate U channel (should be: 360x288)
V = VtoY() # seprate V channel (should be: 360x288)

V = Crop(V,0,0,-16,-0) #remove discolore portion and black border  (should be: 344x288)
extra=FlipHorizontal(V).Crop(0,0,12,-0) # the last 12 pixels of the V channel reflected  (should be: 332x288)
V=StackHorizontal(V,extra).AddBorders(0,0,4,0,$808080) # add the extra, pad to 720 with grey (should be: 668x288)

YtoUV(U, V, last) # mix the separate U and V with the original
return last

can be straight forward ported to Vapoursynth:
Code:

# Separate U and V channels
U = core.std.ShufflePlanes(clip, planes=1, colorfamily=vs.GRAY)  # Extract U plane
V = core.std.ShufflePlanes(clip, planes=2, colorfamily=vs.GRAY)  # Extract V plane

# Process the V channel
V_cropped = core.std.CropRel(V, right=8)  # Remove discolored portion and border
extra = core.std.FlipHorizontal(V_cropped).std.CropRel(left=V_cropped.width - 6)  # Reflect last 6 pixels
V_extended = core.std.StackHorizontal([V_cropped, extra])  # Stack the reflected pixels
V_padded = core.std.AddBorders(V_extended, right=2, color=[128])  # Pad with grey to original width

# Combine U, V, and the original luma
return core.std.ShufflePlanes(clips=[clip, U, V_padded], planes=[0, 0, 0], colorfamily=vs.YUV)

in Vapoursynth.

Cu Selur

araset 01-09-2025 02:42 PM

Hi I have problem when trying do deinterlace video with bwdif audio is going out of sync. AVI file is ok. I am usung current Hybrid and ProRes format.

Selur 01-10-2025 07:24 AM

Without any proper details: no clue.
Wild guess: some problem with the used source filter and the source or some vfr issues.

araset 01-13-2025 04:09 AM

What details should I provide?

Selur 01-13-2025 07:46 AM

https://www.selur.de/support <- most importantly a debug output and ideally a sample file which allows reproducing the problem.

Cu Selur


All times are GMT -5. The time now is 05:07 PM

Site design, images and content © 2002-2026 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2026 Jelsoft Enterprises Ltd.