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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Today's Posts Search

Reply
 
Thread Tools Search this Thread
Old 31st March 2016, 18:22   #1  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
issue avs2avi with big AVI ouput file (127 GB limit)

Hi All!

I have problem with avs2avi v1.39.
I am deal with big clip 2.5 hours, 960x720 resolution, 50 fps, YV12 colorspace.
When ouput file reach size 127 Gb (136*365*211*648 bytes) avs2avi give error that programm could closed.
First time I think that problem is complex script (using multithreded Avisynth, QTGMC with upscaling), but I am see the same issue on 3 PC (1 Windows 7 and 2 Windows 10).
File avs2avi.exe set LAA.
Please advice how can solve problem or other way for conversion Avisynth scripts to AVI.

yup.
yup is offline   Reply With Quote
Old 31st March 2016, 19:16   #2  |  Link
mariush
Registered User
 
Join Date: Dec 2008
Posts: 589
my guess from a very brief look at the source code...

avs2avi uses a bunch of source code from an older version of Virtualdub, that code handles the writing to avi file and creating the index for the video and audio frames (index is read by applications to know at which offsets to jump in the file if they want to go to a particular moment)

AVI has a "superindex" which is made out of several "index"-es, each with a number of entries. In the avs2avi source code, the number of entries in each index is hardcoded to 2048, and I suspect there's a maximum of 256 indexes , which works out to about 127 GB of content ... so that's why I suspect it fails, you reach the maximum of index entries defined in the source code.

code in avs2avi\VirtualDub\AVIOutput.h

Code:
class AVIOutputFile : public AVIOutput {
private:
	enum { MAX_AVIBLOCKS = 64, MAX_SUPERINDEX_ENTRIES=256, MAX_INDEX_ENTRIES=3072 };
code in avs2avi\VirtualDub\AVIIndex.cpp

Code:
class AVIIndexChainNode {
public:
	enum { ENTS=2048 };

	AVIIndexChainNode *next;

	AVIIndexEntry2 ient[ENTS];
Newer virtualdub versions use 256 indexes but each index holds 8192 entries, which works out for 2 GB per index as the text says in the options box:



So with 2048 entries, it would be only logical to have one index per 0.5 GB ( 1/4th of 2GB), so the avi output would crash at 0.5x256 = 128 GB.

I guess the fix would be to patch the source code and recompile the application.
Attached Images
File Type: png vdub-superindex.png (39.6 KB, 255 views)

Last edited by mariush; 2nd April 2016 at 15:50.
mariush is offline   Reply With Quote
Old 2nd April 2016, 10:39   #3  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
mariush!

Do not see Your attached picture two days. waiting approval.
May be exist other way (program)? VirtualDub for me unstable for scripts with multithreaded Avisynth.
yup.
yup is offline   Reply With Quote
Old 2nd April 2016, 12:27   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,491
Yup, I can do a special compile for you of TWriteAVI v2.0 (which also uses Vdub v1.411 source) and you can write via eg

Code:
TWriteAVI("out.avi", Overwrite=True, FourCC="ULY0")  # Write at same time as playing clip (UT_Video)
ForceProcessAVI()                                    # Force write AVI, dont play clip until fully written
Avisource("out.avi")                                 # Load new Lossless clip
return Last                                          # Plays lossless clip after writing
I can do this mod (AVIIndex.cpp)
Code:
class AVIIndexChainNode {
public:
	enum { ENTS=8192 };

	AVIIndexChainNode *next;

