VideoHelp Forum
+ Reply to Thread
Page 1 of 3
1 2 3 LastLast
Results 1 to 30 of 88
Thread
  1. Member
    Join Date
    Sep 2021
    Location
    United Kingdom
    Search Comp PM
    Before starting to use the filters, I wanted to know if I'm doing the basic editing correctly.
    I've joined two videos together, which I have also trimmed down, hopefully I have done both tasks correctly and not missed anything. I have also cropped it and added borders, I know the border is slightly bigger on the right-hand side. Hopefully I've kept it 704x576.

    I wasn't sure if I should have added ConvertToYV12 but I didn't think it was required? I then encoded it. Any advice would be appreciated. Thanks.
    Image Attached Thumbnails Click image for larger version

Name:	crop addBorders join 2 videos & Trim script 2.JPG
Views:	77
Size:	196.1 KB
ID:	69658  

    Image Attached Files
    Quote Quote  
  2. You need ConvertToYV12(interlaced=true).
    Quote Quote  
  3. Captures & Restoration lollo's Avatar
    Join Date
    Jul 2018
    Location
    Italy
    Search Comp PM
    You can use ++ (AlignedSplice) instead of + (UnalignedSplice) for better audio handling

    When YV12 is not needed as final format, if a planar format is required by a filter during processing you can use ConvertToYV16() instead of ConvertToYV12(interlaced=true) to avoid a lossy conversion
    Quote Quote  
  4. The OP encoded as interlaced AVC with 4:2:0 chroma subsampling. The conversion from 4:2:2 to 4:2:0 was handled as progressive, not interlaced. So the chroma of the two fields blurred together.
    Quote Quote  
  5. Member
    Join Date
    Sep 2021
    Location
    United Kingdom
    Search Comp PM
    Thanks jagabo & lollo. If I ConvertToYV12 will that correct the two blurred fields? or did I do something wrong with the encode. Thanks.
    Quote Quote  
  6. Member
    Join Date
    Sep 2021
    Location
    United Kingdom
    Search Comp PM
    Thanks jagabo. I have redone the video with the ConvertToYV12 line added.
    Image Attached Thumbnails Click image for larger version

Name:	new crop add borders join trim.JPG
Views:	52
Size:	199.0 KB
ID:	69659  

    Image Attached Files
    Quote Quote  
  7. Your crop/addborders reversed the field order of the chroma. 4:2:0 video should be cropped by mod 4, not mod2. You can avoid that problem by converting to YV12 after cropp/addborders.
    Quote Quote  
  8. Maybe as a general rule it is safe to put ConvertToYV12(interlaced=true) always at the end of the script, when encoding with x264 interlaced.
    Quote Quote  
  9. Member
    Join Date
    Sep 2021
    Location
    United Kingdom
    Search Comp PM
    Thanks jagabo. I will do that and post it. I read about mod 4 mod 2 but didn't fully grasp it.
    If instead I did crop (8,8,24,8) AddBorders(8,8,8,8) would that be mod4 as everything can be divided by 4? If that was the correct would I still put the ConvertToYV12 after the crop or after Assume TFF() Thanks.
    Quote Quote  
  10. Member
    Join Date
    Sep 2021
    Location
    United Kingdom
    Search Comp PM
    Thank Sharc. I will do that in future.
    Quote Quote  
  11. Originally Posted by SkyBlues2021 View Post
    If instead I did crop (8,8,24,8) AddBorders(8,8,8,8) would that be mod4 as everything can be divided by 4?
    Yes.

    Originally Posted by SkyBlues2021 View Post
    If that was the correct would I still put the ConvertToYV12 after the crop or after Assume TFF()
    Either would be OK.
    Quote Quote  
  12. Member
    Join Date
    Sep 2021
    Location
    United Kingdom
    Search Comp PM
    I've put ConvertToYV12 at the end of the script and also changed the crop/AddBorders to hopefully mod4 which looks better.
    Image Attached Thumbnails Click image for larger version

