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 25th March 2009, 22:38   #1  |  Link
PhilR
Registered User
 
Join Date: Aug 2008
Posts: 6
avs2yuv.exe v0.24 and TFM()

I was trying to use TFM with the output option under avs2yuv.exe, but the stats file was always empty.

The reason is that TFM doesn't write out the statistics file until its destructor is invoked. avs2yuv never deletes its IScriptEnvironment, so this never occurs.

Here is one possible fix:

Code:
--- avs2yuv.cpp.orig.cpp	2009-03-25 14:36:08.417734300 -0700
+++ avs2yuv.cpp	2009-03-25 14:23:34.209782400 -0700
@@ -10,6 +10,7 @@
 #include <string.h>
 #include <io.h>
 #include <fcntl.h>
+#include <memory>
 #include "internal.h"
 
 #ifdef _MSC_VER
@@ -113,7 +114,7 @@
 		if(!CreateScriptEnvironment)
 			{fprintf(stderr, "failed to load CreateScriptEnvironment()\n"); return 1;}
 	
-		IScriptEnvironment* env = CreateScriptEnvironment(AVISYNTH_INTERFACE_VERSION);
+		std::auto_ptr<IScriptEnvironment> env(CreateScriptEnvironment(AVISYNTH_INTERFACE_VERSION));
 		AVSValue arg(infile);
 		AVSValue res = env->Invoke("Import", AVSValue(&arg, 1));
 		if(!res.IsClip())
@@ -197,7 +198,7 @@
 					frm = inf.num_frames-1;
 			}
 
