PDA

View Full Version : Command Line Compressor - AVS2AVI


Pages : [1] 2

Emp3r0r
28th October 2002, 03:54
EDIT DaveEL:
Latest version of avs2avi currently is http://daveel.leffe.dnsalias.com/avs2avi-131a.zip
Just to save you reading the entire thread.


I am looking for a commandline style program that would take a input.avs file and a target output.avi and then prompt you with this: http://jvance.com/images/videocompression.gif

I've already attempted the project myself but I still don't know enough C++ or the VCM interfaces to take "store.c" from DVD2AVI and create the app. Maybe something like this already exists or someone thinks it wouldn't be that hard to whip it up.

Additionally, Nic provided me with the following help: "For encoding to avi, you need to learn the AVI API & IC API to do it yourself. Look up commands like AVIGetStream & ICCompress. Basically you do an AVIReadStream from an avs file. That gives you the YUY2 frame in a buffer, then call ICCompress to get the compressed frame & then use AVIWrite (I think :) DVD2AVI is the place to look :) )"

Thanks Nic and anyone else who may provide help.

int 21h
1st November 2002, 15:03
Look to M4C sources.

Emp3r0r
1st November 2002, 22:15
Thanks and I looked at the code but I just found out in my C++ class that you can set a method()=value and it kinda blew my mind :p but anyway, my c++ skills are horrible so I think I will wait for DirectX.NET

[Toff]
2nd November 2002, 21:48
Here is a surprise for you ;) in attachement.

It should work with RGB24, RGB32, YUY2 and YV12 avs source.

It compress well with DivX 3.11, but it crash at the end with DivX5 and XviD, on the last :
AVIFileRelease(pSRCfile);
I don't now why ATM, I will look at it later. The file is still readable anyway at start :D

Source are included, if any vfw guru want to look at it ?

EDIT : Attachement removed (see below for new version)

[Toff]
3rd November 2002, 11:45
I found what the crash problem is.
Line 195 :
if(pDSTCompVideoStream)
AVIStreamRelease(pDSTVideoStream);
Must be :
if(pDSTCompVideoStream)
AVIStreamRelease(pDSTCompVideoStream);

No crash anymore.

Even if the avi seems perfectly playable there is still a problem at the end of the stream (an invalid chunk, that's what vdub say when using the hexeditor and Riff chunk tree)
The problem is also present in DVD2AVI.

EDIT : Oups, a new problem fixed all frames were written as KF, new upload soon. It's seems that RGB support is broken, I must test with a stable avisynth version.

[Toff]
3rd November 2002, 15:39
OK here is 1.01 version

Tested with avisynth 2.06, RGB24,32,YUY2 works compressing to Xvid, DIvX5 or DivX 3.11.

Tested with avisynth 2.5alpha YUY2, YV12 works.
But RGB seems broken with 2.5 alpha.
I can post a short clip If you want.
EDIT : no bug, I must put ConvertToYUY2 before ConvertToRGB24

Ctrl-C terminate properly now.

EDIT : Attachement removed (see below for new version)

Emp3r0r
4th November 2002, 05:42
Your awesome! I appreciate your work! I will start testing right away. Thanks again.

Emp3r0r
4th November 2002, 05:57
Great work [Toff]! This is exactly what I was looking for! If you ever get time could you display the FPS during the encode? Also, how do learn how to read/create/modify a codec parameters file?

PS: or just tell it to use xvid since i can change those parameters in the registry.

Emp3r0r
4th November 2002, 06:17
I guess I must wait for mod to approve your version 1.01?

[Toff]
4th November 2002, 10:18
>I guess I must wait for mod to approve your version 1.01?
Yes, just have to wait.

>If you ever get time could you display the FPS during the encode
Yes that should be easy, I will add an estimated time also.

>Also, how do learn how to read/create/modify a codec parameters file
The file that is created is a raw copy of the codec state so there is no general method to create/modify them. Each codec has is own format.

>or just tell it to use xvid since i can change those parameters in the registry
I think that's possible to make a special case for xvid :)

There is still a little problem at the end of the file, when you use your media player in loop mode it doesn't loop.
The problem is also present in DVD2AVI.
I let you test.

int 21h
5th November 2002, 06:52
I'll take a look at this later and see about adding some stuff and perhaps compiling with Intel for speed increases (when I'm sober :) )

int 21h
5th November 2002, 16:01
I hope [Toff] doesn't mind, but I went ahead and implemented a limited two pass functionality. It works fine, but its limited in that it currently doesn't support the load/save function, if you supply load/save on the commandline and also supply the twopass argument, it should dump you out with the usage. (Sorry I forgot to update the usage printout also)

To activate two pass mode you just supply something like

avs2avi source.avs destination.avi -2

This will, in succession ask for compression codecs, the first will be for the first pass, and the second for the second pass (it will confirm them and display). If they don't match (i.e. you select XviD during one pass and DivX for the second, the program will close, printing an error).

Version number is incremented to 1.10.

I tested this briefly and I'm 99% certain it works and I didn't break anything existing.

http://phreak404.virtualave.net/avs2avi_110.zip

[Toff]
5th November 2002, 19:02
No problem, feel free to improve.
Let's go test 2 pass encode now.

Emp3r0r
5th November 2002, 21:17
I must be in heaven. You guys are great! I did some testing with DVD2XCD and I think everything is now in place to create a new GKnot type program since GKnot is very outdated. Thanks, for the work.

io
5th November 2002, 23:04
Originally posted by [Toff]
Even if the avi seems perfectly playable there is still a problem at the end of the stream (an invalid chunk, that's what vdub say when using the hexeditor and Riff chunk tree)
The problem is also present in DVD2AVI.
i stumbled over the same problem using AviFile. the files created seem to be fine, but virtualdub shows an error in its hex editor and some apps did not like these files. i donot think that it is a bug in the code, because the same behavior is present in other programms using AviFile (especially. the VFW examples from microsoft!).

as far as i can see, there is a block added after the RIFF AVI chunk (directly succeeding the AVI legacy index), but it only contains a portion of the last frame. i guess this is for some strange padding reasons, but i would like to get rid of this stuff!

probably the only way to solve this, is to follow virtualdub/vidomi and code your own version of AviFile. *sigh*

[Toff]
6th November 2002, 00:27
Thanks, for your comment io.
So I know it's not entirely my fault.

Here we go for v1.11 with :
- 2 pass load/save mode.
- fps display, and remaining time (not very accurate, don't know why)

avs2avi_111.zip (http://christophe.paris.free.fr/temp/avs2avi_111.zip)

No use default codec parameter (from registry) without prompt at the moment.

int 21h
6th November 2002, 01:38
I had a v1.11 also, but I've incorporated my additions in to yours once again, so here is v1.12

Changelog
---------

ReWrote Option Parsing (Won't mean much to most of you, except you can put your flags in whatever order you want now, source, and destination still need to be 1st and 2nd respectively)
Added -q to the flag list, use this to get a 'quiet' mode and supress the frame by frame output (gains about 1fps)
Cleaned up program run header a bit to look sexier ;)
Fixed potential crash if invalid codec state file was supplied, or if there was a problem opening a file for dumping the state
Compiled with Intel compiler (program now requires at least MMX to run), modest speed gain should be seen by some

unplugged
6th November 2002, 02:48
- Surprised about so simple and so effective! (quality+speed toghether with MPEG2DEC3 YV12 and AVS 2.5a)
- Now I'll use VirtualDub only to find frames boundaries :p, command-line is more quick to setup!!
- Should be bundled with Avisynth

Thanx Toff!

MaTTeR
6th November 2002, 04:04
Any chance of multi-threading for the future? *grin* I only ask because otherwise it's going to run much slower on SMP boxes compared to Vdub. Good work guys, can't wait to do some testing.

int 21h
6th November 2002, 05:10
I'll look into it, I'm not familiar with how to synch the threads.

MaTTeR
6th November 2002, 05:18
I started reading some OpenMP documentation several months ago just to see how difficult it would be to parallelize threads. Well, not being a coder myself, I don't half to tell you how completely lost I was after 3 days of reading:rolleyes: Thx for looking into it though, I'm sure Acaila would appreciate it as well.

-h
6th November 2002, 06:41
CreateThread() through pure win32 isn't that horrible from when I last used it. CreateMutex() will make synchronization pretty easy, since you only have to keep decoding 1 frame ahead of encoding.

I would say create your encoding/decoding threads, and have the encoding thread polling for a mutex with the current required frame number. Once that mutex appears, encode the frame and free the mutex, then create another mutex signifying that the frame has been successfully encoded. Decoding should poll for the success mutex created by the encoding thread and proceed to decode another frame (or however many in advance).

There are probably better ways to do it, but this is a pretty quick and easy way to get encoding/decoding threads in your system.

-h

gamr
6th November 2002, 07:07
this is kewl! back to cli! now for the fun of writing some bat files to detect if there is an avs in a directory and if so process it if not sleep, this will be fun :)

im getting weird results with the eta tho,

Pass 1/1 frame 1160/135572, (4.53fps) 00:05:57.233

obviously that should be 5hrs not 5mins. also is there any chance of getting current filesize/estimated final filesize?

[Toff]
6th November 2002, 10:40
>gamr
>im getting weird results with the eta tho,
>Pass 1/1 frame 1160/135572, (4.53fps) 00:05:57.233
Yes it's very possible as I haven't much test it.

>also is there any chance of getting current filesize/estimated final filesize?
For 1 pass mode and 2nd pass it can be done.
But estimated final filesize will may be not accurate. (as my crazy eta)

>int 21h
>ReWrote Option Parsing (Won't mean much to most of you)
>...
Thanks, it was needed ;)

>MaTTer
>Any chance of multi-threading for the future
I think there can be 1 thread for avs frame reading, and 1 thread for encoding.

Hey ! 60 ko ! it's starting to be bloated :D
Let's go test this 1.12 version now.

sh0dan
6th November 2002, 13:09
Great, great program - it's so simple and works so well!

Getting this however:
Pass 1/1 frame 273/1038, (10.63fps) 00:00:-14.-466

Seems a bit strange to me ;)

How about audio handling? Passing uncompressed audio should be fairly easy. Export to WAV could also be a nice feature.

(Another thing: It seems like overkill to use the intel compiler - there really isn't anything to optimize, as far as i can see).

int 21h
6th November 2002, 15:15
Originally posted by sh0dan
(Another thing: It seems like overkill to use the intel compiler - there really isn't anything to optimize, as far as i can see).

I just always use it, its performance, even for anything that appears unoptimizable, usually gives better results on my machine than the MS one, so that's what I use. Feel free to recompile to whatever you'd like :)

sh0dan
6th November 2002, 15:56
Sorry - didn't mean to offend you!

It's a great tool! I already use it exclusively for performancetesting.

int 21h
6th November 2002, 16:28
I wasn't offended :)

int 21h
6th November 2002, 19:58
I've got the functions seperated out so that I can thread them, just having trouble synching my threads now, I'll have to read up on Mutex and Event stuff.

Just thought I'd let you guys know though, I am working on it :)

[Toff]
6th November 2002, 21:05
Great !

I let you know that I have fixed the ETA bug.
Now I'm working on using a codec (default registry settings) by giving his fourcc.
Something like :
avs2avi mymovie.avs myXvidMovie.avi -c xvid

An idea for synchro:
* Init:
mysemaphore = CreateSemaphore(NULL,0,1,NULL);

* Reader :
Read frame
ReleaseSemaphore(mysemaphore, 1, NULL);

* Writer (in is own thread) :
WaitForSingleObject(mysemaphore, INFINITE);
Write frame

Something strange with windows mutex:
doing :
WaitForSingleObject()
WaitForSingleObject()
in same thread doesn't block the thread.

int 21h
6th November 2002, 23:01
Originally posted by [Toff]
Something strange with windows mutex:
doing :
WaitForSingleObject()
WaitForSingleObject()
in same thread doesn't block the thread.

That explains exactly the problem then. I had a WaitForSingleObject(hMutex,INFINITE) and it never stopped one of my threads from going...

[Toff]
6th November 2002, 23:50
I've already exprimented this problem on an old multiplatform (Linux/Win32) project. And I remember very well differences between windows mutex and pthread mutex (I have spent enought time to find the bug on win32 when I first develop more than half of the project on linux)

mandm
6th November 2002, 23:57
where can I get a avs to test the program ?


thanks

M&M

int 21h
7th November 2002, 05:17
Originally posted by [Toff]
Great !

I let you know that I have fixed the ETA bug.
Now I'm working on using a codec (default registry settings) by giving his fourcc.
Something like :
avs2avi mymovie.avs myXvidMovie.avi -c xvid

An idea for synchro:
* Init:
mysemaphore = CreateSemaphore(NULL,0,1,NULL);

* Reader :
Read frame
ReleaseSemaphore(mysemaphore, 1, NULL);

* Writer (in is own thread) :
WaitForSingleObject(mysemaphore, INFINITE);
Write frame



If you use Semaphore, how does the Reader know to stop reading until the writer is ready for another frame? It should be something like this right?

ReadFrame
WaitUntilWriteReady
WriteFrame
WaitUntilReadReady

etc.

I had some other coding to do tonight so I didn't give it as much time as I would have liked, I'll mess around with it more tomorrow.

[Toff]
7th November 2002, 09:50
int 21h : If you use Semaphore, how does the Reader know to stop reading until the writer is ready for another frame? It should be something like this right?

Yes you are right, if reading a frame is fastest than compressing it we are going to have big problem, so one way is to use 2 semaphores (initialized differently) :

* Init:
hSemWaitRead = CreateSemaphore(NULL,0,1,NULL);
hSemWaitWrite = CreateSemaphore(NULL,1,1,NULL);

* Reader :
WaitForSingleObject(hSemWaitWrite, INFINITE);
Read frame
ReleaseSemaphore(hSemWaitRead, 1, NULL);

* Writer (in is own thread) :
WaitForSingleObject(hSemWaitRead, INFINITE);
Write frame
ReleaseSemaphore(hSemWaitWrite, 1, NULL);


Here is v1.13
avs2avi_113.zip (http://christophe.paris.free.fr/temp/avs2avi_113.zip)
What's new ?
- Use codec by fourcc, can be used by external program to encode in xvid. The external program first tweak xvid registry key configuration. Then use the "-c xvid". (sould be usefull to Emp3r0r)
- Fixed ETA
- Display current size of AVI

I'm missing space for estimated final filesize.


mandm : where can I get a avs to test the program ?
You must do it yourself ;)
For that you need Avisynth first : http://www.avisynth.org

octapus
7th November 2002, 12:52
Hey , it's a very nice work you have done. I was wondering what those lines mean inside function
void InitializeDestination(const char* filename)
.
.
.
.

BITMAPINFOHEADER rgb = bmihVideoSource;
rgb.biCompression = BI_RGB; // Force to RGB ? (doesn't accept YUY2, or YV12)
rgb.biBitCount = 24; // Force 24 ? (doesn't accept 16 or 12)
rgb.biPlanes = 1; // Force 1 ?
.
.
.
.
.


And another thing which has been said some times. Time remaining has to output correctly.

Thanks again.

octapus
7th November 2002, 12:53
I'm sorry i didn't read before i post (about remaining time).
-Fixed ETA.

stax76
7th November 2002, 13:19
I did some testing with DVD2XCD and I think everything is now in place to create a new GKnot type program since GKnot is very outdated.

I hope people will like your new GKnot type program better as mine ;) , like you said before people will have a hard time to replace trusty GKnot with another programm, especially when it's a .NET program. When the new GKnot is finished, everbody will use it..., but I know it is a lot hard work to code all the features people expect from the new version, I already did most of it :D

int 21h
7th November 2002, 18:10
Version 1.14

What's new?

Multi-threaded, decode/encode/display are now seperate threads, this improves performance on even non multi-processor machines.

mandm
8th November 2002, 00:17
Well in M&M after a lot of test
semaphores - signaling object - timers...


the easiest way was to generate 2 threads and to put a
sleep (0)
where you want to switch between them...

of course only one thread is active at time...

... instead if you have a multiprocessor :eek: ...
... you should have a sync at a variable level
(but I do not have a MP to test it...:( )


At the end we have abbandoned the synched multi thread version as there was no effective advantage against the actual release (where we use threads but I cannot think we can realy say we "multi thread" :o )


Can anyone tell me how do you encode avs ? or where I can find them ?

M&M

[Toff]
8th November 2002, 00:36
This 1.14 version work great at least with 1 processor.
I have added a priority flag on my version, but as it is a small change, I'm waiting for other features to release it.

@mandm
You don't "encode" avs.
avs are script files that allow video processing.
To use avs script you must first install it http://www.avisynth.org

Take a video source on your hard drive, an AVI file (we call it "mymovie.avi"), you want to resize it before encoding. You create a text file with your prefered text editor :
AVISource("mymovie.avi")
BicubicResize(384,288)
Call it mymovie.avs
To preview the result open it in any player or virtualdub.
Then you can do your encoding :
avs2avi mymovie.avs resizedmovie.avi

You can open the avs file in nearly any application that support avi.
Look at the avisynth web site for more details it's worth a try.

int 21h
8th November 2002, 00:38
Small Update, I've got some primitive audio support working right now via BeSweet, having some issues with BeSweet's progress display and info records but it is producing valid mp3s from an audio stream specified in an avs file via AudioDub() and WavSource().

[Toff]
8th November 2002, 00:55
octapus :
I was wondering what those lines mean inside function
void InitializeDestination(const char* filename)

BITMAPINFOHEADER rgb = bmihVideoSource;
rgb.biCompression = BI_RGB; // Force to RGB ? (doesn't accept YUY2, or YV12)
rgb.biBitCount = 24; // Force 24 ? (doesn't accept 16 or 12)
rgb.biPlanes = 1; // Force 1 ?

I don't really understand myself why you need to use this settings even if you really use different parameters.
Even if you have YUY2 (16bits) AVIStreamSetFormat will fail with rgb.biBitCount = 16;

@int 21h:
Here is a link with the priority flag.
http://christophe.paris.free.fr/temp/avs2avi_priority.cpp
Does your audio mod. works with VBR MP3 ?

int 21h
8th November 2002, 00:58
Ok, updated to include that flag on the thread.

The audio system I have setup works with any parameter of BeSweet including VBR MP3 and many,many other settings :D

I will keep working on the audio stuff, we have to get DSPGuru's permission before using his .dll anyways, I've already messaged him, but am waiting for a reply.

Ok, from what I can see in Debug, the way this info thing is working seems totally wrong, I think its a dll error, so I'm just going to use my own progress indicator.

MaTTeR
8th November 2002, 02:39
Originally posted by int 21h

Multi-threaded, decode/encode/display are now seperate threads

Many many thx. I had no idea you guys would whip something together this fast. My time is limited right now unfortunately but I'm anxious to test it out this weekend.

Emp3r0r
8th November 2002, 05:53
like you said before people will have a hard time to replace trusty GKnot with another programm, especially when it's a .NET program. When the new GKnot is finished, everbody will use it..., but I know it is a lot hard work to code all the features people expect from the new versionWell, everyday things are getting easier. Most of the hard stuff is already done. The way I see it, it is now as simple as:

1) Select your DVD Drive
2) Select the streams
3) Get besweet settings or DSC source sound
4) Create avisynth script
5) Get codec settings
5) Run avs2avi