Name:	yv12 at end.JPG
Views:	43
Size:	199.5 KB
ID:	69662  

    Image Attached Files
    Quote Quote  
  13. Member
    Join Date
    Sep 2021
    Location
    United Kingdom
    Search Comp PM
    Thanks jagabo. Hopefully that looks better. Was the script correct for the joining two videos together and the trimming as I've never done either before. Thanks.
    Quote Quote  
  14. I think you script is fine now. The only thing I'd change is the "+" between the two AviSource() imports. Use "++" instead. That will insure audio sync in case a file has audio and video of different lengths. This was mentioned by lollo earlier.

    But there's still something not quite right with the chroma of your encoded video. View your video frame by frame with a script like:

    Code:
    LWLibavVideoSource("crop borders trim join yv12.mp4", cache=false) 
    Bob(0.0, 1.0)
    StackHorizontal(last, StackVertical(UtoY(),VToY()))
    Watch the motion of the two chroma planes (on the right) from frames 420 to 480 (the blue shirt moving from left to right). The motion of the chroma isn't as smooth as the motion of the luma. There's hardly any motion between the two fields of a frame. Then a jump to the next frame.

    Compare that with what I get using your script and the x264 command line encoder (same encoder, same "slow" preset, same crf, minor changes). The motion of the chroma is much smoother, the same as the luma.

    What program are you using to encode the video? Could it be messing up the chroma? Try adding the Bob and Stacking lines to your conversion script. Is the chroma messed up even before encoding?
    Image Attached Files
    Quote Quote  
  15. Member
    Join Date
    Sep 2021
    Location
    United Kingdom
    Search Comp PM
    Thanks jagabo. When I used your Bob StackHorizontal script lines on "opening presents 1 avi. without any crop/borders/trim I get the same chroma jerky motion. I used Virtualdub2 as the encoder. I think the chroma is a problem before it is encoded. How did you get the chroma smoother on your version? Thanks.
    Image Attached Thumbnails Click image for larger version

Name:	Bob Stack script.JPG
Views:	22
Size:	191.8 KB
ID:	69670  

    Quote Quote  
  16. Hmmm..., the OP's capture seems to be ok, as I see it.

    Code:
    AVISource("opening presents 2.avi")
    assumeTFF()
    Bob(0.0, 1.0)
    StackHorizontal(last, StackHorizontal(UtoY(),VToY()))
    The color advances with every field


    Added:
    Shouldn't we actually inspect the chroma advancements for even and odd fields sequences, for 4:2:0 YV12 interlaced?
    Last edited by Sharc; 10th Mar 2023 at 05:13.
    Quote Quote  
  17. Member
    Join Date
    Sep 2021
    Location
    United Kingdom
    Search Comp PM
    Thanks Sharc. Sorry I'm not following. What does that mean? Thanks.
    Quote Quote  
  18. Originally Posted by SkyBlues2021 View Post
    Thanks Sharc. Sorry I'm not following. What does that mean? Thanks.
    I was just wondering whether we watch/analyze the encoded version correctly. Forget it for now. I have to think it over ... Never mind.
    Figure below: White = luma samples, blue=chroma samples

    Image
    [Attachment 69672 - Click to enlarge]
    Quote Quote  
  19. @SkyBlues
    I tried with VirtualDub2, and the chroma is encoded correctly, advancing with every field

    Did you really have as the last line in your script:
    ConvertToYV12(interlaced=true)

    I can reproduce the chroma issue when I don't specify interlaced=true.
    Last edited by Sharc; 10th Mar 2023 at 07:33.
    Quote Quote  
  20. Originally Posted by SkyBlues2021 View Post
    When I used your Bob StackHorizontal script lines on "opening presents 1 avi. without any crop/borders/trim I get the same chroma jerky motion. I used Virtualdub2 as the encoder. I think the chroma is a problem before it is encoded. How did you get the chroma smoother on your version? Thanks.
    Using this script:

    Code:
    LWLibavVideoSource("opening presents 2.avi", cache=false, format="YUY2")
    AssumeTFF()
    ConvertToYV12(interlaced=true)
    Bob(0.0, 1.0)
    StackHorizontal(last, StackVertical(UtoY(),VToY()))
    I get smooth motion of the chroma.

    The difference may be in LWLibavVideoSource vs. AviSource. AviSource uses the VFW system installed HuffYUV decoder. I don't have one installed so I used LWlibavVideoSource -- which is using its built in HuffYUV decoder.

    Also, I'm using 64 bit AviSynth+.
    Quote Quote  
  21. Member
    Join Date
    Sep 2021
    Location
    United Kingdom
    Search Comp PM
    Thanks Sharc & jagabo. I will do the encode now and post it. Also I will check I did the ConvertToYV12(interlaced=true). Thanks.
    Quote Quote  
  22. Originally Posted by jagabo View Post
    The difference may be in LWLibavVideoSource vs. AviSource. AviSource uses the VFW system installed HuffYUV decoder. I don't have one installed so I used LWlibavVideoSource -- which is using its built in HuffYUV decoder.

    Also, I'm using 64 bit AviSynth+.
    Btw. I tested with AviSource and the Chroma plays smooth. I am using Avisynth+ 32bit. I encoded with the x264 encoder in AvsPmod and with the x264 encoder in VirtualDub2. No problem here as long as ConvertToYV12(interlaced=true) is in the script (as last line).
    Quote Quote  
  23. Member
    Join Date
    Sep 2021
    Location
    United Kingdom
    Search Comp PM
    I've redone the encode. I did have ConvertToYV12 at the end of the previous script, but I'm obviously doing something else wrong. I added another ++ between the joined videos and have also made the top and bottom borders bigger. I then went into virtualdub and did save as AVI. I then encoded with virtualdub2 thanks.
    Image Attached Thumbnails Click image for larger version

