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 > Video Encoding > MPEG-4 Encoder GUIs

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th January 2006, 16:15   #1521  |  Link
klicker4546
Registered User
 
Join Date: Sep 2005
Location: Germany
Posts: 68
Thanks for your reply Doom9. I've already tried it, without success. That's why
I was asking. I will ask in another thread then. Sorry!

Quote:
Originally Posted by Doom9
Actually.. just drag & drop an audio file into megui, select the codec, configure the codec.. and suddenly it will become clear Trying just once never hurts.. and this is a thread for developers...
klicker4546 is offline   Reply With Quote
Old 25th January 2006, 17:16   #1522  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by Doom9
Now you could go all the way and change the input checking prior to encoding to make use of it and even check for YV12 input and give the user a specific warning about the colorspace if it doesn't match the one required...
Maybe better way is to patch x264 and xvid_encraw to invoke ConvertToYV12 if colorspace doesn't match the one required?

Code:
if (!inf.IsYV12() ) 
{
	res = env->Invoke("ConvertToYV12", AVSValue(&res, 1));
}
Easy, isn't it?
dimzon is offline   Reply With Quote
Old 25th January 2006, 17:18   #1523  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
well.. considering how many times the error has come up and nothing had been done I doubt there ever will.. we should proceed under the assumption that encoders stay the way they are, and editing and reloading the avs input file.. that's not really the job of an encoder.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 25th January 2006, 17:27   #1524  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by Doom9
we should proceed under the assumption that encoders stay the way they are
It means nobody ask encoder developers to add such workaround. It's really easy and costs approx. 5 lines of code in C++ and 10 minutes of time. I can do it myself, just need access to encoder sources
really, it encoder reques avs with yv12 support it means encoder are working with avs via avisynth.dll (there are no other way to get yv12 from it, AviFile32 API performs RGB24 conversion). In this case is pretty easy to invoke additional AviSynth function like ConvertToYV12()...
dimzon is offline   Reply With Quote
Old 25th January 2006, 17:47   #1525  |  Link
pest
Registered User
 
Join Date: Feb 2005
Posts: 39
Quote:
Originally Posted by dimzon
2 all devs

found such code:
Code:
                    // Directshowsource needs the FPS information to be supplied.
                    // Without a lot of restructuring of code this is the best way of finding the FPS
                    // If anyone knows a better way of obtaining Framerate info, change this.
                    AVIReader reader;
                    try
                    {
                        reader = new AVIReader(fileName);
                    }
                    catch (Exception) // Some files can't render because you have no VfW codec (like DV sources)
                    {
                        reader = null;
                    }
AFAIK DiresctShowSource reques explicit fps information in very rare cases. And can't believe AVIFile32 API can return fps for such rare cases at all (AFAIK it even can't read such files)

Correct me if I'm wrong, please! I'm suggesting to remove this code!
Why 2 local objects?


Code:
AVIReader *reader=new AVIReader(fileName);

if (!reader) blahblah
pest is offline   Reply With Quote
Old 25th January 2006, 17:50   #1526  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by pest
Why 2 local objects?


Code:
AVIReader *reader=new AVIReader(fileName);

if (!reader) blahblah
Sorry, don't understand Your post at all
dimzon is offline   Reply With Quote
Old 25th January 2006, 18:01   #1527  |  Link
Mutant_Fruit
Registered User
 
Join Date: Apr 2004
Posts: 287
I wrote that particular piece of code as DirectShowSource wasn't loading my AVI files at all. It needed me to pass the FPS parameter to it before it would load my AVI files. I can guarantee no-one else spotted this problem before i added that code because the AVS generation was broken in MeGUI for AVI sources, and i only encountered the FPS problem after i fixed the AVS generation for AVI sources.

What do you mean by two local objects? There's only one reader there...
__________________
Nothing to see here...
Mutant_Fruit is offline   Reply With Quote
Old 25th January 2006, 18:09   #1528  |  Link
dimzon
BeHappy/MeGUI developer
 
dimzon's Avatar
 
