Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Programming and Hacking > Development

Reply
 
Thread Tools Display Modes
Old 22nd March 2002, 15:41   #1  |  Link
ciler
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 39
AVISynth output and AVIFile APIs

Hello,

Here I am, trying (for the challenge) to make an encoder that would use AVISynth scripts and AVIFile APIs. But, but even if I can open the AVS script, it seems it outputs 16 bit video, so that I can't use DivX video Codec on it (v4.12), and using another codec, I obtain an ugly 16 bit video.

However, and here the thing is getting pretty weird, Virtual Dub seems perfectly able to encode this source into DivX 4.12 in 32 bits.

So, here is my question, can anyone figure where I've missed something. I mean
- There is a way for AVISynth to output 32 bit video and I missed it.
- AVISynth outputs 32 video and I'm a dumb AVIFile user.

BTW, if any of you guys can understand what I mean, I'll be happy to hear your answers

@Ookami : I hope this post is in the right forum. If you think it suits better to AVISynth, well, just move it !
__________________
Black Rose of the Artist Clan
ciler is offline   Reply With Quote
Old 23rd March 2002, 08:20   #2  |  Link
BlackSun
CoreCodec
 
BlackSun's Avatar
 
Join Date: Oct 2001
Location: Toulouse
Posts: 726
Why Ookami ? He is not a mod here
__________________
BlackSun
The Concentric Circles of Audio and Video
BlackSun is offline   Reply With Quote
Old 23rd March 2002, 11:39   #3  |  Link
Ookami
Xe-Rotaredom
 
Ookami's Avatar
 
Join Date: Oct 2001
Location: Croatia
Posts: 1,029
Another non-answer posting ...

> @Ookami : I hope this post is in the right forum. If you think it suits better to AVISynth, well, just move it !

You did the right thing to post this! Just obey and you'll not feel my wrath!

> Why Ookami ? He is not a mod here

I am always here... Thou shalt not have strange moderators before me.

@Ciler: IMO, it can stay here, but like BlackSun said, I'm not the mod here (and not even an programmer).

P.s.: BlackSun, check your PM's .

Cheers,

Ookie.
__________________
"Only those who attempt the absurd achieve the impossible."
Ookami is offline   Reply With Quote
Old 23rd March 2002, 17:51   #4  |  Link
ciler
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 39
@ Ookami At least, you were mod here once ago, were'nt you ? Am I that blind ?
__________________
Black Rose of the Artist Clan
ciler is offline   Reply With Quote
Old 24th March 2002, 14:53   #5  |  Link
Nic
Moderator
 
Join Date: Oct 2001
Location: England
Posts: 3,260
Weird problems Ciler...

YUY2 is 16bit, however that should not cause bad video...(One reason YUV is preferred over RGB is that it saves 33% size...)

-Nic
Nic is offline   Reply With Quote
Old 25th March 2002, 13:27   #6  |  Link
BlackSun
CoreCodec
 
BlackSun's Avatar
 
Join Date: Oct 2001
Location: Toulouse
Posts: 726
Quote:
Originally posted by Ookami
Another non-answer posting ...

@Ciler: IMO, it can stay here, but like BlackSun said, I'm not the mod here (and not even an programmer).

P.s.: BlackSun, check your PM's .
Yeah but you are so helpfull for us And yeah, thanks for the PM I love it
__________________
BlackSun
The Concentric Circles of Audio and Video
BlackSun is offline   Reply With Quote
Old 25th March 2002, 14:46   #7  |  Link
Wizard_FL
Registered User
 
Join Date: Oct 2001
Posts: 39
It may look like it outputs 16 bits if you look at an AVS script with mediaplayer, but don't be fooled! It only looks that way because it's not displaying the YUV frames correctly... Convert the stream into RGB and you'll see mediaplayer display the frames correctly.

Anyway, this bug has nothing to do with encoding since displaying and encoding are 2 different things.
Wizard_FL is offline   Reply With Quote
Old 25th March 2002, 17:45   #8  |  Link
ciler
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 39
RE :

Alas, the AVS file looks perfect in WMP. It is the encoded file which looks ugly...
__________________
Black Rose of the Artist Clan
ciler is offline   Reply With Quote
Old 25th March 2002, 23:49   #9  |  Link
Nic
Moderator
 
Join Date: Oct 2001
Location: England
Posts: 3,260
Ciler, how are you saving the AVI using the AVIAPI, ive recently made source that does that....(you can read what for in the DVD2AVI forum )....

