VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 32
Thread
  1. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    I recently added this to my AVS script to covert my DVD video to what I believe is the correct color space:
    Code:
    ConvertToYUY2(interlaced=true)
    But the resulting AVI is now 0.001 seconds shorter, and some of the shots either start 1 frame later or end 1 frame earlier.
    Is this normal? Or is there something I'm not doing right?

    Other software I use in my process:
    DVDFab HD Decrypter
    DGIndex
    Srestore
    QTGMC
    Xvid
    VirtualDub
    Quote Quote  
  2. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    Why are you converting, what I am assuming is a commercial DVD, from YV12 to YUY2?
    Quote Quote  
  3. You must have done something else to the script. ConvertToYUY2 cannot affect the framecount or duration. The interlaced argument does not make the resulting clip interlaced or not interlaced; it merely affects the chroma resampling. To lose 0.001 second duration means your framerate is 1000 FPS, which is unlikely.

    In general, if your script is giving odd results (and it happens to everybody), take a guess at the problem line and add an Info statement just below it. This tells you about the current image size, framerate, duration, etc etc. If the Info is what you expected at that point, try another line. It may take several guesses, but eventually you will find the line that actually caused the problem.
    Quote Quote  
  4. The problem is more likely in the source filter. Some are not frame accurate on random seeks.
    Quote Quote  
  5. Who cares about 0.001 seconds?
    Quote Quote  
  6. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    Originally Posted by sneaker View Post
    Who cares about 0.001 seconds?
    Also don't understand where this number comes from considering a 29.97fps video has a frame every .033 seconds.
    Quote Quote  
  7. The millisecond difference in length is probably a rounding error by the program reporting the statistics.
    Quote Quote  
  8. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by KarMa View Post
    Why are you converting, what I am assuming is a commercial DVD, from YV12 to YUY2?
    It is a commercial DVD. But it's my understanding that VirtualDub doesn't handle interlaced YV12 properly. So shouldn't I be converting it to YUY2?

    Originally Posted by jagabo View Post
    The problem is more likely in the source filter. Some are not frame accurate on random seeks.
    Is there a more accurate alternative to random seeks?

    Originally Posted by sneaker View Post
    Who cares about 0.001 seconds?
    I have frames I'm trying to hide with typography overlays that I add using the TextSub filter. So even with this small difference, the out of place frames are actually apparent even at regular playback speed because the original typography that I don't want to be visible is usually different enough in appearance so that it can be seen briefly flashing (for 1 frame).
    Quote Quote  
  9. Originally Posted by lomaidala View Post
    it's my understanding that VirtualDub doesn't handle interlaced YV12 properly. So shouldn't I be converting it to YUY2?
    It depends on what you're using VirtualDub for. If you are performing an inverse telecine in AviSynth (and the tools for that in AviSynth are far better than those in VirtualDub), or otherwise deinterlacing, the final output is progressive YV12 -- fine for VirtualDub. If you need to work with interlaced video in Virtualdub you definitely want to convert toYUY2 or RGB first.

    Originally Posted by lomaidala View Post
    Originally Posted by jagabo View Post
    The problem is more likely in the source filter. Some are not frame accurate on random seeks.
    Is there a more accurate alternative to random seeks?
    What source filter are you using? The most reliable for MPEG 2 video is DgMpgDec. Build an index file with DgIndex then open that with Mpeg2Source("filename.d2v") in AviSynth.
    Quote Quote  
  10. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    If you need to work with interlaced video in Virtualdub you definitely want to convert toYUY2 or RGB first.
    I'm working with interlaced video by opening VirtualDub and then loading my AviSynth script.

    Originally Posted by lomaidala View Post
    What source filter are you using? The most reliable for MPEG 2 video is DgMpgDec. Build an index file with DgIndex then open that with Mpeg2Source("filename.d2v") in AviSynth.
    It is DgMpgDec that I'm using. And I've been using DgIndex just as you say. But when you say to open it in AviSynth, you mean to open the AVS script from VirtualDub when AviSynth is installed, right? That's my exact process.

    I'm also using the AVS script to replace the opening sequence with one from a second DVD.
    Quote Quote  
  11. Originally Posted by lomaidala View Post
    I have frames I'm trying to hide with typography overlays that I add using the TextSub filter. So even with this small difference, the out of place frames are actually apparent even at regular playback speed because the original typography that I don't want to be visible is usually different enough in appearance so that it can be seen briefly flashing (for 1 frame).
    So maybe the problem is with your subtitling software?
    A quick fix might be to simply delay (pos or neg) all subtitle timings by 1 or 2 ms using e.g. SubtitleEdit to account for the small difference.


    For me it is also not clear how you measure 1 ms difference. I mean you have your AviSynth script with DgMpgDec (what exactly does AviSynth say via info()?) and VirtualDub and I assume you look in VirtualDub File->File information. But where do you get the value you compare to? I mean frame rates on DVDs are standardized and constant so you could just use a calculator to come up with a correct value down to nanoseconds and then decide whether AviSynth/VirtualDub did some rounding wrong or not.
    Quote Quote  
  12. You should post your full AviSynth script.

    DgMpgDec does have problems with MPEG 2 in some containers. Its MKV parsing is bad, for example. But I've never had an issue with MPG or VOB containers.

    If you're using a multithreaded build of AviSynth be sure to run Mpeg2Source() at mode 5:

    Code:
    SetMtMode(5,4) # mode 5, 4 threads
    Mpeg2Source("filename.d2v")
    SetMtMode(2) # mode 2
    etc()
    Last edited by jagabo; 25th Feb 2018 at 08:08.
    Quote Quote  
  13. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by sneaker View Post
    For me it is also not clear how you measure 1 ms difference.
    I've been opening the finished AVI in VirtualDub, going to the final frame, and looking at the bottom of the screen where it shows the frame number and timestamp.

    Originally Posted by sneaker View Post
    (what exactly does AviSynth say via info()?)
    How do I do this?

    Originally Posted by jagabo View Post
    You should post your full AviSynth script.
    Code:
    LoadPlugin("C:\DGDecode.dll")
    clip1 = MPEG2Source("C:\1\VTS_01_1.d2v")
    clip2 = MPEG2Source("C:\2\VTS_01_1.d2v")
    clip2.Trim(18,2704)FadeOut(19) + clip1.Trim(2688,0)
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\mt_masktools-25.dll")
    Import("C:\Program Files (x86)\AviSynth 2.5\plugins\Srestore.avsi")
    QTGMC( Preset="Placebo" )
    ConvertToYUY2(interlaced=true)
    Srestore(Frate=23.976)
    I also have a new finding:
    I've found at least one instance in which not converting to the the YUY2 color space results in a unique frame that is completely missing. I know you said not converting the color space in my case is incorrect, but I thought I'd mention it in case it sounds odd.
    Last edited by lomaidala; 1st Mar 2018 at 19:59. Reason: I accidentally quoted the wrong person.
    Quote Quote  
  14. You're using QTGMC to deinterlace the clip. There's no need for convert to yuy2 for VirtualDub, it's no longer interlaced.

    You're inconsistent seeking is caused by SRestore. It does not generate the same sequence of frames upon random seeking. It needs to be run linearly.
    Quote Quote  
  15. Originally Posted by lomaidala View Post
    LoadPlugin("C:\DGDecode.dll")
    clip1 = MPEG2Source("C:\1\VTS_01_1.d2v")
    clip2 = MPEG2Source("C:\2\VTS_01_1.d2v")
    clip2.Trim(18,2704)FadeOut(19) + clip1.Trim(2688,0)
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\mt_masktools-25.dll")
    Import("C:\Program Files (x86)\AviSynth 2.5\plugins\Srestore.avsi")
    QTGMC( Preset="Placebo" )
    ConvertToYUY2(interlaced=true)
    Srestore(Frate=23.976
    if you're going to use FadeOut like that, you're increasing the framecount by one. If you want to keep the framecount the same, make it FadeOut0. I have no idea how not putting the 'dot' between the Trim and Fadeout affects this as normal scripts always include the dot.

    In fact, that whole script looks kind of convoluted to me. I stick all the LoadPlugin and Import lines before the actual script begins. There are other things I'd quibble with but different brains organize things differently.

    I test unblending with Yadif(Mode=1) because it's so much faster, and then put on QTGMC or another slower bobber for the encode. As jagabo mentions, seeking doesn't work quite right with SRestore. I 'sneak' up on the place I want to check by advancing from maybe 100 frames earlier, giving SRestore time to lock in the cadence.
    Quote Quote  
  16. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    You're using QTGMC to deinterlace the clip. There's no need for convert to yuy2 for VirtualDub, it's no longer interlaced.
    Thanks, that's good to know, but I did some comparisons with random frames, and the video with YUY2 conversion seems to be ever so slightly higher in quality (in the areas with medium dark colors). Plus the resulting file size is smaller (804mb instead of 820mb). While I'm much more concerned with doing things in a way that results in the highest quality at the expense of file size, a smaller file size with higher quality seems like a win win. Although now you have me wondering if there's something I'm missing.

    Is there something else happening here I don't know about that I'm doing when I convert to YUY2 in this case? Some loss in quality I haven't noticed?

    Is there some other disadvantage to converting to YUY2 in my case?

    Also, what about that unique frame I noticed that's missing when I don't do a color space conversion?

    Originally Posted by jagabo View Post
    You're inconsistent seeking is caused by SRestore. It does not generate the same sequence of frames upon random seeking. It needs to be run linearly.
    How do I run it linearly?

    Originally Posted by manono View Post
    if you're going to use FadeOut like that, you're increasing the framecount by one. If you want to keep the framecount the same, make it FadeOut0.
    Thanks! I've been manually subtracting a frame to compensate because I knew about the extra frame being added but didn't know about FadeOut0.

    Originally Posted by manono View Post
    I have no idea how not putting the 'dot' between the Trim and Fadeout affects this as normal scripts always include the dot.
    I didn't know I was leaving out a dot, thanks! I'll have to run some tests at some point and see if I can spot a difference with or without the dot. So like this, right?
    Code:
    clip2.Trim(18,2704).FadeOut(19) + clip1.Trim(2688,0)
    Originally Posted by manono View Post
    I stick all the LoadPlugin and Import lines before the actual script begins.
    Also good to know, thanks.

    Originally Posted by manono View Post
    There are other things I'd quibble with but different brains organize things differently.
    I'm curious what these would be if you feel like sharing. I'm always eager to learn about a potentially better or more efficient way of doing things.

    Originally Posted by manono View Post
    I test unblending with Yadif(Mode=1) because it's so much faster, and then put on QTGMC or another slower bobber for the encode.
    That makes sense. I'll keep this in mind, thanks.

    Originally Posted by manono View Post
    I 'sneak' up on the place I want to check by advancing from maybe 100 frames earlier, giving SRestore time to lock in the cadence.
    You do this from VirtualDub? And you do it after processing the video, right?
    Quote Quote  
  17. Originally Posted by lomaidala View Post
    Is there something else happening here I don't know about that I'm doing when I convert to YUY2 in this case? Some loss in quality I haven't noticed? Is there some other disadvantage to converting to YUY2 in my case?
    Converting from YV12 to YUY2 will blur the colors a bit. And if VirtualDub is working in RGB (many VirtualDub filters only work in RGB) you will get further blurring of colors. Converting directly to RGB in AviSynth should give better results in this case.

    I think what you interpret as "slightly higher... quality" is really artifacts from ConverToYUY2(interlaced=true). At that point in the script the video is no longer interlaced. So that conversion will be messed up.

    Originally Posted by lomaidala View Post
    Also, what about that unique frame I noticed that's missing when I don't do a color space conversion?
    ConvertToYUY2 did not cause that. It was SRestore and the way you scrubbed through the video.

    Originally Posted by lomaidala View Post
    Originally Posted by jagabo View Post
    You're inconsistent seeking is caused by SRestore. It does not generate the same sequence of frames upon random seeking. It needs to be run linearly.
    How do I run it linearly?
    Open the script in VirtualDub, encode to a lossless intermediate without any filtering, open that intermediate in VirtualDub for editing.

    Originally Posted by lomaidala View Post
    Originally Posted by manono View Post
    I have no idea how not putting the 'dot' between the Trim and Fadeout affects this as normal scripts always include the dot.
    I didn't know I was leaving out a dot, thanks! I'll have to run some tests at some point and see if I can spot a difference with or without the dot. So like this, right?
    Code:
    clip2.Trim(18,2704).FadeOut(19) + clip1.Trim(2688,0)
    Yes. But in this case you lucked out and the original script will work. Whenever you don't specify a clip by name the name "last" is used. Your line:

    Code:
    clip2.Trim(18,2704)FadeOut(19) + clip1.Trim(2688,0)
    is the equivalent of

    Code:
    clip2.Trim(18,2704)
    FadeOut(19) + clip1.Trim(2688,0)
    which is the equivalent of

    Code:
    last = clip2.Trim(18,2704)
    last = last.FadeOut(19) + clip1.Trim(2688,0)
    If instead you had tried something like:

    Code:
    clip1 = MPEG2Source("C:\1\VTS_01_1.d2v").Trim(2688,0)
    clip2 = MPEG2Source("C:\2\VTS_01_1.d2v").Trim(18,2704)FadeOut(19)
    clip2 + clip1
    At first glance you might think it does the same thing as the original script. But the FadeOut isn't applied to the result of MPEG2Source("C:\2\VTS_01_1.d2v").Trim(18,2704), it's applied to "last", which hasn't been defined yet. It's the equivalent of:

    Code:
    clip1 = MPEG2Source("C:\1\VTS_01_1.d2v").Trim(2688,0)
    clip2 = MPEG2Source("C:\2\VTS_01_1.d2v").Trim(18,2704)
    last = last.FadeOut(19)
    clip2 + clip1
    Quote Quote  
  18. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    Converting from YV12 to YUY2 will blur the colors a bit. And if VirtualDub is working in RGB (many VirtualDub filters only work in RGB) you will get further blurring of colors. Converting directly to RGB in AviSynth should give better results in this case.
    Ok, thanks! So ConvertToRGB? Do I still need the (interlaced=true) part?

    Originally Posted by jagabo View Post
    I think what you interpret as "slightly higher... quality" is really artifacts from ConverToYUY2(interlaced=true). At that point in the script the video is no longer interlaced. So that conversion will be messed up.
    Strange, it looked like less artifacts when I used ConvertToYUY2.

    Originally Posted by jagabo View Post
    Originally Posted by lomaidala View Post
    Also, what about that unique frame I noticed that's missing when I don't do a color space conversion?
    ConvertToYUY2 did not cause that. It was SRestore and the way you scrubbed through the video.
    Did I use SRestore incorrectly? Or is this just an inevitable consequence of using SRestore? Or should I be using something else in place of SRestore?

    Originally Posted by jagabo View Post
    Originally Posted by lomaidala View Post
    How do I run it linearly?
    Open the script in VirtualDub, encode to a lossless intermediate without any filtering, open that intermediate in VirtualDub for editing.
    Okay, using a lossless codec as opposed to uncompressed video, I presume.

    Originally Posted by jagabo View Post
    Originally Posted by lomaidala View Post
    I didn't know I was leaving out a dot, thanks! I'll have to run some tests at some point and see if I can spot a difference with or without the dot. So like this, right?
    Code:
    clip2.Trim(18,2704).FadeOut(19) + clip1.Trim(2688,0)
    Yes. But in this case you lucked out and the original script will work. Whenever you don't specify a clip by name the name "last" is used. Your line:

    Code:
    clip2.Trim(18,2704)FadeOut(19) + clip1.Trim(2688,0)
    is the equivalent of

    Code:
    clip2.Trim(18,2704)
    FadeOut(19) + clip1.Trim(2688,0)
    which is the equivalent of

    Code:
    last = clip2.Trim(18,2704)
    last = last.FadeOut(19) + clip1.Trim(2688,0)
    If instead you had tried something like:

    Code:
    clip1 = MPEG2Source("C:\1\VTS_01_1.d2v").Trim(2688,0)
    clip2 = MPEG2Source("C:\2\VTS_01_1.d2v").Trim(18,2704)FadeOut(19)
    clip2 + clip1
    At first glance you might think it does the same thing as the original script. But the FadeOut isn't applied to the result of MPEG2Source("C:\2\VTS_01_1.d2v").Trim(18,2704), it's applied to "last", which hasn't been defined yet. It's the equivalent of:

    Code:
    clip1 = MPEG2Source("C:\1\VTS_01_1.d2v").Trim(2688,0)
    clip2 = MPEG2Source("C:\2\VTS_01_1.d2v").Trim(18,2704)
    last = last.FadeOut(19)
    clip2 + clip1
    Thanks for telling me about the automatic "last" naming.

    So should I be using the dot and naming my clips manually? Is that what you're suggesting? How would you do it?
    Quote Quote  
  19. Originally Posted by lomaidala View Post
    So ConvertToRGB?
    Check to see what colorspace your VirtualDub filters are using. Its Filters dialog will show that if you tick "Show Image Formats".

    Click image for larger version

Name:	filters.png
Views:	941
Size:	18.2 KB
ID:	44808

    Originally Posted by lomaidala View Post
    Do I still need the (interlaced=true) part?
    I already told you: after QTGMC your video is no longer interlaced.

    Originally Posted by lomaidala View Post
    Strange, it looked like less artifacts when I used ConvertToYUY2.
    Post a sample. Source video, script, and images.

    Originally Posted by lomaidala View Post
    Did I use SRestore incorrectly? Or is this just an inevitable consequence of using SRestore?
    How many times do you have to be told this? Random seeks when using SRestore may not return the same sequence of frames as when running linearly. If you don't want to make an intermediate file, do what manono suggested. Seek a few hundred frames before the frame of interest and step forward frame by frame until you get to the frame you want. That gives SRestore time to lock into a long term pattern.

    Originally Posted by lomaidala View Post
    Or should I be using something else in place of SRestore?
    There's no alternative.

    Originally Posted by lomaidala View Post
    Okay, using a lossless codec as opposed to uncompressed video, I presume.
    Uncompressed is fine -- but the files will be 2 or 3 times larger.

    Originally Posted by lomaidala View Post
    Thanks for telling me about the automatic "last" naming.

    So should I be using the dot and naming my clips manually? Is that what you're suggesting? How would you do it?
    Some people like to explicitly name every stream. I usually rely on automatic use of last unless I'm using multiple streams. Even then I usually rely on last for the main stream and name the others (not always). Do whatever you want. Just understand what's going on.
    Quote Quote  
  20. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by manono View Post
    As jagabo mentions, seeking doesn't work quite right with SRestore. I 'sneak' up on the place I want to check by advancing from maybe 100 frames earlier, giving SRestore time to lock in the cadence.
    Originally Posted by jagabo View Post
    Random seeks when using SRestore may not return the same sequence of frames as when running linearly. If you don't want to make an intermediate file, do what manono suggested. Seek a few hundred frames before the frame of interest and step forward frame by frame until you get to the frame you want. That gives SRestore time to lock into a long term pattern.
    The thing that isn't clear to me here is how seeking around and stepping frame by frame corresponds to specifying how SRestore functions in my AVS script.

    Originally Posted by jagabo View Post
    Originally Posted by lomaidala View Post
    So ConvertToRGB?
    Check to see what colorspace your VirtualDub filters are using. Its Filters dialog will show that if you tick "Show Image Formats".

    Image
    [Attachment 44808 - Click to enlarge]
    So are you saying that when using filters, the color space the filter indicates determines what color space I should convert to in my AVS script? It says RGB32 for both input and output. Does that mean I shouldn't be putting any color space conversion in my script?

    Originally Posted by jagabo View Post
    Originally Posted by lomaidala View Post
    Do I still need the (interlaced=true) part?
    I already told you: after QTGMC your video is no longer interlaced.
    What I meant was what should I be doing to my script? Should I put in (interlaced=false)? Or simply remove that part and leave it as simply ConvertToRGB?

    Originally Posted by jagabo View Post
    If you're using a multithreaded build of AviSynth be sure to run Mpeg2Source() at mode 5:

    Code:
    SetMtMode(5,4) # mode 5, 4 threads
    Mpeg2Source("filename.d2v")
    SetMtMode(2) # mode 2
    etc()
    How can I tell whether or not I'm using a multithreaded build of AviSynth?

    Originally Posted by jagabo View Post
    Originally Posted by lomaidala View Post
    Did I use SRestore incorrectly? Or is this just an inevitable consequence of using SRestore?
    How many times do you have to be told this?
    I wasn't certain my question would lead to an answer that's already been given. When you said it was "the way" I've been doing something that's giving me my results, it was unclear to me whether you were implying that there's "a better way" I could be doing things, or simply that I'm doing things "the right way," and that my results are a normal, expected, and inevitable consequence. The main reason I asked for clarification is because I want to make sure I'm creating the video the right way.
    Quote Quote  
  21. Originally Posted by lomaidala View Post
    The thing that isn't clear to me here is how seeking around and stepping frame by frame corresponds to specifying how SRestore functions in my AVS script.
    It doesn't matter if it's clear to you or not. It's for this precise reason why I use Yadif(Mode=1) for testing before using QTGMC or another slow bobber for the actual encode.
    So are you saying that when using filters, the color space the filter indicates determines what color space I should convert to in my AVS script? It says RGB32 for both input and output. Does that mean I shouldn't be putting any color space conversion in my script?
    I can't speak for jagabo, but to avoid colorspace conversions I avoid the use of VDub filters. The Textsub filter in the picture has an AviSynth equivalent so why on earth would you even consider using the VDub version? Besides requiring 2 slightly degrading colorspace conversions, the encoding is noticeably slower.

    Should I put in (interlaced=false)? Or simply remove that part and leave it as simply ConvertToRGB?
    A quick check of the AviSynth page would have told you you don't have to put anything.

    bool interlaced = false

    If true, it is assumed that clip is interlaced; by default, it is assumed to be progressive.
    .
    .
    .
    Note, interlaced=true has an effect only on YV12↔YUY2 or YV12↔RGB conversions.
    How can I tell whether or not I'm using a multithreaded build of AviSynth?
    If you don't know, the chances are very good you're not.
    Quote Quote  
  22. Originally Posted by manono View Post
    I avoid the use of VDub filters.
    Same here. I pretty much only use VirtualDub to view the results of AviSynth scripts. I occasionally might use Neat Video or DeShaker in VirtualDub.
    Quote Quote  
  23. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by manono View Post
    I can't speak for jagabo, but to avoid colorspace conversions I avoid the use of VDub filters. The Textsub filter in the picture has an AviSynth equivalent so why on earth would you even consider using the VDub version? Besides requiring 2 slightly degrading colorspace conversions, the encoding is noticeably slower.
    I didn't know AviSynth has a TextSub equivalent that's even better. Thank you for telling me!

    Originally Posted by manono View Post
    A quick check of the AviSynth page would have told you you don't have to put anything.
    Thanks. I actually did do a search through http://avisynth.nl, but I didn't find anything that was clear to me.

    Originally Posted by jagabo View Post
    I pretty much only use VirtualDub to view the results of AviSynth scripts. I occasionally might use Neat Video or DeShaker in VirtualDub.
    What do you use to process the video for your AviSynth scripts?
    Quote Quote  
  24. Originally Posted by lomaidala View Post
    Originally Posted by jagabo View Post
    I pretty much only use VirtualDub to view the results of AviSynth scripts. I occasionally might use Neat Video or DeShaker in VirtualDub.
    What do you use to process the video for your AviSynth scripts?
    I usually encode with x264 cli. Them mux audio and video with MKVToolnix.
    Quote Quote  
  25. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Thanks everyone for your help. I really appreciate it. Can I get some final feedback on my updated script? If anything can be improved, even if it works but just looks funky, please let me know.

    Code:
    LoadPlugin("C:\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\mt_masktools-25.dll")
    Import("C:\Program Files (x86)\AviSynth 2.5\plugins\Srestore.avsi")
    clip1 = MPEG2Source("C:\1\VTS_01_1.d2v")
    clip2 = MPEG2Source("C:\2\VTS_01_1.d2v")
    ConvertToRGB (clip1)
    ConvertToRGB (clip2)
    clip2.Trim(18,2704).FadeOut0(19) + clip1.Trim(2687,0)
    QTGMC( Preset="Placebo" )
    Srestore(Frate=23.976)
    TextSub ("C:\1.ass")
    Quote Quote  
  26. QTGMC and SRestore don't work on RGB. If you want RGB output put ConvertToRGB() at the end (you don't need it here). And, assuming your sources are interlaced , if you needed to use ConvertToRGB where you have it, you would need to use interlaced=true -- because the videos are still interlaced at that point. It's not progressive until after QTGMC.
    Quote Quote  
  27. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by manono View Post
    The Textsub filter in the picture has an AviSynth equivalent so why on earth would you even consider using the VDub version? Besides requiring 2 slightly degrading colorspace conversions, the encoding is noticeably slower.
    I see there are several equivalents for AviSynth. Which one do you recommend?

    Originally Posted by jagabo View Post
    QTGMC and SRestore don't work on RGB. If you want RGB output put ConvertToRGB() at the end (you don't need it here). And, assuming your sources are interlaced , if you needed to use ConvertToRGB where you have it, you would need to use interlaced=true -- because the videos are still interlaced at that point. It's not progressive until after QTGMC.
    Thanks. I've already confirmed my sources are encoded interlaced and have interlaced frames, and that there's field blending.
    Do I need to use ConvertToRGB where I have it? Or should I put it at the end?
    Quote Quote  
  28. Originally Posted by lomaidala View Post
    I see there are several equivalents for AviSynth. Which one do you recommend?
    My guess is they all work. I think I use the old V2.23. You need the VSFilter.dll and then the TextSub line as you showed in the previous script. If the subs are in the same folder as the rest of the files, you don't need the path. You can just use:

    TextSub("1.ass")

    Do I need to use ConvertToRGB where I have it? Or should I put it at the end?
    Why use it at all? If nothing requires a conversion to RGB, then leave it out. Why do you need it? Not for anything in that script. If you need it for the next stage, then add it at the end (or in the next script). As jagabo already mentioned.

    About the only time I ever convert to RGB is for the very rare times I need to do some color work using ChannelMixer.
    Quote Quote  
  29. Originally Posted by lomaidala View Post
    Originally Posted by jagabo View Post
    QTGMC and SRestore don't work on RGB. If you want RGB output put ConvertToRGB() at the end (you don't need it here). And, assuming your sources are interlaced , if you needed to use ConvertToRGB where you have it, you would need to use interlaced=true -- because the videos are still interlaced at that point. It's not progressive until after QTGMC.
    Thanks. I've already confirmed my sources are encoded interlaced and have interlaced frames, and that there's field blending.
    Do I need to use ConvertToRGB where I have it? Or should I put it at the end?
    Maybe you don't understand: in AviSynth video flows from filter to filter, starting at the top and flowing down (when filters are on the same line, explicitly piped or not, the frames pass from left to right). So lets look at what your script does:

    Code:
    clip1 = MPEG2Source("C:\1\VTS_01_1.d2v")
    clip2 = MPEG2Source("C:\2\VTS_01_1.d2v")
    You import two YV12 videos and name them clip1 (YV12) and clip2 (YV12).

    Code:
    ConvertToRGB (clip1)
    You create an RGB stream called last, from clip1 (YV12) converted to RGB.

    Code:
    ConvertToRGB (clip2)
    You create a new RGB stream called last, from clip 2 (YV12) converted to RGB. This has the effect of discarding last from the previous line.

    Code:
    clip2.Trim(18,2704).FadeOut0(19) + clip1.Trim(2687,0)
    You're creating a new stream called last (YV12), from clip 2 (YV12) and clip 1 (YV12), discarding last from the previous line.

    Code:
    QTGMC( Preset="Placebo" )
    Your passing last (YV12) from the previous line to QTGMC and creating a new stream called last (YV12)

    Code:
    Srestore(Frate=23.976)
    last (YV12) from QTGMC is sent to SRestore, creating a new stream called last (YV12).

    Code:
    TextSub ("C:\1.ass")
    Finally, last (YV12) from SRestore is passed to TextSub which adds subtitles and create a new stream called last (YV12). Then the script returns last (YV12) to the calling program (VirtualDub, encoder, whatever).

    So your two ConvertToRGB calls have the net effect of doing nothing.
    Last edited by jagabo; 5th Mar 2018 at 08:21.
    Quote Quote  
  30. Member
    Join Date
    Sep 2008
    Location
    United States
    Search Comp PM
    Originally Posted by jagabo View Post
    Maybe you don't understand: in AviSynth video flows from filter to filter, starting at the top and flowing down (when filters are on the same line, explicitly piped or not, the frames pass from left to right).
    That's something I've been conscious of, but it's properly executing what I want to do that I have a problem with. Regardless, thanks for confirming that. My only goal with all of this is simple: I just want to cut two DVDs together and create the highest quality video I can using AviSynth and VirtualDub (and redo a few shots of typography with some overlays if I can, hence TextSub).

    Originally Posted by jagabo View Post
    Finally, last (YV12) from QTGMC is passed to TextSub which adds subtitles and create a new stream called last (YV12).
    But last (YV12) from QTGMC also includes Srestore before it is passed to TextSub, even in the case of my previous script you're referencing, right?

    Originally Posted by jagabo View Post
    So lets look at what your script does:
    Thank you so much for breaking it down like that. That's really helpful. I had no idea how many blunders I had in there. I didn't realize I was overriding streams with "last." I thought I was combining, adding, and accumulating, rather than canceling streams out.

    Can I get your feedback again on this update? Please do be critical. I want to improve it if possible.
    Code:
    LoadPlugin("C:\DGDecode.dll")
    LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\mt_masktools-25.dll")
    Import("C:\Program Files (x86)\AviSynth 2.5\plugins\Srestore.avsi")
    clip1 = MPEG2Source("C:\1\VTS_01_1.d2v")
    clip2 = MPEG2Source("C:\2\VTS_01_1.d2v")
    clip2.Trim(18,2704).FadeOut0(19) + clip1.Trim(2687,0)
    QTGMC( Preset="Placebo" )
    Srestore(Frate=23.976)
    TextSub("1.ass")
    It's my attempt at executing what you and manono have to say.

    Originally Posted by manono View Post
    My guess is they all work. I think I use the old V2.23. You need the VSFilter.dll and then the TextSub line as you showed in the previous script. If the subs are in the same folder as the rest of the files, you don't need the path. You can just use:

    TextSub("1.ass")
    Great, that's the one I've been using and you are right, it is way better than the VDub filter equivalent. I'm very happy with the results, thanks! And thanks for the TextSub tip.

    Originally Posted by manono View Post
    Do I need to use ConvertToRGB where I have it? Or should I put it at the end?
    Why use it at all? If nothing requires a conversion to RGB, then leave it out. Why do you need it? Not for anything in that script. If you need it for the next stage, then add it at the end (or in the next script). As jagabo already mentioned.
    Next stage as in putting it into a DVD format? That doesn't apply to me. As far as I know, there is no next stage. The end result is intended to be an AVI created by loading the AviSynth script in VirtualDub and then processing the video.

    As for why I thought I needed ConvertToRGB, it was based on these comments:

    If you need to work with interlaced video in Virtualdub you definitely want to convert toYUY2 or RGB first.
    (I am working with interlaced video in VirtualDub.)

    Converting directly to RGB in AviSynth should give better results in this case.
    I'm not sure how I should be interpreting this if it doesn't mean I should be using ConvertToRGB.
    Quote Quote  



Similar Threads

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