Now I imagine it must be kept as flexible as possible... something I always liked about gknot. All that needs to be done is the gathering of variables and using automation to the max. The next big thing will be a program that uses besweet, avisynth and avs2avi in an appropriate manner.

What's neat is that all these things get better everyday making everyone's life easier, including whoever creates the next great gknot.

[Back on topic]
I am so grateful for the updated version of avs2avi. Thanks [Toff] and int 21h. I'll test immediately. Anyone with some fps numbers on a 2CPU machine?

int 21h
8th November 2002, 07:03
New version. [Waiting for DSPGuru's ok for BeSweet.dll usage]

What's new

Can encode .wav files into VBR/CBR mp3 files via BeSweet.dll, just add the .wav file to your Avisynth script like this:

AudioDub(mpeg2source("C:\vobs\test.d2v"),WavSource("c:\vobs\test.wav"))

(AC3 support may come, it requires another parameter on the commandline, and some other changes, easier if Avisynth team implements a new source filter for it :) )

Fixed potential ETA bug that popped back up after AVS2AVI became multi-threaded.

LAME parameters for BeSweet encoding added to commandline, extended commandline is now avs2avi sourcefile destinationfile [flags], if flag -a is set, Audio will be processed, the following parameters can be set along with that flag:

--abr: ABR Encoding mode
-b: CBR low bitrate (or VBR low bitrate)
-B: VBR High Bitrate
-m: Mode (S,J,M,F)
--alt-preset: enables alt-presets
--preset: enables -presets
--r3mix: use r3mix
-V: VBR Quality (0-9)
-G: Gain for BeSweet to add (default is auto-find)


Two pass XviD with an mp3 would be

avs2avi xvid.avs xvid.avi -2 -a --alt-preset 192

ComingSoon: Hopefully muxxing support.

[Toff]
8th November 2002, 12:48
I have noticed a problem in "Ctrl-C" handling to stop the program during the process.
The display thread lock the program.
changing:
while(current_frame > 0)
to:
while(current_frame > 0 && !Stop)
must fix the problem.

int 21h
8th November 2002, 17:42
Ok fixed. I have permission from DSPGuru, but I am going to wait a little and see if he fixes the bug I found, and also his answer to another request.

int 21h
8th November 2002, 21:02
Originally posted by int 21h
ComingSoon: Hopefully muxxing support.

This will take awhile, mostly because I don't know the specifics of converting a file into the stream required for the AVI. And from what I can see on how AVIMux, Vidomi, and Nandub all do it, its very complicated.

DSPguru
8th November 2002, 22:50
@int 33
my mailbox is full, please post your request in here.

int 21h
8th November 2002, 23:02
Your terms sound fine.

Would it be possible to change the output of the .dll so that when its deinitalized it does not show the URL message? I would be more than willing to show the URL in the beginning, at the end it really messes up our program's output (because it has more to do after its done with the audio).

Right now our program startup looks like this:


AVS2AVI v1.15 (c) 2002 Christophe PARIS (christophe.paris@free.fr)
Contributions by: int21h

Thanks to Avery Lee author of VirtualDub and Chia-chen Kuo author
of DVD2AVI for providing great source code of inspiration.

Also uses:
BeSweet v1.4 by DSPguru.
--------------------------


I think it would be good as:


AVS2AVI v1.15 (c) 2002 Christophe PARIS (christophe.paris@free.fr)
Contributions by: int21h

Thanks to Avery Lee author of VirtualDub and Chia-chen Kuo author
of DVD2AVI for providing great source code of inspiration.

Also uses:
BeSweet v1.4 by DSPguru. Check for the latest version at: http://dspguru.doom9.org


Because when it outputs the URL at the end it looks very, very bad. And also, do you intend to fix the info-> bug?

Thanks again.

mandm
8th November 2002, 23:06
[QUOTE]Originally posted by Emp3r0r
[B]Well, everyday things are getting easier. Most of the hard stuff is already done. The way I see it, it is now as simple as:

1) Select your DVD Drive
2) Select the streams
3) Get besweet settings or DSC source sound
4) Create avisynth script
5) Get codec settings
5) Run avs2avi

...

What's neat is that all these things get better everyday making everyone's life easier, including whoever creates the next great gknot.

[Back on topic]

how do you do 1-2 ???

about the program we were thinking to evolve M&M to include advanced functionalities as besweet...

DSPguru
8th November 2002, 23:42
#ifdef BeSweetDLL
if (!strcmp(*argv,"singleline"))
fprintf(stderr,"BeSweet %s by DSPguru. Check for the latest version at: http://DSPguru.doom9.org\n",BeSweetVer());
else
#endif
pinfo(1);


i will check out the info bug asap.
btw, i believe this bug only relevant for wav source. i believe it works fine for ac3 source.

ps,
it would be very cool if we could have muxing in your tool. i would really like to see a tool that mux BeSweet's payload directly into a video stream. this will save precious i/o time.

int 21h
8th November 2002, 23:54
Where should I place that code (I dont ever #define BeSweetDLL so I don't think this would do anything)? Also, what does pinfo(1); do?

DSPguru
8th November 2002, 23:57
this is a BeSweet code.
pinfo(1) is what BeSweet have today - the two lines greetings.
as you can see from code above, if argv[0] will be "singleline", BeSweet will print a single greetings line instead of pinfo(1).

int 21h
9th November 2002, 00:01
Ah, thanks. This is updated in the dll, so I should download a new copy, or this already existed? :-P

DSPguru
9th November 2002, 00:10
no new binary yet :o

int 21h
9th November 2002, 00:13
This change also makes it so it omits the URL output when its finished processing right?

DSPguru
9th November 2002, 00:16
#ifndef BeSweetDLL
fprintf(stderr,"\n\nVisit DSPguru's Homepage at :\n");
fprintf(stderr," http://DSPguru.doom9.net/\n");
#endif

int 21h
9th November 2002, 00:29
Really? :( You won't consider changing that if we already mention the URL in the beginning?

DSPguru
9th November 2002, 00:32
reread :
ifndef :D.

int 21h
9th November 2002, 00:36
Gah, sorry, was reading quickly before I go out for the evening.

Thanks again.

[Toff]
9th November 2002, 02:26
it would be very cool if we could have muxing in your tool. i would really like to see a tool that mux BeSweet's payload directly into a video stream. this will save precious i/o time.

Yes, sure it would be cool.
But what about the AVI problem with VBR files ?

I don't know much about muxing myself.

MaTTeR
9th November 2002, 02:31
Originally posted by [Toff]
Yes, sure it would be cool.
But what about the AVI problem with VBR files ?
Why not use the Ogg container(OGM)?

[Toff]
9th November 2002, 02:35
MaTTer : Why not use the Ogg container(OGM)?

In a program called avs2avi ;) it's not possible.
You will need an avs2ogm :D

Is it possible to mux AC3 in OGM now ?

MaTTeR
9th November 2002, 02:39
Originally posted by [Toff]
[B]Is it possible to mux AC3 in OGM now ? LOL, well you do have a point:D

Yes, I've been muxing AC3 into OGM for quite sometime now with VdubOGM which is now incorporated into VirtualDubMod I think.

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

int 21h
9th November 2002, 08:28
Well, I've never had any problems with the fact that muxing a VBR audio stream into an AVI produces 'invalid' AVI files. It has never failed to play correctly for me... so I continue to use it.

That being said, if anyone wishes to submit mods to allow the usage of OGM in AVS2AVI, I'm sure they would be accepted ;) However, I won't be coding for it until I figure out all the AVI stuff.

TheUnforgiven
9th November 2002, 12:42
thanx guys for the great program.
i already use it as well in my GKnot like program QuickAVS:
http://forum.doom9.org/showthread.php?threadid=37626
now small request:
can u plz add a pause after the program finishes processing so that one can read the average fps value before the dos window closes.

int 21h
9th November 2002, 18:11
What language is your program written in? In all honesty I think a better solution would be for you to redirect stdout to a window or something in your program. If you give me more details about your program I can help you accomplish this, and it will be much better looking than a dos box opening up :)

Also, once things get stable, and I either figure out, or give up on muxxing, I can probably be persuaded to make a .dll for avs2avi.

TheUnforgiven
9th November 2002, 23:37
thanx for the responce int 21h
the program is written in vb6. i think u mean something like the right window in headac3he? this sure would be better. is this done with win32 api functions? if yes i will be grateful if u gave me the names of these functions and i'll search the MSDN for more info.
the dll would be great also, but i would like to know how this is done even if there will be a dll.
good luck on muxing

int 21h
10th November 2002, 00:57
http://support.microsoft.com/default.aspx?scid=KB;en-us;q150767

http://www.codeproject.com/atl/redirect.asp <-- good.

TheUnforgiven
10th November 2002, 09:38
@int 21h
thank u for the links i'll try to implement that in the next version

iago
10th November 2002, 18:15
@[Toff] / int 21h

Thanks a lot for this tiny but great command-line program! ;)

regards,
iago

Koepi
10th November 2002, 18:56
Now only a small GUI is missing, for users convenience ;) (just showing up if no command line parameters are given).

