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 Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd June 2018, 14:15   #741  |  Link
Music Fan
Registered User
 
Join Date: May 2009
Location: Belgium
Posts: 1,743
Quote:
Originally Posted by Richard1485 View Post
May I ask how I convert the video to 10-bit RGB?
I never did this but it's probably ConvertToRGBP10 ;
http://avisynth.nl/index.php/Avisynthplus_color_formats

And maybe add matrix="Rec709".
Music Fan is offline   Reply With Quote
Old 3rd June 2018, 14:22   #742  |  Link
Richard1485
Guest
 
Posts: n/a
^ Yeah, thanks. :-) That's what I tried (with the matrix), but I received the standard "There is no function..." error message.
  Reply With Quote
Old 3rd June 2018, 15:18   #743  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 496
Quote:
Originally Posted by l33tmeatwad View Post
So this was kind of a pain to figure out so I decided I would post some build notes to help anyone else out trying to compile their own. The static libs build is a single DLL file and the shared libs contains the libav DLLs.

LSMASHSource r941 (hydra3333 Mod)
Static Libs Build (x86 & x64) | Shared Libs Build (x86 & x64) | Sources
Bonus: FFMS2 with Shared Libs

Build Notes:
Compiled with Microsoft Visual Studio 2015
Shared Libs & Include Files were copied to the Visual Studio Directories in: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
Patch included with previous releases was applied to FFmpeg before compiling.

Static FFmpeg compiled with:
Code:
./configure --toolchain=msvc --enable-gpl --enable-version3 --disable-encoders --disable-programs --disable-filters \
 --disable-network --disable-doc --disable-avdevice --disable-swresample --disable-postproc --disable-avfilter --enable-avresample
make install
Shared Libs FFmpeg compiled with:
Code:
./configure --toolchain=msvc --enable-gpl --enable-version3 --enable-shared --disable-encoders --disable-programs --disable-filters \
--disable-network --disable-doc --disable-avdevice --disable-swresample --disable-postproc --disable-avfilter --enable-avresample
make install
Visual Studio Project Modifications (x86 Static Build)
Project Properties > Configuration Properties > VC++ Directories
- Include Directories: C:\msys32\usr\local\include
- Library Directories: C:\msys32\usr\local\lib
Project Properties > Configuration Properties > Linker > General
- Additional Library Directories: C:\msys32\usr\local\lib
Project Properties > Configuration Properties > Linker > Input
- Additional Dependencies: libavutil.a;libavcodec.a;libavformat.a;libswscale.a;libavresample.a;

Visual Studio Project Modifications (x64 Static Build)
Project Properties > Configuration Properties > VC++ Directories
- Include Directories: C:\msys64\usr\local\include
- Library Directories: C:\msys64\usr\local\lib
Project Properties > Configuration Properties > Linker > General
- Additional Library Directories: C:\msys64\usr\local\lib
Project Properties > Configuration Properties > Linker > Input
- Additional Dependencies: libavutil.a;libavcodec.a;libavformat.a;libswscale.a;libavresample.a;

Changes to exlibs.cpp (both Static Builds)
Code:
//#pragma comment( lib, "libmingwex.a" )
//#pragma comment( lib, "libgcc.a" )
#pragma comment( lib, "lsmash.lib" )
#pragma comment( lib, "bcrypt.lib" )
//#pragma comment( lib, "avutil.lib" )
//#pragma comment( lib, "avcodec.lib" )
//#pragma comment( lib, "avformat.lib" )
//#pragma comment( lib, "swscale.lib" )
//#pragma comment( lib, "avresample.lib" )
Changes to exlibs.cpp (both Builds w/ Shared Libs)
Code:
//#pragma comment( lib, "libmingwex.a" )
//#pragma comment( lib, "libgcc.a" )
#pragma comment( lib, "lsmash.lib" )
#pragma comment( lib, "avutil.lib" )
#pragma comment( lib, "avcodec.lib" )
#pragma comment( lib, "avformat.lib" )
#pragma comment( lib, "swscale.lib" )
#pragma comment( lib, "avresample.lib" )
Included Libs:
LibAV (from FFmpeg 4.0)
L-Smash 2.14.5