	AVIIndexEntry2 ient[ENTS];
Are you willing to give it a try (I will not make it public) ?

TWriteAVI v2.0:- http://forum.doom9.org/showthread.ph...ight=TwriteAvi

EDIT: Sent PM link to TWriteAVI mod, totally untested (let me know if it works without problem, and I'll make public).
__________________
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 April 2016 at 03:04.
StainlessS is offline   Reply With Quote
Old 3rd April 2016, 20:23   #5  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,491
Here Yup, mod of avs2avi:- http://www.mediafire.com/download/3z...d_20160403.zip
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 3rd April 2016, 23:00   #6  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,869
Quote:
Originally Posted by mariush View Post

Newer virtualdub versions use 256 indexes but each index holds 8192 entries, which works out for 2 GB per index as the text says in the options box:



So with 2048 entries, it would be only logical to have one index per 0.5 GB ( 1/4th of 2GB), so the avi output would crash at 0.5x256 = 128 GB.

I guess the fix would be to patch the source code and recompile the application.
Had similar issue, but for me it was 2TB boundary. After changing Vdub default values it worked.
kolak is offline   Reply With Quote
Old 4th April 2016, 17:32   #7  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
StainlessS!

Moded version avs2avi do not solve problem.
I get error when file size reached 127 GB.
yup.
yup is offline   Reply With Quote
Old 4th April 2016, 19:18   #8  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,669
I quite frequently use AVI's larger than that. FFMpeg can do it from avs input

Some other options you can look at are dividing up script into parts (perhaps with some "overlap" for filtering purposes), or using stronger lossless compression to reduce filesize

If the problem is with the script (MT can often cause problems, usually due to memory), consider dividing up the script into sections and lossless intermediates, or using non MT

Last edited by poisondeathray; 4th April 2016 at 19:20.
poisondeathray is offline   Reply With Quote
Old 4th April 2016, 19:46   #9  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
VirtualDub make job for output file size 170GB with default setting (see post 2 and 6 this thread).
poisondeathray thanks for advice I am try ffmpeg instead of avs2avi.
yup.
yup is offline   Reply With Quote
Old 4th April 2016, 19:54   #10  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,669
yup, some MT scripts in ffmpeg work better with distributor() , some do not (I mean speed-wise). Do a quick test with avsmeter before proceeding to the full encode
poisondeathray is offline   Reply With Quote
Old 11th April 2016, 09:04   #11  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
Hi poisondeathray!
I am try simple command
Code:
ffmpeg -i test.avs -codec:v utvideo test.avi
fps dropped to three times compare to avs2avi.
Interesting I am try encode my script using avs4x264 and avs4x265 without problem.

yup.
yup is offline   Reply With Quote
Old 11th April 2016, 09:38   #12  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,869
Try also adding -threads. Not sure if utvideo does it by the default. Older versions of ffmpeg did not support threading in utvideo.
kolak is offline   Reply With Quote
Old 11th April 2016, 17:27   #13  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
kolak!
threads=8 do not increase fps.
poisondeathray!
Yes when added distributor() as last line in script speed like using avs2avi.
Now testing stability.
yup.
yup is offline   Reply With Quote
Old 11th April 2016, 17:38   #14  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,669
ut video ? Just an FYI, the ffmpeg ut video variant is slower (about 2/3) than the VFW variant for decoding speed . Something about differences optimization, instruction sets. For example, if I use it in another application like a NLE, the ffmpeg ut variant is noticably slower/sluggish
poisondeathray is offline   Reply With Quote
Old 14th April 2016, 17:38   #15  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
When I try convert my working script (QTGMC + nnedi3 enlargement) using ffmpeg, I do not have problem for clip 1.5 hour, but during conversion 2.5 hours clip ffmpeg crashed.
I am only have success with this big clip using encoding x264 and x265, both use interface from 32 bit avisynth to 64 bit encoder.
No one 32 bit programm do not work properly (avs2avi, VirtualDub and ffmpeg).
Any recommendations please.
May be can organize pipe from 32 bit avisynth to 64 bit AVI writer?
yup.
yup is offline   Reply With Quote
Old 14th April 2016, 20:55   #16  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 2,105
137,4GB... hm, 28-bit LBA limit comes into mind, but only if you have an old ATA-5 controller sitting somewhere.
External HDD possibly ? But then the system would see the first 137GB of that HDD anyway...
Some older Chipsets have that limitation: InSystem ISD300A1 (USB2.0), ATA-5 brings it.

Quote:
137GB (FAT-32) is a Microsoft problem. Even though they claim to use up to 28 bits & 32K clusters to give 8TB, there are other limitations. Some older system tools like ScanDisk and Format are 16 bit and have a memory block maximum allocation size of 16 MB less 64 KB. Using one memory block for the FAT with 4 bytes for each FAT entry and 64KB overhead, there can be only 4,177,920 clusters allocated. Also some older programs can not handle clusters larger than 32KB. . . . Therefor . . . 4,178,920 clusters x 32,768 Bytes per cluster = 137GB

Note;
According to Microsoft's FAT32 spec, the cluster numbers are really only 28 bits and the upper 4 bits of a cluster number are "reserved". If that were the case then FAT32 could handle up to 1 Terabyte partition size with 4K clusters. Microsoft doesn't even adhere to their own spec.

137GB is also a BIOS limit where the system BIOS can only handle 28 bit LBA but not “large" 48 bit LBA.
28 bit LBA limit = 2^28 x 512 bytes per sector = 268,435,456 x 512 = 137,438,953,472 bytes
- - - This is also a limit on Windows XP-SP0 and Windows 2000-SP2 which failed to support 48 bit LBA and corrected on later versions of Windows.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 14th April 2016, 21:53   #17  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Emulgator View Post
137,4GB... hm, 28-bit LBA limit comes into mind, but only if you have an old ATA-5 controller sitting somewhere.
External HDD possibly ? But then the system would see the first 137GB of that HDD anyway...
Some older Chipsets have that limitation: InSystem ISD300A1 (USB2.0), ATA-5 brings it.
Firstly, the limit that was mentioned is 127 G, not 137 G. Secondly, it was determined that avs2avi is to blame and that the OP can create files larger than 127 G with VirtualDub.
Read the thread title and the replies before posting solutions to unrelated problems that were an issue 16 years ago.
Groucho2004 is offline   Reply With Quote
Old 23rd April 2016, 12:26   #18  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 2,105
Yes, me too tired..
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 25th April 2016, 17:08   #19  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
Hi All!

Now I am try switch from Set MT build to Avisynth+(little change script, replace MT call to SetFilterMTMode and add Prefetch), speed drop from 17 fps to 11 fps, but using Virtualdub I can save whole file, 166 GB.

yup.
yup 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 14:45.


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