Maybe I could do a small MFC GUI directly using your code, I think it would be a nice vdub replacement... ;)

Regards
Koepi

TheUnforgiven
10th November 2002, 19:14
@koepi
my program QuickAVS offers a GUI already have u tried it
http://forum.doom9.org/showthread.php?s=&threadid=37626

EDIT: sorry i just reread ur post u mean from inside the program.

int 21h
11th November 2002, 15:37
Any news on a new .dll release DSPguru?

DSPguru
11th November 2002, 22:07
i'm very very very very very very busy lately. and again, this is only a plastic bug that relates to wave transcoding. so you'd have to wait.

ps,
feedback on ac3 transcoding is more than welcomed.

int 21h
12th November 2002, 00:32
all I really need is the ifdef, and ifndefs, the bug can wait....

DSPguru
15th November 2002, 06:30
it's up.

int 21h
15th November 2002, 17:11
I'll take a look, and post the new version of this today :)

int 21h
15th November 2002, 17:22
With the new callback function in the .dll it should make muxing a little bit easier, I just have to figure out how to convert the data into a stream for the file...

DSPguru
15th November 2002, 17:24
great :)

int 21h
15th November 2002, 21:58
To break the 4GB barrier?

mfluder
17th November 2002, 04:36
Hi,

I made a little GUI for this great program. It's very small (only 16K) and a good thing about it is it wont immediately close console window after encoding is finished. Instead it will wait for you to press a key, so you will be able to see average fps and encoding time. If you have some strange things going on while using avs2avi 1.14 (like strange output during encoding) then please download avs2avi 1.13 until this "bug" is fixed. As I understand int 21h already fixed this but he will not release it until there are some bigger changes, like audio support. I almost forgot to mention that you will have to put this file in same directory with avs2avi.exe.

I attached a file to this post but you will have to wait until it is approved. Please report bugs if you find any.

@[Toff] and int 21h:
Thank you very much for this great tool.

mfluder

octapus
18th November 2002, 00:17
This little program is very helpful. And using it, i thought of a feature that would be very useful, but i don't have a clue how easy it is to implement or if it is even possible to be implemented.

How about having the possiblity to pause encoding, close program ,reboot and after computer restarts, to continue from where (frame number) it had left encoding (having an option to do so).

Any ideas, everybody? I just need to hear some opinions on how this can be implemented. The only thing that i can think of and which maybe is far from what i want, is "hibernate" option of windows xp(the way it works).

Thanks.

DaveEL
18th November 2002, 01:48
Originally posted by octapus

How about having the possiblity to pause encoding, close program ,reboot and after computer restarts, to continue from where (frame number) it had left encoding (having an option to do so).


Yes this is possible. I know ive done it before (lost the source code now and the thing wasnt very useful as it was more a proof of concept rather then a real implementation some things needed to be done by hand). My previous implementation relied heavily on features in nandub and gordian knot but it should be possible to do without these however file size predictability will not as good (my old implementation only dropped changes the file size by a couple of kbytes (undersized) each time you paused (and only in the second pass first pass was losless). Also my old implementation could cope with machine crashes (i even puilled the power cable out of my pc a couple of times to test this) but without some of the nandub features i used i dont think this will be possible.

Do you want to use this for one or two pass encoding? one pass is very easy but two pass should be possible (and far more useful) but will be limited to certain codecs (i would write it for xvid but the code would be available if someone wanted to write divx support). Also i need to work out some issues concerning b-frames as vfw codecs were not designed to do b-frames and it could cause problems with my intended implementation.

Ill try to work out if this is really practical and if i have time to do it soonish. Also im not sure if i can do this with avs2avi anyway it may need to be rewritten to allow some extra functionality that this would require.

If anyone else wants to have a go at writing this pm me and ill explain how i implementated this last time and my concerns about doing this without nandub/with b-frames etc.

DaveEL

octapus
18th November 2002, 18:35
DaveEL:


That's great news. I have been waiting for such a feature for a long time. Since you implement according to codec used, i use only xvid dev-api3 with virtualdub or avs2avi. Of course two pass is desired, but if it is trouble for you, one pass is a step forward, also.

It would be even better than my thoughts if it could handle power supply loss. I say this because what i asked was simply the user to pause,resume encoding (resume even after computer restart) supposing that we have constant power supply.

If you want me to help with coding i could give a try, but i'm a new c++ coder(learned it previous semester) and haven't codec anything serious so far.

Again, thanks a lot.

int 21h
22nd November 2002, 01:15
Just to let everyone know how development is progressing, I've been real busy lately outside of this realm, and so development has slowed somewhat, this next week looks relatively clear though, so I am hoping on getting some work on the code done then.

[Toff]
22nd November 2002, 10:05
DaveEL, octapus:
Any progress with encoding pause ?
As DavelEL says, one pass encoding should be easy and can work for nearly every codec. If you look into avs2avi, after encoding a frame you have a KF flag. When you want to pause encoding you can wait for the next KF (hey you don't want to loose any processing ;) then close all the file cleanely (as with a Ctrl+C).
Then on resume, instead of creating a new avi, you open the precedent file, you check its length and go to its end, you seek to the same frame in avs, and encoding can continue.

2 pass encoding, is codec dependant so you need to save specific information.

DaveEL
22nd November 2002, 19:06
Originally posted by [Toff]
DaveEL, octapus:
Any progress with encoding pause ?
As DavelEL says, one pass encoding should be easy and can work for nearly every codec. If you look into avs2avi, after encoding a frame you have a KF flag. When you want to pause encoding you can wait for the next KF (hey you don't want to loose any processing ;) then close all the file cleanely (as with a Ctrl+C).

Ok 1-pass support kind of works. If you press ctrl-c it now waits for the next key frame before it exits. Note down the number of frames encoded in the output. To resume use the same input file and a new output filename and use -f <number of frames +1 >. The files then need to be appended with virtualdub. Anyone know of a small utility to do this?


http://www.ecs.soton.ac.uk/~del100/avs2avi.zip

DaveEL

[Toff]
22nd November 2002, 20:09
Great! I'm going to test it right now.
It should be possible to read the number of frame of the 1st file.
And maybe continue with this file.
I will test if it's possible.

[Toff]
23rd November 2002, 01:39
Here is an new version.

You use the resume function this way.
>avs2avi mymovie.avs xvidmovie.avi -r
Now you can press Ctrl+C at any time during encoding.
It will create a "resume.codec" file that contain codec parameters.
Then you do what you want, stop your computer and go sleeping :D
When you want to continue encoding you do :
>avs2avi mymovie.avs xvidmovie.avi

Voilą !

One more precision, it works only for 1 pass encoding.

AVS2AVI v1.15 (http://christophe.paris.free.fr/temp/avs2avi_115.zip)

Have fun !

EDIT : Whou ! very synchro ;)

DaveEL
23rd November 2002, 01:41
It should be possible to read the number of frame of the 1st file.


Was going to implement it so i saved this data along with codec config so you could continue where you left off.


And maybe continue with this file.

Tried this a lot and gave up for now. Made it write to the same file but depending on how it was done it would only let me play the first or last parts of the encoding. From what i read of the API docs this is not possible to do with avis. What i did think might be possible but again never got to work was:

1) encode first past to file x.
2) when you restart the encode move x to y and open it
3) create a new avi at x
4) copy each frame from y to x
5) now start reading from the input file again and put the encoded frame on the end of the file y.

Problems
1) couldnt get it to work at all
2) can see any way in the avi to find out if a frame i read was a keyframe so i cant specify this flag in the output file either. The nearest example in the microsoft code instead set the keyframe flag on every frame.


Think i might give up trying on the append stuff for now and work on a) making b-frames work
b) two pass support (xvid)

DaveEL

DaveEL
23rd November 2002, 06:44
Originally posted by [Toff]
Here is an new version.

You use the resume function this way.
>avs2avi mymovie.avs xvidmovie.avi -r
Now you can press Ctrl+C at any time during encoding.
It will create a "resume.codec" file that contain codec parameters.
Then you do what you want, stop your computer and go sleeping :D
When you want to continue encoding you do :
>avs2avi mymovie.avs xvidmovie.avi

Voilą !

One more precision, it works only for 1 pass encoding.

AVS2AVI v1.15 (http://christophe.paris.free.fr/temp/avs2avi_115.zip)

Have fun !


Very nice i guess i should start working on b-frames and 2-pass support now.


DaveEL

[/i]

EDIT : Whou ! very synchro ;)

Just dont try b-frames things WILL go wrong. Does anyone know the address in the divx5 config i need to look at to check if b-frames are enabled?

[Toff]
23rd November 2002, 11:02
Just dont try b-frames things WILL go wrong. Does anyone know the address in the divx5 config i need to look at to check if b-frames are enabled?


What's the problem with b-frames ?
If you always cut on a K frame there shouldn't be any problem ?
It works well here with xvid-20112002 and Divx 5.


Here is a possible improvement :
We are waiting for next KF to "pause" encoding. I think that it would be possible to stop encoding instantely.
Then to resume, you reopen the destination file and go to the last keyframe (with AVIStreamPrevKeyFrame) of the file and continue at this point.
I don't know if old unused data would be well overwritten. But it's something to try ;)


Also how you plan to support 2 pass ?
(thinking for myself here)
- For the 1st pass you need to append to the stat file. Maybe done by creating 1 stat file per "session" and appending stat file at end.
- For 2nd pass I think it's not possible to save all data used for file size estimation. When you want to resume, you can erase the beginning of the stat file, and you will have to substract the size of the current destination file to the estimated end file size.

I wonder if adding support for this directly in xvid wouldn't be easier ?


EDIT:
Just another idea I've got :
What would be great is to had a function pointer into the compressor struct of the Xvid codec.
This function pointer will be at a fixed place in all Xvid version so you have no update problem.
The function could look like this :
int XvidCommand(char* command);

you can use it like this (bitrate example) :
XvidCommand("bitrate=900");
int bitrate = XvidCommand("get_bitrate");

or like this (stat file example) :
XvidCommand("stat_file=C:\\mylog.stat");
char* stat_file = XvidCommand("get_stat_file");

or even :
XvidCommand("save_state_file=resume.xvid");
XvidCommand("save_state");

and to resume session :

XvidCommand("save_state_file=resume.xvid");
XvidCommand("load_state");

hmm, just an idea.
In fact it looks a bit like UCI ;)

octapus
23rd November 2002, 14:56
I just saw that you have incorporated the features mentioned into new version just released. That's good news. I'm going to test it and report back.

Thank you.

DaveEL
23rd November 2002, 16:58
Originally posted by [Toff]
What's the problem with b-frames ?
If you always cut on a K frame there shouldn't be any problem ?
It works well here with xvid-20112002 and Divx 5.
[/i]

Try a very high max b-frames setting in xvid. Basically avi and b-frames = not good. Each encoding starts with some number of blank frames where the codec was getting enough data for the b-frame encoder. When doing this in several parts this will happen several times.
Also the output is not in sync with the input so you have to restart the source some number of frames earlier.

Divx5 packed bitstreams seems a better solution to the problem then the current xvid support i hope someone will fix the packed bitstream in xvid soon im not sure its really possible to support resuming without it.


Here is a possible improvement :
We are waiting for next KF to "pause" encoding. I think that it would be possible to stop encoding instantely.
Then to resume, you reopen the destination file and go to the last keyframe (with AVIStreamPrevKeyFrame) of the file and continue at this point.
I don't know if old unused data would be well overwritten. But it's something to try ;)

As long as it will write to the correct place in the output this will work fine. The next keyframe was just the easy way to do it.


Also how you plan to support 2 pass ?
- For the 1st pass you need to append to the stat file. Maybe done by creating 1 stat file per "session" and appending stat file at end.

This is also made a bit more complicated by the "last" keyframe thing above. You need to seek back the correct number of frames in stats files as well.

- For 2nd pass I think it's not possible to save all data used for file size estimation. When you want to resume, you can erase the beginning of the stat file, and you will have to substract the size of the current destination file to the estimated end file size.

Yeah thats how it works the trouble is getting the file size predictability back up to the same level it was without resuming as any the internal codec information is lost.

[i]
I wonder if adding support for this directly in xvid wouldn't be easier ?

Just another idea I've got :
What would be great is to had a function pointer into the compressor struct of the Xvid codec.
This function pointer will be at a fixed place in all Xvid version so you have no update problem.
[/B]

To help support Vidomi the first 4 or 5 fields were put at fixed memory locations some time ago. This includes all the important stuff like the mode (1st/2nd pass), output file size and stats file name. So its about the same amount of work to do it in avs2avi as in xvid.

DaveEL

[Toff]
23rd November 2002, 20:12
Try a very high max b-frames setting in xvid. Basically avi and b-frames = not good.

Yes, I just tried with a Max B-Frame = 8, and there is synchro problem.


So its about the same amount of work to do it in avs2avi as in xvid.

Yes, but if you do it in xvid you can save some internal value. And have easier access to stat file, seek in them.
I will try to hack something in xvid.

DaveEL
23rd November 2002, 21:16
Originally posted by [Toff]
Yes, I just tried with a Max B-Frame = 8, and there is synchro problem.


Yes, but if you do it in xvid you can save some internal value. And have easier access to stat file, seek in them.
I will try to hack something in xvid.

That can be done but you can get very accurate encodes if you just manipulate the output size correctly (the version i wrote with nandub was never more then a few k out).


Been trying to hack on b-frames (divx 5, would prefer xvid but divx b-frames are better for now). Have the resuming working now i just need to fix the existing bug with avs2avi with b-frames.

Try this take a short clip and encode with b-frames in both virtualdub and avs2avi compare the two frame by frame and you will notice the one from avs2avi is one frame out.

DaveEL

DaveEL
23rd November 2002, 22:30
UPDATE: small bug fixed please download again.

Ok B-Frames code is now done.

I know it works on Divx5 and should also work on Xvid as that seems to produces the same output when it wants to drop an output frame.


This also "fixes" (make it act the same as virtualdub rather then a normal vfw application) b-frames even if you dont use the resume feature.

One small bug in the code currently is that at the end of the encode it should send the codec some blank frames to flush the codec of the last frames (currently they will not be in the output). I want to try and find some more information (im going to have to read the virtualdub source as i dont think its documented) on if the codec needs to be signaled in some other way that the source is finished.

