Log in

View Full Version : AVS2AVI -- new version


Pages : [1] 2 3 4 5 6

Moitah
24th February 2004, 04:55
I have updated AVS2AVI. Changes are as follows: Stats is now 'instant' over the last 1-2 minutes instead of 300ms (will be much smoother now)... overall average is still displayed at the end
Fractions of a second aren't shown for elapsed time while encoding (clutters up display)
Size of encoded video is now displayed properly (was always 0 before)... now it will only show 0 when not in the last pass of a multi-pass encode (this is intended)
Note on the above: the size while encoding is just the size of the video data, at the end of the encoding it will be the total size of the file (including overhead)
Frame count/FPS at the end of encode is now displayed properly
Path of destination is now relative to the source (i.e. if the source is "c:\stuff\main.avs" and the dest is given as "new.avi", the full dest path will be "c:\stuff\new.avi"), same for the state file
If no destination is given, it will be the same as the source but with the proper extension (i.e. in the above example, the dest would be "c:\stuff\main.avi")
If the destination has the wrong extension (or no extension), it will be corrected (i.e. if the dest is given as "c:\test.avi" but '-o m' is set, the dest will be changed to "c:\test.avi.mkv")
Checks to make sure the source file exists before starting (this way you won't have to wait until after you select the compressor to find out the filename is wrong)
Checks to make sure you're not trying to overwrite the destination file (if you want to, use the '-w' switch)
Rewrote the command line parsing (to support some new features and fix bugs)
Fixed not completely exiting if an error occurred
Fixed crash if no compressor was selected (i.e. "No Recompression")... it still won't let you output but it exits instead of crashes :)
Displays the name of the format you're outputting to if it's not AVI
Added option for null output ('-o n'), can be used for speed testing or whatever
Fixed ReadFrame/EncodeFrame using StopRead instead of Stop
Misc other display and code cleanups
Notes: This was compiled with the latest libMatroska and libEBML. This may have broken something, use Matroska output at your own risk (a small test clip plays fine for me, but I can't open it in the latest VirtualDubMod (same with mkv files made by v1.31a, though))!
Compiler optimization is disabled (that's the way it was when I downloaded it... if it wasn't disabled for a reason, a new compile should be made with it enabled)
Runtime library was set to single-threaded in the original project, I changed it to multi-threaded just to be safe (what should this be?)
The XviD status window is completely locked up for me, anyone know how to fix this?
I didn't include the full source code, only the file that I changed (avs2avi.cpp). After you add this to the project, you will need to add "shlwapi.lib" as a dependency.

--------------------------------------------------

This link will be kept up to date with the latest version: AVS2AVI v1.39 (http://www.avs2avi.org/avs2avi-139.zip)

If for some reason you want the original version linked to in this post (v1.32), you can get it here (http://www.avs2avi.org/avs2avi-132.zip).

KpeX
24th February 2004, 05:27
Nice work!

Regarding the xvid status window, Koepi posted about this issue (http://forum.doom9.org/showthread.php?s=&postid=442623#post442623) a while back - hopefully that gives you some idea :).

When using matroska output, the result opens fine with VLC, but not with MPC or VdubMod 1.5.4.1 on my box.

For future versions - how about an additional logfile mode to write a log containing stats such as fps, filesize, etc. while encoding to avi/mkv. Welcome to the forums, and thanks for your work, cheers,

dimzon
24th February 2004, 11:52
May be some avs2avi_drop in addition to command-line :)

DaveEL
24th February 2004, 13:22
Matroska code is probably b0rked it was the starting point for a new project and so i would probably remove it now as its only does video it can always be remuxed from avi anyway.

DaveEL
PS i have been meaning to put my cvs tree for avs2avi on corecodec for a while ill try to get round to doing it sometime this week and will commit your changes too.

DaveEL
24th February 2004, 14:20
Originally posted by Moitah
Fixed ReadFrame/EncodeFrame using StopRead instead of Stop [/B]

I sure StopRead was useful for something... was to do with threads or b-frames i think. That or it was part of the resume feature in which case its no longer needed. EDIT :- Yep now i have time to think it was about resuming thats why it nolonger works this may even be in my cvs tree already

If you don't mind once i test this myself ill stick it on my webspace as the new official version?

DaveEL
(PS i think i worked out what went wrong with the avilib output which is much simpler if you want to try it out send me a message)

DaveEL
24th February 2004, 14:23
Originally posted by dimzon
May be some avs2avi_drop in addition to command-line :)

I did have an avs2avi dll somewhere ill see if i can dig it up.

DaveEL

Moitah
24th February 2004, 19:50
Originally posted by DaveEL
If you don't mind once i test this myself ill stick it on my webspace as the new official version?Sounds good to me :)
Originally posted by DaveEL
(PS i think i worked out what went wrong with the avilib output which is much simpler if you want to try it out send me a message) I don't know how much more work (if any) I will be doing... but if you want to tell me what's wrong, maybe I'll get around to it. What advantages would it have over the current AVI writing method?

Moitah
24th February 2004, 19:56
Originally posted by KpeX
Regarding the xvid status window, Koepi posted about this issue (http://forum.doom9.org/showthread.php?s=&postid=442623#post442623) a while back - hopefully that gives you some idea :)Yeah, thanks... I'll see if I can figure out how to fix it.

Moitah
25th February 2004, 07:08
I have fixed the problem with the XviD status window. After I clean up the code I will release a new version :).

Moitah
25th February 2004, 17:52
AVS2AVI v1.33 Changes: Handles window messages in the encode thread (fixes XviD status window)
Removed Matroska support
I made a new project for it because I wanted to be sure there weren't any weird settings I wasn't aware of. The only options I changed in the new project were adding the proper dependencies, setting runtime library to multi-threaded, and optimize for Pentium Pro/PII/PIII.

Download here (http://members.cox.net/moitah/avs2avi-133.zip).

DarkNite
26th February 2004, 11:28
Nice work. Mmmm, streamlining is a beautiful thing. ;)

Moitah
26th February 2004, 23:26
Originally posted by dimzon
May be some avs2avi_drop in addition to command-line :) I don't know how to do any GUI stuff in C++, but I have an idea about how to make it work with VB. It would involve having AVS2AVI create an invisible window (while researching the XviD problem I spent a few hours learning how to use CreateWindow, though it turned out I didn't need it :p) and keeping status information in the titlebar. Then the VB program could use CreateProcess to run AVS2AVI without showing a console window, and pull information from the invisible window's titlebar. Sounds like fun, I may try it tonight :D.

EDIT: I know this probably isn't the best way, but it seems like the easiest to me.

Moitah
27th February 2004, 06:27
Take a look:

http://members.cox.net/moitah/avs2avidrop.png

It works :D. It needs better error handling (if AVS2AVI quits with an error, all you will see in the GUI is "Error" with no description of the problem) and more features (Stop button, a progress bar, the rest of the switches). It makes a .avi file with the same name as your .avs (but with the .avi extension, of course). Make sure to check "Overwrite destination" if you plan on testing with the same source file more than once. It only works with the special version of AVS2AVI included in the zip.

If you want to try it: AVS2AVIDrop v0.1.0 (http://members.cox.net/moitah/avs2avidrop-0_1_0.zip)

Have fun ;)


EDIT: I'm not releasing the source code until I clean it up unless someone really wants to see it...

dimzon
27th February 2004, 10:46
@Moitah
please get me Your source code now. I'm planing to create AVS2XVID_Drop based on AVS2AVI on this weekend. I think i can change XviD encoding params throught -l key + a little binary codec parameters file patching :)

Moitah
27th February 2004, 20:33
Originally posted by dimzon
please get me Your source code now.I made some improvements with the error handling (it still won't tell you the exact message avs2avi quit with, though, but I'll try to do that eventually) and added a progress bar (it's just a Shape control for now, I didn't want the exe to require the common controls OCX).

Here it is, along with source: AVS2AVIDrop v0.2.0 (http://members.cox.net/moitah/avs2avidrop-0_2_0.zip)

Moitah
29th February 2004, 21:18
From the other thread:
Originally posted by RathO
I tried AVS2AVI ...
... my hard disk seems to be working harder than when im using Vdubmod.I found out how to fix this, disable_os_caching() needs to be called so the VirtualDub AVI writer will use its own caching. This will be in the next release.

ChristianHJW
1st March 2004, 11:12
Originally posted by Moitah
Removed Matroska support


I fully agree with this policy. As avs2avi cant handle audio, there is a remuxing step with either mkvmerge or VdubMod necessary in any case to add the audio, and then the source video can as well be AVI.

Things were different once anybody would care about avs2matroska, to create native MPEG4 MKV files ... my long dreamed wish, and we were so close already ....

ChristianHJW
1st March 2004, 11:20
Originally posted by DaveEL
DaveEL
PS i have been meaning to put my cvs tree for avs2avi on corecodec for a while ill try to get round to doing it sometime this week and will commit your changes too.

DaveEL,

may i recommend to create a new project like

avs2video

on corecodec.org, and then to make two different CVS trees,

avs2avi

and

avs2matroska

????

Actually, as there seem to be more than one guy working on this project now, may i suggest you guys all get accounts on corecodec.org, and get familiar with using CVS ? http://tortoisecvs.sf.net works perfect for most of us on Windows, and its quite convenient as it is a n extension to Windows Explorer ( even i can use it :D ).

I will see if i can motivate jcsston or spyder482 to look over the avs2matroska sources, maybe there is a way find the bug, or to completely remove DaveEL's old matroska writing code and replace it with jcsston's new matroska output module ? maybe even spyder's MILK could be used for it :O ??

This program, once it was out, could completely replace VdubMod in the matroska DVD encoding tool ( DVDtoMKV, release this week ), and even create native files that way !

perko
3rd March 2004, 00:50
Hi.

Sorry to be such a noob, but this is killing me.

I have a bunch of MPEG files that I need to convert to AVIs (using DIVX).

I understand AVS2AVI will provide a command line alternative to using the Dr. Divx GUI. I really need a command-line driven tool in order to automate this process.

Since all the MPEG source files are basically the same (in terms of resolution, etc.) What is the easiest way to generate the script for this? Do i really need to split the video and audio first and then fire up GKnot? That seems cumbersome to generate a script.

I have been looking around for example AVS scripts to no avail.

Any help is greatly appreciated.

DarkDudae
3rd March 2004, 02:58
@Moitah

Great work! We will update the avs2avi version we use in ARCalculator development with this one if you are agree :)

We also are working in a integrated Job Control for ARCalculator with full support for avs2avi :)

