VideoHelp Forum
+ Reply to Thread
Results 1 to 16 of 16
Thread
  1. I have the script (listed below) which is proposed elsewhere on this forum for smooth conversion of 50p/HD to MPEG2.

    I have the script ready and loaded in Virtualdub. But I am confused - how do I get MPEG2 as output? Because I do not have mpeg2 as an output option in Virtualdub.

    Thanks.


    # 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()
    }

    IResize(720,576)
    LoadPlugin("ColorMatrix.dll")
    ColorMatrix(mode="Rec.709->Rec.601",clamp=0)
    AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()
    Quote Quote  
  2. Open the script with an MPEG2 encoder like HcEnc, HcGUI.

    It makes no sense to use IResize here. It's for resizing interlaced video -- but your source is progressive. Just resize with a "normal" resizer like Spline36Resize(), BicubicResize(), whatever works best for your material. If you find the picture flickers a little too much on playback add a small vertical blur with Blur(0.0, 0.5) or something like that. Or use a less sharp resizer like BilinearResize().
    Quote Quote  
  3. Thanks for that. But I am still confused. I have stripped down the code to bare minimum:

    LoadPlugin("ColorMatrix.dll")
    ColorMatrix(mode="Rec.709->Rec.601",clamp=0)
    AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()

    and fed it through HEnc and it comes up with error:
    "invalid aruments to function colourmatrix..."

    ...and where do I specify the input file?

    Sorry, I am novice starting out.
    Quote Quote  
  4. You need a source filter. Something like LWlibavVideoSource("filename.mp4") (included in the LSMASH package). But you said earlier you had successfully opened the script with VirtualDub -- so it must have had a source filter at some point. Having no source is the cause of the ColorMatrix error.
    Quote Quote  
  5. Thanks jagabo. I ended with the following script which works now. But results are not very good. Although I have lost the artifacts the pic is still jittery/stuttery - gives a headache just watching it.

    AviSource("L:\test\waltest.avi")
    ConvertToYV12(matrix="PC.709")
    Spline36Resize(720,576)
    Blur(0,1.0)
    LoadPlugin("ColorMatrix.dll")
    ColorMatrix(mode="Rec.709->Rec.601",clamp=0)
    AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()
    Quote Quote  
  6. Upload a small sample of your source and the resulting MPG video. I suspect your source is encoded 50p but the underlying video is not 50p.
    Quote Quote  
  7. your video source is progressive (50p/HD) so you dont need this in script:

    AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave() -
    just remove it
    Quote Quote  
  8. I have removed that line and it looks much better. Although there is a small amount of stutter, it is much more stable than before.

    Only if I can ever make it buttery smooth. Motion interpolation?
    Quote Quote  
  9. If it's for MPEG2 for DVD - you need it interlaced - "50p" will not work . You would need to add the line back

    If there is stutter there, there is probably stutter in the source. It depends what you mean exactly by "stutter". Upload a sample of the source
    Quote Quote  
  10. Also, how are you watching the video? If it's not being deinterlaced properly on playback it will not be smooth. If you're watching it on a 60 Hz computer monitor it will not be smooth. If your computer is underpowered it may not not be smooth. If it's really 50p content, properly encoded and authored to a PAL DVD, and properly played on a PAL TV it should be smooth.
    Quote Quote  
  11. Ultimate target is a Sony TV (at claimed 100Hz).
    But if we are taking 50p (real) footage and reducing it to 25i - are we not throwing away half of the frames, thus introducing stutter?
    Quote Quote  
  12. Originally Posted by akkers View Post
    Ultimate target is a Sony TV (at claimed 100Hz).
    But if we are taking 50p (real) footage and reducing it to 25i - are we not throwing away half of the frames, thus introducing stutter?
    No, you're throwing away half the fields. It still has smooth 50 fields per second motion. In any case, you have no choice for DVD -- it does not support 50p.
    Quote Quote  
  13. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    For better analysis upload a clip from your source. 10 or 15 seconds should be enough
    Quote Quote  
  14. I am attaching 2 clips. The first is straight out of camera original clip (50p). The 2nd one DVD_YDXJ0001 is the converted one through HENC/avisyn/AVStoDVD.

    You can clearly see the converted clip has a lot of stutter.
    Image Attached Files
    Quote Quote  
  15. Your MPG clip is 25p, not 25i.

    Code:
    LWLibavVideoSource("YDXJ0001.MP4") 
    BilinearResize(720,576)
    AssumeTFF()
    SeparateFields().SelectEvery(4,0,3).Weave()
    Image Attached Files
    Quote Quote  
  16. I don't know your encoding tools, but your output is 25p progressive rather than 25i, means you threw 50% of the time resolution away.
    Use this simple script
    Code:
    DirectShowSource("YDXJ0001.MP4")  #or a source filter of your choice
    bicubicresize(720,576)
    separatefields().selectevery(4,0,3).weave()  #for TFF
    and encode this as INTERLACED.

    Edit: ooops, jagabo was faster
    Quote Quote  



Similar Threads

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