http://www.ecs.soton.ac.uk/~del100/avs2avi.zip

DaveEL

JimiK
24th November 2002, 15:23
Hello, for me DaveELs version does not work in 2pass. And I posted a possible AVS2Avi-problem here:
http://forum.doom9.org/showthread.php?s=&postid=214686
Edit: Sorry, maybe it was not nice to say it that way. Great work, didn't mean to offend anyone.

Best regards,
JimiK
P.S. Pictures can be found a few posts before that one.

DaveEL
24th November 2002, 22:34
Originally posted by JimiK
Hello, for me DaveELs version does not work in 2pass.

Fixed i forgot to reset the bframe counter between passes.
http://www.ecs.soton.ac.uk/~del100/avs2avi.zip

DaveEL

DaveEL
24th November 2002, 23:02
Added support for flushing the codec after encoding bframes

http://www.ecs.soton.ac.uk/~del100/avs2avi.zip

DaveEL

DaveEL
25th November 2002, 00:17
Edit: Another bug fix please download again.

It now pauses at the last keyframe (not next) and so stops when you press ctrl-c.

DaveEL

DarkNite
26th November 2002, 12:58
So far, so sweet! Keep up the excellent work!

I can't wait to see avs2ogm ;) :D

Wilbert
26th November 2002, 17:43
Could you provide some documentation in the next version? Ie: how does it work (do you need VDubMod, it works with DivX5 and Koepi's built of Xvid (does it also work with other Xvid builts without doing any color conversions), where do you have to install it, what happens to the audio, etc.

DaveEL
26th November 2002, 18:05
Originally posted by Wilbert
Could you provide some documentation in the next version? Ie: how does it work (do you need VDubMod, it works with DivX5 and Koepi's built of Xvid (does it also work with other Xvid builts without doing any color conversions), where do you have to install it, what happens to the audio, etc.


If you read this forum post thats about all the documentation that exists appart from if you run it with no parameters it prints the usage information.


Basic usage: avs2avi [AVS Input File] [AVI Output File]

No it doesnt need any other applications.
It should work with any codec.
The Xvid Enhancements im working on now (not in the current build as they dont work yet) will require any xvid build since 23 April 2002.
install it anywhere you want.
encode the audio with what ever tool you want and mux it with any tool you want. (it doesnt do audio).


BTW i posted yet another new build to fix thread sync issues in that last build when you paused the encode.
Edit: still not fixed im trying something else now to try to make it work but its gonna take a little while (mainly cos im also doing the xvid enhancements on the same version).
If someone else wants to look at the code and try to find the problem please do (my brain hurts when i think about threads for too long).

DaveEL

int 21h
26th November 2002, 18:53
I'm still working on the audio support, its slowed down a little bit because I've not had much time, but I'll keep people updated on its progress.

DaveEL
26th November 2002, 19:09
Hey guess what..
yes thats right ANOTHER new build

i think i finally have the thread issues sorted.

And a little preview of two pass pause and resume.
Only currently does the first pass in xvid.

How to test
install an xvid build.
enable resuming and select first pass in xvid.
pause (ctrl-C) and resume as many times as you like.
When you finish you should have a correct stats file.
WARNING Dont use mv hints this will NOT work.

Ill work on the 2nd pass soon but:
1) i want a break
2) i want to make sure whats here works (such as the deadlock in the threads which was so much harder to fix as i id written a whole load of new code which i tried to debug but was working fine).

Also ill try to seperate out the xvid specific code and perhaps if i get time add divx 2 pass support as well (doesnt look hard).

DaveEL

[Toff]
26th November 2002, 21:21
About the thread lock problem I think that the best way is to use 2 writing loop.
The first loop just write the frame in synch with the read loop.
(it doesn't write bframe). It doesn't buffer frame.

The second loop is not synchronized with the reading thread. It write frames corresponding to the delay produce by bframe.

Using this way I don't think you need a buffer.

Then to add Ctrl+C handling you define a "safe" point in the writing loop where you test for the Stop flag and you break. (depending on where you put this test you will need to release the semaphore before breaking).


Currently with your version I have problem when I don't pause ;) some frame are missing.
I have only tested one pass encoding at the moment.
But when I pause/resume 1 or several time it work well.

Also could you increment version number, or at least give a number to your zip so we know about the version we talk.
You can also put your name or pseudo, if you want.

For my part, I have done some experimentation in the xvid code. I can call custom function using the vfw interface. So maybe it could be interesting to add some function to make xvid start at a defined point in the stat files. And add a function to save full codec stat (with 2 pass info).
But it's true that it will need to be added officially to be really used.

DaveEL
26th November 2002, 22:22
Originally posted by [Toff]
About the thread lock problem I think that the best way is to use 2 writing loop.
The first loop just write the frame in synch with the read loop.
(it doesn't write bframe). It doesn't buffer frame.

The second loop is not synchronized with the reading thread. It write frames corresponding to the delay produce by bframe.

Using this way I don't think you need a buffer.

Then to add Ctrl+C handling you define a "safe" point in the writing loop where you test for the Stop flag and you break. (depending on where you put this test you will need to release the semaphore before breaking).




Not sure i get what you mean here the thread locking was a problem whereby the stop even was read by the two threads at different points and so appropirate semaphores are not released. nothing to do with compression or saving of data. I think i can correct it by taking the semaphores before testing the stop variable.


Currently with your version I have problem when I don't pause ;) some frame are missing.


Hmm are you using b-frames and if so how many and how many frames are missing.



I have only tested one pass encoding at the moment.
But when I pause/resume 1 or several time it work well.

Very Strange that would expalin why i didnt see it i tested the pause and resume code dont think ive done a run through in one go yet.


Also could you increment version number, or at least give a number to your zip so we know about the version we talk.
You can also put your name or pseudo, if you want.

Will add info to next version

For my part, I have done some experimentation in the xvid code. I can call custom function using the vfw interface. So maybe it could be interesting to add some function to make xvid start at a defined point in the stat files. And add a function to save full codec stat (with 2 pass info).
But it's true that it will need to be added officially to be really used.
All you need is a variable to select to start position but its easy to do outside of xvid so i wouldnt (and didnt) bother.

DaveEL

DaveEL
26th November 2002, 22:45
Currently with your version I have problem when I don't pause some frame are missing.
I have only tested one pass encoding at the moment.
But when I pause/resume 1 or several time it work well.


Cant replicate that problem tried both with and without bframes.
Earlier version did have that problem with b-frames (did you upgrade between tests?)
Anything before i posted "Added support for flushing the codec after encoding bframes" suffered from that problem after thatShould be ok.

DaveEL

[Toff]
26th November 2002, 23:04
Hmm are you using b-frames and if so how many and how many frames are missing.
Encode in 1 pass without pause :
Xvid, 3 b-frame, input : 501 frame, output : 492 frame
It doesn't change anything if I change the b-frame number or even without bframe.

I don't really understand the buffering part?
Is it possible to do something like that without buffering :


void EncodeFrame()
{
...
// 1st loop
for (DWORD frameNumber = StartFrame;
frameNumber < SRCStreamInfo.dwLength && !Stop;
frameNumber++)
{
ICSeqCompressFrame(...)
if(not_delay_frame)
AVIStreamWrite(...)
else
BFrameNum++;
}

// 2nd loop (write delayed frame)
for (DWORD frameNumber = SRCStreamInfo.dwLength
frameNumber < SRCStreamInfo.dwLength+BFrameNum && !Stop;
frameNumber++)
{
ICSeqCompressFrame(...)
AVIStreamWrite(...)
}
}


Also estimated time has a strange behaviour. Not very important at the moment but I hope it doesn't impact on anything.

EDIT:
did you upgrade between tests?
The exe date in zip is 26/11/2002 18:00

DaveEL
26th November 2002, 23:18
Originally posted by [Toff]
Encode in 1 pass without pause :
Xvid, 3 b-frame, input : 501 frame, output : 492 frame
It doesn't change anything if I change the b-frame number or even without bframe.

Weird cant see how that would work if your on the current build like i say i cant make it do that here. The only time i had problems was an old build with serious threading issues (the first time i tried to rewrite the threading cos i couldnt make it work). Ill check the buffer is being flushed correctly at the end.

I don't really understand the buffering part?
Is it possible to do something like that without buffering :

The B-Frames and the buffering code are seperate.
The buffer allows me to stop at the last keyframe.

Im going to move the linked list buffer routines outside of that function so its easier to read.

Ill try to get all this done tomorow

Also estimated time has a strange behaviour. Not very important at the moment but I hope it doesn't impact on anything.


Its due to the buffer i think should be possible to fix i think it doesnt recalc some of the stuff till it commits from the buffer to the file.

DaveEL

[Toff]
26th November 2002, 23:32
Originally posted by DaveEL
The B-Frames and the buffering code are seperate.
The buffer allows me to stop at the last keyframe.


Ok I haven't think about that.
It's more clear in my head know.

I'm going to test another way.
You write all frame the normal way in destination file.

When you break the destination file look like this :
I P P P P P I P P P P
| break here


When you reopen it, FrameStart = last_KF (you can get last KF with AVIStreamPrevKeyFrame) and you overwrite the 4 old frame.

So that way you don't need buffering.

I will tell you if it work.

[Toff]
27th November 2002, 00:23
He ! He !
My last idea doesn't work :o

But I needed to try.

So yes we need buffering !


Im going to move the linked list buffer routines outside of that function so its easier to read.
Ill try to get all this done tomorow


Yes, I wait for tomorrow.

jonny
27th November 2002, 15:49
Hi

I've problems with the "-l" option (tested on 1.13 and 1.15 with same results).

I'm using a simple avs script (containing only the Version() function)



This is what i do:



avs2avi ver.avs ver.avi -s 1p.bin
i select DivX 5.02
i set Quick Config CLI with:

-b21 800 -key 250 -log "C:\divxpass.log" -mv "C:\mvinfo.bin0" -dr 12,2,2000,10,20 -sc 50 -pq 5

This do a 1st pass encode.


avs2avi ver.avs ver.avi -s 2p.bin
i select DivX 5.02
i set Quick Config CLI with:

-b22 800 -key 250 -log "C:\divxpass.log" -mv "C:\mvinfo.bin0" -dr 12,2,2000,10,20 -sc 50 -pq 5

This do the 2nd pass encode.


The file ver.avi is created correctly.


Now the problem, i want to make the 1st, then the 2nd pass using 1p.bin and 2p.bin:

avs2avi ver.avs ver.avi -l 1p.bin

A window appear with this message:
"Could not open log file for reading"
I think this is a DivX Codec message... it seems that the parameters are not set correctly.
avs2avi quit with this message:
AVIStreamSetFormat failed : Impossibile trovare il file specificato.

"Impossibile trovare il file specificato" in english mean: "unable to find the specified file"

Is this a bug or i'm missing something?

Cheers
jonny


PS: parameters saved in 1p.bin and 2p.bin seems to be generated correctly, i've compared the codec data with the data generated by my DivX5Enc and are equal.


Edit: i haven't this error all the times, sometimes the 1st pass go and the second give me errors...

DaveEL
27th November 2002, 16:37
Ok new build up should fix the missing frames problem (the frames were missing if you didnt ask it to enable resuming).

Code should be easier to read now (new files xvid.cpp and xvid.h for xvid specific stuff and moved the linked list code.)

DaveEL

[Toff]
27th November 2002, 20:06
Yes problem fixed here.

So if I resume now we can pause/resume :
- Encoding done in 1 pass
- Encoding done in 2 pass but only during 1st pass and without the -2 flag

Also we have a little jumping frame counter problem caused by buffering.

DaveEL
27th November 2002, 22:13
Originally posted by [Toff]
Yes problem fixed here.

So if I resume now we can pause/resume :
- Encoding done in 1 pass
- Encoding done in 2 pass but only during 1st pass and without the -2 flag

Also we have a little jumping frame counter problem caused by buffering.

Small problem with the xvid code change mmioFourCC('X','V','I','D') to mmioFourCC('x','v','i','d') in xvid.cpp and then it should work.

sorry

im working on (and nearly done i think) the second pass. Give me a couple of days (or possibly till next week as my birthday is soon so im gonna be very drunk this weekend :) )

Need to look at the frame counter stuff.

DaveEL

[Toff]
28th November 2002, 00:15
Hey ! Hey ! no problem, take your time...

I was just summarizing so others people don't say "hummm! there is a bug here it doesn't work ..."
But if it's not implemented it can't work :D

Need to look at the frame counter stuff.
I have 2 idea/solutions to try to solve this problem.
- Use a 2nd frame counter that is increased when we read and use this counter for dynamic display.
- Use the old way wait for KF with no buffering.

Happy birthday Dave ! :p

DaveEL
28th November 2002, 00:33
Originally posted by [Toff]

I have 2 idea/solutions to try to solve this problem.
- Use a 2nd frame counter that is increased when we read and use this counter for dynamic display.
- Use the old way wait for KF with no buffering.



Done in my codebase earlier today. change the value of frames done and output size when things are added to the buffer rather then when saved to the avi stream. will be in my next release. :)

DaveEL

DaveEL
29th November 2002, 12:16
Ok as i spent so much time fixing the threading code i thought i should make it work properly. So can someone with a multiprocessor machine test to see if this is faster for me

http://www.ecs.soton.ac.uk/~del100/avs2avi.zip

DaveEL

DaveEL
29th November 2002, 16:03
version 1.20 http://www.ecs.soton.ac.uk/~del100/avs2avi.zip


*Fixed Threads AGAIN (ok so i broke them but that's not the point).
*Implemented resuming on xvid 2nd pass (internal only no mv hints file).

Ill work on getting the -2 option working with resuming soon.

DaveEL

Dark-Cracker
29th November 2002, 21:24
@DaveEL

very good work the possibilty to resume the encoding process is a damn good idear :) good luck for the support of the hintme function.

[Toff]
29th November 2002, 23:17
Originally posted by DaveEL
Fixed Threads AGAIN (ok so i broke them but that's not the point).

I see a little problem here using xvid, 1 pass encode, 3 bframe.
The encoding thread lock the program at end. (I just see "done read", but the program continue).

Also why SRCData is now an array ? Is it for threading issue ?

I will try to look at it this weekend.
No, don't look at it it's your birthday ;)