Join Date: Oct 2003
Location: Moscow, Russia
Posts: 1,727
Quote:
Originally Posted by Mutant_Fruit
I wrote that particular piece of code as DirectShowSource wasn't loading my AVI files at all.
Can you provide me sample AVI file (upload it to mytempdir.com in 7z, max 10-20 MB)

Thanx!
dimzon is offline   Reply With Quote
Old 25th January 2006, 18:11   #1529  |  Link
pest
Registered User
 
Join Date: Feb 2005
Posts: 39
Ups, I forgot you where using C#, perhaps its different than in C++

Code:
AVIReader reader;
creates a local object

Code:
reader = new AVIReader
creates a reference to a local Object-Pointer

Sorry to confuse you. If your code would create 2 Instances
it wouldn't compile anyway

<- never trys to understand C#
pest is offline   Reply With Quote
Old 25th January 2006, 18:43   #1530  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Quote:
AVIReader reader;
try
{
reader = new AVIReader(fileName);
}
catch (Exception) // Some files can't render because you have no VfW codec (like DV sources)
{
reader = null;
}
Please note that if a exception is thrown in the ctor no instance is created and reader will stay null.

@pest

Yes, .NET is different.

Last edited by stax76; 25th January 2006 at 18:46.
stax76 is offline   Reply With Quote
Old 25th January 2006, 22:28   #1531  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
To all devs:
Quote:
Originally Posted by berrinam
Make more use of "Don't show me this again" in dialogs.
Description: See http://forum.doom9.org/showthread.ph...750#post772750
Status: Pending Doom9's approval.
I posted that at the beginning of the Feature Request thread. It's not so much of a feature that can be implemented in one go, because it is really something that should be in every dev's mind while coding. MeGUI is all set up to support these, so people just need to use them.

Also, I think it would generally be a good idea to look at the first post of the Feature Request thread, as there are quite a few new requests (mostly from me), once Doom9 approves them.

Last edited by berrinam; 25th January 2006 at 22:33.
berrinam is offline   Reply With Quote
Old 25th January 2006, 22:43   #1532  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Code:
0.2.3.2049 25 Jan 2006
Commit by berrinam:
	-Made the error messages shown for AviSynth more specific
	-Drag'n'drop handling starts in a new thread, preventing the window where the drag started from freezing
berrinam is offline   Reply With Quote
Old 25th January 2006, 22:50   #1533  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
@dimzon: I'm going to put some notes about AviSynth audio encoding on the MeGUI guide. In what situation would someone want to use 'force decoding via directshow'?
berrinam is offline   Reply With Quote
Old 25th January 2006, 23:09   #1534  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
No-one's made a file release on SourceForge for over a week.
1. Can someone do that.
2. dimzon, can you tell us more about the build facility on SF? I couldn't find anything about it.
berrinam is offline   Reply With Quote
Old 25th January 2006, 23:45   #1535  |  Link
Mutant_Fruit
Registered User
 
Join Date: Apr 2004
Posts: 287
Quote:
Originally Posted by dimzon
Can you provide me sample AVI file (upload it to mytempdir.com in 7z, max 10-20 MB)

Thanx!
For some strange reason, all the avi's that i threw up the error unless i had the FPS parameter are now working fine without passing the FPS parameter. I assume it must have something to do with my directshow filters... since i created that patch i have reinstalled and deinstalled quite a few filters and parsers as part of a project i'm doing in college.

I suppose that that makes my little addition redundant. I'll investigate further and see if i can figure out why i got the FPS error. But for the moment, i think its looking like that bit of code is just a waste of CPU cycles.

EDIT: Just a heads up, i'm finishing off a report for college, so i should be back into coding again by saturday. So if someone wants to grab the bitrate calculator before then, feel free. Otherwise i'll take a look at it on saturday.
__________________
Nothing to see here...

Last edited by Mutant_Fruit; 25th January 2006 at 23:51.
Mutant_Fruit is offline   Reply With Quote
Old 26th January 2006, 00:39   #1536  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Code:
0.2.3.2050 26 Jan 2006
Commit by berrinam:
	-Fix the MeGUI crash when auto-loading wavs after DGIndexing
	-Fix the error when selecting multiple chained jobs and pressing delete
