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. |
10th February 2017, 21:00 | #3002 | Link | |
Guest
Posts: n/a
|
Quote:
This isn't Java where you need an abstract factory factory builder simply to create a one-off utility function. Last edited by JoeyMonco; 10th February 2017 at 21:05. |
|
10th February 2017, 21:05 | #3003 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
I want to know BitsPerComponent of the destination format passed as a string. How am I to know whether it's 8-bit, 10-bit or 16-bit? It could be YV12, YUV444P10, YUVAP16... doing it the "if" or "switch" way is a direct road to hell. If you want to write long series of conditions each time you want to do such an operation, then go ahead, but I'm not going down that road.
|
10th February 2017, 21:41 | #3004 | Link |
Guest
Posts: n/a
|
And why do you need to pass the format as a string? What are you doing that you actually need the string for? What purpose is the string serving that can't be served by passing through the enum value? It sounds like you're inventing an over-complicated solution to an imaginary problem.
Last edited by JoeyMonco; 10th February 2017 at 21:56. |
10th February 2017, 21:45 | #3005 | Link | |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
Quote:
|
|
10th February 2017, 21:49 | #3006 | Link | |
Guest
Posts: n/a
|
Quote:
Still failing to see the reason why strings need to be passed around instead of the enum value, though. |
|
10th February 2017, 22:02 | #3007 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
There are many standard functions that take a format as parameter ... or is there? Actually, there is ConvertToY8, ConvertToYV24, ConvertToYUV444, ConvertToRGB32... many different functions, sometimes taking only BitsPerComponent as a parameter. There's got to be other filters taking the format as a string ...
oh yeah, ColorBars, AviSource and CombinePlanes take pixel_type as a string.
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 10th February 2017 at 22:38. |
10th February 2017, 22:19 | #3008 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Pinterf, ConvertFromDoubleWidth and ConvertToDoubleWidth don't support RGB24 and RGB32.
In ConvertToDoubleWidth, add Code:
else if (vi.IsColorSpace(VideoInfo::CS_BGR48)) vi.pixel_type = VideoInfo::CS_BGR24; else if (vi.IsColorSpace(VideoInfo::CS_BGR64)) vi.pixel_type = VideoInfo::CS_BGR32; Code:
else if (vi.IsRGB24()) vi.pixel_type = VideoInfo::CS_BGR48; else if (vi.IsRGB32()) vi.pixel_type = VideoInfo::CS_BGR64;
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 10th February 2017 at 22:47. |
10th February 2017, 23:49 | #3009 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Bug in ConvertBits. If I call ConvertBits(14, dither=-1), it says "dithering is allowed only for 8 bit targets". If I do not specify "dither=-1", then it works.
Also, ConvertFromDoubleWidth supports 10-16 bit, while ConvertToDoubleWidth only supports 16-bit. Code needs to be replaced with this: Code:
if (vi.BitsPerComponent() < 10 || vi.BitsPerComponent() > 16) env->ThrowError("ConvertToDoubleWidth: Input clip must be 10-16bit format"); else if (vi.Is420()) vi.pixel_type = VideoInfo::CS_YV12; else if (vi.Is422()) vi.pixel_type = VideoInfo::CS_YV16; else if (vi.Is444()) vi.pixel_type = VideoInfo::CS_YV24; else if (vi.IsY()) vi.pixel_type = VideoInfo::CS_Y8; else if (vi.IsColorSpace(VideoInfo::CS_BGR48)) vi.pixel_type = VideoInfo::CS_BGR24; else if (vi.IsColorSpace(VideoInfo::CS_BGR64)) vi.pixel_type = VideoInfo::CS_BGR32; else env->ThrowError("ConvertToDoubleWidth: Input clip must be 10-16bit format"); |
11th February 2017, 00:14 | #3010 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
This code causes a crash: "cannot decompress video frame: the video data is too short"
Code:
ConvertToYV24() AddAlphaPlane() CombinePlanes(planes="RGBA", source_planes="YUVA", pixel_type="RGBAP8") ConvertToYV24() Code:
ConvertToPlanarRGBA() CombinePlanes(planes="YUVA", source_planes="RGBA", pixel_type="YUVA444P8")
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 11th February 2017 at 00:29. |
11th February 2017, 09:31 | #3011 | Link | ||
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
Quote:
Quote:
I also like dynamic features a lot cuz they are handy to use, but I would just go with a completely dynamic programming language like Python if I'm gonna use dynamic features throughout my program Last edited by feisty2; 11th February 2017 at 09:37. |
||
11th February 2017, 15:47 | #3012 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Good to know.
Then, I could create a generic class that automatically builds a dictionary from specified Enum on first use (via reflection), and then does the conversion though the dictionary on all subsequent calls. But in the case of AviSynth, the Enum is a bit more complicated than that, with combinations of fields, and with names that don't always match format values, so here there's no way around listing all valid formats manually. Plus, it's only 1 Enum, and it's unlikely to change much. If it were 100 Enums that could change and evolve regularly, then it would be a different story.
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 11th February 2017 at 15:50. |
12th February 2017, 10:54 | #3015 | Link |
Registered User
Join Date: Jan 2012
Posts: 46
|
I have problems with Avisynth+ latest versions and Potplayer.
I use this script to resize my videos while playing Code:
SetMemoryMax(512) SetFilterMTMode("DEFAULT_MT_MODE", 2) ffdshow_source() dispWidth = 1920 dispHeight = 1080 mWidth = float(last.width) mHeight = float(last.height) ratio = (mWidth/mHeight) newHeight= round((dispWidth/ratio)/2)*2 newHeight > dispHeight ? Eval(""" newHeight=dispHeight newWidth=round((newHeight*ratio)/2)*2 """) : Eval(""" newWidth=dispWidth """) spline64resize(newWidth,newHeight) Prefetch(4) Here an example. https://www.mediafire.com/?4t75s2m74wuvzj3 The only Avisynth+ version that works well is r1779 Another problem with Potplayer is that I can't hear audio unless I remove TimeStretch.dll plugin. It appears this error message Also, I had to remove ImageSeq.dll plugin because I had many Potplayer crashes with it |
12th February 2017, 15:08 | #3016 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
I'll also mention that I've been seeing an audio/video sync issue with the latest version.. not even sure if it's related to Avisynth version, but I'm just throwing it out there. Has anyone else experience audio/video sync issue? Might be related to VFR as I only have issues with a few videos, and I'm pretty sure it was working fine before. This is when I open the AVS script in MPC-HC to retune the audio to 432hz. That would require more investigation to identify where the issue comes from.
|
12th February 2017, 22:25 | #3020 | Link | |
Registered User
Join Date: Jan 2014
Posts: 2,314
|
Quote:
Converting String to VideoInfo:: pixel_type integer: Invoke this script function: int ColorSpaceNameToPixelType (string ColorSpaceName) |
|
|
|