DaveEL
30th November 2002, 11:00
Originally posted by [Toff]
I see a little problem here using xvid, 1 pass encode, 3 bframe.
The encoding thread lock the program at end. (I just see "done read", but the program continue).

Also why SRCData is now an array ? Is it for threading issue ?

I will try to look at it this weekend.
No, don't look at it it's your birthday ;)

Damm the threads still lock. Ill take another look i HATE threads.

by making SCRData an array on multi processor system it should be a lot faster as one thread can decode while the other encodes.


DaveEL

DaveEL
30th November 2002, 11:10
ok this *should* work

Change
while (!ReleaseSemaphore(hSemWaitWrite, 1, NULL) && (frameNumber < SRCStreamInfo.dwLength+BFrameNum) && !Stop) Sleep(100);

to
while (!ReleaseSemaphore(hSemWaitWrite, 1, NULL) && (frameNumber < SRCStreamInfo.dwLength) && !Stop) Sleep(100);

in EncodeFrame.

DaveEL

You might also want to make the sleep shorter needs some testing to find a good value.

[Toff]
30th November 2002, 16:57
When you look in details you can see some frame ordering problem with xvid (25112002).
It works pefectly only if I check "Packed bitstream" & "DX50 B-VOP compatibility".
You can easily see the problem using avisynth ShowFrameNumber function.

But I don't know if it's an encoding or decoding problem.

I've quickly tested the 2nd pass pause/resume, it works here.

Also I've simplified a bit (I think) the thread synchronization.

http://christophe.paris.free.fr/temp/avs2avi_121.zip

Emp3r0r
10th December 2002, 00:14
IIRC, the older version allowed you to run avs2avi to just save codec settings. Now when you do the "-s out.txt", it also encodes. Is there anyway to run avs2avi to just save codec settings?

Beave
11th December 2002, 04:00
HI, I always get this error:

AVIFileOpen failed to create destination file "d:\...avi"

I tried with avs2avi 1.20, 1.21, 1.13 with gui on 2 different computers with the included test.avs files. it happenes after i choose the codec and the commandline window opens. It only prints the avs2avi infos until
Destination:
* Filename: D:\DVD (...).avi

What could that be?

DaveEL
11th December 2002, 04:41
Emp3r0r : just press ctrl-c when it starts encoding :)

Beave : What is the command you are running?

Edit: whoops didnt read the gui bit
sounds like the gui isnt quoting paths with spaces in them. Ttry using a file with no spaces in the path.

DaveEL

Beave
11th December 2002, 12:04
ok, I tried with avs2avi the following lines:

D:\DVD\avs2avi\bin>avs2avi test.avs test.avi
D:\DVD\avs2avi\bin>avs2avi.exe test.avs test.avi
D:\DVD\avs2avi\bin>"avs2avi.exe" "D:\DVD\avs2avi\bin\test.avs" "D:\DVD\avs2avi\bin\test.avi"

They are all not working. After the Videocompression window pops up i choose divx 5.02 in quality mode (tried xvid and cinepak as well), click ok and the command line window says:

AVIFileOpen failed to create destination file D:\DVD\avs2avi\bin\test.avi : Das System kann die angegebene Datei nicht finden.

Do I need additional options? Do I need anything else installed? I have avisynth 2.07 on one of my computers and 2.5 alpha on the other. Both report the same thing.

DaveEL
11th December 2002, 13:49
Originally posted by Beave
ok, I tried with avs2avi the following lines:

D:\DVD\avs2avi\bin>avs2avi test.avs test.avi
D:\DVD\avs2avi\bin>avs2avi.exe test.avs test.avi
D:\DVD\avs2avi\bin>"avs2avi.exe" "D:\DVD\avs2avi\bin\test.avs" "D:\DVD\avs2avi\bin\test.avi"

They are all not working. After the Videocompression window pops up i choose divx 5.02 in quality mode (tried xvid and cinepak as well), click ok and the command line window says:

AVIFileOpen failed to create destination file D:\DVD\avs2avi\bin\test.avi : Das System kann die angegebene Datei nicht finden.

Do I need additional options? Do I need anything else installed? I have avisynth 2.07 on one of my computers and 2.5 alpha on the other. Both report the same thing.

hmm weird looks ok to me.
1) what version of windows are you running
2) does it work with other avs files rather then the test ones?

DaveEL

Beave
11th December 2002, 14:35
I'm using Win XP SP1. On my second computer I even have a fresh install. I tried with other avs as well, same thing.
I even tried with a windows98 version running inside VMWare.

here is the full window:

AVS2AVI v1.13 (c) 2002 Christophe PARIS (christophe.paris@free.fr)
Contributions by: int21h

Thanks to Avery Lee author of VirtualDub and Chia-chen Kuo author
of DVD2AVI for providing great source code of inspiration.

Source:
* Filename: D:\DVD\avs2avi\bin\testlong.avs
* Bit depth: 32
* FOURCC: none (RGB)
* Frames: 650
* Resolution: 320x240
Compressor:
* Name: DivX Pro 5.0.2 Codec
* FOURCC: DIVX
Destination:
* Filename: D:\DVD\avs2avi\bin\test.avi

AVIFileOpen failed to create destination file D:\DVD\avs2avi\bin\test.avi : Das
System kann die angegebene Datei nicht finden.

[Toff]
12th December 2002, 00:25
I'm not a divx5 user and I haven't made more test before today where I found there is really problems with divx5.
I've try a lot of thing (having only 1 instance of the codec at one time), but it won't work for 2pass in loading settings mode.
I must miss some initialization things somewhere.

But at least it work well with 1 pass encode.


Now when you do the "-s out.txt", it also encodes. Is there anyway to run avs2avi to just save codec settings?


Yes I can be done. I just want to (try to) fix divx5 problem first.

Beave
12th December 2002, 03:54
Same thing happenes with XVID as well, so its not only a DiVX problem. Acually none of the codecs work here so far.
What I find really weird, is that it even doesn't work on my other machine but no one else seems to have a problem. So how come both my computers don't work, but all the others work fine?

Why is the program acually asking for the avi file, if it isn't created yet?

Emp3r0r
12th December 2002, 04:12
Beave, I have found that problem to only occur when something else is also using the codec. Do you have virtualdub going or something else?

DaveEL
13th December 2002, 02:54
New release been meaning to do this for a while but had loads of work to do.

You can now resume encodes when doing 2 pass (with -2)

http://www.ecs.soton.ac.uk/~del100/avs2avi.zip


BTW im not sure xvid + resuming + 2 pass + bframes all work together (any combination except all is fine) as the stats file format seems to have changed slightly for bframes. Ill try to look into this in the new few days. Then ill start bothering the xvid team to change xvid config struct so i can do:
1) mv hints
2) 2nd pass external mode.
with the resuming support.


After that im gonna try to tidy up the code a bit (remove the globals) so i can implement an idea i saw on the xvid developer mailing list about doing very fast encoes on dual cpu boxes. (should be faster then the normal approach of doing the encode on one cpu and decode on the other like we do now).

DaveEL

Emp3r0r
13th December 2002, 06:35
I can't tell you how much I appreciate avs2avi. Here is what I came up with as part of the program I am working on. Image attached

mfluder
15th December 2002, 04:39
Hi,

I updated my GUI to support new avs2avi features. I attached it to this post.

mfluder

sh0dan
17th December 2002, 19:45
@Beave: Delete resume.codec - for some reason resume seems to be enabled per default.

DaveEL
17th December 2002, 20:41
Yes the key resuming is enabled is a bit weird (if you want to start a resumable encode you use -r and then it auto resumes after that)

I think it would be better to change it to this if noone minds


All encodes are started with resuming support (if you dont pause it resuming should make no difference to the encode).

if you specify -r it will resume the previous encode.

Additionally in the .codec file i think the file names should be stored but they can be overiden on the command line

So you end up with:

to start an encode

avs2avi inputfile outputfile [options]

To resume that encode later

avs2avi -r


Also -s should not encode just save the parameters
Loading support could then be either
avs2avi -l file.codec
which will use the options and filenames you used to save the codec file
or
avs2avi inputfile outputfile -l file.codec
which will use the files on the command line and the options from file.codec


DaveEL