Other Software:
MSYS2 (i686 & x86_64)
Yasm 1.3.0 (General Use Executables)
this is a avs 2.5 API. can you update this to avs 2.6? greetings
__________________
[AUR] Vapoursynth Stuff
[AUR] Avisynth Stuff
sl1pkn07 is offline   Reply With Quote
Old 3rd June 2018, 15:31   #744  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by Richard1485 View Post
^ Yeah, thanks. :-) That's what I tried (with the matrix), but I received the standard "There is no function..." error message.
Got same message here using trial avs+ from a couple of days back (not todays issue).

Tried with RT_Stats Make_Avisynth_BuiltIn_FunctionList.avs
Got this (partial output below)
Code:
        AviSynth+_0.1_(r2693,_MT,_i386)_ORDERED_Function_List


There follows a list of all function names together with CPP style argument specifiers that inform
Avisynth the argument types and optional names. Optional arguments have square brackets surrounding
their name as in [name] and are followed by a type specifier character that gives the type.
Unnamed arguments are not optional. eg "cc[arg1]b[arg2]i" would be two compulsory unnamed clip args,
followed by optional 'arg1' of type bool and optional 'arg2' of type int.

# Argument type specifier strings.
 c - Video Clip
 i - Integer number
 f - Float number
 s - String
 b - boolean
 . - Any type (dot)
# Array Specifiers
 i* - Integer Array, zero or more
 i+ - Integer Array, one or more
 .* - Any type Array, zero or more
 .+ - Any type Array, one or more
#    Etc
###################################

BitsPerComponent          "c"
BuildPixelType            "[family]s[bits]i[chroma]i[compat]b[oldnames]b[sample_clip]c"
ColorSpaceNameToPixelType "s"
CombinePlanes             "cccc[planes]s[source_planes]s[pixel_type]s[sample_clip]c"
ComponentSize             "c"
ConvertBackToYUY2         "c[matrix]s"
ConvertBits               "c[bits]i[truerange]b[dither]f[dither_bits]i[fulls]b[fulld]b"
ConvertTo16bit            "c[bits]i[truerange]b[dither]f[dither_bits]i[fulls]b[fulld]b"
ConvertTo8bit             "c[bits]i[truerange]b[dither]f[dither_bits]i[fulls]b[fulld]b"
ConvertToFloat            "c[bits]i[truerange]b[dither]f[dither_bits]i[fulls]b[fulld]b"
ConvertToMono             "c"
ConvertToPlanarRGB        "c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s"
ConvertToPlanarRGBA       "c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s"
ConvertToRGB              "c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s"
ConvertToRGB24            "c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s"
ConvertToRGB32            "c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s"
ConvertToRGB48            "c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s"
ConvertToRGB64            "c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s"
ConvertToY                "c[matrix]s"
ConvertToY8               "c[matrix]s"
ConvertToYUV411           "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s"
ConvertToYUV420           "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s[ChromaOutPlacement]s"
ConvertToYUV422           "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s"
ConvertToYUV444           "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s"
ConvertToYUY2             "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s"
ConvertToYV12             "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s[ChromaOutPlacement]s"
ConvertToYV16             "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s"
ConvertToYV24             "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s"
ConvertToYV411            "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s"
Is420                     "c"
Is422                     "c"
Is444                     "c"
IsFloatUvZeroBased        ""
IsPackedRGB               "c"
IsPlanar                  "c"
IsPlanarRGB               "c"
IsPlanarRGBA              "c"
IsRGB                     "c"
IsRGB24                   "c"
IsRGB32                   "c"
IsRGB48                   "c"
IsRGB64                   "c"
IsVideoFloat              "c"
IsY                       "c"
IsY8                      "c"
IsYUV                     "c"
IsYUVA                    "c"
IsYUY2                    "c"
IsYV12                    "c"
IsYV16                    "c"
IsYV24                    "c"
IsYV411                   "c"
MergeARGB                 "cccc"
MergeChroma               "cc[chromaweight]f"
MergeLuma                 "cc[lumaweight]f"
MergeRGB                  "ccc[pixel_type]s"
NumComponents             "c"
PixelType                 "c"
PlaneToY                  "c[plane]s"
RemoveAlphaPlane          "c"
ShowAlpha                 "c[pixel_type]s"
ShowBlue                  "c[pixel_type]s"
ShowGreen                 "c[pixel_type]s"
ShowRed                   "c[pixel_type]s"
ShowU                     "c[pixel_type]s"
ShowV                     "c[pixel_type]s"
ShowY                     "c[pixel_type]s"
VToY                      "c"
VToY8                     "c"
YToUV                     "cccc"
YToUV                     "cccc"
YToUV                     "cccc"
This works OK
Code:
ColorBars.Killaudio
#ConvertToRGBP10(Matrix="rec709")   # Fail
#ConvertToPlanarRGB        "c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s"
#ConvertBits               "c[bits]i[truerange]b[dither]f[dither_bits]i[fulls]b[fulld]b"
ConvertToPlanarRGB()       # Presumably dont need matrix here as from RGB
ConvertBits(10)
Info
ConverttoRGB32 # for display


