avi to mpeg problems

edited June 2004 in Internet & Media
hi there

i'm a newbie to dvd authoring so if anyone can help i'd be really thankful.

i recently bought a dv camera - canon mv700i and i want to put my holiday footage onto dvd. when i convert from avi to mpeg2 ( i have been using TMPGEnc and Adobe's media encoder within premiere pro to do this) i get a nasty distortion on the picture.

When there is movement from people or objects a series of jagged horizontal lines follow the movement. obviously this looks awful on the tv when playing on my dvd player.

i'm transferring all my footage from camera to computer through firewire.

can anyone help me?

thanks in advance!!!

Comments

  • ThraxThrax 🐌 Austin, TX Icrontian
    edited June 2004
    This is difficult. Your camera shoots in an interlaced format (I think).

    There's three things you might be suffering from, however, since I don't know the full specs of your camera (Despite my trying to locate them):

    1. It's pure 29.97 interlaced source being fuggered up by playback or conversion. Deinterlacing is the reverse of this process:
    INTERLACING is the use of two half-frames (fields) instead of one whole frame. The two fields are shown at a slight time difference and in a way so line 1,3,5... is from the first field and line 2,4,6... is from the second. Most TV’s will show the picture this way, first field 1 then field 2. Computer monitors and some progressive DVD decks on the other hand will show both fields at once, so some form of deinterlacing must be used on interlaced material. What follows is a picture of an interlaced frame and another of the same picture deinterlaced by blending.

    <b>OR</b>

    2. It's an telecined 29.97 FPS stream and requires IVTC (Inverse Telecine) to make it 23.976, to fix your jaggies.
    TELECINE is a process where the FILM first is slowed down to 23.976 frames/second. Then for every 4 frames, an extra frame is created from fields of adjacent frames. If a frame consists of two fields, top (t) and bottom (b) and the original sequence is 1t1b 2t2b 3t3b 4t4b, then the telecined sequence would be 1t1b 2t2b 2t3b 3t4b 4t4b (commonly called 2:3 pull down because of the alternating 2 field, 3 field progression). This also means that the frame rate increases to 29.97 frames/second. <i>Inverse</i> telecine is the elimination of this process to reduce a film back to its clean, native 23.976 shot.

    OR

    3. Your interlaced material is not being properly encoded to MPEG by the program you're using. If you want to keep the pure interlace (Which I think your camera encodes), you need to make sure that the programs you're using aren't trying to use an NTSC FILM template on you (TMPGenc).


    How do I know if I need to IVTC or deinterlace?
    Another way to check the frames is to open it in VirtualDub and make an examination of the frames. You're hoping to see very few interlaced frames (which a deinterlacer can take care of), and one duplicate in every 5 frames. If, in every 5 frames, you see 2 interlaced frames and 3 non-interlaced (progressive) frames, then it has been telecined and can be IVTC'd (Inverse Telecined). If you see that every frame is interlaced, then it was created at 29.97fps (actually 30fps) and you'll need to deinterlace.


    There's an easy way of doing deinterlacing with AVISynth Scripts, CinemaCraft Encoder 2.66, and AVISynth this script here may work for that:
    function maskDeint (clip c, int "order", int "cut", int "rolloff", bool "post",
    \ bool "halfy", int "bobber")
    {
    order=default(order,0)
    cut=default(cut,1)
    rolloff=default(rolloff,16)
    rolloff=cut+rolloff
    post=default(post,false)
    halfy = default(halfy,true)
    bobber = default(bobber,1)

    c2 = (halfy==true)? c.horizontalreduceby2() : c
    c_toms = c.tomsmocomp(order,5,0)
    c_sang = c.sangnom(order)
    c_kern = c.kerneldeint(order=order, threshold=0)
    cdeint = (bobber==1)? c_kern : (bobber==2)? c_sang : c_toms

    cdeint = (post==true)?
    \cdeint.yv12convolution(horizontal="1",vertical="1,2,1",Y=3,U=3,V=3,usemmx=true) : cdeint
    overlay(c,cdeint,mask=mcComb(c2,cut,rolloff).pointresize(c.width,c.height))
    }

    ##### misc functions called inside the above #####

    function McComb (clip c, int "cut", int "rolloff")
    {
    cut=default(cut,1)
    rolloff=default(rolloff,cut+16)
    c=c.converttoyv12(interlaced=true)
    overlay(c.doubleweave().selectodd(),c,mode="difference").limiter()
    yv12convolution(horizontal="1",vertical="1,-2,1",Y=3,U=0,V=0,usemmx=true)
    gauss(8).levels(cut,1,rolloff,0,255,coring=false)
    }

    function gauss (clip c,int "radius",bool "conv",int "precision") {

    radius=default(radius,4)
    conv=default(conv,false)
    precision=default(precision,8)
    mul=int(pow(2,precision))

    Function siney(string s,int stop,int len,int mul)
    {
    eqn = string(round(mul*pow(sin(pi*stop/len),2)))
    #(stop == 0) ? s : eqn + "," + siney(s,stop-1,len)
    return (stop == 0) ? s : siney(s,stop-1,len,mul) + "," + eqn
    }

    matrix=siney("",radius*2,radius*2,mul)
    matrix=matrix.midstr(2,(matrix.strlen()-3))

    (conv==false)?c.bilinearresize(4*(c.width/(radius*2)),4*(c.height/(radius*2)))
    \.bicubicresize(c.width,c.height,1,0):
    \c.yv12convolution(horizontal=matrix,vertical=matrix,Y=3,U=3,V=3,usemmx=true)

    }

    Save that script as deint.avs, and then write this script after you've download these plugins 1. TomsMoComp, 2. Sangnom, and 3. KernelDeint:
    LoadPlugin("x:\path\to\TomsMoComp.dll")
    LoadPlugin("x:\path\to\sangnom.dll")
    LoadPlugin("x:\path\to\KernelDeint.dll")
    AviSource("YOUR AVI HERE")
    Import("deint.avs")
    maskDeint()
    Lanczos4Resize(720,480)

    If the source is 23.976 encapsulated in 29.97, run IVTC:
    AviSource("YOUR AVI HERE")
    Telecide(Guide=1,Post=False)
    Decimate(Cycle=5)
    Lanczos4Resize(720,480)

    If you don't want to fuss with AVISynth and CCE, here's how you deinterlace or IVTC in TMPGEnc:

    Deinterlacing/IVTC Tutorial for TMPGEnc

    Always remember this:
    FOR NTSC PEOPLE: FORCE FILM WHEN YOU CAN, IVTC WHEN YOU CAN'T FORCE FILM, AND DEINTERLACE WHEN YOU CAN'T DO EITHER.

    I think the second tutorial is better for your purposes, but the first one will produce more admirable results.

    My final prognosis? No ****ing clue what it really is.

    1. If it's 29.97 FPS interlace. God help your soul.
    2. If it's telecined 23.976, rest easy. Do a 2:3 pulldown with pulldown.exe and the pulldown gui from the same page after you've run IVTC.
    3. If you want to forgo conversions and keep your stream, make sure it's not trying to force FILM on your 720i source.

    <b>If you REALLY want this solved, send me as much footage as you possibly can on a DVD (Don't encode anything, just take it straight off the camera for me in AVI/MPEG) and I'll try to fix it and give you a tutorial on how to correct your footage from here on out.</b>

    If this prospect sounds good to you, PM me, and I'll give you my address. Either way, we'll get you sorted.

    The main problem here is it's just hard to ascertain the source, so I can't declare a definitive process.
  • edited June 2004
    just want to say thanks alot to thrax for taking the trouble and effort to reply to my problem. i've just sent you a PM! thanks again mate and hopefully i'm on the first step to solving my prob!!
  • ThraxThrax 🐌 Austin, TX Icrontian
    edited June 2004
    You've told me that your source is PAL (You're in the UK).

    That's good because they don't have telecining, but bad because it's almost guaranteed to be interlaced.
  • MediaManMediaMan Powered by loose parts.
    edited June 2004
    Telecine should be the same "old" term for 3:2 pulldown. A quick check to the camera specs/website should tell you the native format of the camera (NTSC or PAL).

    Sideways motion of the scene will give away the redraw effect between converting NTSC format to PAL format.

    Quick question? Does the jagged effect appear on the PC once the footage is dubbed in or just on DVD playback once the disk is burnt and played in a standalone or PC dvd player?
  • edited June 2004
    thanks mediaman for you input but i have now solved the problem thankfully!

    the camera is PAL format (i'm based in the UK).

    I tried out a number of settings in premiere pro and finally found a combination that works. I used the 'Field interpolate' video effect that premiere offers and then encoded to mpeg2 using a progressive scan.

    The results are fantastic - no sign of line distortion anymore and the picture quality on tv playback is great.

    thanks for your help! :)
Sign In or Register to comment.