(Emp3r0r: I see your devloping in c#, have you worked out how to send SIGINT (Ctrl-c) to avs2avi yet? I cant seem to find any way to do it)

Beave
18th December 2002, 00:24
hmm, i can't find any resume.codec on my system.
I just unzipped all those files in avs2avi.zip and run them on the test files and on some other *.avs I had on my system.
There has never been any setting files or something simular created in the avs2avi directory. I also searched the rest of my hd for "resume".

Any more Ideas?

On my new system i actually only installed all of GKnot and the Divx Codec plus OggDS and XCD Filters. Maybe one of those things collide with avs2avi?

Emp3r0r
18th December 2002, 07:09
I was thinking of a way to do this while reading your post and it came to me right before I read Originally posted by DaveEL

(Emp3r0r: I see your devloping in c#, have you worked out how to send SIGINT (Ctrl-c) to avs2avi yet? I cant seem to find any way to do it) I haven't tried it yet but I'm assuming you just create a StreamWriter and then pipe it to the StandardInput of the Process.

anyway I hook a System.IO.StreamReader to System.Diagnostics.Process.StandardOutput to read the console. I'll play with sending "ctrl-v" by possibly creating a System.IO.StreamWriter and then writing to System.Diagnostics.Process.StandardInput

Emp3r0r
18th December 2002, 07:15
hmm, i can't find any resume.codec on my systemI think you can create that file manually using -s "resume.codec". I haven't tested but I think the resume.codec is created automaticaly when you use -r and pause the encoding.

seewen
21st December 2002, 17:02
I've tried many times to re-encode DIvX (for Kiss DP-450), in 2-pass Mode with DivX 5 Pro.

It works very weel @ 75%

But the 25% left, The process stops after the 1st pass (it's blocked, but the computer continue to work hard).

Someone have an idea about this (I use always the same method. And I use only the cmd line, no GUI ) .

Thanks

EDIT : I use AVS2AVI 1.21, only with "-2" cmd.

MaTTeR
21st December 2002, 21:44
Originally posted by DaveEL
So can someone with a multiprocessor machine test to see if this is faster for me On my AMD dualie the speed seems and CPU usage seems to be almost on par with VirtualDub. I haven't had a chance to do any "real" benchmarking yet but first results seem very promising to say the least. Excellent work guys!

The only problem I'm having with a few of the versions here is that avs2avi is locking up during the first pass for some reason. CPU usage reamins very high but no encoding is actually taking place according to Debug View. At some point during the 1st pass of XviD the CLI is reporting bogus ETA and FPS information, at the start of the encode it seems to be just fine though. I'll report back more after some further testing this week. Many thx again for all the efforrts here:)

Beave
22nd December 2002, 21:10
I tried with -s resume.codec. The only difference is that it now won't ask for the Codec Settings. The errormessage:
AVIFileOpen failed to create destination file test.avi
remains the same.

If I delete it again it will pop up a window and ask for the Codec, that's all. Error stays the same.

Is there anything written to the registry?
Maybe somebody could give me a debug version of it, so I could test it?

iago
23rd December 2002, 18:16
Thanks everybody putting effort on this great tool! It's really fantastic! :)

regards,
iago

DaveEL
24th December 2002, 15:41
Originally posted by MaTTeR
On my AMD dualie the speed seems and CPU usage seems to be almost on par with VirtualDub. I haven't had a chance to do any "real" benchmarking yet but first results seem very promising to say the least. Excellent work guys!

Can you try an old version (anything before i added the SMP optimisations in that post you quoted) against the latest builds.

The only problem I'm having with a few of the versions here is that avs2avi is locking up during the first pass for some reason. CPU usage reamins very high but no encoding is actually taking place according to Debug View.

Does it lock straight away or does it encode a bit and then lock later?

At some point during the 1st pass of XviD the CLI is reporting bogus ETA and FPS information, at the start of the encode it seems to be just fine though. I'll report back more after some further testing this week. Many thx again for all the efforrts here:)


FPS/ETA is based on the average speed not the current speed. That could be why it looks wrong.

DaveEL

bilu
26th December 2002, 12:33
I'm getting output related to deviation in avs2avi with XVID builds after 09 December, both Koepi and Nic's. Is this related to B-frame compensation? I'm @work so I can't send you any output now.

Another question:
I make OGM movies using AVS2AVI, BeSweet and OggMux.
Since I use B-frames that should be compensated for the AVI stream by AVS2AVI,would this afect the OGM movie? I've encoded a movie (not seen it, was ripped in my HD) and noticed speaking delay in some parts in the middle, but not in the whole movie. Still I don't know if the delay was already present in the source DVD.

DaveEL
26th December 2002, 13:28
Originally posted by bilu
I'm getting output related to deviation in avs2avi with XVID builds after 09 December, both Koepi and Nic's. Is this related to B-frame compensation? I'm @work so I can't send you any output now.

Another question:
I make OGM movies using AVS2AVI, BeSweet and OggMux.
Since I use B-frames that should be compensated for the AVI stream by AVS2AVI,would this afect the OGM movie? I've encoded a movie (not seen it, was ripped in my HD) and noticed speaking delay in some parts in the middle, but not in the whole movie. Still I don't know if the delay was already present in the source DVD.

Checked the changelog for xvid around the 9th and can't see anything but i do remember a cvs change the other day to adjust the 2 pass code for the new version of virtualdub. Can you check the latest builds at http://xvid.hopto.org/ and tell me if these present a problem. Also are you using the resuming support with 2-pass/b-frames this will be broken until i understand the new stats file format. How big is the size deviation? the b-frame code in avs2avi should only throw the size out by a few bytes*max bframes, but if the 2-pass code is adjusting for differences in way virtualdub does b-frames this would explain it. If this is the case ill need to change the b-frame code to do the same as vdub.


Not sure about OGM issues i assume it just remuxes the frames in the avi so any problems in the avi will be present in the ogm. Try using the packed bitstream option (warning this is still buggy) to remove the delay in the b-frames. Unfortunatly until this option is fixed b-frames wont work properly.

bilu
26th December 2002, 13:37
I'm using 1-pass CBR, no resume.
I'll send you some output tonight.

DaveEL
26th December 2002, 17:40
Hmm the 1-pass code should be fine have you tested with virtualdub to check its not a problems with xvid rather then avs2avi.

DaveEL

bilu
26th December 2002, 17:55
I haven't noticed any problem in the video output but I didn't check the filesize at the time. What I have noticed was something related to deviation in the screen output of avs2avi that didn't appear with any of the prior builds of xvid.

DaveEL
26th December 2002, 20:34
Avs2avi outputs the size of the bitstream rather then the avi so the size printed will be a little smaller. Older versions i believe printed the size of the file but the buffering code meant the size jumped up every now and then as frames things were not commited to the avi directly.

DaveEL

bilu
27th December 2002, 03:01
This is the screen output I get with every XVID build after 09/12.
I use the exact same parameters: 1 BF, ratio 150%, offset 0.


D:\dvd_progs\QuickAVS\filters\tests>avs2avi teste.avs teste.avi -l codec.txt -p
0

AVS2AVI v1.22 (c) 2002 Christophe PARIS (christophe.paris@free.fr)
Contributions by: int21h
B-Frames and resuming support by David Leatherdale (dave@leatherdale.net)

Thanks to Avery Lee author of VirtualDub and Chia-chen Kuo author
of DVD2AVI for providing great source code of inspiration.

Source:
* Filename: teste.avs
* Bit depth: 16
* FOURCC: YUY2
* Frames: 781
* Resolution: 528x320
Compressor:
* Name: XviD MPEG-4 Codec
* FOURCC: XVID
Destination:
* Filename: teste.avi
Pass 1/1 frame 0/781, 0.00fps, ETA: , size: 0.00MBCBR: frame: 0, quant: 5, devia
tion: 14852

Pass 1/1 frame 2/781, 6.08fps, ETA: 00:02:08.145, size: 0.02MBCBR: frame: 1, qua
nt: 5, deviation: 18128

Pass 1/1 frame 3/781, 5.78fps, ETA: 00:02:14.593, size: 0.03MBCBR: frame: 2, qua
nt: 5, deviation: 23438

Pass 1/1 frame 4/781, 5.80fps, ETA: 00:02:14.032, size: 0.03MBCBR: frame: 3, qua
nt: 6, deviation: 23478

Pass 1/1 frame 5/781, 5.75fps, ETA: 00:02:15.023, size: 0.04MBCBR: frame: 4, qua
nt: 6, deviation: 23209

Pass 1/1 frame 6/781, 5.75fps, ETA: 00:02:14.849, size: 0.04MBCBR: frame: 5, qua
nt: 6, deviation: 23179

and so on...

DaveEL
27th December 2002, 12:14
ah i forgot about that all xvid debug info for cbr mode is directed to the console this is an xvid bug ive been meaning to report. Dont worry nothing is wrong.

DaveEL

Emp3r0r
28th December 2002, 10:14
can we get this data during a dual pass and possibly count the quants and make a nice chart that displays quant frequency?

DaveEL
28th December 2002, 11:06
Originally posted by Emp3r0r
can we get this data during a dual pass and possibly count the quants and make a nice chart that displays quant frequency?

Not really somthing that should be in avs2avi but if you want to do it xvid prints this info to the windows debug function so you should be able to get your application recieve these messages looks like a good place to start reading would be here (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/about_basic_debugging.asp)

DaveEL

bilu
28th December 2002, 11:54
@ Emp3r0r

can we get this data during a dual pass and possibly count the quants and make a nice chart that displays quant frequency?

I've been using CBR and never used 2-pass before, but isn't that what DebugView does?

DaveEL
28th December 2002, 12:04
Originally posted by bilu
@ Emp3r0r

I've been using CBR and never used 2-pass before, but isn't that what DebugView does?

Yes debugview captures the debug output that i pointed out above.

DaveEL
1st January 2003, 19:07
New version again hopfully this should fix the 2pass resuming support but ive got a lot of work to do currently so its not well tested. It shouldn't stall after the first pass at least when resuming is enabled and shouldnt crash when pressing ctrl-c on the first pass of two pass encodes (everything worked before the second pass stuff was not closed properly causing an error message was all).


http://www.ecs.soton.ac.uk/~del100/avs2avi.zip

DaveEL

DaveEL
2nd January 2003, 09:19
Ok so i did some testing when i got back from the pub so here is another new version which i really think works this time (but i was drunk while testing so who knows ;) )


DaveEL

PS i would like to thank redbull and vodka for keeping me up long enough to debug this build.

((( atom )))
2nd January 2003, 14:30
ok [edit] ...oops - wrong thread!

wotef
4th January 2003, 04:18
hi, lovely app

bug report: with 03/01 xvid build, the latest version of avs2avi fails to insert any keyframes if b-frames are enabled - virtualdub still manages to do so - if you then open the avs2avi encoded file in vdub and press CTRL+rightarrow (jump to next keyframe), you get a message that reads something like "warning: nothing to output, b-frame decoder lag"

DaveEL
4th January 2003, 05:49
Originally posted by wotef
hi, lovely app

bug report: with 03/01 xvid build, the latest version of avs2avi fails to insert any keyframes if b-frames are enabled - virtualdub still manages to do so - if you then open the avs2avi encoded file in vdub and press CTRL+rightarrow (jump to next keyframe), you get a message that reads something like "warning: nothing to output, b-frame decoder lag"

Hmm i get the same thing except i get it when using virtualdubmod too can you retest to make sure virtualdub is working correctly.

Also i just put up a new version with a bframe bugfix.

DaveEL

cult
4th January 2003, 18:55
sorry,but where?

Pasqui
4th January 2003, 19:28
@cult
the same address as usual:
http://www.ecs.soton.ac.uk/~del100/avs2avi.zip
it still displays AVS2AVI v1.25 but compilation date is different form previous.

DaveEL
4th January 2003, 20:38
Originally posted by Pasqui
@cult
the same address as usual:
http://www.ecs.soton.ac.uk/~del100/avs2avi.zip
it still displays AVS2AVI v1.25 but compilation date is different form previous.

whoops sorry about that forgot to increase the version number (i keep the same file name as i dont like keeping buggy builds around or dead links).

DaveEL

cult
4th January 2003, 22:42
thank you.I downloaded but I thought it was the same version.All clear now:)

jonas
6th January 2003, 15:01
first of all I have to say that this is a great and very usefull tool.

But is the a chance that special charakters like ä for example can be used for filenames as well? If it is complicated just leave it, as it is easy to work around as soon as you know that you can't use those chrakters.
I just got confused when I was testing you app yesterday evening I couldn't get it to work at first.

Secondly, and I'm not sure whether this has be discussed before or whether this only occured to me, I noticed that there is a large time between the finish of the first pass and the beginning of the second, while avs2avi is still using the cpu. Since it didn't display any new lines (like starting 2nd pass) I was just about to quit the app when it suddenly started the second pass....

thanks again for this tool
jonas

MaTTeR
6th January 2003, 15:07
Originally posted by jonas
I noticed that there is a large time between the finish of the first pass and the beginning of the second, while avs2avi is still using the cpu. Since it didn't display any new lines (like starting 2nd pass) I was just about to quit the app when it suddenly started the second pass.... Ack!! I guess I haven't been patient enough. I've been thinking the app was in an infinite loop and killing it after waiting 5-10mins.

Nic
6th January 2003, 16:45
That large gap used to happen in my dvd2avi, its because its trying to close an incorrect AVI file (the 1st pass file)

A hack to stop it, is to not do the AVIFileClose(...) on the first pass AVI file. Just skip it & leave the file open.

-Nic

sillKotscha
6th January 2003, 19:31
Originally posted by MaTTeR
Ack!! I guess I haven't been patient enough. I've been thinking the app was in an infinite loop and killing it after waiting 5-10mins.

*ouch* patience is one of things i don't have and killed it after ~5min, too :D

and the really madest thing is, that after finishing the first pass (I swear i didn't touched anything) WinDVD started :confused:

Sill

DaveEL
6th January 2003, 23:00
Originally posted by Nic
That large gap used to happen in my dvd2avi, its because its trying to close an incorrect AVI file (the 1st pass file)

A hack to stop it, is to not do the AVIFileClose(...) on the first pass AVI file. Just skip it & leave the file open.

-Nic


Not sure how that world work with my resuming support which counts the number of frames in the file to find out where to resume from so ive just written some new threading code to start second pass before the file is closed. codes written but have no time to test it now. (anyone who wants to test drop me a messages and ill send you the code or a binary). Ill try to get this done next week when i have done all my coursework.

DaveEL

DaveEL
7th January 2003, 05:13
hmm my departments web server seems to be broken try http://www.soton.ac.uk/~del100/avs2avi.zip

DaveEL

DaveEL
8th January 2003, 00:34
Originally posted by Nic
That large gap used to happen in my dvd2avi, its because its trying to close an incorrect AVI file (the 1st pass file)

A hack to stop it, is to not do the AVIFileClose(...) on the first pass AVI file. Just skip it & leave the file open.

-Nic

thinking about it would this not be best fixed by making xvid output a valid streram (well valid to the standard avifile routines) in the first pass (i guess if it output 1 bytes frames instead of 0 it would be fine)

DaveEL

Nic
8th January 2003, 00:54
Not necessarily as divx5 has the same problem. My solution is what I use & it works but isn't nice. the best solution is to write your own or use another avi output routine (vidomi's code is quite good)...

Infact I guess there is no need to actually create a first pass file at all, just use ICCompress but don't do the avifileopen, avistreamwrite, etc.

-Nic

jonny
8th January 2003, 00:58
Yes, what nic says is correct (at least for divx 5), no need to write the Avi in the 1°pass, i've made some real test about this some weeks ago (using avs2avi source :) )

DaveEL
8th January 2003, 01:11
Originally posted by jonny
Yes, what nic says is correct (at least for divx 5), no need to write the Avi in the 1°pass, i've made some real test about this some weeks ago (using avs2avi source :) )

Except that in order to do the resuming i need to know what point i encoded up to so i count the number of frames in the file.

DaveEL

jonny
8th January 2003, 01:16
You can always write a fake avi: a file that simple contain the number of frames encoded (this file will be written if the user press ctrl-c)

Nic
8th January 2003, 01:19
@Dave: Hmmm, but there must be a better way of counting what frame you were upto other than the 1st pass avi. Registry key or file could do?...only a thought though.

Cheers,
-Nic

DaveEL
8th January 2003, 05:14
Originally posted by Nic
@Dave: Hmmm, but there must be a better way of counting what frame you were upto other than the 1st pass avi. Registry key or file could do?...only a thought though.

Cheers,
-Nic
Its just that the info in the avi file is already available seems redundant to keep it in a seperate place. While i could save the frame number one small problem is the frame to resume from is not the last frame encoded its the frame before the last keyframe so i would need to keep a seperate count of that (buffering commits frames to the avi when a keyframe is encounterd). However i have come up with a different idea that i can ignore the first pass data (all the 0 length frames) and instead produce an avi with the right number of frames but with data generated by avs2avi which should then save without the delay associated with the normal first pass file close. Also with this way the first and second passes are handled in much the same way and so reduces possible problems (i hope). hmm now all i have to remember is how to do function pointers in c. Besides registery keys are bad if someone does more then one encode at once (why they would want to i dont know but they might. I suppose it might be slightly faster on SMP systems but thats somthing i have an idea that i will try to implement soon should be possible to split up the encode with very little loss of quality if you use external stats processing).


Once again ive got loads of work to do so it may take a while however avs2avi is in general more intresting then my uni work so it may be done soon :).
DaveEL

DaveEL
8th January 2003, 06:11
And for my 200th post here :)

http://www.ecs.soton.ac.uk/~del100/avs2avi-test.zip

Can someone test to see if this removes the pause after the first pass bug.

DaveEL

Beave
9th January 2003, 04:35
I'm sorry to bother you again, but I somehow want to use avs2avi for my encodes. here is what mit command window sais:


D:\avs2avi>avs2avi test.avs test.avi

AVS2AVI v1.25 (c) 2002 Christophe PARIS (christophe.paris@free.fr)
Contributions by: int21h
B-Frames and resuming support by David Leatherdale (dave@leatherdale.net)

Thanks to Avery Lee author of VirtualDub and Chia-chen Kuo author
of DVD2AVI for providing great source code of inspiration.

Source:
* Filename: test.avs
* Bit depth: 32
* FOURCC: none (RGB)
* Frames: 51
* Resolution: 320x240
Compressor:
* Name: XviD MPEG-4 Codec
* FOURCC: XVID
Destination:
* Filename: test.avi

AVIFileOpen failed to create destination file test.avi : Das System kann die ang
egebene Datei nicht finden.


Any new Ideas?

DaveEL
9th January 2003, 04:58
Originally posted by Beave
I'm sorry to bother you again, but I somehow want to use avs2avi for my encodes. here is what mit command window sais:


D:\avs2avi>avs2avi test.avs test.avi

AVS2AVI v1.25 (c) 2002 Christophe PARIS (christophe.paris@free.fr)
Contributions by: int21h
B-Frames and resuming support by David Leatherdale (dave@leatherdale.net)

Thanks to Avery Lee author of VirtualDub and Chia-chen Kuo author
of DVD2AVI for providing great source code of inspiration.

Source:
* Filename: test.avs
* Bit depth: 32
* FOURCC: none (RGB)
* Frames: 51
* Resolution: 320x240
Compressor:
* Name: XviD MPEG-4 Codec
* FOURCC: XVID
Destination:
* Filename: test.avi

AVIFileOpen failed to create destination file test.avi : Das System kann die ang
egebene Datei nicht finden.


Any new Ideas?

1) Try the load defaults button in xvid?
2) try the new avs2avi-test.zip i just uploaded should return an error number in the message can you post that here please.

DaveEL

Beave
9th January 2003, 08:10
1) Try the load defaults button in xvid?
I did, no effect. Same error message.

2) try the new avs2avi-test.zip i just uploaded should return an error number in the message can you post that here please.

I have actually used your latest avs2avi-test.zip.