EDIT: ConvertBits only works on Planar RGB, but OK on Planar YUV, eg YV12,
produces ColorSpace: YUV420P10, BitsPerComponent: 10.

EDIT:
AviSynth+_0.1_(r2693_ORDERED_Function_List.TXT.7z (Does not included any updated builtin filter definitions for todays updated avs+).
7Zip file ~5KB, expanded ~ 22KB text file.
http://www.mediafire.com/file/3ub7ld...on_List.TXT.7z

EDIT: Have extended partial output of builtin function definitions earlier in this post, Its possible that I may have missed one or two out.

EDIT: Only Single function definitions given in earlier text file, eg BlankClip has multiple alternate arg lists, but the RT_Stats script
cannot output multiple, they all produce same result text (there was no way to parse multiples external to avs Standard, I assume this has not changed in avs+).

EDIT: The ColorSpaceNameToPixelType() listed takes a colorspace name eg "RGBP10" and returns hex 0x90050001 [internal bit flags descriptor].
Perhaps some other missing definition (missing multiple definition) can take a PixelType and produce a clip, maybe eg
BlankClip(PixelType) exists, dont know (or some clip conversion filter).
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 3rd June 2018 at 16:50.
StainlessS is offline   Reply With Quote
Old 3rd June 2018, 17:25   #745  |  Link
Richard1485
Guest
 
Posts: n/a
^ I appreciate your help and interest in this problem. With your script, I get an error message that says: "There is no function named ConvertToPlanarRGB()", which baffles me. When I call Version(), the correct AviSynth+ version is displayed: I'm using the one released today (r1576, x64).
  Reply With Quote
Old 3rd June 2018, 17:32   #746  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by Richard1485 View Post
I'm using the one released today (r1576, x64).
Seems old ? StainlessS is on r2693 if you look above
poisondeathray is offline   Reply With Quote
Old 3rd June 2018, 17:35   #747  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
Quote:
Originally Posted by sl1pkn07 View Post
Quote:
Page
long
full
quote
wasting
space
One line
Just a matter of taste?

If I refer to a specific part of a quote, I crop the quote down to the relevant part. Or just mention "@ author".
__

@ Richard1485:

Still the "ancient" version from http://avs-plus.net/ ... no, this page seems to be abandoned since 2014.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid

Last edited by LigH; 3rd June 2018 at 17:37.
LigH is offline   Reply With Quote
Old 3rd June 2018, 17:39   #748  |  Link
Richard1485
Guest
 
Posts: n/a
Quote:
Originally Posted by poisondeathray View Post
Seems old ?
That's very strange, because I reinstalled it today. But you're right. It must be picking up an old version from somewhere. I'll try installing it again.

EDIT: Okay. The version information is now correct. (Thanks, LigH!)

EDIT: Now there's a message about the conversion to RGB being possible only from an 8-bit source. It must be the call to ConvertToRGB32() at the end.

EDIT: Well, if I remove the call to ConvertToRGB32(), the error message goes away, but VirtualDub2 chokes on the video because it "can't locate a decompressor for format "G3[0][10]" (unknown)".

Last edited by Richard1485; 3rd June 2018 at 17:48.
  Reply With Quote
Old 3rd June 2018, 18:50   #749  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Ok. In latest avs+ _test_ build, see avs+ topic for r2696, I have made ConvertoRgb32 callable from any bitdepth, helping the previewing. When you removed the conversion, your clip is fed to vdub as planar 10 bit rgb fooucc code: G3[0][10] which is not handled by your system. You may do Convertbits(8).Converttorgb32 or Convertbits(16). Converttorgb64 if you are using avs+ r2664 (latest official). Latter needs Vdub2
pinterf is offline   Reply With Quote
Old 3rd June 2018, 21:01   #750  |  Link
Richard1485
Guest
 
Posts: n/a
Yeah, I guessed the reason for the last error message. Thanks! Is ConvertToRGBP10() not an option at present? I'm just trying to get my head round this high bit-depth stuff. ☺
  Reply With Quote
Old 3rd June 2018, 22:34   #751  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by Richard1485 View Post
Is ConvertToRGBP10() not an option at present?
IMO, there's way too many* new pixel formats added to AviSynth+ to add explicit bridging functions for all of them to the core. A better place for them - if you really feel like you need direct shortcuts, rather than using the more generic functions added to AviSynth+ to handle this - would be to break them out into an AVSI file like the colors_rgb list is. Otherwise it's a lot of nearly-identical code copy-pasted over and over again with only minor changes, for each destination format.

*you can see them all listed in the AviSynth+ headers (link directs only to the new set, just scroll up a little for the 2.5/2.6 formats):
https://github.com/AviSynth/AviSynth...synth_c.h#L146

That's 52 new pixel formats. And most of the internal bridges would just be invoking a combination of ConvertBits and ConvertTo[YUV***|PlanarRGB(A)], which like I said, is much easier to just break out into an AVSI:
Code:
function ConvertToRGBP10(clip c)
{
    ConvertToPlanarRGB(c)
    ConvertBits(10)
}
That is, of course, just an example and doesn't enable most of the underlying extra params from ConvertBits and ConvertToPlanarRGB, but those could be passed through with minimal effort, right there in the AVSI.
qyot27 is offline   Reply With Quote
Old 3rd June 2018, 22:53   #752  |  Link
Richard1485
Guest
 
Posts: n/a
Oh, I see. I'm not one for writing procedures/functions, but that looks pretty simple. And if that's how they would be implemented internally, then I don't mind doing it the long way. Thanks!
  Reply With Quote
Old 3rd June 2018, 22:57   #753  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Obviously, the optimal solution would be for a generic master ConvertToPixelFormat() (or just plain old ConvertTo(), but I figured the main one I suggest should be more explicit about what it does) function that can convert between YUV(A), Y, Planar/Packed RGB(A) and change bitdepth at the same time, either by the user selecting the bitdepth separately or by taking it from the dest format name. A master function like that wouldn't massively reduplicate code and, IMO, would be fine to include in the core*. For instance:
Code:
input()
ConvertToPixelFormat("YUV420P16", extra_opts)
or
Code:
input()
ConvertToPixelFormat("YUV420", bit_depth=16, extra_opts)
Or you know, the same function as-written could do either of those, since 'YUV420P16' and 'YUV420' are both valid format names; the difference is just whether you'd have to declare any of the extra_opts explicitly because there's also a dedicated bit_depth= parameter.

*and before anyone hits me with the 'AviSynth+ doesn't do implicit conversions' thing, filters shouldn't silently change the input format to do the processing. A master ConvertTo function is always an explicit conversion, so that criticism doesn't apply.
qyot27 is offline   Reply With Quote
Old 4th June 2018, 08:49   #754  |  Link
Richard1485
Guest
 
Posts: n/a
That solution does sound feasible. Even if it's never included in the core, perhaps someone will write an .avsi for it all at some point.
  Reply With Quote
Old 4th June 2018, 10:35   #755  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Then there is the z.lib resizer plugin, see z_ConvertFormat as a swiss-army knife.
Color-space, primaries, bit-depth, size conversion - all-in-one.
https://forum.doom9.org/showthread.php?p=1784316
pinterf is offline   Reply With Quote
Old 17th June 2018, 19:15   #756  |  Link
Gser
Registered User
 
Join Date: Apr 2008
Posts: 418
Yeah the newest L-smash does not work for VC-1 at all,at least not in avs+. Getting super corrupt frames with grey bits everywhere.
Gser is offline   Reply With Quote
Old 17th June 2018, 22:01   #757  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
Decoding interlaced VC-1 was always a problem, not sure if it was ever completely fixed... can you provide samples? If it fails for "usual" progressive VC-1 as well, which worked with earlier versions, then there may be a regression in libavcodec?
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid
LigH is offline   Reply With Quote
Old 17th June 2018, 22:15   #758  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Two samples:
https://drive.google.com/file/d/0Bwx...pHeW5wbjQ/view (interlaced)
https://drive.google.com/file/d/0Bwx...RVVGNfeEU/view (progressive)
(via https://kodi.wiki/view/Samples )

No problem with ffmpeg git.
sneaker_ger is offline   Reply With Quote
Old 17th June 2018, 22:24   #759  |  Link
videoh
Useful n00b
 
Join Date: Jul 2014
Posts: 1,667
The files look fine as both decode without problems with DGDecNV and Avisynth+.

I don't understand the big problem with interlaced VC-1. There's nothing special about it.
videoh is offline   Reply With Quote
Old 18th June 2018, 08:16   #760  |  Link
LigH
German doom9/Gleitz SuMo
 
LigH's Avatar
 
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,753
May be in combination with the container, correct demultiplexing and joining the contained video streams from interleaving segments. FFMS2 used to have issues with interlaced AVC in TS (may have been due to its early dependency on Haali). "Nobody is perfect"... and I know nothing about the details, there are only vague memories.

Quick test: Both L-SMASH Works r929 (20170224) Static in MeGUI and r941 (20180530) Shared fail the same way, already with the progressive source (VC-1_23.976_sample.mkv). FFMS 2.23-1 Static in MeGUI and FFMS2 (bonus) Shared decode it correctly. — Known as L-SMASH-Works issue #58.

At least I hope that they got correctly assigned...

Code:
ClearAutoloadDirs()
LoadPlugin("E:\Programme\MeGUI\tools\lsmash\LSMASHSource.dll")
LwLibavVideoSource("VC-1_23.976_sample.mkv")
vs.
Code:
ClearAutoloadDirs()
LoadPlugin("E:\Programme\AviSynth+\plugins\LSMASHSource.dll")
LwLibavVideoSource("VC-1_23.976_sample.mkv")
Note: The FFMS2_2.23.1_MSVC_SharedLibs.7z contains 64 bit libav DLL's in the x86 subdirectory. The ones in LSMASHSource_r941_MSVC_SharedLibs_hydra3333.7z are correct for 32 bit.
__________________

New German Gleitz board
MediaFire: x264 | x265 | VPx | AOM | Xvid

Last edited by LigH; 18th June 2018 at 08:34.
LigH 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 23:41.


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