...You might be doing it better than I am (I am pretty new to the AVIAPI (although simply, it is kind of picky at times ), but I don't get any problems....

Good luck

Cheers,
-Nic

ps
Are you decompressing the frame or sending it directly to the API?
Nic is offline   Reply With Quote
Old 26th March 2002, 10:08   #10  |  Link
ciler
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 39
Hi Nic,

I'm actually pretty new to this too .

Basically, I do this
- opening the AVS with AVIFileOpen
- Getting the video stream with AVIFileGetStream(...,StreamTypeVIDEO,...)
- Getting COMPRESSOPTION for the stream with AVISaveOption
- sending all the stuff to AVISaveV which popups me the ICCompressorChoose window and there I think you guess what happend

In the ICCom..I dont have DivX Video Codec that shows up and using the 3.11, picture is, well, not good.

I'll have a look at DVD2AVI forum, maybe we can help each other !

Edit : Hey ! We are really getting into parallel ways (however I'm planing vStrip->d2v->Frameserve to AVIfile APIs) not using DVD2AVI.
I still wonder how you can go faster than fast recompress ?
__________________
Black Rose of the Artist Clan

Last edited by ciler; 26th March 2002 at 10:31.
ciler is offline   Reply With Quote
Old 26th March 2002, 11:37   #11  |  Link
Nic
Moderator
 
Join Date: Oct 2001
Location: England
Posts: 3,260
We are doing very similar things ..my first attempt was to use AVISave also...Didn't go well, it was slow & picky for me (the problem was it needs a decompressor....

I assume from one post you mention that the decompressor your using (even though YUY2 is a raw format) is an ATI one ??? Try removing that & installing the HUFFYUV codec...as that will do it too.

However, that isn't the best way, Im now doing it rawly, i.e. using the ICCompress commands. This is much better & way faster (the only reason its quicker than VDub is that VDub, does checks, analyse, keyframe/scenechange analysis, etc, where as mine is just reading & writing

At present, or at least last night, the code was a bit buggy on the second pass & at releasing the new AVI, but I think I've got all the bugs out now As I go along & test more ill be releasing the source so you'll be able to look & see at what im doing (im trying to do it neatly, so it shouldnt be too hard to follow I hope...)

Cheers,
-Nic
Nic is offline   Reply With Quote
Old 26th March 2002, 12:24   #12  |  Link
ciler
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 39

Alas that I don't read C++ ... (I definitely should do something about this !)

The fact is that with some advise from the Master Himself (Avery lee ) I switched to AVIStreamWrite, but I can't have this function to work either.

I don't think the ATI codec is the trouble 'cause VDub outputs a correct video. Obviously, there is somehow a way to tell AVIFile APIs to output in 24/32 bit but I can't figure how...

On an other, I'm not getting perfectly that :
> -- QUOTE --
However, that isn't the best way, Im now doing it rawly, i.e. using the ICCompress commands. This is much better & way faster (the only reason its quicker than VDub is that VDub, does checks, analyse, keyframe/scenechange analysis, etc, where as mine is just reading & writing
> -- QUOTE --
I just open the stream and send samples to the new (compressed) stream, so basically, I'm obliged to use the standard decompressor.
If I understand well how ICCompress work, I just have to
-open the source stream
-get one frame (will AVIStreamRead fit ?)
-ICCompress it
-send it to the new stream
close stream and file and tada !

This should 'skip' the decompression that would be used with any other method if lpbiInput corresponds to an YUV format ? isn't it that ?
__________________
Black Rose of the Artist Clan
ciler is offline   Reply With Quote
Old 26th March 2002, 13:18   #13  |  Link
Nic
Moderator
 
Join Date: Oct 2001
Location: England
Posts: 3,260
Well, VDub will consider it Raw data & will not use a decompressor, hence, you don'y huffyuv or ATI to load YUV into VDub (Avery Lee is quite the master)

What language you using? VB? Now I understand why you used AVISaveV rather than AVISave...

& how you stated you should use ICCompress was completely correct....I got stuck & was going to ask Avery, but I kind of get the feeling I may need him in the future, I don't want bug to the legend too much

-Nic
Nic is offline   Reply With Quote
Old 26th March 2002, 13:33   #14  |  Link
ciler
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 39
Did u just mention VB

No, I'm not using VB but Delphi (which don't makes a wide difference in fact). I use AVISaveV because it's array based call is convinient as delphi don't really likes to have too much parameters in a function.

BTW, you seems to answer quite rapidly, so maybe we can have a chat or something. Would IRC be OK for you ?
I'm often on this server : irc.u-psud.fr (port 6667)
channel #naheulbeuk
__________________
Black Rose of the Artist Clan
ciler is offline   Reply With Quote
Old 26th March 2002, 14:10   #15  |  Link
Nic
Moderator
 
Join Date: Oct 2001
Location: England
Posts: 3,260
I reply quick, because im bored at work lol, Ive never done chatting (actually tried it last night to get to the MCF IRC room, but failed)...So I wont for now until I get the hang of this trillian prog

(Delphi & VB were the reasons the AVISaveV command was added, (stdcall & cdecl cr*p))

Cheers,
-Nic
Nic is offline   Reply With Quote
Old 26th March 2002, 14:18   #16  |  Link
ciler
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 39
Try mIRC, it's the one I use and it is really simple
__________________
Black Rose of the Artist Clan
ciler is offline   Reply With Quote
Old 26th March 2002, 20:31   #17  |  Link
Slyde
Registered User
 
Join Date: Jan 2002
Posts: 36
Ciler...

You'll have to give me some advice in a near future Ciler
Slyde is offline   Reply With Quote
Old 27th March 2002, 07:23   #18  |  Link
BlackSun
CoreCodec
 
BlackSun's Avatar
 
Join Date: Oct 2001
Location: Toulouse
Posts: 726
Et voila on se retrouve en famille
__________________
BlackSun
The Concentric Circles of Audio and Video
BlackSun is offline   Reply With Quote
Old 27th March 2002, 13:28   #19  |  Link
ciler
Registered User
 
Join Date: Oct 2001
Location: France
Posts: 39
When you want guys

@Nic :
I can't have AVIStreamWrite to work (the source frame beeing compressed or not). Is there something special to do. Basically, it don't crash, just send an error (ie not AVIERR_OK).
Can you help me ?
__________________
Black Rose of the Artist Clan
ciler is offline   Reply With Quote
Old 27th March 2002, 16:20   #20  |  Link
Nic
Moderator
 
Join Date: Oct 2001
Location: England
Posts: 3,260
I can try But ill need to have more info to help.....

The whole process can be quite picky (The best one is that alot of the error codes returned from AVIWriteStream are AVIERR_INTERNAL, meaning there is an internal error(!?!) Hows that supposed to help you.... )

So post some info & ill try to help
(i.e paramaters, etc)

Cheers,
-Nic
Nic is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:17.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.