VideoHelp Forum
+ Reply to Thread
Results 1 to 13 of 13
Thread
  1. Member
    Join Date
    Aug 2023
    Location
    Sweden
    Search PM
    I have some problems converting an avi file YUV/4:2:2/8/tv to YV12. I want to deinterlace the file in QTGMC

    Is it even possible?
    How can I deinterlace such file?

    When I try to deinterlace and compress in Hybrid to mp4 it crashes when starting the first pass.

    I also tried to write a script which would recognize the color type, but with no success.
    The script goes like:

    if /i "%pix_fmt%"=="yuv422p" (
    echo The video is in YUV 4:2:2 8-bit planar format.

    Link to clip
    Last edited by Jokris; 26th Nov 2024 at 02:41.
    Quote Quote  
  2. Originally Posted by Jokris View Post
    I have some problems converting an avi file YUV/4:2:2/8/tv to YV12. I want to deinterlace the file in QTGMC
    Is it even possible?
    How can I deinterlace such file?
    QTGMC handles 4:2:2 as well as 4:2:0.
    If you however want to convert 4:2:2 to 4:2:0 insert in your script ConvertToYV12(interlaced=true) before QTGMC
    or insert ConvertToYV12() after QTGMC(), for example at the end of your script.
    If it doesn't work upload a short snippet of your interlaced source.
    Quote Quote  
  3. Member
    Join Date
    Aug 2023
    Location
    Sweden
    Search PM
    I have tried ConvertToYV12(interlaced=true) before QTGMC but without success.

    I edited my post and put a clip at the bottom.
    Quote Quote  
  4. Here you go. What's the problem?
    Code:
    AVISource("yuv422-8.avi")
    AssumeTFF()
    QTGMC()
    ConvertToYV12() #if you want YV12
    Image Attached Files
    Last edited by Sharc; 26th Nov 2024 at 02:58.
    Quote Quote  
  5. Member
    Join Date
    Aug 2023
    Location
    Sweden
    Search PM
    I haven't been able to test after yet (my computer not nearby right now)

    But if it works then thanks, I really appreciate it.

    Which also makes me wonder if it always is ok to ConvertToYV12() after QTGMC? Because when I did it with my miniDV bands I did it before QTGMC and it worked as expected. But then my script also recognized 4:2:0 format then on the other hand.
    Quote Quote  
  6. Either
    ConvertToYV12(interlaced=true) before QTGMC()
    or
    ConvertToYV12() after QTGMC()

    If you had ConvertToYV12() before QTGMC() the chroma is not processed correctly. It needs to be ConvertToYV12(interlaced=true)

    You can always leave convertToYV12() after QTGMC. It does nothing if it has already been converted to YV12 before.
    Quote Quote  
  7. Member
    Join Date
    Aug 2023
    Location
    Sweden
    Search PM
    I have images of the error in Hybrid.

    Shouldn't Hybrid be able to get it through without issues?
    Image Attached Thumbnails Click image for larger version

Name:	hybrid-base.png
Views:	14
Size:	66.1 KB
ID:	83747  

    Click image for larger version

Name:	hybrid-x264.png
Views:	10
Size:	34.1 KB
ID:	83749  

    Click image for larger version

Name:	hybrid-job.png
Views:	9
Size:	31.7 KB
ID:	83750  

    Click image for larger version

Name:	hybrid-log.png
Views:	6
Size:	20.0 KB
ID:	83751  

    Quote Quote  
  8. No problem here ...

    Image
    [Attachment 83752 - Click to enlarge]
    Image Attached Files
    Quote Quote  
  9. Member
    Join Date
    Aug 2023
    Location
    Sweden
    Search PM
    I also have the same deinterlacing settings (except the speed), but still something is not right.Image
    [Attachment 83758 - Click to enlarge]


    should I convert somewhere in Hybrid to YV12? I see your output is yuv 4:2:0 8


    When I write in cmd and try to convert with:
    ffmpeg -i yuv422-8.avi -pix_fmt yuv420p output.avi

    I get this:
    Image
    [Attachment 83759 - Click to enlarge]
    Last edited by Jokris; 26th Nov 2024 at 07:37.
    Quote Quote  
  10. No idea what's wrong. You don't need ffmpeg.
    I would select .mp4 or .mkv as container for x264, rather than .avi. But that's not your issue.....

    Edit:
    If nothing helps save the script of post#4 as jokris.avs and encode it with ffmpeg, like
    Code:
    ffmpeg -i "jokris.avs" -c:a aac -c:v libx264 -preset medium -crf 18 -vf setsar=12/11,format=yuv420p "out.mp4"
    Last edited by Sharc; 26th Nov 2024 at 10:31.
    Quote Quote  
  11. No conversion before feeding the file to Hybrid is necessary, Hybrid will:
    a. convert to color space XY if some filter does not support the current color space
    b. Hybrid will convert to the output color space set in the encoder
    The error indicates that something if wrong with either the script or the ffmpeg call.
    a. try whether the problem also happens with latest dev (recreate jobs, don't use old jobs)
    b. if it does not: Read https://www.selur.de/support and share a debug output, also create a debug output of trying the Avisynth preview. (no clue why you switched to Avisynth)

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  12. Member
    Join Date
    Aug 2023
    Location
    Sweden
    Search PM
    Hello Selur

    Hybrid seems to work after uninstalling and reinstalling.
    Strange because I have no clue what in my settings were wrong

    Thanks both of you for helping me out!

    But why would I use VapourSynth instead of AviSynth?
    Does it matter for deinterlacing? I use AviSynth because I try to write scripts in AviSynth, and I don't know if I can do something similar in VapourSynth (due to inexperience).
    Quote Quote  
  13. In my honest opinion:

    Vapoursynth:
    • pro:
      • often scales better with multithreading
      • more gpu and machine learning based stuff
      • uses Python as a base
      • more intuitive if you know some programming language
      • quite active group of folks when it comes to anime/cartoon filtering with machine learning
      • better cross-plattform support
      • (better support in Hybrid, since I prefer it)
    • con:
      • requires Python
      • No 'ClearAutoloadDirs'
      • less filters and scripts

    Avisynth:
    • pro:
      • may be a bit easier (so folks that know no programming language)
      • lots of (older) folks using it, so you often get more suggestions
      • more filters and documentation
      • implicit 'last' variable, can make starting out easier
    • con:
      • ugly GScript addition trying to add some basic programming language stuff (as soon as you use GScript yourself, you really should think about using Vapoursynth instead)
      • sometimes finding up-to-date or just the right documentation and filter dependencies is a pain
      • implicit 'last' variable, can lead to confusion and some scripts to really be unnecessarily complicated to understand

    Side note:
    Avisynth does get more of the color handling/tagging and machine learning stuff and (backport) of Vapoursynth filters.
    Newer filters are often available for both.
    Sadly, both are quite similar, both have a community which doesn't really care about (properly) documenting scripts.

    => it's up to your preferences
    (I prefer Vapoursynth, but if you prefer Avisynth that is fine too.)

    Strange because I have no clue what in my settings were wrong
    Since you didn't share a debug output or your settings in detail, nobody can say for sure.

    Cu Selur

    Ps.: About Hybrid: It is meant for advanced users, it can make some stuff easier, but you can also easily mess things up without really knowing it.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  



Similar Threads

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