Thanks

Moitah
3rd March 2004, 03:07
Originally posted by DarkDudae
Great work!Thanks :)
Originally posted by DarkDudae
We will update the avs2avi version we use in ARCalculator development with this one if you are agree :) Sure, but don't use the 'info window' (that's what AVS2AVIDrop uses to get the progress information) because I am planning on removing it and doing it properly (I figured out how to read stdout from VB).

timecop
3rd March 2004, 03:41
i got a novel idea.
in the time you spend figuring out how to read console in vb, you can figure out how to make simple GUI's using win32 api.

you can start at http://winprog.org/tutorial/

DarkDudae
3rd March 2004, 03:55
Originally posted by Moitah
(I figured out how to read stdout from VB).

Take a look at: http://www.freevbcode.com/ShowCode.Asp?ID=3957

This is also interesting: http://www.freevbcode.com/ShowCode.Asp?ID=1282

I think this can help you :)

Greetings

bill_baroud
4th March 2004, 14:17
@perko

I have been looking around for example AVS scripts to no avail.

you didn't search wery well :rolleyes:
there is almost a script by post in the Avisynth Usage forum :rolleyes:

avs2avi compress only video, so you have to do something about audio separatly for your mpeg conversion.

Moitah
5th March 2004, 06:33
AVS2AVI v1.34: Now uses internal buffering for the AVI output (it's set it to 512 KB, this should reduce disk activity)
Added "-f" switch for frontend display mode (makes it easier for people writing frontends to parse the info from stdout... documentation will come soon :))
AVS2AVIDrop v0.3.0: Gets information from stdout now
Stop button
Displays all error messages properly
Smaller, cooler GUI :D
avs2avi.exe must be in the same directory (need to make this so the path can be loaded from a config file or set in options...)

