VideoHelp Forum




+ Reply to Thread
Results 1 to 7 of 7
  1. I know I'm making some type of simple mistake, but I'm having trouble removing commerials from a recorded television show in .MPG format. I recorded a television show using my ATI AIW 9700 pro video card, and everything worked great and now I just wanted to remove the commerials and then once they are out burn the final version on a SVCD. The burning it is no problem, just removing the commercails is where I'm having trouble.

    I first used VirtualDubMod to load the original .mpg video file and find all starting and ending frames where commercials start and stop and wrote all these values down. I would use this information later in my avisynth script.

    I have Gordian Knot 0.33.0 and from the ripping tab I opened the .mpg file with DGIndex 1.0.12 and found all the file information.

    In DGIndex I made the appropriate changes under Video 'Force FILM' since it's NTCS video type and under Audio selected 'Demux All Tracks(AC3, MPA, DTS) since it's MPEG Audio. Then I saved it and created the .d2v file.

    Next I opened the .d2v file from Gordian Knot and made appropriate changes to the 'Bitrate' tab and the 'Resolution' tab as the guide I was following instructed and I chose to use the XviD codec. Next I hit the 'Save & Encode' button after opening the .dv2 file from this screen I made needed selections, such as for 'Resizing' I left it as 'Selected Outupt Resolution', for 'Resize Filter' I selected 'Nutral Bicubic', for 'Noise Filter' I selected 'None' and for 'Field Operations' I selected 'TomsMoComp' and left everything else as default. Next I hit the 'Edit' button and added "Trim(0,436)+Trim(17768,24976)+Trim(50606,56174)+Tr im(72593,80510)+Trim(101032,116780) " to my AviSynth Script and didn't change anything else in the script.

    Here's what the complete script looks like:
    # Created with Gordian Knot
    #
    # http://gknot.doom9.org

    # PLUGINS
    LoadPlugin("f:\PROGRA~1\GORDIA~1\AviSynthPlugins\d gdecode.dll")
    #LoadPlugin("f:\PROGRA~1\GORDIA~1\AviSynthPlugins\ decomb.dll")
    #LoadPlugin("f:\PROGRA~1\GORDIA~1\AviSynthPlugins\ KernelDeInt.dll")
    LoadPlugin("f:\PROGRA~1\GORDIA~1\AviSynthPlugins\U nDot.dll")
    #LoadPlugin("f:\PROGRA~1\GORDIA~1\AviSynthPlugins\ dgbob.dll")
    #LoadPlugin("f:\PROGRA~1\GORDIA~1\AviSynthPlugins\ Convolution3d.dll")
    #LoadPlugin("f:\PROGRA~1\GORDIA~1\AviSynthPlugins\ FluxSmooth.dll")
    LoadPlugin("f:\PROGRA~1\GORDIA~1\AviSynthPlugins\T omsMoComp.dll")
    #LoadPlugin("f:\PROGRA~1\GORDIA~1\AviSynthPlugins\VSFilter.dll")
    #LoadPlugin("f:\PROGRA~1\GORDIA~1\AviSynthPlugins\ SimpleResize.dll")

    # SOURCE
    mpeg2source("J:\Survivor\Survivor.d2v")

    # TRIM
    Trim(0,436)+Trim(17768,24976)+Trim(50606,56174)+Tr im(72593,80510)+Trim(101032,116780)

    # IVTC
    #Telecide(order=1,guide=1).Decimate()
    # or use
    #IVTC(44,11,95)
    #GreedyHMA(1,0,4,0,0,0,0,0)

    # CROPPING
    crop(2,0,348,240)

    # DEINTERLACING (1)
    #FieldDeinterlace()
    #FieldDeinterlace(blend=false)
    TomsMoComp(1,5,1)

    # DEINTERLACING (2)
    #KernelDeInt(order=1,sharp=true)
    # or maybe
    #DGBob(order=1,mode=0)

    # DEINTERLACING (3) - special requests
    #GreedyHMA(1,0,0,0,0,0,0,0)
    #Telecide()
    #SeparateFields()

    # SUBTITLES
    #VobSub("FileName")

    # RESIZING
    BicubicResize(640,480,0,0.5)

    # DENOISING: choose one combination (or none)
    Undot()

    # 1) little noise
    #Temporalsoften(2,3,3,mode=2,scenechange=6)
    #mergechroma(blur(1.3))
    #FluxSmoothST(5,7)

    # 2) medium noise
    #Temporalsoften(3,5,5,mode=2,scenechange=10)
    #Convolution3d("moviehq")
    #FluxSmoothST(7,7)

    # 3) heavy noise
    #Temporalsoften(4,8,8,mode=2,scenechange=10)
    #Convolution3d("movielq")
    #FluxSmoothST(10,15)

    # BORDERS
    #AddBorders(left,top,right,bottom)

    # COMPRESSIBILITY CHECK
    # !!!!Snip Size now has to be 14 for use in GKnot!
    #SelectRangeEvery(280,14)

    # FOOL CCEnc
    #empty = BlankClip()
    #AudioDub(last,empty)


    Next I added the Audio and Video files to the Gordian Knot encoding job queue and started the encoding process. After it finishes the video files was trimmed down to only 14 minutes (orinially it was around an hour, and after trimming commercials it should have been around 45 minutes) and the commerials are still in there and the audio is now out of sync? If I don't add that TRIM line to the AviSynth Script it ecodes perfectly to an .avi file but since this .mpg file was 600MB to begin with I wasn't encoding it to shrink it so it would fint on a VCD it was already small enough for that, I just wanted to remove the commerials. Obviously my problem is in the TRIM statement but I'm unsure what to try next.

    Thanks for any help, and I'm sorry if I've posted this in the wrong section.
    Quote Quote  
  2. Use VideoRedo and you'll remove those commercials in about a minute and half and you won't have to write anything down.
    Quote Quote  
  3. Thanks I may give VideoRedo a try - but I'd rather not have to pay for something. But since I've been trying to do this for about 3 days I'm sure I've wasted $49.99 of my own time! Now it's more of a challenge to find out what I've done wrong. Thanks for the quick reply.
    Quote Quote  
  4. VideoRedo has a free trial. If you are only going to do this a few times you get to use the program for free. If you are going to do it a lot it is well worth buying. Don't forget, your time is worth something too.
    Quote Quote  
  5. Member DVWannaB's Avatar
    Join Date
    Dec 2001
    Location
    United States
    Search PM
    Originally Posted by jreed
    In DGIndex I made the appropriate changes under Video 'Force FILM' since it's NTCS video type and under Audio selected 'Demux All Tracks(AC3, MPA, DTS) since it's MPEG Audio. Then I saved it and created the .d2v file.
    Agree with presto. You might as well buy it, because you will need again and again. Another good program for cutting commercials in Womble MPEG2VCR and MPEG Video Wizard.

    One thing I noticed in you post above, I would strongly, strongly advise against doing that. Unless you are very knowledgable about handling such intricacies of video frame rate, I would not do Force Film for a TV capture. Its more problems than its worth. If the Gordian Knot package includes an advanced upgrade from previous versions that allow a simple "check Force Film.... and we do the work for you" then you are going to be disappointed.

    For TV capture check the "No video performance" or whatever its called. Also, I am assuming you stepped through your captured video and noticed the 3/2 pattern of interlace and progressive frames? Another thing to note is TV movies tend to break that 3/2 pattern because of where commercials are inserted and where they decide to cut the movie. Word to the wise. Be forwarned.
    Quote Quote  
  6. presto is right, there is an easier way for you to do this, but here are some possible reasons it went wrong. I haven't tried the Avisynch scripting to remove commercials, but a quick look at your log makes me wonder if you don't have the frames reversed, i.e., you are leaving in the commercial frames instead of excluding them. The 14 minutes result vs. 45 minutes expected is a pretty good clue given your one hour program!

    The two arguments in the Avisynch Trim(xxx,xxx) command defines the beginning and ending frames to include in the video. Perhaps you inserted the beginning and ending frames of the commercials instead. The log would seem to indicate that the included video ranges were far smaller that the total frames, which would tend to confirm this possibility.

    You should NOT have used "Force Film" in DGIndex. This setting is only for theatrical film movies from video sources such as DVDs. The "Force Film" setting simply restores the original movie framerate of about 24 fps and can't be used with television programs.

    NTSC is a televison standard, encoded at about 30 fps and is interlaced. See Force Film, IVTC, and Deinterlacing for explanations of various standards and conversions. DVD2AVI was renamed to DGIndex.

    The audio is bound to be a problem, as removal of the commercials affects only the video, not the audio under the method you are trying. You are attempting to edit the video to a shorter length with a full length audio track.

    The best option is to edit the original MPEG file with the programs recommended by presto and DVWannaB. You can then convert to a VCD or Xvid if desired.
    Quote Quote  
  7. Hey guys thanks for the information! OK that definitely makes sense on why my TRIM statement didn't work and I can correct that, and that also makes sense about the not using the 'Force to Film' option and I know where to change that but I'm not sure how to fix the audio, like '??' said:
    The audio is bound to be a problem, as removal of the commercials affects only the video, not the audio under the method you are trying. You are attempting to edit the video to a shorter length with a full length audio track.
    That is definitely a problem, unless you know of a AviSynth like program for audio?

    Thanks everyone for sharing your knowledge! I really appreciate all your input!
    Quote Quote  



Similar Threads

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