Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th June 2016, 04:48   #1  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 748
A note on Simpleresize

If Simpleresize is fed RGB data instead of YUV data, it will incorrectly report a problem with the horizontal resolution not being a multiple of 2, rather than a problem with the colorspace.

This should be fixed.
__________________
If I ask "How do I do X?" or "what happens if I do X?", and X is a very bad thing that no one would ever normally do, assume that I already know this, and that I have Katie reasons for asking anyway.

Last edited by Katie Boundary; 11th June 2016 at 20:05.
Katie Boundary is offline   Reply With Quote
Old 11th June 2016, 05:00   #2  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,177
Quote:
Originally Posted by Katie Boundary View Post
Simpleresize is designed such that it can only accept image widths that are divisible by 2. This is fine with me. I never use odd numbers for my image widths anyway. HOWEVER, it has a slight bug: If the edges of the image are cropped by odd numbers, but the result is still even, Simpleresize will mistakenly assume that the result is odd and throw an error.

This should be fixed.
Please post your script and exact error message. Does it help if you add align=true to crop? Just wondering, any particular reason you're using SimpleResize?

Last edited by Reel.Deel; 12th June 2016 at 02:15. Reason: Add original statement from op
Reel.Deel is offline   Reply With Quote
Old 11th June 2016, 05:08   #3  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 748
Quote:
Originally Posted by Reel.Deel View Post
Please post your script and exact error message.
Script:

Code:
mpeg2source("blahblahblah.d2v")

converttorgb()

crop(7,0,-9,-0)

simpleresize(352,240)
Error message:

Code:
Avisynth open failure:
SimpleResize: Horizontal pixels must divide by 2
Quote:
Originally Posted by Reel.Deel View Post
Does it help if you add align=true to crop?
I don't know. I'll try it, but it shouldn't be necessary.

Quote:
Originally Posted by Reel.Deel View Post
Just wondering, any particular reason you're using SimpleResize?
Faster than bilinear in this extremely specific application (reducing by 2 in both directions), but without the half-pixel "shift" allegedly produced by the quick-and-dirty Reduceby2 filter.

EDIT: Nope, align=true didn't do jack.
__________________
If I ask "How do I do X?" or "what happens if I do X?", and X is a very bad thing that no one would ever normally do, assume that I already know this, and that I have Katie reasons for asking anyway.

Last edited by Katie Boundary; 11th June 2016 at 05:14.
Katie Boundary is offline   Reply With Quote
Old 11th June 2016, 05:20   #4  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,177
Quote:
Originally Posted by Katie Boundary View Post
Script:

Code:
mpeg2source("blahblahblah.d2v")

converttorgb()

crop(7,0,-9,-0)

simpleresize(352,240)
SimpleResize only accepts YUY2 and YV12, so you must convert back to YUV before SimpleResize.
Reel.Deel is offline   Reply With Quote
Old 11th June 2016, 11:02   #5  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,033
Wow, an entire thread just because RTFM seems to be a concept too difficult to grasp for some people.

I suppose this stretch of K-T Boundary forum pollution shall pass as well.
Groucho2004 is offline   Reply With Quote
Old 11th June 2016, 13:59   #6  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,376
Has anybody used WarpedResize [with a YV12 source] lately? For me it is warping Chroma from one side instead of centered like Luma, which looks a bit odd:
Code:
LoadPlugin(p + "SimpleResize\Avisynth_2.5_Alpha\SimpleResize.dll")
ColorBars(pixel_type="YV12")
Subtitle("5 4 3 2 1 0 1 2 3 4 5", 
\       align=5, size=Height*0.2, font="Courier New",
\       text_color=$aaffffff, halo_color=$ff000000)
WarpedResize(Width, Height, 1.5, 1.0)
Subtitle("WarpedResize(hWarp=1.5)", align=8,
\       text_color=$ebebeb, halo_color=$ff000000)
return Last
...but this fixes the problem:
Code:
## fix WarpedResize YV12 chroma bug; make warp arguments optional 
function WarpedResize2(clip C, int width, int height, float "hWarp", float "vWarp")
{
    Assert(C.IsYV12, 
    \   "WarpedResize2: source must be YV12")     
    Assert(width % 4 == 0, 
    \   "WarpedResize2: 'width' arg must be mod 4")
    Assert(height % 4 == 0, 
    \   "WarpedResize2: 'height' arg must be mod 4")
    
    hWarp = Default(hWarp, 1.0)
    vWarp = Default(vWarp, 1.0)
    
    U = C.UToY .WarpedResize(width / 2, height / 2, hWarp, vWarp)
    V = C.VToY .WarpedResize(width / 2, height / 2, hWarp, vWarp)
    Y = C      .WarpedResize(width, height, hWarp, vWarp)

    return YToUV(U, V, Y)
}

