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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th January 2022, 23:41   #1  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Import script in c++ code fails for 32bit, works for 64bit

I got the following code (on github):
which works fine when used with 64bit AviSynth.dll (3.7.1)
Code:
  try { // always fails for 32bit WTF?!
    std::cout << "Importing " << qPrintable(m_currentInput) << std::endl;
    const char* infile = m_currentInput.toLocal8Bit(); //convert input name to char*
    AVSValue arg(infile);
    m_res = m_env->Invoke("Import", AVSValue(&arg, 1));
  } catch (AvisynthError &err) { //catch AvisynthErrors
    std::cout << "Failed importing " << qPrintable(m_currentInput) << std::endl;
    std::cerr << "-> " << err.msg << std::endl;
    return false;
  } catch (...) { //catch everything else
    std::cerr << "-> invoking Import for " << qPrintable(m_currentInput) << " failed!" << std::endl;
    return false;
  }
but always fails for 32bit AviSynth.dll (3.7.1).
Output I get is:
Code:
loaded avisynth dll,..(I:/workspace/avsInfo/debug/AviSynth.dll)
loaded CreateScriptEnvironment definition from dll,..
loaded IScriptEnvironment using AVISYNTH_INTERFACE_VERSION,.. (9)
getting avs linkage from environment
Importing c:\Users\Selur\Desktop\version.avs
-> Does anyone have an idea what could cause this?
The code itself should be fine as it works fine with the 64bit AviSynth.dll.
Got the dlls from the AviSynthPlus_3.7.1_20211231-filesonly.7z package. (same with 'Avisynth+ 3.7.2 test 1 (20220113)')
According to the debug output the error seems to be in AviSynth!avs_is_yuv420ps which seems to loop.

Cu Selur
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 30th January 2022 at 11:25.
Selur is offline   Reply With Quote
Old 30th January 2022, 12:30   #2  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
In vapoursynth YUV420PS is not allowed. Only YUV444PS can be input. Is it an issue?
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 30th January 2022, 14:07   #3  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
My problem is with AviSynth not Vapoursynth, so not sure how this is related.

hmm,... when using
AviSynthPlus_3.7.1_20211231-filesonly.7z
+
Code:
version()
return last
it dies in avs_is_yuv420ps.

same when using the files from Avisynth_3.7.2_20220113_test1
it seems to die in avs_clip_get_error.

No clue why this is happening and only with the 32bit versions.

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 31st January 2022, 16:57   #4  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
avs_is_yuv420ps and avs_clip_get_error are C interface calls.
Your linked code is using c++ interface.
Which component in your processing chain is using C interface calls?
pinterf is offline   Reply With Quote
Old 31st January 2022, 17:52   #5  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Quote:
Which component in your processing chain is using C interface calls?
None that I'm aware of. :/
I mean the whole project isn't large ( see: https://github.com/Selur/avsInfo/) and I don't see anything that uses the c interface calls.
(I include the avisynth.h and not the avisynth_h.h headers,..)
Also why does it work with 64bit and not with 32bit is really beyond me. :/

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 31st January 2022, 21:25   #6  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,420
I've been seeing strange results with FFmpeg and avs2yuv (which do use the C interface) - some combinations of 32-bit builds of AviSynth+ and FFmpeg work, but not other combinations. 64-bit is completely unaffected.

Rolling 32-bit AviSynth+ all the way back to 3.5.1 (or even back to classic 2.6.1) was able to confirm that something probably came in during the Neo merge that is messing with 32-bit builds on Windows. Whatever it is, it affects both MSVC and GCC builds, may or may not affect Debug builds of AviSynth+, and may be a problem in FFmpeg or one of its dependencies (because I was seeing weird references to videolan and Java in one of the backtraces, and to my knowledge, the only thing that would probably refer to that inside of FFmpeg is libbluray, but libbluray shouldn't be screwing with AviSynth). That it could be a dependency chain issue would point to a problem potentially in MinGW-w64, except that it's also on the MSVC side as well. If the problem exists in normal 32-bit builds but not XP 32-bit builds, that would point to possibly being an issue in the Windows 10 SDK in MSVC 2019 (if it exists in the XP builds it would be a general issue with the cl compiler in MSVC 2019).

32-bit builds on other OSes are fine (tested with VMs of both Debian 10/i386 as well as OS X Tiger/PPC), so it's not even universally a GCC problem, just a Windows problem.

Last edited by qyot27; 31st January 2022 at 21:34.
qyot27 is offline   Reply With Quote
Old 31st January 2022, 21:53   #7  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,420
Now that I'm reminded of how similar this is appearing, I certainly hope this isn't something caused by having fixed 64-bit GCC builds back in October:
https://github.com/AviSynth/AviSynthPlus/issues/237

It appears almost like the inverse of that, except even the MSVC builds are giving us problems.
qyot27 is offline   Reply With Quote
Old 1st February 2022, 10:25   #8  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Quote:
Originally Posted by Selur View Post
None that I'm aware of. :/
I mean the whole project isn't large ( see: https://github.com/Selur/avsInfo/) and I don't see anything that uses the c interface calls.
(I include the avisynth.h and not the avisynth_h.h headers,..)
Also why does it work with 64bit and not with 32bit is really beyond me. :/

Cu Selur
Which compiler are you using?
pinterf is offline   Reply With Quote
Old 3rd February 2022, 15:32   #9  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
Quote:
Which compiler are you using?
MSVC 2019

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 4th February 2022, 14:13   #10  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
Then these sentences need a bit more clarification:
"it dies in avs_is_yuv420ps."
"same when using the files from Avisynth_3.7.2_20220113_test1 it seems to die in avs_clip_get_error."
What does "dies" mean and which software is giving the error messages if there is an error message at all?
Since they are C interface functions, obviously something is using C interface in your chain, e.g. an ffmpeg, an ffms C plugin or I don't know.
pinterf is offline   Reply With Quote
Old 4th February 2022, 17:19   #11  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
I run the avsViewer in debug mode through QtCreator set ip to open the version.avs on my desktop and see this:

I uninstalled and reeinstalled the msvc 32bit run time files in hope that would help, which it did not.

First I thought I messed up the code somewhere, but like I wrote if I compile it with 64bit, everything works fine.
(you can see the whole code I use over at the github, see link in first post)

version.avs just contains:
Code:
version()
return last
extending it to:
Code:
ClearAutoloadDirs()
version()
return last
doesn't change a thing.

Cu Selur
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 4th February 2022, 21:47   #12  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
What happens when omitting 'return last'?
pinterf is offline   Reply With Quote
Old 5th February 2022, 08:55   #13  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
sadly:
Code:
#ClearAutoloadDirs()
version()
#return last
and
Code:
ClearAutoloadDirs()
version()
#return last
give the same error

Cu Selur

Ps.: same with Avisynth_3.7.2_20220201_test2 and Avisynth+ 3.7.2 test 3 (20220208)
__________________
Hybrid here in the forum, homepage

Last edited by Selur; 8th February 2022 at 17:58.
Selur is offline   Reply With Quote
Reply


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 04:50.


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