berrinam is offline   Reply With Quote
Old 26th January 2006, 01:18   #1537  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Quote:
Originally Posted by dimzon
It means nobody ask encoder developers to add such workaround. It's really easy and costs approx. 5 lines of code in C++ and 10 minutes of time. I can do it myself, just need access to encoder sources
You can get the x264 sourcecode with SVN:
Code:
svn co svn://svn.videolan.org/x264/trunk x264
(from http://developers.videolan.org/x264.html)

However, it may not be such a good idea to add ConvertToYV12 silently, because it means that AviSynth error clips will also be encoded without realising it. In my opinion, a better idea would be for MeGUI to check the colorspace before it sends it to the encoder (I mentioned that here: http://forum.doom9.org/showthread.ph...47#post772747), because it should be the GUI's job. If someone knows enough to use the commandline, they will know what a colorspace error is, and they will prefer to know about it, so that they can fix it in a (perhaps) better way than simply converttoyv12.

Last edited by berrinam; 26th January 2006 at 04:40.
berrinam is offline   Reply With Quote
Old 26th January 2006, 09:26   #1538  |  Link
Inc
Squeeze it!
 
Inc's Avatar
 
Join Date: Oct 2003
Location: Germany
Posts: 472
Quote:
Originally Posted by Dimzon
AviFile32 API performs RGB24 conversion
Not at all, it depends on how you set up the decompression in AVIStreamGetFrameOpen().

Here a piece of code

Code:
BITMAPINFOHEADER bih;
    ZeroMemory(&bih, sizeof(BITMAPINFOHEADER));

    bih.biBitCount=24;    //24 bit per pixel
    bih.biClrImportant=0;
    bih.biClrUsed = 0;
    bih.biCompression = BI_RGB;
    bih.biPlanes = 1;
    bih.biSize = 40;
    bih.biXPelsPerMeter = 0;
    bih.biYPelsPerMeter = 0;
    //calculate total size of RGBQUAD scanlines (DWORD aligned)
    bih.biSizeImage = (((bih.biWidth * 3) + 3) & 0xFFFC) * bih.biHeight ;

    PGETFRAME pFrame;

    // Let the Handler decide which Colorspace matches best your display:
    pFrame=AVIStreamGetFrameOpen(pStream, AVIGETFRAMEF_BESTDISPLAYFMT);

    // Or do force the decompressor to use the Cspace as given in the bih above:
    pFrame=AVIStreamGetFrameOpen(pStream, &bih);
So If yot want to keep a YV12 as YV12 to serve it to an encoder, just apply to bih a BITMAPINFOHEADER Structure for RAW YV12 decompression or to whatever Cspace you want the stream decompressed to.

This weekend Ill add to the AvsRedirect/AvsWrapper some calls to avs's streamdetection (cspace etc etc etc).
Btw. In the avs_openscript command I did implement a routine so you can force the outputted Cspace via a simple String ("YV12","YUY2", "RGB24", "RGB32"). So depending on the encoder the user choosed you can force in MeGUI to serve the encoders native Cspace.

Last edited by Inc; 26th January 2006 at 09:47.
Inc is offline   Reply With Quote
Old 26th January 2006, 11:15   #1539  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
Quote:
In my opinion, a better idea would be for MeGUI to check the colorspace before it sends it to the encoder
I fully agree with that. If using the avisynth script creator, we should do the conversion automatically. In addition, the encoder should check the colorspace before encoding and raise an error in case it's the wrong colorspace. When we make the script creator automatically put the proper commands in the script, the only reason why an error would be raised would be if the user created his own avs script.. I think it's reasonable to expect those people to understand if we write "your avisynth script does not output YV12, please change your script accordingly" to the log.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 26th January 2006, 11:46   #1540  |  Link
Inc
Squeeze it!
 
Inc's Avatar
 
Join Date: Oct 2003
Location: Germany
Posts: 472
Not shure, but AFAIK also Qenc.'s avs script input parser automatically adds an ConverttoYV12() if the incoming script doesn't result in a YV12 Cspace.
Inc is offline   Reply With Quote
Reply

Tags
development, megui, not a help thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

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

Forum Jump


All times are GMT +1. The time now is 03:29.


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