Here's a screenshot of the new AVS2AVIDrop:

http://members.cox.net/moitah/avs2avidrop-0_3_0.png


Download link (both AVS2AVI and AVS2AVIDrop, including source): AVS2AVI v1.34 (http://members.cox.net/moitah/avs2avi-134.zip)

Moitah
5th March 2004, 06:39
timecop/DarkDudae: Thanks for the links :cool:

Moitah
6th March 2004, 00:56
Here's the documentation for the '-f' switch (it should look familiar if you know the IRC protocol):



Each message is on its own line (a line appears to end with CR/LF... in AVS2AVI the printf uses \n, so I guess this gets translated when going to stdout). A message consists of a type, followed by optional parameters. The type and parameters are separated by a single space. If a parameter begins with a colon, the colon should be ignored and the rest of the line is to be treated as a single parameter (this is called a trailing parameter). If a message is not recognized, it should be ignored. Example:

message_type first_param second_param :this is all the third param


Here are the messages currently used:

VERSION <major> <minor> <avs2aviversion>
This is sent immediately after AVS2AVI starts. <major>/<minor> refer to the version number of the message protocol itself, not AVS2AVI. <major> will be incremented when a backwards-incompatible change (such as changing the parameters for any of the messages) is made to the message protocol. <minor> will be incremented for backwards-compatable changes (such as adding new messages which can safely be ignored). <avs2aviversion> is a trailing parameter and is the version of AVS2AVI.

INIT <hiddenwindowhandle>
This is sent immediately after AVS2AVI starts, after the VERSION message. <hiddenwindowhandle> is the handle to a hidden window which AVS2AVI creates. The only purpose of this window is to watch for a WM_CLOSE message to signal that encoding should be aborted.

ERROR <message>
This may be sent at any time. <message> is a trailing parameter and contains a description of the problem. AVS2AVI will exit after sending this message.

ENC_START <numpasses> <numframes>
This is sent when the encoding starts.

PASS_START
This is sent when starting an encoding pass (this will be sent before the first pass too, and even if its only a 1-pass encode).

PROGRESS <curframe> <datasize> <fps> <eta>
This shows the progress of the current pass. Curently it is sent every 300ms during encoding. <datasize> is in bytes, <fps> will contain a decimal point (I believe it pays attention to the locale settings), <eta> is in milliseconds. If <fps> and <eta> are unable to be calculated (i.e. no frames have been encoded yet), they will be 0 and -1, respectively.

PASS_END <elapsedtime> <datasize>
This is sent when a pass is finished. <elapsedtime> is in milliseconds, <datasize> is in bytes.

ENC_END <filesize> <keyframes>
This is sent when the whole encode is finished. <filesize> is the size of the resulting file (this will be slightly larger than <datasize> for the last pass, as it includes stream overhead), in bytes.


Example of an encoding session (most of the PROGRESS messages were cut out to save space, obviously):

VERSION 1 1 :1.34
INIT 4525658
ENC_START 2 712
PASS_START
PROGRESS 261 0 44.369807 10164
PROGRESS 279 0 44.491525 9732
PROGRESS 293 0 44.491525 9417
PASS_END 16272 0
PASS_START
PROGRESS 546 4581672 22.782130 7286
PROGRESS 554 4647944 22.747990 6945
PROGRESS 561 4737880 22.747583 6638
PASS_END 31855 6075066
ENC_END 6098944 3


Here's an example where an error occurred:

VERSION 1 1 :1.34
INIT 2887324
ERROR :Destination file already exists (or unable to overwrite).

iradic
8th March 2004, 23:33
i get this error msg... using winme...

the avs2avi.exe is linked to missing export kernel32.dll:getfilesizeex

Moitah
9th March 2004, 00:22
Originally posted by iradic
i get this error msg... using winme...

the avs2avi.exe is linked to missing export kernel32.dll:getfilesizeex I didn't realize this was only a 2000/XP function, I'll fix this soon.

Moitah
9th March 2004, 03:07
AVS2AVI v1.35 (http://members.cox.net/moitah/avs2avi-135.zip): Uses GetFileSize instead of GetFileSizeEx (should work under Win9x now)Please let me know if it works or not.

iradic
9th March 2004, 05:56
yes, works now... tested only cmd line "avs2avi" to get help...

thanks...

Moitah
9th March 2004, 05:58
Originally posted by iradic
yes, works now...Thanks

Emp3r0r
12th March 2004, 05:44
Great job Moitah, used it the other day and it worked great!

Rainy
21st March 2004, 13:18
I wrote sort of a gui, which uses a dll interface instead of cli. It's in early stages, thus don't wonder if some functions are disabled. The program doesn't even have a name.

If someone wants to test it:
http://www.home.no/rainy/pr/avs2avid-pre-alpha.zip

Tested only under Windows XP with SP1.

Screenshot:
http://www.home.no/rainy/pr/avs2avid-scs.jpg

DarkDudae
21st March 2004, 13:45
Good Work Rainy, I have tested with XviD and 2 passes. Everything worked ok.

(Windows XP Sp1 / 256RAM DDR /ATHLON XP)

lamer_de
22nd March 2004, 15:12
My windows 2000 is complaining about a missing dll, uxtheme.dll
Simply by the name of the dll I would guess it is used to create the fancy (or butt-ugly imho) window captions. Could you please look into this, judging from the screenshot your program looks rather nice and I would like to test it.

CU,
lamer_de

Rainy
23rd March 2004, 14:16
fixed, plus:
* added support for saving compressor settings as a preset
* unlimited pass count (whoever needs it)

see above for download link

jjseth
24th March 2004, 13:53
@Rainy
Tested with WinXP SP-1 and XviD: great work.
In Win2000 AVS2avid don't work...

@lamer_de
Uxtheme.dll is a .dll for the management of WinXP visual styles.

Sorry my poor english.

Rainy
24th March 2004, 15:11
Thanks, but can you explain what exactly doesn't work? Do you get any error messages or something? The problem with uxtheme.dll should be fixed by now. I removed every reference to visual styles api.

jjseth
25th March 2004, 13:23
I canīt reproduced the bug again but this was a message of error in the load of avs2avi.dll when i ran avs2avid.exe first time....
Now it seems to work ok in Win2000, only a "cosmetic" bug->avs2avid.jpg (http://perso.wanadoo.es/sethftp/avs2avid.jpg)

Works OK in WinXP:D

Sorry my poor english.

Rainy
25th March 2004, 13:49
I've uploaded a new version, hopefully it works now :)

DarkDudae
25th March 2004, 16:30
@Rainy

Can you give me info about your avs2avi.dll?
I would like to include it in ARCalculator for a status window like you have, if you are agree, of course.
I have almost finish a function like Moitah implemented in Visual Basic to read stdout using -f command in avs2avi.exe. I am progamming in delphi but I donīt know why, sometimes the code I use freezes avs2avi and doesnīt read stdout correctly. It is really strange because sometimes, it reads it correctly, so it is misterious :D

I will post the function when I can (I haven't it here right now)

Thanks in advance.

Rainy
25th March 2004, 17:33
avs2avi.dll exports a class with virtual methods which are being called while encoding for status info, pass begin - end, error and so on. Available sources were a little disordered and not reusable at all, thus I had to rewrite it completly.

I'm not sure if delphi can import C++ classes, but I can upload the sources :)

dimzon
25th March 2004, 19:11
Originally posted by Rainy
avs2avi.dll exports a class with virtual methods
maybe better is move from class to interface (IAvs2AviProcessor) :)

Rainy
25th March 2004, 20:06
You mean to export a COM-Interface? If there are enough people who are interessted, I will provide it.

dimzon
26th March 2004, 11:04
Originally posted by Rainy
You mean to export a COM-Interface?
Yes, i did exatly that :)

jjseth
30th March 2004, 12:32
I've uploaded a new version, hopefully it works now
Great work Rainy, now works ok!!!

esby
6th April 2004, 04:19
May i ask for three 'small' features requests?

--Range:XXX-YYY
--RangeDrop=true/false
with multiple ranges possible
eg --Range:0-150 --Range:200-250
to encode only from frame 0 to 150, and after 200 to 250
RangeDrop selecting between:
-true : the non selected frames are dropped (zeroSized)
-false: the non selected frames are not encoded, resulting a clip of 200 frames in the example.
I think RangeDrop==true might be easier to implement.


--NoCompress:
Do not compress, use directstream copy...


esby

theuser86
8th April 2004, 01:49
@Moitah

I just have a random question. Are you the original developer of avs2avi? Reason being is that DivX Digest < http://www.divx-digest.com/software/avs2avi.html > states the newest version is 1.31a and also that the official download site is < http://daveel.leffe.dnsalias.com/ >.

In addition, a guide from AviSynth.org < http://www.avisynth.org/index.php?page=Drazen > links the official download site as < http://daveel.leffe.dnsalias.com/ >.

Also, a 3rd site < http://jonny.leffe.dnsalias.com/ > links the official download site as the one previously stated twice.

The "official download site" only has up to version 1.31a on it too.

And in this thread @ doom9 v1.35 is out, how come all these sites plus the official download site does not have v1.35 online? Just a random question because avs2avi is a great program and I don't want to keep on missing updates. Thanks :)

DaveEL
8th April 2004, 13:15
Ok original developer was [Toff] and int21h and myself added some extra stuff to it (oh and i b0rked it many times) eventually i took over and hence its hosted on my site.

http://forum.doom9.org/showthread.php?s=&threadid=36768

Been meaning to look over the new version and once ive checked it out ill put it up on my site too as my last versions were not exactly polished releases.

EDIT:- Have not tested the version yet but have looked through the code and people here seem to be happy with it so it will be available from daveel.dnsalias.com shortly 1.35 is now the official latest version according to me :) ill let divx-digest know soon too.

DaveEL