VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 26 of 26
Thread
  1. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    This problem occurs in Sony Vegas. Here is the data of my source file below. If I export the project with a frame size different than the original, combs start to appear. What causes it? I checked it in the default media player of Windows 10 only, but this player plays the exported file without error if the frame size is not changed.

    General
    ID : 1 (0x1)
    Complete name : C:\Users\Bence\Desktop\Szandi esküvő\templom.ts
    Format : MPEG-TS
    File size : 6.37 GiB
    Duration : 39mn 8s
    Overall bit rate mode : Variable
    Overall bit rate : 23.3 Mbps
    Maximum Overall bit rate : 35.5 Mbps

    Video
    ID : 4113 (0x1011)
    Menu ID : 1 (0x1)
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4
    Format settings, CABAC : Yes
    Format settings, ReFrames : 2 frames
    Format settings, GOP : M=3, N=12
    Codec ID : 27
    Duration : 39mn 8s
    Bit rate mode : Variable
    Bit rate : 21.9 Mbps
    Maximum bit rate : 22.7 Mbps
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate : 25.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Interlaced
    Scan type, store method : Separated fields
    Scan order : Top Field First
    Bits/(Pixel*Frame) : 0.422
    Stream size : 5.99 GiB (94%)
    Quote Quote  
  2. Before resizing, interlaced video must be deinterlaced, after resizing if you wish you may reinterlace it back.
    Exception is resizing down by 2, 4, 6... (any even number - efficiently you applying deinterlace called field blending).
    Quote Quote  
  3. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    To scale 1080i50 (interlaced, 50 fields per second) to 720p50 (progressive, 50 frames per second), you will probably use a "bobber" to interpolate all fields to full frames before downscaling.
    Quote Quote  
  4. I expect you didn't notice the interlacing earlier because whatever you use to play it had the deinterlacer on by default. You only began to see it after the resize but by then it was too late. If, as LigH.de thinks, the idea is to make a double-rate 720p version, deinterlace (bob) before the resize. If you have something else in mind, then say what it is. And when watching videos to help decide how they should be treated, I make sure the deinterlacer is turned off. And I don't (and would never) use WMP for anything at all.

    You might post a short 10 second sample. There's a chance the problem is something other than pure interlacing, something like phase-shifted fields or a bad standards conversion full of blended fields and interlacing.
    Last edited by manono; 9th May 2017 at 22:49.
    Quote Quote  
  5. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    Did a little more experimenting, now I could render the thing seemingly without any serious artifacts. I set the project property to progressive instead of identical to the source, and selected interpolate fields as deinterlace method. This doesn't change the source, just tell Sony Vegas how to treat the file I guess. Anyway, when I export this way in PAL DVD format, the MPEG is acceptable.

    However, I did a little research before, and I found you can select from many more deinterlace methods, but Smart Bob is written to usually be the best. Can you recommend any way to do this? Sony Vegas doesn't seem to have it, I guess I should use AvySynth. My source file is MTS, but I already did the editing, and it would be very tiring to start everything from the beginning with a previously deinterlaced source file. But I could export the project in MP4 from Vegas, and set it to remain interlaced, with the original size. And then would do a proper deinterlacing, and then a resizing to DVD format.

    I attached a small clip of my source file.
    Image Attached Files
    Quote Quote  
  6. Deinterlace and resize it outside of Vegas.

    For example set project properties to interlace HD, not as progressive as you say. Edit your clips, then export a lossless 1920x1080 interlaced or use Debugmode frame server to export avi. Load that AVI into Avisynth and bob deinterlace it. QTGMC() is the best but very, very slow and not really necessary for HD footage, or use yadif(mode=1), then resize to desired resolution, then mux it into MP4. Or there are x264 front-ends that load that AVI and give you MP4.
    Image Attached Files
    Quote Quote  
  7. When getting DVD format, it is more difficult because you have to re-interlace again. You do it in Avisynth script as well. Again outside of Vegas (using lossless or debugmodeframe server avi) you deinterlace that avi for example using yadif(mode=1) and then resize it to 720x576 and change color space to SD. That you can encode as lossless (in VirtualDub) and load back to Vegas to create DVD.

    If encoding to m2v (for DVD authoring) using HcEncoder, so not a lossless, just to show you, script used lowpass filter to prevent flickering.
    Code:
    Load_Stdcall_plugin("C:\Program Files (x86)\AviSynth 2.5\plugins\yadif.dll")
    ConvertToYV12(interlaced=true, matrix="PC.709") #if exporting RGB32 from Vegas otherwise without that matrix...
    assumetff()
    yadif(mode=1)
    Import("IResize.avsi")
    IResize(720,576)
    Blur(0,1.0) #low pass filter, fancy name for just vertical blur
    Import("changing_color_space_HD_to_SD.avsi")
    AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()
    Image Attached Files
    Last edited by _Al_; 10th May 2017 at 18:57.
    Quote Quote  
  8. Why do you need Vegas at all for making a DVD? To use its encoder? Use HCEnc instead. Author in any one of several ways. AviSynth will do a better job of the deinterlace/resize than Vegas will any day of the week.

    Nice example, _Al_. If Bencuri wants to use that script to downsize and reinterlace, you might consider providing the two AVSIs you imported. If using HCEnc he can open the script in it for encoding to DVD video. There's nothing so slow in it that he might want to make an intermediate AVI (except maybe for the source hi-def video).
    Quote Quote  
  9. IResise function and also colorspace change from HD to SD all within that script:
    Code:
    # IResize by Gavino and IanB and mod by A.SONY to use Custom resizer and Extra resizer parameters may be passed via res_params. like this IResize(240,480,res_params=",src_left=5")
    function IResize(clip c, int NewWidth, int NewHeight, string "resifilter", string "res_params") {
      resifilter   = default ( resifilter,         "Spline36resize" )
      res_params = default(res_params, "")
      c
      SeparateFields() 
      Shift = (GetParity() ? -0.25 : 0.25) * (Height()/Float(NewHeight/2)-1.0)
      v2=last
      SelectEven(v2)
      E  = Eval(resifilter + "(NewWidth, NewHeight/2, src_top=Shift" + res_params + ")")
      Ec = Eval(resifilter + "(NewWidth, NewHeight/2, src_top=2*Shift" + res_params + ")")
      SelectOdd(v2)
      O  = Eval(resifilter + "(NewWidth, NewHeight/2, src_top=-Shift" + res_params + ")")
      Oc = Eval(resifilter + "(NewWidth, NewHeight/2, src_top=-2*shift" + res_params + ")")
      Interleave(E, O)
      IsYV12() ? MergeChroma(Interleave(Ec, Oc)) : Last
      Weave()
    }
    
    
    Load_Stdcall_plugin("C:\Program Files (x86)\AviSynth 2.5\plugins\yadif.dll")
    
    AviSource("C:\my_avi")  #lossless or debugmode frame  server avi
    ConvertToYV12(interlaced=true, matrix="PC.709") #if exporting RGB32 from Vegas thru frame server otherwise ConvertToYV12(interlaced=true)
    assumetff()
    yadif(mode=1)
    IResize(720,576)
    Blur(0,1.0) #low pass filter, fancy name for just vertical blur
    ColorMatrix(mode="Rec.709->Rec.601",clamp=0)
    AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()
    Yadif.dll and ColorMatrix.dll put into Avisynth plugin folder

    If that IResize is included as above it does not have to be imported, also that "HD to SD color change" does not have to be imported because my batch scripts cannot handle ">" character so I just go around this Importing another avsi,
    if clamp=0 is not going to be recognized you downloaded some older version of Colormatrix, try latest one
    Quote Quote  
  10. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    Originally Posted by _Al_ View Post
    Code:
    # IResize by Gavino and IanB and mod by A.SONY to use Custom resizer and Extra resizer parameters may be passed via res_params. like this IResize(240,480,res_params=",src_left=5")
    function IResize(clip c, int NewWidth, int NewHeight, string "resifilter", string "res_params") {
      resifilter   = default ( resifilter,         "Spline36resize" )
      res_params = default(res_params, "")
      c
      SeparateFields() 
      Shift = (GetParity() ? -0.25 : 0.25) * (Height()/Float(NewHeight/2)-1.0)
      v2=last
      SelectEven(v2)
      E  = Eval(resifilter + "(NewWidth, NewHeight/2, src_top=Shift" + res_params + ")")
      Ec = Eval(resifilter + "(NewWidth, NewHeight/2, src_top=2*Shift" + res_params + ")")
      SelectOdd(v2)
      O  = Eval(resifilter + "(NewWidth, NewHeight/2, src_top=-Shift" + res_params + ")")
      Oc = Eval(resifilter + "(NewWidth, NewHeight/2, src_top=-2*shift" + res_params + ")")
      Interleave(E, O)
      IsYV12() ? MergeChroma(Interleave(Ec, Oc)) : Last
      Weave()
    }
    
    
    Load_Stdcall_plugin("C:\Program Files (x86)\AviSynth 2.5\plugins\yadif.dll")
    
    AviSource("C:\my_avi")  #lossless or debugmode frame  server avi
    ConvertToYV12(interlaced=true, matrix="PC.709") #if exporting RGB32 from Vegas thru frame server otherwise ConvertToYV12(interlaced=true)
    assumetff()
    yadif(mode=1)
    IResize(720,576)
    Blur(0,1.0) #low pass filter, fancy name for just vertical blur
    ColorMatrix(mode="Rec.709->Rec.601",clamp=0)
    AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()
    I don't understand why yadif is being used here when iResize uses SeparateFields, which is what the iResize shifts are all about. Why use both?
    I thought one would low-pass with a blur before resizing, not after. The original already looks soft as it is.
    Doesn't the script below get the same result without deinterlacing twice?

    Code:
    AssumeTFF()
    iResize(720,576)
    ColorMatrix(mode="Rec.709->Rec.601")
    return last
    
    function iResize(clip c, int NewWidth, int NewHeight, string "resifilter", string "res_params") 
    {
      resifilter = default (resifilter, "Spline36resize" )
      res_params = default (res_params, "")
      c
      SeparateFields() 
      Shift = (GetParity() ? -0.25 : 0.25) * (Height()/Float(NewHeight/2)-1.0)
      v2=last
      SelectEven(v2)
      E  = Eval(resifilter + "(NewWidth, NewHeight/2, src_top=Shift" + res_params + ")")
      Ec = Eval(resifilter + "(NewWidth, NewHeight/2, src_top=2*Shift" + res_params + ")")
      SelectOdd(v2)
      O  = Eval(resifilter + "(NewWidth, NewHeight/2, src_top=-Shift" + res_params + ")")
      Oc = Eval(resifilter + "(NewWidth, NewHeight/2, src_top=-2*shift" + res_params + ")")
      Interleave(E, O)
      IsYV12() ? MergeChroma(Interleave(Ec, Oc)) : Last
      Weave()
    }
    Image Attached Files
    Last edited by LMotlow; 11th May 2017 at 00:46.
    - My sister Ann's brother
    Quote Quote  
  11. So use it like that, yes IResize is good for interlace resize. I think this algorithm is used in VirtualDub as well and I used it for this purpose within VirtuaDub before for making DVD from interlaced HD. (Vegas -frame server -VirtualDub - Avisynth - mpg encoder ). But now excluding VD having that IResize available. Also I have plenty of time encoding , so using QTGMC, then resizing, that is the main point to bob it first, so I just replaced QTGMC with yadif, but sure do it right away if it works.

    Another point, that QTGMC losslesshigh quality double frame rate file could be made as intermediate and then it could be used for other 2-3 renders ,... for DVD, 720p, web file 540p as well etc. so it is made only once ...

    IResize gives much less flickering alone as oppose usual resize algorithms even if resizing progressive footage (with re-interlacing involved after), I posted some samples here

    vertical blur before resizing has a very little effect, so I use it after, the goal is prevent any sort of flickering and this is much more intrusive then blur, everyone can notice flickering of any sort, but not slight blur, because there is no reference point while watching DVD.
    Last edited by _Al_; 11th May 2017 at 10:06.
    Quote Quote  
  12. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    Originally Posted by _Al_ View Post
    Another point, that QTGMC losslesshigh quality double frame rate file could be made as intermediate and then it could be used for other 2-3 renders ,... for DVD, 720p, web file 540p as well etc. so it is made only once ...
    Well, I dunno....the script makes a DVD 720x576 @25fps, not double frame rate. You'd have to run a second script if you wanted double frame rate, so using the original script and deinteracing again deinterlaces three times to get a 50fps progressive for web mounting. Seems like a lot of work.

    For 720p disc-deliverable BluRay:

    Code:
    AssumeTFF()
    iResize(1280,720)
    QTGMC(preset="super fast")
    Six of one and half-dozen of then other, I guess. To get three files -- 480i, 480p, 720p, you'd still need three scripts.
    Image Attached Files
    - My sister Ann's brother
    Quote Quote  
  13. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Why not use QTGMC alone to bob and downscale?
    Quote Quote  
  14. Originally Posted by LigH.de View Post
    Why not use QTGMC alone to bob and downscale?
    If for DVD there's no need to, unless you want to make use of its cleaning properties. Because Yadif keeps one field unchanged and because it's very fast, for DVD it's the better choice if you want the resulting DVD video to be as close to the original hi-def version as possible. For anything else - such as 720p 50fps - yes, I agree.
    Quote Quote  
  15. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    Thanks guys for the scripts. I would have an update on this though. Besides resizing to DVD, I noticed that I get artifacts when I simply modify the alignment of the videos, or zoom in them, I guess because this changes the video dimensions too. So I concluded maybe it would be better to deinterlace the 50i mts files first, edit the deinterlaced files in Vegas, and then I could export it in either progressive or interlaced, depending on which version works better. I guess it would be better to export in progressive, and reinterlace in AviSynth, based on your comments. How would the script go in this case and what would be the ideal format to deinterlace to and feed to Vegas? By the way, can AviSynth open an deinterlace from MTS directly?

    The source file would be the one that I attached above, but here is it again. It is TS, but it is so because I merged two MTS' together in TsMuxer. This is the only source I work with recently, I use the camcorder that makes these most of the time.

    https://forum.videohelp.com/attachments/41559-1494449744/templom2.ts
    Quote Quote  
  16. yes zooming in Vegas means Vegas resizes interlace video = not good

    if you can load that interlaced clip into Avisynth then use yadif mode 1 to bob your interlace video, load script into VirtualDub and encode to sole lossless codec, like utvideo
    Code:
    Load_Stdcall_plugin("C:\Program Files (x86)\AviSynth 2.5\plugins\yadif.dll")
    #line with loading your clip here
    assumetff()
    yadif(mode=1)
    it is going to be a huge file,
    loading that utvideo clip into Vegas for editing, you might apply Sony levels effect on it - Studio RGB to computer RGB if it looks greyed out on timeline

    if all clips on timeline will be 50p/60p then you proceed making DVD from 50p/60p footage, you might try something like this to resize it and make it interlace for DVD stream, or just test Vegas alone, it might look ok to you (nice sharp encoding but flickering horizontal lines)
    Quote Quote  
  17. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Better yet, install AVFS and frame-serve directly from your Avisynth script to Vegas.
    Quote Quote  
  18. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    Originally Posted by _Al_ View Post
    yes zooming in Vegas means Vegas resizes interlace video = not good

    if you can load that interlaced clip into Avisynth then use yadif mode 1 to bob your interlace video, load script into VirtualDub and encode to sole lossless codec, like utvideo
    Code:
    Load_Stdcall_plugin("C:\Program Files (x86)\AviSynth 2.5\plugins\yadif.dll")
    #line with loading your clip here
    assumetff()
    yadif(mode=1)
    it is going to be a huge file,
    loading that utvideo clip into Vegas for editing, you might apply Sony levels effect on it - Studio RGB to computer RGB if it looks greyed out on timeline

    if all clips on timeline will be 50p/60p then you proceed making DVD from 50p/60p footage, you might try something like this to resize it and make it interlace for DVD stream, or just test Vegas alone, it might look ok to you (nice sharp encoding but flickering horizontal lines)
    Is it possible to export to Avid DNxHD from virtualdub instead of Avi? They say it is a pretty easy to edit format for Sony Vegas, so it would be practical to export the interlaced video in that.

    What is the code to open the MTS with AviSynth, I am looking at the AniSynth Wiki about it, but find it not in the list of codes for opening formats. Opening TS is there, but is it also good for MTS?
    Quote Quote  
  19. to load transport stream into Avisynth you could use this

    I do not use DNxHD, I never tried that, you might use ffmpeg to load clips and generate DNxHD. As soon as you realize you are using Yadif and not QTGMC for deinterlace you can use ffmpeg, without using Avisynth or VirtualDub. That VD was just a suggestion.

    You can look here, where there is recommendation for bitrates and command lines to generate DNxHD
    you'd need to include Yadif filter, mode 1 if bob deinterlacing
    Quote Quote  
  20. A few clarifications, in case anyone in the future stumbles upon this thread.

    The OP's original problem is caused by selecting "None" for the "Deinterlace Properties" in the Vegas project properties dialog. This is a well-known mistake that has been discussed many times in the Vegas forum. Setting this to either "Blend Fields" or "Interpolate Fields" will avoid the OP's original problem. You can then pick any size you want for the rendered output, and Vegas will re-size correctly, without the well-known artifacts one gets if interlaced video is resized without first deinterlacing. Everything above the horizontal line in that Project Properties dialog box does NOT affect rendering, and only affects how the video is displayed in the preview screen. However, everything below that line DOES affect the final render. It is a terrible and really stupid UI. The OP should not feel bad for having made this mistake. Hundreds of other people have done the same thing.

    As for better ways to deinterlace outside of Vegas, that is well-covered by the previous posts. However, if the OP has (or can get) the latest version of Vegas (14), it apparently has finally added a decent deinterlacer, much better than Yadif. I didn't upgrade to Vegas 14 (I mostly use 7, 8, 10, and 13), but a person who has done many days of work on discovering the "ultimate" way to deinterlace out of Vegas, Nick Hope, has concluded that version 14 finally gets it "right" and is as good as any of the AVISynth scripts and plugins, with the possible exception of QTGMC.
    Quote Quote  
  21. Good news about that latest deinterlacing in Vegas 14, hopefully it is present in Platinum version as well, something to test.

    That is very good reminder about that setting in Vegas just to stress it out.
    But he uses term "acceptable" later on when he set it up like that in settings, interpolate or blend. At that point I joined discussion, because it was more clear what he was doing.

    As always if op presents a sample right away, days of discussions could be avoided sometimes.

    To the point of Vegas properly set and its deinterlace. I would not give a DVD to anyone like that, flickering is quite visible, watching it on CRT it was really bad experience then, man-made structures just flickered like crazy, later on with LCD or plasma it was a bit better but very visible. That was the major reason lots of us started to work with frame server (and using different encoder as well). At that time someone discovered that VirtualDub interlace resize filter working quite well so it was used with very good result, nowadays it is available for Avisynth as well as iResize (or rather I did not know about that script then) . What was Vegas problem, now this is my guess, perhaps it was rather re-interlacing that introduced that flicker, rather than bad bob deinterlace or whatever algorithm was used then.
    Last edited by _Al_; 24th May 2017 at 17:26.
    Quote Quote  
  22. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    Originally Posted by _Al_ View Post
    Good news about that latest deinterlacing in Vegas 14, hopefully it is present in Platinum version as well, something to test.

    That is very good reminder about that setting in Vegas just to stress it out.
    But he uses term "acceptable" later on when he set it up like that in settings, interpolate or blend. At that point I joined discussion, because it was more clear what he was doing.

    As always if op presents a sample right away, days of discussions could be avoided sometimes.

    To the point of Vegas properly set and its deinterlace. I would not give a DVD to anyone like that, flickering is quite visible, watching it on CRT it was really bad experience then, man-made structures just flickered like crazy, later on with LCD or plasma it was a bit better but very visible. That was the major reason lots of us started to work with frame server (and using different encoder as well). At that time someone discovered that VirtualDub interlace resize filter working quite well so it was used with very good result, nowadays it is available for Avisynth as well as iResize (or rather I did not know about that script then) . What was Vegas problem, now this is my guess, perhaps it was rather re-interlacing that introduced that flicker, rather than bad bob deinterlace or whatever algorithm was used then.
    Yeah, in my video the output has much more serious flcikers than the original. I will test it with leaving settings on no-deinterlacing. It is possible I chose a deinterlace mode on the Project Properties panel, I never gave too big attention to this before, because it was never obvious to me what effects those settings have, as John predicted it correctly.
    Quote Quote  
  23. Member
    Join Date
    Apr 2012
    Location
    Hungary
    Search PM
    Originally Posted by _Al_ View Post
    to load transport stream into Avisynth you could use this

    I do not use DNxHD, I never tried that, you might use ffmpeg to load clips and generate DNxHD. As soon as you realize you are using Yadif and not QTGMC for deinterlace you can use ffmpeg, without using Avisynth or VirtualDub. That VD was just a suggestion.

    You can look here, where there is recommendation for bitrates and command lines to generate DNxHD
    you'd need to include Yadif filter, mode 1 if bob deinterlacing

    Thanks! Willy try the ffmpeg method and we'll see how it goes.
    Quote Quote  
  24. ... wrong thread
    Last edited by _Al_; 25th May 2017 at 17:06.
    Quote Quote  
  25. Here's a link to a good discussion about the new "smart adaptive" deinterlacing that was introduced in Vegas Pro 14:

    Smart Adaptive Deinterlacing example
    Quote Quote  
  26. yes that but we also deal with re-interlacing as well, so it is about deinterlace and re-interlacing it again if making DVD from HD interlaced which introduces flicker

    or most of footage nowadays is basically 50p/60p so Vegas has to just re-interlace for DVD and that causes flicker, so not sure how or if Vegas treats it better now,..., vertical blur for low pass filter is too strong but anyway it should be used after resize basically ...
    Quote Quote  



Similar Threads