Last edited by raffriff42; 16th March 2017 at 23:16. Reason: (fixed image links)
raffriff42 is offline   Reply With Quote
Old 11th June 2016, 17:00   #7  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 509
Very interesting, raffriff42.
This could be the missing puzzle stone to move from DVD PAL to NTSC.
__________________
By law and justice!

Flea Market

Last edited by GMJCZP; 11th June 2016 at 17:22.
GMJCZP is offline   Reply With Quote
Old 11th June 2016, 19:46   #8  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 748
Quote:
Originally Posted by Reel.Deel View Post
SimpleResize only accepts YUY2 and YV12, so you must convert back to YUV before SimpleResize.
Whoops. Well, mystery solved.

Quote:
Originally Posted by Groucho2004 View Post
Wow, an entire thread just because RTFM seems to be a concept too difficult to grasp for some people.

I suppose this stretch of K-T Boundary forum pollution shall pass as well.
Which of the following more closely qualifies as "forum pollution": a sincere inquiry resulting from an error message that specified the wrong error, or a post pointlessly and senselessly bitching about the aforementioned inquiry?
__________________
If I ask "How do I do X?" or "what happens if I do X?", and X is a very bad thing that no one would ever normally do, assume that I already know this, and that I have Katie reasons for asking anyway.

Last edited by Katie Boundary; 11th June 2016 at 20:01.
Katie Boundary is offline   Reply With Quote
Old 11th June 2016, 21:03   #9  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,033
Quote:
Originally Posted by Katie Boundary View Post
Which of the following more closely qualifies as "forum pollution": a sincere inquiry resulting from an error message that specified the wrong error, or a post pointlessly and senselessly bitching about the aforementioned inquiry?
You changed the wording of your original post (as you frequently do) so it has become pointless to even start a discussion.
Groucho2004 is offline   Reply With Quote
Old 11th June 2016, 22:43   #10  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 748
Quote:
Originally Posted by Groucho2004 View Post
You changed the wording of your original post (as you frequently do)
I clarified the nature of the problem, but it doesn't change any of the relevant facts or even significantly alter the conversation.
__________________
If I ask "How do I do X?" or "what happens if I do X?", and X is a very bad thing that no one would ever normally do, assume that I already know this, and that I have Katie reasons for asking anyway.
Katie Boundary is offline   Reply With Quote
Old 12th June 2016, 00:34   #11  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
bilinearresize or pointresize should work, and should be fast, if not, try the avisynth+ version, or you could convey rgb as yuv, by stuffing y into g, b into v, r into u.
jmac698 is offline   Reply With Quote
Old 12th June 2016, 02:06   #12  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,338
Quote:
Originally Posted by Groucho2004 View Post
You changed the wording of your original post (as you frequently do) so it has become pointless to even start a discussion.
Yes, he did this to me a few days ago in this thread:

Superior field-matching filter needed

I commented on it at the time, but didn't realize until now that it is a habit.

Lots of people edit their posts to correct typos, update links, add references to later posts, etc. I think that is within normal forum etiquette. However, when the nature of the post is significantly changed, especially when it is the thread starter, and even more especially when people have already responded to what was originally said, it messes everything up.

I agree with you that, under these circumstances, it is pointless to try to have any sort of discussion. I have learned my lesson and will stick to threads that don't have this problem.
johnmeyer is offline   Reply With Quote
Old 12th June 2016, 06:32   #13  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 748
Quote:
Originally Posted by johnmeyer View Post
Yes, he did this to me a few days ago in this thread:

Superior field-matching filter needed

I commented on it at the time, but didn't realize until now that it is a habit.
I actually made that edit before I saw your post. Additionally, the edit did absolutely nothing to change the flow or meaning of the conversation in any way, just as it didn't in this one.
__________________
If I ask "How do I do X?" or "what happens if I do X?", and X is a very bad thing that no one would ever normally do, assume that I already know this, and that I have Katie reasons for asking anyway.
Katie Boundary is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 17:00.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.