![]() |
[HELP] MKV (H.264/ACC) for Plex audio sync issues - Printable Version +- Selur's Little Message Board (https://forum.selur.net) +-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html) +--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html) +--- Thread: [HELP] MKV (H.264/ACC) for Plex audio sync issues (/thread-1331.html) Pages:
1
2
|
MKV (H.264/ACC) for Plex audio sync issues - evillink - 29.04.2020 Hello everyone, I’ve been trying out Hybrid for the past 3 months and found it to be awesome to have so many tools integrated into one place. My goal is to transfer all of my family’s VHS to DVD, I have capture the master file in VirtualDub using huffyuv as the compression method, the resulting AVI is then processed using Avidemux to create a compliant DVD file and everything works as expected, I get a really good end product with audio and video in sync. My other task was to convert the master file to an H.264 for my Plex server and this is where things get a bit weird. I tried Avidemux and even though the resulting file has no audio video sync problems, the deinterlacing algorithms available are not really good, at least not compared to QTGMC script. So, Hybrid to the rescue, not only does it allow me to encode to H.264 and AAC, add my chapters, but I can run QTGMC with bob using VapourSynth or AviSynth. Problem is, in the resulting MKV file, the audio is progressively out of sync. An hour into the video the audio lags about 1s, I really don’t know what’s causing the problem. I tried encoding the video alone with audio passthrough, not applying any filtering, different encoding modes (2pass/CRF) all under the same profile Hight 4.1 Slow and every time the result is the same audio sync problem. The only way I’ve managed to complete my task is by using Hybrid to apply QTGMC filter and output to FFvHuff with audio passthrough (doubling the file size from 30 to 60 GiB) and then use AviDemux to do the actual H.264 encoding, resulting in a synced mkv file. Question is… why do I get this issue in Hybrid? Hopefully someone can help shed some light on why is this happening. Additional information Hybrid 2020.02.17.1 x264 --preset slow --crf 18.00 --profile high --level 4.1 --sync-lookahead 12 --vbv-maxrate 62500 --vbv-bufsize 78125 --sar 20:11 --qpfile GENERATED_QP_FILE --non-deterministic --range tv --colormatrix bt470bg --demuxer raw --input-res 352x480 --input-csp i420 --input-range tv --input-depth 8 --fps 30000/1001 --output-depth 8 --output "C:\Users\f\AppData\Local\Temp\clip.264" – MediaInfo for the original AVI file General RE: MKV (H.264/ACC) for Plex audio sync issues - Selur - 29.04.2020 At least I would need a sample file which allows me to reproduce the issue to figure out what is causing the issue and how to work around it. Cu Selur RE: MKV (H.264/ACC) for Plex audio sync issues - evillink - 29.04.2020 (29.04.2020, 20:55)Selur Wrote: At least I would need a sample file which allows me to reproduce the issue to figure out what is causing the issue and how to work around it.Thank you for fast response Selur, I could provide you with a sample clip cause the entire file is 30GiB but I don't know if the issue will appear if the clip is too short, as it begins to be noticeable the longer the file is. In any case I will prepare a clip and upload it so you can try and reproduce the error. Thank you for your time. RE: MKV (H.264/ACC) for Plex audio sync issues - Selur - 30.04.2020 No problem, send me a link via PM and I'll look into it after work. Cu Selur RE: MKV (H.264/ACC) for Plex audio sync issues - evillink - 11.05.2020 (30.04.2020, 05:28)Selur Wrote: No problem, send me a link via PM and I'll look into it after work.Good morning Selur, I’m quite sorry for the delay of my response but it’s been kind of hectic these past days, I also wanted to run a few more test to try and make sure this same issue happen on other sources, which it did. Like I said before my source file is a 30GiB 352x480 Huffyuv AVI capture using VirtualDub, and since its not possible for me to upload that file what I did was cut two clips one with just random footage (Tik.avi) and the second one with a person talking (Tok.avi). Then I combined the two files Tik.avi (x2) + Tok.avi (x1) until I got different length videos and ran them through the same process on Hybrid MKV[(x264 CRF 20), (AAC LC FDK) and (QTGMC Bob), (PAR 20:11)] and for short clips 5, 10, 15, 20, 30, 45 minutes the audio pretty much stays in-sync. I then created a 30GiB file following the same pattern two Tik.avi and one Tok.avi, repeated until I got about 2 hours of footage (the actual length of my VHS tapes) and that’s then the problem appears, you can see how the parts when the person speaks slowly goes out of sync towards the end of the video. I uploaded the two files to: https://www.dropbox.com/sh/df38hmdkwahylgc/AABiqHF_AQ90EQCMuiSVqGjaa?dl=0 Thanks for your support and dedication to Hybrid. PS. System specs AMD Ryzen 5 PRO 2400GE (Radeon Vega Graphics) 3.20GHz 16GiB RAM 256GiB NVMe Win 10 Pro 64-bit (1903) RE: MKV (H.264/ACC) for Plex audio sync issues - Selur - 11.05.2020 How did you append the files? Did you make sure to create OpenDML avi files, otherwise anything beyond 2GB will make problems? RE: MKV (H.264/ACC) for Plex audio sync issues - evillink - 12.05.2020 (11.05.2020, 22:51)Selur Wrote: How did you append the files?I tried two different ways with the same result. The first was using VirtualDub to append AVI segment and then just saved the AVI with direct stream copy for both audio and video. I did the same using AviDemux Append and direct copy to Avi Muxer selecting OpenDML. RE: MKV (H.264/ACC) for Plex audio sync issues - Selur - 13.05.2020 I'll try to reproduce this later today. Cu Selur RE: MKV (H.264/ACC) for Plex audio sync issues - Selur - 13.05.2020 While encoding a 34gb file I created by appending these two files I thought I found the problem. Those files seem to be vfr and interlaced which is a bad combi. Looking at the time codes of the file Toki.avi file: # timecode format v2 Everything seems to be okay since in average one would still get 33.6ms per frame (= 3000/1001 fps), but my guess is that your source might have larger glitches in the time codes which might be what causes the problem. Since the source isn't flagged as vfr Hybrid assumes it to be cfr and uses the average fps. So the obvious solution would be to tell Hybrid to simply use the time codes of the input and be done with that. Problem is that as soon as you change the frame count that isn't possible any more. So whenever you bob or interpolate to another frame rate and thus change the frame count the input frame count would be ignored by Hybrid. Since Hybrid handles audio and video separately it's not really capable of compensating this delay FFmpeg or Handbrake based tool might be better suited for this, but my guess is that anything that is Vapoursynth or Avisynth based won't be able to bob and keep the content sync. So now after encoding the file I looked at the output and the output plays sync here. (I looked at the woman speaking at the end of the clip.) Here's a link: https://drive.google.com/open?id=1mWwA1xMzbDgs0FiPbaHERjiWCZzIEi0r to the 4,4GB file I encoded. Some glitches in the time codes might still be the cause of your sync issues, but with the given files I'm not able to reproduce the issue. So my recommendation would be to try a Handbrake or FFmpeg based tool which encodes Audio&Video at the same time and thus can to better error handling. Cu Selur Ps.: To be sure that you can use the same tools I used I'll send you a link via PM to my current dev version that I used to encode the file. RE: MKV (H.264/ACC) for Plex audio sync issues - evillink - 20.05.2020 I’m finally back, it took me a while to try and understand and test out everything you pointed out. I’m far from an expert on many of the topics you clearly have profound knowledge on. First, I checked my source and capture another VHS to the same container and same compression (AVI/Huffyuv) and they are in fact interlaced cfr and not vfr. Does AVI container even allow vfr? I was under the assumption it didn’t. Second, I used ffmpeg and ffprobe to get the timecodes for each frame (I did it by hand on the Tik and Tok files by copying and pasting form VirtualDub status bar and it was a horrible experience) and the results were same ones you found, each frame is around 33.3667 [33-34], no major jumps or glitches. Is there a better approach to extract timecodes? What I did found is that I have some in-between shots that caused frame drops during capture, that lead me to believe that was the cause of all problems, but:
I really appreciate your help Selur |