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
    May 2004
    Location
    Brazil
    Search Comp PM
    There's a film I shot in DV and HDV, mainly because of budget restrictions I had. The intention had been to try blowing the SD material to HD later on, all to be edited in Avid Media Composer in an HD timeline.

    Following some tips I got from Doom9, I got to do some tests that proved quite promising. So I ended up blowing things up with ffmpeg using an avisynth script that read like this:

    Code:
    import("C:\video\AviSynth 2.58\plugins\BlindDeHalo3.avs")
    AVISource("h:file.avi") 
    trim(1991,3000)
    converttoyv12(interlaced=true)
    TempGaussMC_beta1mod(EDIMode="NNEDI2")
    nnedi(field=0,dh=true).TurnRight().nnedi(field=0,dh=true).TurnLeft()
    spline36resize(1280,960)
    BlindDeHalo3(rx=3.2,ry=1.5)
    sharpen(0.3)
    spline36resize(1920,1080)
    return last
    separatefields.selectevery(4,0,3).weave
    What I would like to know is if there are other options to do this, instead of going through ffmpeg.
    Quote Quote  
  2. You can use any encoder that supports AviSynth scripts.
    Quote Quote  
  3. Member
    Join Date
    May 2004
    Location
    Brazil
    Search Comp PM
    Originally Posted by jagabo View Post
    You can use any encoder that supports AviSynth scripts.
    But which of them allow upscaling to DNxHD MOV?
    Quote Quote  
  4. Originally Posted by carlmart View Post
    Originally Posted by jagabo View Post
    You can use any encoder that supports AviSynth scripts.
    But which of them allow upscaling to DNxHD MOV?
    only ffmpeg for free; but you can do it through any software that can access quicktime API (e.g. premiere pro with .avs import plugin, vegas with avisynth virtual file system AVFS) , if you have dnxhd installed

    the upscaling part is done by avisynth and your script

    the encoding part is done by ffmpeg

    What is your question? Are you asking for other upscaling methods ? other import formats? or other encoding options?

    The problem is trying to get quicktime to "read" an .avs script. You can with AVFS , just add ConvertToRGB24() at the end of the script.
    Quote Quote  
  5. Member
    Join Date
    May 2004
    Location
    Brazil
    Search Comp PM
    Originally Posted by poisondeathray View Post
    only ffmpeg for free; but you can do it through any software that can access quicktime API (e.g. premiere pro with .avs import plugin, vegas with avisynth virtual file system AVFS) , if you have dnxhd installed
    It has to be for free. I use Avid, not Premiere or Vegas. So I do have dnxhd installed.

    the upscaling part is done by avisynth and your script

    the encoding part is done by ffmpeg
    I upscaled my two longer shots with ffmpeg two weeks ago. But on the third shot I tried yesterday I'm getting this error:

    http://www.mediafire.com/i/?mzahzzjiymy

    As the script is the same, only changing the avi shot, and the ffmpeg variables are also the same, I wonder why I'm getting this error.

    What is your question? Are you asking for other upscaling methods ? other import formats? or other encoding options?
    Until I find out what is happening I'm looking for alternate methods.

    The problem is trying to get quicktime to "read" an .avs script. You can with AVFS , just add ConvertToRGB24() at the end of the script.
    Any other option besides those you mentioned?
    Quote Quote  
  6. judging from that error message I would say something is wrong with your script . It's reading the dimensions as 840x80, which isn't compatible with DNxHD

    What you open your script in vdub, and use file=>file information what does it say?

    There are no other options for encoding to dnxhd. On windows, it has to be done through quicktime API (some of those programs I mentioned, or maybe mpegstreamclip). So you need quicktime installed. If you are trying to use avisynth that's even harder, because quicktime doesn't understand avisynth. The only reliable way is frameserve through AVFS.

    You could also try encoding your avs script to uncompressed AVI, then feed that into ffmpeg
    Last edited by poisondeathray; 19th Mar 2010 at 14:33.
    Quote Quote  
  7. Member
    Join Date
    May 2004
    Location
    Brazil
    Search Comp PM
    I'm ashamed to confess that the error was mine and simpler than I thought it might be: wrong directory for the avi file on the script.

    It would be longish and unnecessary to explain why it happened, but I tried that and it worked. My fault and I'm sorry for my mess. Conversion went fine.

    Now I have a different problem: where to put the trim line for it to work. I'm working on upscaling another shot, using the same script as on my first post above.

    The problem is where to place the trim line. It doesn't work as it should where it is now: I get one frame long shot.

    Where should the trim line be placed for it to work correctly?
    Quote Quote  
  8. Originally Posted by carlmart View Post
    The problem is where to place the trim line. It doesn't work as it should where it is now: I get one frame long shot.

    Where should the trim line be placed for it to work correctly?
    Use AvsP and figure it out the start & end frames of the section you want to keep.

    It is usually after you bob it (so after TGMC) , because the frame count is doubled. Once you have that section Trim(start,end) , then you can re-interlace it
    Quote Quote  
  9. Nothing happens after the 'Return Last' line. Therefore it's not being reinterlaced. Therefore the framecount remains doubled. Therefore your Trim statement is trimming about 995 to 1500 of the original frames.

    Is the DV BFF to begin with? If so, do you know you're reversing the field order (after you get the reinterlacing going again)? Nor do I think TempGaussMC the best bobber for this kind of work.
    Quote Quote  
  10. Member
    Join Date
    May 2004
    Location
    Brazil
    Search Comp PM
    Originally Posted by manono View Post
    Nothing happens after the 'Return Last' line. Therefore it's not being reinterlaced. Therefore the framecount remains doubled. Therefore your Trim statement is trimming about 995 to 1500 of the original frames.
    OK. Now that I put the trim line after TGMC things were fine.

    Is the DV BFF to begin with? If so, do you know you're reversing the field order (after you get the reinterlacing going again)? Nor do I think TempGaussMC the best bobber for this kind of work.
    How do I find out which DV type mine is? What would you suggest to make things right again?

    Which bobber would you suggest for this application?
    Quote Quote  
  11. Member
    Join Date
    May 2004
    Location
    Brazil
    Search Comp PM
    Sorry. I didn't know the terms Bottom Field First or Top Field First could be named with BFF or TFF.

    AFAIK all DV is captured as BFF, from what I could find out. These particular videos were captured with WinDV, and you can't specify on it what you want it to be.

    Also what I don't know is what Avid does when it imports the video.
    Quote Quote  
  12. DV is BFF. I don't see how your script is going to change the field order.
    Quote Quote  
  13. Originally Posted by carlmart View Post
    OK. Now that I put the trim line after TGMC things were fine.
    As long as you reinterlace after the 'Return Last' line, it doesn't get reinterlaced. Either remove it entirely (there's no need for it at all, as near as I can tell), or make it the very last line.
    Originally Posted by jagabo View Post
    DV is BFF. I don't see how your script is going to change the field order.
    Correct me if I'm wrong because interlaced video isn't my strong suit, but if you put an 'Info()' line at the end of the script, doesn't it show as TFF? He never had an 'AssumeBFF' before beginning the reinterlacing. The SelectEvery(4,0,3) does it (unless I'm very mistaken). There's nothing really wrong with reversing the field order except for...
    Originally Posted by carlmart View Post
    Which bobber would you suggest for this application?
    Just about anything other than TempGaussMC. It's good at doing away with aliasing, but it affects both fields. If the aim is to upsize with as little filtering otherwise as possible (except for what you put into the script), then something like Yadif is fine. All TempGaussMC does is slow the encoding to a crawl. The visual difference might be slight but the encoding speed difference is significant.

    Most bobbing deinterlacers will keep one field the same and interpolate off of it to bob the second field (that's a simplistic explanation, I know). When reinterlacing you want to use the unfiltered field which usually, in the case of BFF, means the bottom field. So, I'd use 'SelectEvery(4,1,2)'. It keeps it BFF and should result in slightly better quality. Alexander taught me this. Where are you Alexander (or Gavino)? Did I mess up your teachings? I'd reinterlace it like this:

    AssumeBFF()
    Yadif(Mode=1)
    #Upsize, Halo Removal, Sharpen
    AssumeBFF()
    SeparateFields()
    SelectEvery(4,1,2)
    Weave()

    Also, I see no need for resizing twice. Is there really a Doom9 thread that recommends all the things you've done the way you've done them? Is there a link? Or, as I suspect, have you taken bits and pieces from various threads and posts to come up with this?
    Quote Quote  
  14. Originally Posted by manono View Post
    Originally Posted by jagabo View Post
    DV is BFF. I don't see how your script is going to change the field order.
    Correct me if I'm wrong because interlaced video isn't my strong suit, but if you put an 'Info()' line at the end of the script, doesn't it show as TFF?
    AviSynth assumes BFF with AviSource().
    Quote Quote  
  15. Oh yeah, you're right. I was testing with an MPEG, and it seems to behave differently. Thanks for the correction.

    I'll apologize to carlmart for needlessly confusing the issue. I still see no need for TempGaussMC or for the double resize (although maybe there's a reason for doing it that way I haven't noticed yet).
    Quote Quote  
  16. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by manono View Post
    When reinterlacing you want to use the unfiltered field which usually, in the case of BFF, means the bottom field. So, I'd use 'SelectEvery(4,1,2)'. It keeps it BFF and should result in slightly better quality. Alexander taught me this. Where are you Alexander (or Gavino)? Did I mess up your teachings?
    Perhaps I'm misunderstanding what you're saying, but I think you've got this the wrong way round - SelectEvery(4,1,2) reverses the original (assumed) field order, while SelectEvery(4,0,3) preserves it.
    Quote Quote  
  17. Originally Posted by manono View Post
    Oh yeah, you're right. I was testing with an MPEG, and it seems to behave differently. Thanks for the correction.
    That's funny. Yesterday, when I checked to be sure I was right, I opened an MPEG file I had just finished working with and saw AviSynth assumed TFF. I didn't realize before then that AviSynth could assume TFF at times. So I learned something from you too!
    Quote Quote  
  18. Originally Posted by Gavino View Post
    Perhaps I'm misunderstanding what you're saying, but I think you've got this the wrong way round - SelectEvery(4,1,2) reverses the original (assumed) field order, while SelectEvery(4,0,3) preserves it.
    You're not misunderstanding, and maybe I just should have deleted or heavily edited that earlier post. It's probably reversing a reversal bringing it back to BFF. Or something. As I said later on, I was testing with an MPEG and his first script didn't work right with it.

    Do you agree that just about any bobber will work well for this, as long as you're careful to use the original uninterpolated field when reinterlacing - that there's no need for the excruciatingly slow TempGaussMC?
    Quote Quote  
  19. Member
    Join Date
    May 2004
    Location
    Brazil
    Search Comp PM
    Originally Posted by manono View Post
    Also, I see no need for resizing twice. Is there really a Doom9 thread that recommends all the things you've done the way you've done them? Is there a link? Or, as I suspect, have you taken bits and pieces from various threads and posts to come up with this?
    There's a thread I begun there a long time ago on this upscale, and the tips I got were from there.

    http://forum.doom9.org/showthread.php?t=145314

    I do not know enough to come up with this scripts yet.

    If you look at post #162 you will see that I agree that Yadif was marginally better for deinterlacing. It showed quite well in AvsP.

    But a few posts below, our friend Poison argued that yadifmod+nnedi2 could leave artifacts. So I went in a different direction.

    The problem I was having was a different one, as there was an artifact I described later on, that I thought might be related to yadif. But it was not, and apparently might be an Avid codec problem.
    Last edited by carlmart; 21st Mar 2010 at 06:49.
    Quote Quote  
  20. Member
    Join Date
    May 2004
    Location
    Brazil
    Search Comp PM
    Just to be more thorough. The artifact I have sometimes is like this. Imagine a circle which splits horizontally in two, and you see them displaced for a split second, sometimes in two places at the same time.

    At first I thought it might be something related to Avid and its video player, which is QT, or even the video board. But when I used a Geforce 9600GT, things were crystal clear, so it's not hardware related.

    My guess was it might be related to the deinterlacing plug-ins, as the artifact always happens in movements: subject, pan or camera movement. It's a split second, so it doesn't show when you view it frame by frame.

    Any suggestions?

    1) The name of this artifact.

    2) Tips to avoid them.
    Quote Quote  
  21. Originally Posted by manono View Post
    Do you agree that just about any bobber will work well for this, as long as you're careful to use the original uninterpolated field when reinterlacing
    Neither field of the upscaled image will contain only data from the original field.
    Quote Quote  
  22. Originally Posted by carlmart View Post
    Just to be more thorough. The artifact I have sometimes is like this. Imagine a circle which splits horizontally in two, and you see them displaced for a split second, sometimes in two places at the same time.

    At first I thought it might be something related to Avid and its video player, which is QT, or even the video board. But when I used a Geforce 9600GT, things were crystal clear, so it's not hardware related.

    My guess was it might be related to the deinterlacing plug-ins, as the artifact always happens in movements: subject, pan or camera movement. It's a split second, so it doesn't show when you view it frame by frame.

    Any suggestions?

    1) The name of this artifact.

    2) Tips to avoid them.


    This sounds like a tearing artifact, and a playback issue. If you watch videos through flash player (e.g. youtube) you can consistently see this

    Post a sample to provide more information




    But a few posts below, our friend Poison argued that yadifmod+nnedi2 could leave artifacts. So I went in a different direction.
    Actually they ALL leave artifacts. They ALL have problems. You will find TGMC might let a few frames pass through with jaggies, but overall is usually better than most deinterlacers. Sometimes you have to tweak the settings to get the best out of it. I've gone so far as to mix & match frames from different deinterlacers.
    Quote Quote  
  23. Originally Posted by jagabo View Post
    Originally Posted by manono View Post
    Do you agree that just about any bobber will work well for this, as long as you're careful to use the original uninterpolated field when reinterlacing
    Neither field of the upscaled image will contain only data from the original field.
    Sure, but that's not what I said, or not what I intended to say. With regular old bobbers, ones like TDeint in bob mode, LeakKernelBob, Yadif in bob mode, etc. (but not TempGaussMC), the new frame will contain one untouched field and one interpolated from that field in various ways. Heck, probably even AviSynth's basic Bob() should be OK for this. Then you go ahead and filter it (here resizing, dehaloing, and sharpening). And when the time comes to reinterlace it, you want to make sure you use the field that hasn't been created by interpolation in the first place, the one that was originally untouched before the filtering took place. But both fields from a TempGaussMC bob have already been filtered prior to being additionally filtered (in carlmart's script). The AviSynth page says this about it:
    Motion-compensated bob deinterlacer, based on temporal gaussian blurring. Reduces noise/grain of the source and does NOT leave the original fields unchanged.
    http://avisynth.org/mediawiki/TempGaussMC

    Which isn't to say it's bad, just that it wasn't intended for this job and is overkill for what the bobber is needed for in this kind of a script.

    Maybe that makes more sense. Or maybe not. And maybe you don't even agree. I don't know.
    Quote Quote  
  24. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by manono View Post
    With regular old bobbers, ones like TDeint in bob mode, LeakKernelBob, Yadif in bob mode, etc. (but not TempGaussMC), the new frame will contain one untouched field and one interpolated from that field in various ways. Heck, probably even AviSynth's basic Bob() should be OK for this. Then you go ahead and filter it (here resizing, dehaloing, and sharpening). And when the time comes to reinterlace it, you want to make sure you use the field that hasn't been created by interpolation in the first place, the one that was originally untouched before the filtering took place.
    I see what you're getting at, but once you introduce resizing into the post-deinterlacing filter chain, you are inevitably mixing data from both fields, so in principle you want that data to be as good as possible.

    You may well be right that TempGaussMC is overkill in this case, but I think that would depend more on the quality of the OP's source material.
    Quote Quote  
  25. Member
    Join Date
    May 2004
    Location
    Brazil
    Search Comp PM
    Originally Posted by poisondeathray View Post
    This sounds like a tearing artifact, and a playback issue. If you watch videos through flash player (e.g. youtube) you can consistently see this

    Post a sample to provide more information
    That is next to impossible to implement, at least from what I know. The original DV shot plays flawlessly, and the converted mov/DNxHD file proved unplayable except inside Avid after it imports it.

    It is not in the original or even shows in Avid when you play frame by frame.

    That's why I think it's a temporary playback issue, that hopefully will not be there when I export the final edit.

    Actually they ALL leave artifacts. They ALL have problems. You will find TGMC might let a few frames pass through with jaggies, but overall is usually better than most deinterlacers. Sometimes you have to tweak the settings to get the best out of it. I've gone so far as to mix & match frames from different deinterlacers.
    How did you do that, mixing and matching frames?

    But you are right: I'm sure all plugins leave artifacts. The ones I care more are those that show more. Some are just a fair price to pay for some other benefit.

    I also want to learn how to tweak the settings, as most are still chinese for me, difficult to grab.
    Quote Quote  
  26. Originally Posted by carlmart View Post

    How did you do that, mixing and matching frames?
    This is trivial to do in an editor, but it can get as difficult as you want it to be. You basically make as many versions as you want (you might make several different TGMC versions with different settings, throw in some MCBOB versions, etc.... and mix and match the best frames from each), you can even do this in avisynth, but it's a lot easier to do in a NLE like premiere, vegas or avid etc...

    But you are right: I'm sure all plugins leave artifacts. The ones I care more are those that show more. Some are just a fair price to pay for some other benefit.
    They all degrade quality. They all leave artifacts or damage quality in some manner, some worse than others (e.g. TGMC might erode detail with default settings).

    If you can't provide a sample or see it on a frame by frame basis when scrubbing, I suspect the ones you describe are probably from playback issues (screen tearing & video refresh).

    I also want to learn how to tweak the settings, as most are still chinese for me, difficult to grab.
    You have to read the documentation - it's all there - then play with the settings. TGMC has many settings, and even then some frames are better , some are worse. If you mix & match you can get better results - this can be very tedious to do
    Quote Quote  



Similar Threads