-			PVideoFrame f = clip->GetFrame(frm, env);
+			PVideoFrame f = clip->GetFrame(frm, env.get());
 	
 			if(out_fhs) {
 				static const int planes[] = {PLANAR_Y, PLANAR_U, PLANAR_V};
PhilR is offline   Reply With Quote
Old 4th July 2011, 15:39   #2  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
@PhilR
Thanks! Your patch solved this issue

I applied your patch and some cosmetics to original avs2yuv0.24.

avs2yuv-0.24m (This binary requires msvcr100.dll)

sourcecode

*fix crash on Windows7 when closing process.
*change the tool for -hfyu from mencoder to ffmpeg.
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 4th July 2011, 20:45   #3  |  Link
MasterNobody
Registered User
 
Join Date: Aug 2007
Posts: 520
Some time ago I decided to compile avs2yuv in GCC (didn't want to install MSVS) so I replaced C++ code with C (based on AviSynth input from x264).
May be somebody will find it useful: avs2yuv-0.24-mod.zip.zip
MasterNobody is offline   Reply With Quote
Old 6th July 2011, 04:58   #4  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
@MasterNobody
Your code doesn't work at all...
Code:
g:\Enctools> echo ColorBars^(^).Trim^(0,999^) > ./in.avs

g:\Enctools> .\avs2yuv_ch.exe .\in.avs -o .\out1.y4m
.\in.avs: 640x480, 30000/1001 fps, 1000 frames
converting RGB -> YV12

g:\Enctools> .\avs2yuv_bm.exe .\in.avs -o .\out2.y4m
(null)
__________________
my repositories

Last edited by Chikuzen; 6th July 2011 at 05:04.
Chikuzen is offline   Reply With Quote
Old 6th July 2011, 08:15   #5  |  Link
MasterNobody
Registered User
 
Join Date: Aug 2007
Posts: 520
Chikuzen
Hm. It is strange. It works for me (Windows XP 32-bit + AviSynth 2.5.8) and your version doesn't work due dependecy on msvcr100.dll (I don't have it on my system).
MasterNobody is offline   Reply With Quote
Old 6th July 2011, 09:01   #6  |  Link
MasterNobody
Registered User
 
Join Date: Aug 2007
Posts: 520
Try this version avs2yuv-0.24-mod.zip (may be one of the used functions doesn't exist in msvcrt.dll of your OS)
MasterNobody is offline   Reply With Quote
Old 6th July 2011, 10:33   #7  |  Link
Groucho2004
Fossil
 
Groucho2004's Avatar
 
Join Date: Mar 2006
Location: A wretched hive of scum and villainy
Posts: 4,473
Quote:
Originally Posted by Chikuzen View Post
@PhilR
Thanks! Your patch solved this issue

I applied your patch and some cosmetics to original avs2yuv0.24.

avs2yuv-0.24m (This binary requires msvcr100.dll)

sourcecode

*fix crash on Windows7 when closing process.
*change the tool for -hfyu from mencoder to ffmpeg.
I'm curious about a couple of things:

In your avisynth.h, AVISYNTH_INTERFACE_VERSION has the value "2". Why did you change that?

Also, why don't you remove the dependency to msvcr100.dll by simply linking statically?

Edit: Sorry, I just noticed that the original avisynth.h that Loren Merrit included is a very old one. So, you actually didn't change it. I guess I was thrown off by the comment in your code repository that you updated to a more recent version (which you didn't).

Last edited by Groucho2004; 6th July 2011 at 10:59.
Groucho2004 is offline   Reply With Quote
Old 6th July 2011, 10:40   #8  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
Quote:
Originally Posted by MasterNobody View Post
Try this version avs2yuv-0.24-mod.zip (may be one of the used functions doesn't exist in msvcrt.dll of your OS)
still doesn't work...

btw, this is static-link version of mine.
http://www.mediafire.com/download.php?zhl0044zbhfaigy
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 7th July 2011, 17:48   #9  |  Link
Chikuzen
typo lover
 
Chikuzen's Avatar
 
Join Date: May 2009
Posts: 597
Quote:
Originally Posted by Groucho2004 View Post
Also, why don't you remove the dependency to msvcr100.dll by simply linking statically?
Because I think that Microsoft says "You shouldn't link CRT statically to your program except when there is a special reason"
http://msdn.microsoft.com/en-us/libr...=vs.80%29.aspx
__________________
my repositories
Chikuzen is offline   Reply With Quote
Old 7th July 2011, 18:03   #10  |  Link
Groucho2004
Fossil
 
Groucho2004's Avatar
 
Join Date: Mar 2006
Location: A wretched hive of scum and villainy
Posts: 4,473
Quote:
Originally Posted by Chikuzen View Post
Because I think that Microsoft says "You shouldn't link CRT statically to your program except when there is a special reason"
http://msdn.microsoft.com/en-us/libr...=vs.80%29.aspx
I prefer static linking, especially when it comes to such tiny utilities where the size argument is irrelevant.
Groucho2004 is offline   Reply With Quote
Old 7th July 2011, 18:07   #11  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,384
Quote:
Originally Posted by Groucho2004 View Post
I prefer static linking, especially when it comes to such tiny utilities where the size argument is irrelevant.
But it's precisely with tiny utilities that statically linking the RTL leads to a huge (relative) increase in filesize.

(Sorry to contradict you for the 2nd time today. )
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 7th July 2011, 18:16   #12  |  Link
Groucho2004
Fossil
 
Groucho2004's Avatar
 
Join Date: Mar 2006
Location: A wretched hive of scum and villainy
Posts: 4,473
Quote:
Originally Posted by Gavino View Post
But it's precisely with tiny utilities that statically linking the RTL leads to a huge (relative) increase in filesize.

(Sorry to contradict you for the 2nd time today. )
No problem.

I'll give you an example:
avs2yuv compiled with VC8 (VC2005) and statically linked gives me a file size of 94,208 bytes.
If you consider this huge I suggest you look at recent versions of Adobe Reader.
Groucho2004 is offline   Reply With Quote
Old 7th July 2011, 19:32   #13  |  Link
MasterNobody
Registered User
 
Join Date: Aug 2007
Posts: 520
Chikuzen
This was really stupid bug (my bad I didn't test it with AviSynth 2.6.0). This time it should work for sure. avs2yuv-0.24-mod-fixed.zip
MasterNobody is offline   Reply With Quote
Old 29th April 2013, 08:21   #14  |  Link
verisokin
Registered User
 
Join Date: Dec 2012
Posts: 2
Quote:
Originally Posted by MasterNobody View Post
Chikuzen
This was really stupid bug (my bad I didn't test it with AviSynth 2.6.0). This time it should work for sure. avs2yuv-0.24-mod-fixed.zip
Link died.
Please create a new one.
http://forum.doom9.org/showthread.php?t=148782
I would like a new version Avisynth 2.6 MT

Last edited by verisokin; 29th April 2013 at 08:27.
verisokin 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 11:29.


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