Name:	script 10-3-22.JPG
Views:	33
Size:	196.8 KB
ID:	69674  

    Click image for larger version

Name:	Viirtualdub2 encode settings 10-3-23.JPG
Views:	20
Size:	63.5 KB
ID:	69675  

    Image Attached Files
    Quote Quote  
  24. Just drag and drop your script.avs onto the window of VirtualDub2, which will load it into Vdub's Script Editor. Or copy the script manually into VirtualDub2's Script Editor (Menu Tools -> Script Editor).
    No need to save an intermediate avi.
    Quote Quote  
  25. Member
    Join Date
    Sep 2021
    Location
    United Kingdom
    Search Comp PM
    Thanks Sharc. I will try that.
    Quote Quote  
  26. Member
    Join Date
    Sep 2021
    Location
    United Kingdom
    Search Comp PM
    I've installed Avisynth+ 32bit but I'm getting this error message when I start up AvsPmod. It made me think could the problem I'm having with my chroma be related to a compatibility issue? I captured my videos with Virtualdub 1.9.11 (x86) I attached it's properties. Thanks.
    Image Attached Thumbnails Click image for larger version

Name:	error message 2.JPG
Views:	17
Size:	65.8 KB
ID:	69708  

    Click image for larger version

Name:	virtualdub properties.JPG
Views:	18
Size:	46.3 KB
ID:	69709  

    Quote Quote  
  27. I've never seen errors like that in AviSynth or VirtualDub. What happens if you just start VirtualDub? No errors? Try opening an AviSynth script with just

    Code:
    version()
    Any errors?
    Quote Quote  
  28. Member
    Join Date
    Sep 2021
    Location
    United Kingdom
    Search Comp PM
    Thanks jagabo. The AvsPmod still opens and works but the error message comes up first. It doesn't affect virtualdub. I copied my plugins to Avisynth+ plugin folder and thought maybe this had caused problems. Thanks.
    Quote Quote  
  29. Here's a video that more clearly shows the motion of the chroma:

    Code:
    AviSource("huffyuv.avi") # LWlibavVideoSource("huffyuv.avi", cache=false, format="YUY2") 
    AssumeTFF()
    Bob(0.0, 1.0)
    ConvertToYV12(interlaced=true)
    StackHorizontal(last, StackVertical(UtoY(),VToY()))
    Image Attached Files
    Last edited by jagabo; 11th Mar 2023 at 10:12.
    Quote Quote  
  30. Member
    Join Date
    Sep 2021
    Location
    United Kingdom
    Search Comp PM
    Thanks jagabo. What does that mean. Sorry to sound ignorant. What can I do to put it right? I've attached the video encoded with Avidemux but I'm guesssing it's no better than the Virtualdub2 version. Thanks.
    Image Attached Files
    Quote Quote  



Similar Threads

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