((( atom )))
9th January 2003, 09:07
ok, so i am about to try it again.. one thing is not clear to me: when i encode and decide to restart the pc for any reason - i have [enable resuming] checked - how do i actually do the resume? i don't see any button for that?!?

wertherman
9th January 2003, 12:31
Illegal Exception at end of first pass with latest build...

Emp3r0r
9th January 2003, 16:02
@atom: push ctrl-c

DaveEL
9th January 2003, 16:03
Originally posted by Beave
I have actually used your latest avs2avi-test.zip.

I posted a new version when i posted that message download it and run it it will give you an error number in the message without it can tell nothing about whats going wrong.

DaveEL

DaveEL
9th January 2003, 16:12
Originally posted by ((( atom )))
ok, so i am about to try it again.. one thing is not clear to me: when i encode and decide to restart the pc for any reason - i have [enable resuming] checked - how do i actually do the resume? i don't see any button for that?!?


press ctrl-c to pause it then to restart it run it again without the enable resuming switch.

DaveEL

Beave
9th January 2003, 16:17
OK, now redownloaded it. It gives the following error messege now:

AVIFileOpen failed to create destination file Error 1 test.avi : Das System kann die angegebene Datei nicht finden.

DaveEL
9th January 2003, 18:04
Originally posted by Beave
OK, now redownloaded it. It gives the following error messege now:

AVIFileOpen failed to create destination file Error 1 test.avi : Das System kann die angegebene Datei nicht finden.

Microsoft decided to not document that error! new build up which should return a little more in the error message.

DaveEL

DaveEL
9th January 2003, 18:40
Originally posted by Nic
The best solution is to write your own or use another avi output routine (vidomi's code is quite good)...


Been wanting to do this but i havnt found one which does what i need except the avifile ones. The one missing feature is that i need to be able to open up an existing avi and append to the end of it. If i cant solve the problems with the avifile api ive been having ill have to make a copy of the avi and then copy frames back to the original before starting to compress. Also one small problem is one of licensing most of the avi write routines ive found are gpl however no explicit license is on avs2avi yet - Toff and int21h do either of you have a problem with relicensing your code gpl so we can use these routines.

DaveEL

[Toff]
10th January 2003, 00:00
Originally posted by DaveEL
Toff and int21h do either of you have a problem with relicensing your code gpl so we can use these routines.

No problem for me.
int21h asked me the same thing some times ago, so I think he doesn't have any problem and would like to relicense the code to GPL.

If someone want to test an alternative to the vfw avi writer, I've made a test with the virtualdub one some times ago :
http://christophe.paris.free.fr/temp/avs2avi113_vdub.zip
it's old so use it as your own risk :D
(also it still use vfw to read the avs file)

DaveEL
10th January 2003, 00:24
Originally posted by [Toff]
No problem for me.
int21h asked me the same thing some times ago, so I think he doesn't have any problem and would like to relicense the code to GPL.

If someone want to test an alternative to the vfw avi writer, I've made a test with the virtualdub one some times ago :
http://christophe.paris.free.fr/temp/avs2avi113_vdub.zip
it's old so use it as your own risk :D
(also it still use vfw to read the avs file)

Thanx ill take a look at that try to update it to the latest code and write the resuming support for it.

@Beave can you test this one as well at my latest test build and see if you have any problems.

DaveEL

((( atom )))
10th January 2003, 01:12
so i ran a test and everything works well now! thx.

some things/thoughts..

- in the second pass i get the resulting filesize for the actual first pass diplayed, this is actually funny..

- would it be possible (easyest with the gui) to tell the encoder about audiofiles to mux straight while encoding? this would save some time and also space.

- i compared the movie (taking screenshots in vdub) to my vdub-encode and the colors were definitely differnt. now i can't exactly reconstruct the avs-file for the vdub-encode, since i reripped the thing, but is it possible, that something infulences the colors? it might as well take actually place in virtualdub, no blaming here. i would just like to figure, since when there is a difference, one of the encodes will be closer to the orignial..

greetings

DaveEL
10th January 2003, 06:47
Originally posted by ((( atom )))
so i ran a test and everything works well now! thx.

some things/thoughts..

- in the second pass i get the resulting filesize for the actual first pass diplayed, this is actually funny..

- would it be possible (easyest with the gui) to tell the encoder about audiofiles to mux straight while encoding? this would save some time and also space.

- i compared the movie (taking screenshots in vdub) to my vdub-encode and the colors were definitely differnt. now i can't exactly reconstruct the avs-file for the vdub-encode, since i reripped the thing, but is it possible, that something infulences the colors? it might as well take actually place in virtualdub, no blaming here. i would just like to figure, since when there is a difference, one of the encodes will be closer to the orignial..

greetings

I assume you mean the size is not reset after the firts pass ill check that out and clean it up when i get the next version out.

As for audio avs2avi knows nothing about audio so no for the time being.

The colour changes are worrying. Can you try encoding part of you film in vitualdub and checking it against Avs2avis output with the same source if they are still different its somthing ill have to look into. virtualdub in fast recompress mode should produce exactly the same as the avs2avi picture.

DaveEL

Beave
10th January 2003, 07:29
It's now:

AVIFileOpen failed to create destination file with 0 test.avi Error 1 test.avi: : Das System kann die angegebene Datei nicht finden.

DaveEL
10th January 2003, 08:26
That should work somthing about your windows install seems broken as avifileopen fails even with the correct params Try the virtualdub file routines build above

DaveEL

((( atom )))
10th January 2003, 09:07
@dave
assume you mean the size is not reset after the firts pass.. actually it counts up the size while encoding. my 2nd pass came out to be 1200mb and the counter was countig up until about double of that value, so i supposed it to be somehow the size of the first pass.

about the colourspace-change i can run a small test this weekend somewhen..

@beave
have you simply tried creating the file before encoding. windows actually says "the system cant find the file specified". that sounds like it was not able to actually create it. this might have several reasons: a, you have no rights to write in that folder at all, wich i don't assume. b, for any strange reason avs2avi is not capable of creating the file right there. it might really help to create any text file there and rename it to yourvideoname.avi.

i know that issue. on my pc here i sometimes have the situation where a program can't create the file but can actually overwrite a dummy-file i give it..

DaveEL
10th January 2003, 09:42
Originally posted by ((( atom )))
@dave


i know that issue. on my pc here i sometimes have the situation where a program can't create the file but can actually overwrite a dummy-file i give it..

Problem here is that the file is deleted before the avifileopen is done (due to a bug in avifileopen according to the comments in the source) so it wont make any difference.

DaveEL

Beave
10th January 2003, 19:11
So finally I actually got one to work:
The vdub version works!!!

I tried to create the file manually, but the error messege is still the same with the nonvdub version. So this won't work either.

I have all the rights on my computer. (Win XP, Athlon TB 1400)
I tested it also on a Win XP and Win 98 SE, both Celeron 900 Computer. None of those worked. They all give this mistake. I'm just wondering, how the others get it to work, since I tried on 3 different OSs on 2 different Computers and all failed.

Anyway, are there any drawbacks on using the vdub version of avs2avi?

By the way, I discovered that the psychovisiual setting under divx 5.02 produces a very bad image of testlong.avs. Maybe I should stop using that? Can anyone confirm?

((( atom )))
10th January 2003, 21:22
i confirm: (actually confess)

use xvid! it is the codec of tomorrow. good thing is: you can already use it today. ;)

i changed over to it shortly and i am deeply impressed by the results. also i am pissed of having loads and loads of divx4+5 encoded movies. they could be better.

take your time and read into the xvid-forum.

make sure to check the sticky-posts first, because they will:
a, answer most of your questions in deed, and
b, point you to (most) of the software you will want to use

also for encoding-settings you should look out for iagos guide on how to set up the encoder-settings. you will get great results with it.

finding all the stuff together means a bunch of work, be warned. i can't help you with links, atm..

good luck!

DaveEL
10th January 2003, 22:15
Originally posted by Beave

Anyway, are there any drawbacks on using the vdub version of avs2avi?


Its based on a very old version of avs2avi ill update it to the latest version soonish and remove the avifile write routines altogether. (its not all that simple due to the resuming code as the virtualdub routines have no way to append to the file)

Im also starting to look at mp3 muxing support its probably a way off still but the virtualdub output code is a good starting point.

DaveEL

((( atom )))
20th January 2003, 00:18
@dave:
just returned to this thread after quite some time. it looks as if there has either nothing new happened or you have moved to another thread or something..
what's going on?

DaveEL
20th January 2003, 01:35
ummm... one of these

1) I have a thing against finishing projects see http://forum.doom9.org/showthread.php?s=&threadid=21499

2) Ive just been made a forum mod and am on a power trip ill be back to development when ive calmed down a bit.

3) I have lots of exams to not revise for.

4) My computer exploded.

5) I still cant work out how xvid stats files work see http://forum.doom9.org/showthread.php?s=&threadid=43372

6) Too much whisky... (same thread as above)

7) My threads are still locked.

8) trying to port avs2avi to my zaurus (http://www.sharp.co.uk/pda) so i can encode on the move :)

9) weather turned cold so im hibernating.

10) i accidentally deleted my avs2avi source code so had to start again (this one really happened).

or something...

DaveEL

((( atom )))
20th January 2003, 08:29
:(

DarkNite
22nd January 2003, 02:30
That's either the funniest, or saddest post I've ever read.

:confused:

bilu
22nd January 2003, 02:55
Well... good luck then :rolleyes:

int 21h
23rd January 2003, 16:54
I have to apologize for really dropping the ball on development of this project, but between real life, and other new toys, I've really moved past the VFW formats this tool was designed for. And between playing with my DRU500A and developing for my embedded projects, I really don't have time to work on this.

I did however consent to GPL release of the little snippets of code I contributed, and I wish DaveEL the best of luck in continuing with this project.

Sorry again,

--int 21h

DaveEL
23rd January 2003, 18:43
Originally posted by int 21h
I have to apologize for really dropping the ball on development of this project, but between real life, and other new toys, I've really moved past the VFW formats this tool was designed for. And between playing with my DRU500A and developing for my embedded projects, I really don't have time to work on this.

Sorry to see you go. Toff you still with me or am i on my own now?

Not gonna be able to update for a while as i have got exams (in fact i just had the worst exam of my life :( ). After i get back to work ive got to

1) Finish up the virtualdub file writer support
2) Rip out some of the virtualdub code i dont use
3) Xvid b-frames for the resuming support. (and you never know i might add external stats files processing and mv hints)
4) divx5 resuming support if i can be bothered (if anyone who uses divx5 wants to add this ill show you what you need to add)?
5) possibly add a gui so it runs just like it does now except if you dont specify parameters it prompts you for them.
6) Fix the bugs...

Anyone think of other things that are missing?
If someone wants to help with the code it should be possible to add support for other output formats like ogg media or mp4 but i dont know enough about the formats to do it myself.

DaveEL

[Toff]
24th January 2003, 21:19
I'm a bit bored by vfw & avi api.

But there are some good things to come in the future, like 2pass encoding support in xvid core, or the new matroska container.
My dream : a pure avs2xvidmatroska multiplatforme encoder with a port of avisynth to linux :)
(I hope that ChristianHJW is not around here ;))

I haven't much time, but if there is a lot of request I can have a look.
@avs2avi users:
What is missing in avs2avi ?

bilu
24th January 2003, 21:47
I'm no programmer, but I feel that you could get a lot of inspiration from the VdudMod features, mainly OGM support :)

I'm not using resume, but I like AVS2AVI a lot for batch encoding of test scripts : run batch, view clip, correct script, run batch again :)

What troubles me is that a lot of times lately (don't know if it's related to the latest XVID builds) is that sometimes it crashes after 1st pass ( it's not a 10 min delay, I've waited hours :confused: )

maybe the new Vdub routines will fix this. in the meanwhile i'm encoding 1 pass at a time.

Bilu

DaveEL
24th January 2003, 22:49
Originally posted by bilu
I'm no programmer, but I feel that you could get a lot of inspiration from the VdudMod features, mainly OGM support :)

I'm not using resume, but I like AVS2AVI a lot for batch encoding of test scripts : run batch, view clip, correct script, run batch again :)

What troubles me is that a lot of times lately (don't know if it's related to the latest XVID builds) is that sometimes it crashes after 1st pass ( it's not a 10 min delay, I've waited hours :confused: )

maybe the new Vdub routines will fix this. in the meanwhile i'm encoding 1 pass at a time.

Bilu

Sorry about that ive been trying to track it down but it only seems to happen with long clips (well ive never had it happen on my test scripts anyway) which makes its rather hard to test things.

Just to check can you 1) test http://www.ecs.soton.ac.uk/~del100/avs2avi-test.zip this is my current test code and RESUMING IS BROKEN.
2) if it locks can you post here the last few lines of the output so i can try to track down exactly where it happens.

DaveEL

DaveEL
24th January 2003, 23:17
Originally posted by [Toff]
I'm a bit bored by vfw & avi api.

But there are some good things to come in the future, like 2pass encoding support in xvid core, or the new matroska container.
My dream : a pure avs2xvidmatroska multiplatforme encoder with a port of avisynth to linux :)
(I hope that ChristianHJW is not around here ;))

I haven't much time, but if there is a lot of request I can have a look.
@avs2avi users:
What is missing in avs2avi ?

I was thinking of interfacing with avisynth directly 1) to get that last extra speed boost 2) so i can return real error messages instead of encoding a video with the error message in. So then all the vfw stuff except the encoders is gone hmmm direct interface with xvid encore function could be done then someone just needs to port avisynth to linux :). If your looking to hack on output formats i can recode the stuff i lost which was plugins for output formats.

The one thing i would really like someone to look at is audio (at least muxing plenty of tools for encoding already) as i have no idea where to even start really.

DaveEL

DarkNite
25th January 2003, 00:41
Every time someone sais "avisynth for linux" it makes me tingle. :D

Anyways, back to the windoze box for encoding...

bilu
26th January 2003, 00:15
Originally posted by DaveEL
Sorry about that ive been trying to track it down but it only seems to happen with long clips (well ive never had it happen on my test scripts anyway) which makes its rather hard to test things.

Just to check can you 1) test http://www.ecs.soton.ac.uk/~del100/avs2avi-test.zip this is my current test code and RESUMING IS BROKEN.
2) if it locks can you post here the last few lines of the output so i can try to track down exactly where it happens.

