VideoHelp Forum
+ Reply to Thread
Results 1 to 21 of 21
Thread
  1. Hi all

    I am unregularly suffering from a few out-of-order frames when using Avisynth++ and multitreading.

    I am using the latest Avisynth++ and importing the latest mtmodes.avsi. My current script that sometimes brings issues (not always and when doing multiple encodes at different places) looks like:

    Code:
    FFmpegSource2("00002.m2ts", atrack=1)
    
    AssumeTFF()
    QTGMC(Preset="Slower").SelectEven()
    
    Crop(8,0,-8,-0)
    Spline36Resize(768,576)
    Crop(8, 2, -2, -2)
    
    aWarpSharp2(depth=5, thresh=120)
    Sharpen(0.25)
    xaa()
    
    PreFetch(20)
    What could be the issue here? Should MT just not be used at all to be totally sure to have no wrong frames?
    Thanks for your help.
    Quote Quote  
  2. What could be the issue here?
    FFmpegSource2 having problems with the source,...
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  3. Should I use LSMASH/LWLibav in that case?
    Quote Quote  
  4. Kawaiiii
    Join Date
    May 2021
    Location
    Italy
    Search Comp PM
    Originally Posted by Roemer View Post
    Should I use LSMASH/LWLibav in that case?
    With MPEG streams it is always better to use a specific source, such as D2VSource .. using .d2v file indexed by DgIndex. Other sources (not meant for mpeg) have troubles dealing with mpeg streams.
    Quote Quote  
  5. If you got an NVIDIA card, DGDecNV (which is free nowadays) is also a good alternative, but LibavSource would be worth a try.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  6. I tried LSmash with LibavSource2 and I still got a few single broken frames.
    Quote Quote  
  7. Have you tried LWLibavSource while enabling hardware decoding support? (especially with vc-1 sources this might help)
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  8. Also try FFVideoSource (threads=1) , and LWLibavVideoSource (threads=1)
    Quote Quote  
  9. Originally Posted by Selur View Post
    Have you tried LWLibavSource while enabling hardware decoding support? (especially with vc-1 sources this might help)
    I'm running in it in a VM on a dell server so I guess there is no hardware support as I don't have a GPU in the server (yet). But I have 20 cores in there so I do use heavy multithreading with at least Prefetch(20). Might it be that some plugins do not work correctly although I am using the mtmodes.avsi?
    Quote Quote  
  10. Might it be that some plugins do not work correctly although I am using the mtmodes.avsi?
    sure.

    But I would try the suggestion from poisondeathray.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  11. Originally Posted by poisondeathray View Post
    Also try FFVideoSource (threads=1) , and LWLibavVideoSource (threads=1)
    Ok I can give that a try. Is this supposed to help with frame ordering issues? Also is there any reliable way I can use to tell if frames are out of order beside just watching a full clip and hoping not to blink at the wrong time?
    Quote Quote  
  12. Is this supposed to help with frame ordering issues?
    It's supposed to help with decoding issues caused by multithreading in the decoder.

    Regarding FFmpegSource, did you read it's limitations?
    http://avisynth.nl/index.php/FFmpegSource

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  13. Originally Posted by Selur View Post
    Is this supposed to help with frame ordering issues?
    It's supposed to help with decoding issues caused by multithreading in the decoder.

    Regarding FFmpegSource, did you read it's limitations?
    http://avisynth.nl/index.php/FFmpegSource

    Cu Selur
    Yes, that's why I now switched to LibavSource2 but I do have a feeling that the issue is caused by the filter `TemporalDegrain2`.
    Quote Quote  
  14. Sure, might be caused by any filter which calls the frames out of order.
    So your choices are: either make sure that the decoder can handle out of order frame calls for your source or try to work around it i.e. by using PreRoll (http://avisynth.nl/index.php/Preroll) or RequestLinear.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  15. Aha, so the problem is that the source filter veeery seldom sends out of order frames especially when accessing them randomly, which obviously is heavily used in the "Temporal"Degrain2 filter. So the changes are just high that it will happen somewhere inbetween. I wil now try with threads=1 and LibavSource2 and if that does not work, I will probably try D2VSource and DGIndex next.
    Quote Quote  
  16. Transport streams can be tricky - what video compression is used ? DGIndex will only work on MPEG2

    Another workaround is to remux into MKV container, then use LWLibavVideoSource
    Quote Quote  
  17. It is a vob file from a dvd (Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, progressive), 720x576 [SAR 16:15 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc). So it is mpeg2. Should I anyway switch to DGIndex in that case?
    Quote Quote  
  18. It is a vob file from a dvd (Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, progressive), 720x576 [SAR 16:15 DAR 4:3], 25 fps, 25 tbr, 90k tbn, 50 tbc).
    Then why is your first post about an .m2ts file!??

    Should I anyway switch to DGIndex in that case?
    Yes, DGIndex and DGDecNV are the recommended methods to open mpeg-2 content,...
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  19. Originally Posted by Selur View Post
    Then why is your first post about an .m2ts file!
    I actually have the problem in two cases: once with .m2ts and once with that vob (mpeg2) file.
    Quote Quote  
  20. Ok, I embedded DGIndex and call it like via cli with
    Code:
    -i "{inputFile}" -om 0 -exit -hide -o "{outputPath}"
    to generate the d2v and then I use D2VSource-1.2.3 and
    Code:
    D2VSource
    in avisynth to load it. Will take a while until it is finished due to the degrain filter. Let's hope that fixes the issue with the vob file at least.
    Quote Quote  
  21. Ok, it seems that using LWLibavVideoSource solved the issue with the m2ts file and DGIndex / D2VSource solved the issue with vob (mpeg2) files! I will do some more tests but it looks promising so far. Thanks for your help.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!