DaveEL


Sorry, but your link is down. :(

DaveEL
26th January 2003, 00:33
Originally posted by bilu
Sorry, but your link is down. :(


hmm website on my departments server is down again use this one for now
http://www.soton.ac.uk/~del100/avs2avi-test.zip

DaveEL

REIGN_
29th January 2003, 19:53
@mfluder: I believe there is an error in your gui because when i use your program avs2avi fails but when i write the settings on my own it succeeds

CruNcher
12th February 2003, 21:04
looks like Avs2Avi isn't anymore compatible to the new XviD builds it doesn't start the encoding :(

svenrender
12th February 2003, 23:51
Batch convert? Here two small Batchfiles:

1. Create for all AVI-Files a AVS-File.

"QuickAVScreate.bat"
----------------------------------------
cd /d "%~0"
for %%f in (*.avi) do echo AVISource("%%f")>%%f.avs
pause
----------------------------------------

2. Create for all AVS-Files one AVS2AVI-BatchFile.

"QuickAVS2AVIJobCreate.bat"
----------------------------------------
cd /d "%~0"
for %%f in (*.avs) do echo avs2avi %%f %%f_hfyu.avi -c hfyu>>avs2aviJob.bat
echo pause>>avs2aviJob.bat
----------------------------------------

Mirror to AVS2AVI v1.26: http://doom9.psydon.org/download.php?id=386
from german Thread: http://doom9.psydon.org/viewtopic.php?t=6008

bilu
4th March 2003, 14:53
Dave,

I know I promised you to check on full encodes a lot of time ago with your Vdub build but I've been learning and testing a lot (http://forum.doom9.org/showthread.php?s=&threadid=47053) these days :)

I haven't done any full encodes for some months but I still use avs2avi for testing and started to look at compressibility checks with Moonwalker's XVID Analizer with DebugView.

That's why I remembered this: :D

Originally posted by DaveEL
ah i forgot about that all xvid debug info for cbr mode is directed to the console this is an xvid bug ive been meaning to report. Dont worry nothing is wrong.

DaveEL

Originally posted by Emp3r0r
can we get this data during a dual pass and possibly count the quants and make a nice chart that displays quant frequency?


I don't know if you have the time these days, but since you can get debug info just as DebugView does, and since this is a command-line tool just like Moonwalker's tool, you could have an option to output XVID debug info so we can do Batch Analysis ! :D

What do you think?

Best regards,
Bilu

DaveEL
4th March 2003, 16:59
Originally posted by bilu
Dave,

I know I promised you to check on full encodes a lot of time ago with your Vdub build but I've been learning and testing a lot (http://forum.doom9.org/showthread.php?s=&threadid=47053) these days :)

I haven't done any full encodes for some months but I still use avs2avi for testing and started to look at compressibility checks with Moonwalker's XVID Analizer with DebugView.

That's why I remembered this: :D

I don't know if you have the time these days, but since you can get debug info just as DebugView does, and since this is a command-line tool just like Moonwalker's tool, you could have an option to output XVID debug info so we can do Batch Analysis ! :D

What do you think?

Best regards,
Bilu

Problem is avs2avi doesnt currently capture the xvid debug output its just a bug in xvid cbr mode that it did (might still do) put all the output to the console not to the windows debug functions this means that avs2avi has no idea what xvid is sending i could implement a silent mode where avs2avi doesnt print anything at all and then (in cbr mode at least) you could just redirect the output to a file but this would break if the xvid bug was fixed, this would be better implemented in xvid i guess a write debug info to file option could be added to xvid.

DaveEL

Valky
6th March 2003, 08:38
Originally posted by CruNcher
looks like Avs2Avi isn't anymore compatible to the new XviD builds it doesn't start the encoding :(

Nonsense! Everything works just great with Koepis latest builds.

majerle
6th March 2003, 08:45
@CruNcher

Latest build crash on pentium 4 cpu if used with vhq AND sse2 optimization. Remember also that vhq and gmc isn't fuctional.

Regards

Andres

NiTroGen
7th March 2003, 03:46
Originally posted by majerle
Remember also that vhq and gmc isn't functional. VHQ and GMC combination IS functional, but there is a small bitrate waste, that's why it is not recommended. Anyway, that's off-topic. ;)

CruNcher
9th March 2003, 17:41
@majerle

in fact i was one of the first who found that out hehe but thats not the problem in this case try koepis new build uncheck sse2 and activate some of the advanced features like refdivx lumimasking or vhq and u will see the decoding doesn't start (3frames then stops and creates a 16MB Avi with no Video data) sad but true maybe im doing something realy wrong but with older xvid releases it works
hope for a fix soon in that time have to use VdubMod with the new CVS and Koepis build.

RathO
13th March 2003, 04:13
@mfluder:

Just wondering if we'll have the "Shutdown when done" option in a 'next' avs2aviGUI release?

Regards

RathO
13th March 2003, 04:16
@mfluder:

Also a job-batch option so we can queue some jobs...

ChristianHJW
13th March 2003, 16:06
Hi Dave,

did you find the time to have a short look at libmatroska already ? The lib was officially released last weekend and is now available as a tarball from our project page on http://sf.net/projects/matroska .

Further to our conversation via PM here, there is some interesting code existing that can NOT be found in the official matroska CVS as of yet, as the author ( Moritz Bunkus ) prefers to keep it on his own, private CVS server until it meets with his own level of demand. This code can be used to mux matroska files from either AVIs, OGMs, Oggs and MP3/AC3 sources. Its working flawlessly, we could even create matroska files with 80 different audio tracks in it, for testing purposes. We are currently in the process of porting it from Linux to a Windows environment, but its purpose, to give you an idea how to write matroska files correctly is served already.

I have big interest in an avs2matroska program for mainly 2 reasons :

1. All video files/streams created on matroskadub ( VirtualdubMod ) are being done using VfW codecs. As you all are aware this old codec API has to use tricks to be able to handle b-frames correctly, by inserting dummy frames and the like. These video streams have to be treated using our 'VfW/AVI compatibility mode' and do not comply with matroska's native MPEG4 modes, as the latter by definition have to use coding order for frame order, dummy frames and the like are not allowed. As long as we dont have a more advanced codec API like UCI we are limited a lot here, at least until we decided to hardcode ffmpeg into matroskadub so that we can write files that will comply with our MPEG4 native modes. Your tool could be used to create such native streams, proving the x-platform strategy we had in mind when making matroska ( i just hope Nic or Milan will adapt their DShow filters then to accept the 'new' frame order, so that we can read the files on Windows :D ).

2. Using your app clearly promises a real nice speed boost :) !!

Sorry for interrupting here, but i somehow felt it was better to summon this up in public instead of writing another PM to you.

Christian

BTW : the first alpha of our DShow parser is promised to me for this weekend :D !

DaveEL
14th March 2003, 00:33
Originally posted by ChristianHJW
Hi Dave,

did you find the time to have a short look at libmatroska already ? The lib was officially released last weekend and is now available as a tarball from our project page on http://sf.net/projects/matroska .

I had a quick look but have been busy so i wouldn't say im familar with it. plus ive only booted into linux for the last week so i couldn't have worked on avs2??? even if i did have time. :)

Further to our conversation via PM here, there is some interesting code existing that can NOT be found in the official matroska CVS as of yet, as the author ( Moritz Bunkus ) prefers to keep it on his own, private CVS server until it meets with his own level of demand. This code can be used to mux matroska files from either AVIs, OGMs, Oggs and MP3/AC3 sources. Its working flawlessly, we could even create matroska files with 80 different audio tracks in it, for testing purposes. We are currently in the process of porting it from Linux to a Windows environment, but its purpose, to give you an idea how to write matroska files correctly is served already.

Sounds intresting... WANT :)

I have big interest in an avs2matroska program for mainly 2 reasons :

1. All video files/streams created on matroskadub ( VirtualdubMod ) are being done using VfW codecs. As you all are aware this old codec API has to use tricks to be able to handle b-frames correctly, by inserting dummy frames and the like. These video streams have to be treated using our 'VfW/AVI compatibility mode' and do not comply with matroska's native MPEG4 modes, as the latter by definition have to use coding order for frame order, dummy frames and the like are not allowed. As long as we dont have a more advanced codec API like UCI we are limited a lot here, at least until we decided to hardcode ffmpeg into matroskadub so that we can write files that will comply with our MPEG4 native modes. Your tool could be used to create such native streams, proving the x-platform strategy we had in mind when making matroska ( i just hope Nic or Milan will adapt their DShow filters then to accept the 'new' frame order, so that we can read the files on Windows :D ).

Only problem i have here is that currently im just using standard old VCM (vfw) codecs and b-frame support is minimal to just dropping the frames used for padding. That means for real mpeg4 support i would need to
1) Parse the frames to determine type/timecode and reorder them correctly.
2) Write direct xvid api support and bypass VCM.
problems with these "solutions"
1) I don't know MPEG-4 VOP format at all.
2) Needs time and im guessing lots of it.

2. Using your app clearly promises a real nice speed boost :) !!

Hmm well to me matroska will hopefully give me a nice way which to mux the audio with (one of the reasons i havn't worked on any support is that without audio your going to need somthing else to mux and so might as well use unmodified avs2avi and then mux in matroskadub, but if i find time and get to know the lib well (BTW any api documentation available? didn't seem to be any in the tarball) then ill try to code it up with audio support (mux only i guess).

BTW : the first alpha of our DShow parser is promised to me for this weekend :D !

Nice, directshow goodness.

I should really finish avs2avi in its current form before moving on to matroska support but then again not being finished never stopped me before :) (to be honest it would be finished if it wasn't for the fact resuming is broken with the virtualdub avi output routines (which i only need as the avifile output routines are broken for some users).

Anyway looks like i should go grab the xvid source and start reading :).

DaveEL

[Toff]
14th March 2003, 01:18
Hi DaveEL,

I have started an xvid encoder to make some test some time ago (I work on it when i'm depressed :D ).
Maybe you will find interesting things in it :
- use avilib (come from linux ;) )
- direct access to avisynth without VFW
- direct encoding with Xvid
- direct connection of avisynth YUV plane to the XVid encoder (doesn't bring mutch speed :( )
- very little embryon of matroska support (quite old now)

Xvid encoding settings are hardcoded ATM.

(Source only)
http://christophe.paris.free.fr/temp/axenc000.zip

You can do what you want with this code.

DaveEL
14th March 2003, 02:28
Originally posted by [Toff]
Hi DaveEL,

I have started an xvid encoder to make some test some time ago (I work on it when i'm depressed :D ).
Maybe you will find interesting things in it :
- use avilib (come from linux ;) )
- direct access to avisynth without VFW
- direct encoding with Xvid
- direct connection of avisynth YUV plane to the XVid encoder (doesn't bring mutch speed :( )
- very little embryon of matroska support (quite old now)

Xvid encoding settings are hardcoded ATM.

(Source only)
http://christophe.paris.free.fr/temp/axenc000.zip

You can do what you want with this code.

And just when i decided it wouldn't take me long to get to grips with the xvid api (its really nice and simple). Doesn't look like much needs doing it does most of whats needed except it really needs 2 pass support to be ripped from the vfw module in xvid (at least until dev-api-4 is working).

DaveEL

bilu
10th April 2003, 18:11
Any news on this magnific project? ;)

Bilu

DaveEL
10th April 2003, 18:20
The news is... no news.
Sorry i have no time (and i havn't run windows for a while so its hard to test it :) ) I have a few ideas to tweak a little more speed from it when i get some time.

are you having a specific problem with the current code or do you just like new versions?

DaveEL

Valky
11th April 2003, 08:36
Actually there isn't any problems, althought I dont know what's the point in ticking Xvid on? It doesn't do 2-pass xvid anyway.

And I have noticed that everytimue I start encoding my avs-file the command window says something about 3ivx processing..? Any idea what does that mean, since I have it only installed, but I dont encode or decode using that codec?

If you dont mean what I ment, I can take screenshot as shoon as I return home.

bilu
11th April 2003, 12:11
@DaveEL

Well, I've been able to use 2-pass (haven't tested on clips larger than 7 minutes yet). The average FPS reported at the end of each pass is wrong but that's not really a problem.

But I do have a question: I'm using XVID and would like to change the setting through a batch file. I know I can change XVID settings on the registry but I suspect that the codec dumpfile does keep more than just the codec selection ( else we couldn't use 2-pass at all ).

Which way would you recommend to change settings on-the-fly ?

Bilu

I think I found it :) It's this option:

-c <4cc> : Use codec having <4cc> with default settings

DaveEL
11th April 2003, 19:19
Originally posted by Valky

And I have noticed that everytimue I start encoding my avs-file the command window says something about 3ivx processing..? Any idea what does that mean, since I have it only installed, but I dont encode or decode using that codec?


Bug in the 3ivx codec i reported it to them and they assured me it would be fixed in the next version so check you have got the latest build of 3ivx.

DaveEL

Valky
12th April 2003, 13:25
I have the latest build of 3ivx. This bug doesn't affect to my encodings with other codecs I hope?

DaveEL
12th April 2003, 14:09
nope the codec just outputs some text its safe to ignore just annoying.

Anyway seems its time to bother the 3ivx ppl again.

DaveEL

Stux
13th April 2003, 10:24
If this is related to an ICM_GET/SETSTATE bug, we're currently working on a maintenance release which fixes this (among other things) to be released in the very near future

DaveEL
13th April 2003, 13:09
Originally posted by Stux
If this is related to an ICM_GET/SETSTATE bug, we're currently working on a maintenance release which fixes this (among other things) to be released in the very near future

(Assuming its the same problem as before) Everytime you show the vfw compressor choose dialog it prints some stuff to the console not noticable in virtualdub etc but a little annoying when working on the command line.

DaveEL

Stux
13th April 2003, 14:37
Okay, yes, that's been fixed too :)

DaveEL
13th April 2003, 18:23
Originally posted by Stux
Okay, yes, that's been fixed too :)

Thanx

DaveEL

TaZ4hvn
23rd April 2003, 17:24
I just wanted to know if there is a way to totally disable the resume support as it has a strange behaviour on my box (kicking in even for ended conversions sometimes) why is a really a pain :)