View Full Version : MeGUI development
fegul
3rd January 2006, 23:41
I have the location of DGindex 1.45 listed in the settings, so it should be looking in that directory for the DLL
Also, I tried selecting the default profile, but still got the crash when I hit crop
Also, when I try to preview it, I get a really thin narrow line (like 600x70) even though my video settings are set higher than that, and its just a thin black bar with no video.
Mutant_Fruit
4th January 2006, 00:02
Shouldn't the TODO be moved to Source Forge tasks so that it's not required to get a CVS update just to see the TODO?
Aye. I think if people posted bug reports up there, it'd help coordinate us aswell. That way someone could take a bugreport and assign it to themselves to stop two or more people trying to fix the same bug.
bob0r
4th January 2006, 01:05
megui-x264-svn.exe compiled using compile.bat x264-svn
This is the output:
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
Encoder.cs(91,4): warning CS0618: 'System.Threading.Thread.Suspend()' is obsolete: 'Thread.Suspend has been deprecated. Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources. http://go.microsoft.com/fwlink/?linkid=14202'
Encoder.cs(98,4): warning CS0618: 'System.Threading.Thread.Resume()' is obsolete: 'Thread.Resume has been deprecated. Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources. http://go.microsoft.com/fwlink/?linkid=14202'
Dont know how this affects the compiled .exe so i just report this (it is working as far as i can see)
Sharktooth
4th January 2006, 04:52
those are just warning, the bins should work as expected.
CVS update:
0.2.3.1031 (work in progress)
Fixed AVS default profile selection in MeGUISettings.cs
Fixed PSNR checkbox label for Segoe font (Win Vista default) in x264ConfigurationDialog.cs
Sharktooth
4th January 2006, 05:15
@mutant_fruit: seems some things of your patch have been already integrated... could you re-post your patch for the latest source?
sources: http://www.webalice.it/f.corriga/megui/MeGUI-src.CVS.0.2.3.1031.1.7z
berrinam
4th January 2006, 07:12
Could Doom9 or Sharktooth or charleski do something about the #cvs.lock file which is preventing non-admin developers from using the password-based CVS?
Doom9
4th January 2006, 09:01
Dont know how this affects the compiled .exe so i just report this (it is working as far as i can see)It has no effect, it's just a warning. It will be gone when I'm through with my major encoding section revamp that I'm currently working on.. but it'll be a while until everything is merged.
FYI, here are the main points: At this point I have defined an Interface which video encoders need to implement. It outlines all the basic operations I expect every encoder to provide, plus the means to return results (via the well-known StatusUpdate... it might be modified in the process though as it has become more of a hack with each additional functionality that was added). That would allow different video encoders, even non commandline based ones. Then there's a base class for all commandline based video encoders that implements the interface.. so in the end the actual encoder class is rather small and only has to handle stdout and stderr data (the reading is also done in the base encoder class).. so basically separate between errors and progress reports and decide where to put them and keep the status updated. My xvid encraw encoder is currently only 3k and I don't expect much more work.. most of the legwork is done in the base encoder which can be reused for all other encoders (I plan to merge them eventually).
Also, when I try to preview it, I get a really thin narrow line (like 600x70) even though my video settings are set higher than that, and its just a thin black bar with no video.This means there's an error in your AviSynth script. For reasons unkown (so far), if there's an error, the video size reported via VfW doesn't correspond to the video size that script should have.. so you only get to see black, bug if you play the script in a media player, you'll get to see the error.
The TO DO list is not up to date What is missing / requires updates? Somebody else could be in charge of the todo in a post on this board.. being admin ensures that I can always make my own updates.
Bugtracking can be nice on SF if that's the only facility you have, but I think with this forum we have a well established way of handling just that. And I find myself personally very reluctant to post bugs anyplace but where I'm already a member and since most people are not sf members, trying to move everything there might actually reduce the level of feedback we get. It's not the most convenient for us, but for the user I think sticking to the forum is the better option, and it's what is commonly done for softwares that have their home in this place.
Mutant_Fruit
4th January 2006, 10:08
could you re-post your patch for the latest source?
I'll do that later today, when i get back from work.
bob0r
4th January 2006, 10:12
@Doom9: Okay
@Sharktooth: Okay.... and dont forget to update AssemblyInfo.cs :)
berrinam
4th January 2006, 10:52
What is missing / requires updates? Somebody else could be in charge of the todo in a post on this board.. being admin ensures that I can always make my own updates.
As both this thread and the main MeGUI thread are very long, and this thread is meant only for developers, perhaps it would be worth having a dedicated feature-request/bug-report thread?
On the topic of long threads, here's (http://forum.doom9.org/showthread.php?p=756631#post756631) a feature request which may have been lost in the midst of everything else:Could perhaps the "shutdown when finished" tick box be moved out of the settings onto the queue tab. I keep forgetting to disable it again and will just be doing a simple mux, only for the computer to then shutdown! lol :D
Finally, the D2V Creator seems to be ignoring whether you have the 'and close' checkbox checked. To fix this, change queueButton.DialogResult = DialogResult.Yes; in VobinputWindow.checkIndexIO() to queueButton.DialogResult = DialogResult.None;
Doom9
4th January 2006, 11:08
Finally, the D2V Creator seems to be ignoring whether you have the 'and close' checkbox checked. To fix this, changeHmm.. did somebody break that? I seem to recall that feature working in my latest release build that I used for the codec comparison. Why would the queuebutton need a DR anyway?
And Sharktooth already promised to move the shutdown checkbox.
Doom9
4th January 2006, 11:14
As far as creating multiple threads go.. I think we need a maintainer for the feature request and bug report thread so that he can start (and then edit) the thread. The first post imho should include approved/discarded feature request and verified bugs respectively. And of course, in the bug thread, it's about whipping people into shape to make proper bugreports (don't forget logs, verify the script works properly, proper configuration, etc)
charleski
4th January 2006, 13:49
As I said above: anonymous CVS is a pain, as is making patches. :devil: Can I have my developer access back, please, or can I be made an admin? This 'training period' excuse seems quite flimsy to me.
Yeah, I put you back to developer access.
The question is which access method works best: dimzon was having problems with the CVS access, you seem to be having problems with the Patch Tracker. But I think it's best if we use one consistent method. Both do involve a certain amount of training to get used to the system.
charleski
4th January 2006, 14:05
When I use the Avisynth creator and hit prevew after inputing the d2v file, I get a narrow black bar that has no video.
This basically means that there's a problem reading in the d2v file.
I see from your d2v file that you're using an older version of DGMPDEC, which may well be the problem. Upgrade to the latest version (1.4.6 I believe, but Donald Graft is still actively developing DGIndex) and recreate the d2v file. Make sure that there is no dgdecode.dll in your MeGUI directory, it should use the one in the DGIndex dir, which will be updated along with the rest of it.
Sharktooth
4th January 2006, 16:18
CVS update:
Fixed the D2V creator thing, updated MeGUI version and changelog.
@doom9: i completely forgot about moving the "shutdown" checkbox. However im doing very small changes coz i have not enaugh time (until 7th january) to work on MeGUI... something like 5 mins per day and im still learning :)
Doom9
4th January 2006, 16:25
i completely forgot about moving the "shutdown" checkbox. Well.. it's not a huge change.. if you remove it from the settings dialog, there'll be an error in Form1.cs.. that's the part that needs to be changed for it to work again. And I already put you down for making this change ;) I like breaking bigger things like the whole encoder backend :) I wonder if I get my new and improved backend to work as I want.. if I do it's really quite beautiful.. and while at it I'll probably introduce an option to keep the entire stdout and stderr output for debugging purposes.
godhead
4th January 2006, 17:26
Bugtracking can be nice on SF if that's the only facility you have, but I think with this forum we have a well established way of handling just that. And I find myself personally very reluctant to post bugs anyplace but where I'm already a member and since most people are not sf members, trying to move everything there might actually reduce the level of feedback we get. It's not the most convenient for us, but for the user I think sticking to the forum is the better option, and it's what is commonly done for softwares that have their home in this place.
I guess I'll just have to get used to looking at the newly suggested Request/Bug thread. Unless the maintainer of that thread wants to also make the correct entries in the SF bug tracker. I would volunteer for this, but I'm not sure I have enough time to do this daily as is probably needed.
godhead
4th January 2006, 17:31
I'd also like to propose that once the Feature Request/Bug Tracking thread is created, we move this development thread to the Programming and Hacking/Development forum to further seperate the development discussions from the normal user discussions.
Sharktooth
4th January 2006, 17:37
The previous link to sources was pointing to the wrong file.
... http://www.webalice.it/f.corriga/megui/MeGUI-src.CVS.0.2.3.1031.4.7z
Sharktooth
4th January 2006, 17:40
Well.. it's not a huge change.. if you remove it from the settings dialog, there'll be an error in Form1.cs.. that's the part that needs to be changed for it to work again. And I already put you down for making this change ;)
well... it is since it's in "settings"... or i'm just drunk again?
Raithmir
4th January 2006, 18:45
Also, when I try to preview it, I get a really thin narrow line (like 600x70) even though my video settings are set higher than that, and its just a thin black bar with no video.
Still problems selecting the AVISynth path in the settings (it starts at "c:\program files" and there's no option to select the other drive that the plugins are on. I have however entered the correct address manually in the XML file.
I also have the same problem as fegul, quoted above, when attempting to use deinterlacing or noise reduction.
This is in 1030, I can't see 1031 on SF yet?
Sharktooth
4th January 2006, 19:13
CVS update:
Allowed the selection of any folder to locate avisynth scripts.
sources: http://www.webalice.it/f.corriga/megui/MeGUI-src.CVS.0.2.3.1031.5.7z
Mutant_Fruit
4th January 2006, 21:13
Recreated the dialog patch against the latest source. Its up on sourceforge.
*hopes it gets integrated before someone else changes the source again* ;)
berrinam
4th January 2006, 23:26
CVS Update:
Fixed crash on configuring level-incompatible x264 settings
Fixed the over-restrictive AVC Levels (pixel size vs macroblock size issue), and the ignored Validate AVC Level dialog results
See more about the bugs in BlackSharkfr's post (http://forum.doom9.org/showthread.php?p=762117#post762117)
Doom9
4th January 2006, 23:35
@all developers: as long as I keep the todo list in this thread, could you guys please give me a heads-up when you are working on something/have finished/want to do something? And if anybody wants to volunteer for that task...
berrinam
5th January 2006, 00:01
I'm willing to start feature request and bug report threads. Anything else I need to know before I do?
Doom9
5th January 2006, 09:03
Anything else I need to know before I do?Not really.. just make sure you put up some nice reporting guidelines, but you've already written some in the past. And make sure that no support will be given for those that don't bother with a good report.. we all have better things to do than pull worms out of people's noses.
Similarly, a feature request should contain a good argumentation why a certain feature makes sense, looking beyond the plate that's in front of you.
Sharktooth
5th January 2006, 15:38
Im personally working on bugfixing right now coz, as i said, i have not much time to spend for adding features or stuff.
For the TO DO list, check the changelog.
jmk
5th January 2006, 16:39
i have encountered the following problems with the latest version (but also with the ones before) of MeGui (btw, beautiful program, love it!):
- the window title of MeGui stays at 99% even though everything is finished
- right now it seems, that mp4 muxing in the "oneclick mode" forgetts the chapter file
---
IsoMedia import - track ID 1 - Video (size 640 x 384)
IsoMedia import - track ID 1 - HE-AAC (SR 24000 - SBR-SR 48000 - 6 channels)
IsoMedia import - track ID 2 - media type "odsm:mp4s"
IsoMedia import - track ID 3 - media type "sdsm:mp4s"
Saving ***.mp4: 0.500 secs Interleaving
---
- if i select "auto-detect" in the aspect ratio drop down list and click "signal AR", the correct aspect ratio is not detected (neither in mplayer nor vlc)
and maybe some suggestions, if i may:
- add a button "hide" or "close" or something in the process window. it took me a while before i realized it can be closed without aborting the process.
thanks again for this great program!
jmk
Sharktooth
5th January 2006, 17:16
0.2.3.1031 5 Jan 2005
Redesigned x264 codec config and part of the main form (original patch by mutant_fruit)
Fixed crash on configuring level-incompatible x264 settings
Fixed the over-restrictive AVC Levels, and the ignored Validate AVC Level dialog results
Fixed the displacement of the SettingsForm.cs controls and allowed to select a any folder in Settings to located Avisynth filters.
Fixed the "and close" checkbox in D2V Creator and LoadOnComplete control size
Fixed AVS default profile selection in MeGUISettings.cs
Fixed PSNR checkbox label for Segoe font (Win Vista default) in x264ConfigurationDialog.cs
Sources: http://www.webalice.it/f.corriga/megui/MeGUI-src.CVS.0.2.3.1031.7z
Binaries on SF.
Shinjite
5th January 2006, 17:22
I am just wondering, no more updates on binaries for .net 1.1 for MEGUI?
Sharktooth
5th January 2006, 17:25
No. MeGUI has moved to .NET 2.0.
godhead
5th January 2006, 17:49
@Doom9 and berrinam: Please put me down for the following 2 items on the TODO list.
add support for the -name tag in mp4box
Description: N/A
Status: No-one is working on it
Replace English language names with native language names
Description: N/A
Status : No-one is working on it
Sharktooth
5th January 2006, 17:51
i think i broke the 3-state thing for b-frames with with the latest patch...
partially fixed and CVS updated...
godhead
5th January 2006, 18:47
Yeah, I put you back to developer access.
The question is which access method works best: dimzon was having problems with the CVS access, you seem to be having problems with the Patch Tracker. But I think it's best if we use one consistent method. Both do involve a certain amount of training to get used to the system.
I'd prefer to have CVS access as well if you can enable it for me. I just don't care for the patching method. If the group would rather use the patching method, then I'll force myself with that method.
Just to verify I'm doing the patching method correctly. I'll need to have two copies of the source where one is modified and one if the CVS copy. Once I'm completed with my changes I use WinMerge or other diff tool to create the patch, is that correct? Sorry, never done the patching so maybe that's why I think it's a pain.
Sharktooth
5th January 2006, 18:49
Im still looking at what's missing in x264ConfigurationDialog.cs...
tri-state is not working poperly... but i cant see what's missing (or i am blind)...
godhead
5th January 2006, 18:54
I'd prefer to have CVS access as well if you can enable it for me. I just don't care for the patching method. If the group would rather use the patching method, then I'll force myself with that method.
Just to verify I'm doing the patching method correctly. I'll need to have two copies of the source where one is modified and one if the CVS copy. Once I'm completed with my changes I use WinMerge or other diff tool to create the patch, is that correct? Sorry, never done the patching so maybe that's why I think it's a pain.
Ahh nevermind about my patch question. I just noticed that Tortoise has a patch context menu option that will create a patch file by checking the CVS, so I will only need 1 copy of the source. I guess this is workable.
charleski
5th January 2006, 19:08
Well, ask doom9, he asked if we could try out the Patch tracker feature, as it should provide a more structured method of managing various alterations of the codebase.
BTW, something came to me last night re the 'shutdown when finished' issue - why not have a button on the queue page that will insert a Shutdown job into the queue? This will then be a job like any other and can be moved around in the list. It also means it will be clear from a simple glance at the queue list whether a shutdown is scheduled or not.
If this sounds like an idea I'll code it up.
Sharktooth
5th January 2006, 19:14
it could be interesting.
Could any dev update to the latest CVS and check x264ConfigDialog.cs to find what's wrong with it?
latest sources are here btw: http://files.x264.nl/?dir=./Sharktooth/megui/Sources
Sharktooth
5th January 2006, 19:43
in the meanwhile i pulled 1031 from the file releases...
EDIT: CVS update
More fixes for Segoe font (Win Vista default).
Sources (as usual) are here: http://files.x264.nl/?dir=./Sharktooth/megui/Sources
charleski
5th January 2006, 21:55
0.2.3.1032 6 Jan 2006
Added a button to the Queue tab on the main form: "Add Shutdown". This adds a shutdown job to the end of the queue. Automatic shutdown can still be set using the checkbox in the Settings form.
Fixed tri-state GUI display dependencies in x264ConfigDialog.cs
Actually, the tri-state problem was a side-effect of not allowing showCommandLine() to run when the dialog is first being initialised. I just added a separate call at the end of the load process.
Sharktooth
5th January 2006, 21:56
?!? Where was the error ?!?
berrinam
5th January 2006, 22:01
@jmk: Bug reports should really be posted on the bug report thread. Similarly with feature requests and the feature request thread.
- the window title of MeGui stays at 99% even though everything is finished
Yep, it happens to me, too. Will go on the bug report thread.
- add a button "hide" or "close" or something in the process window. it took me a while before i realized it can be closed without aborting the process.Will put this on the feature request thread.
As to the other bugs you mentioned, they don't happen for me, so you should post a more detailed explanation on the MeGUI Bug Report Thread. This thread is for developers.
charleski
5th January 2006, 22:03
The tri-state stuff is only called by showCommandLine(), and this was disabled when the dialog is being loaded: private void showCommandLine()
{
--> if (!loaded)
--> return;
if (!x264ConfigurationDialog.levelEnforced)
EnforceLevel(this.CodecSettings);
x264DialogTriStateAdjustment(); So when the dialog loads it doesn't go through the x264DialogTriStateAdjustment() code and only adjusts to the right state if you change something.
Doom9
5th January 2006, 22:05
- add a button "hide" or "close" or something in the process window. it took me a while before i realized it can be closed without aborting the process.Hmm.. I don't agree on that.. I took VDub as a model for the progress window and that one also allows closing by pressing X.
berrinam
5th January 2006, 22:08
The tri-state stuff is only called by showCommandLine(), and this was disabled when the dialog is being loaded: private void showCommandLine()
{
--> if (!loaded)
--> return;
if (!x264ConfigurationDialog.levelEnforced)
EnforceLevel(this.CodecSettings);
x264DialogTriStateAdjustment(); So when the dialog loads it doesn't go through the x264DialogTriStateAdjustment() code and only adjusts to the right state if you change something.
I added those two lines because otherwise, MeGUI was sometimes being forced to do a TriStateAdjustment before all the values had been set, leading to a NullReferenceException. Sorry to cause the problem.
charleski
5th January 2006, 22:13
I added those two lines because otherwise, MeGUI was sometimes being forced to do a TriStateAdjustment before all the values had been set, leading to a NullReferenceException. Sorry to cause the problem.
Yeah, one of the problems with event handlers is that the code can waste a fair amount of time needlessly thrashing through them. It just needed an extra explicit call at the end of the load routine.
bob0r
5th January 2006, 22:54
Using megui-x264-svn.exe:
- Selecting profiles HQ-Insane and HQ-slowest then hit config (or select these profiles in config) crashes.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentOutOfRangeException: InvalidArgument=Value of '6' is not valid for 'SelectedIndex'.
Parameter name: SelectedIndex
at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
at MeGUI.x264ConfigurationDialog.set_CodecSettings(x264Settings value)
at MeGUI.x264ConfigurationDialog.videoProfile_SelectedIndexChanged(Object sender, EventArgs e)
at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
at System.Windows.Forms.ComboBox.WmReflectCommand(Message& m)
at System.Windows.Forms.ComboBox.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
megui-x264-svn
Assembly Version: 0.2.3.1032
Win32 Version: 0.2.3.1032
CodeBase: file:///G:/msys/1.0/home/user/pack/megui-x264-svn.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
_7rwuzjn
Assembly Version: 0.2.3.1032
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Profiles used:
http://forum.doom9.org/showthread.php?t=101813
MeGUI-x264_generic_profiles_v20.7z
Doom9
5th January 2006, 22:59
- Selecting profiles HQ-Insane and HQ-slowest then hit config (or select these profiles in config) crashes.It appears to me that those use subme7.. don't try to use non SVN features with a built that only supports SVN features.. you're the one who wanted that build - I think it was pointed out that this could happen when I added the additional conditional code.
bob0r
5th January 2006, 23:27
Ah ok, i understand.
Coding an option to detect valid profiles can be touch i guess.
Thanks (And yes svn only still is perfect, profiles do not come with the package, i only report what i see :))
Edit:
Moved the other report to the bug report thread, i just noticed it :D
charleski
6th January 2006, 01:51
Ok, doom9 pointed out that the Oneclick code actively modifies the queue during processing, which makes it hard to insert jobs that require absolute placement without a lot of special handling. So I revised things back to using the settings shutdown code, but modified the window title so that the application's behaviour won't cause any nasty surprises. I also added in something to deal with the progress percentage appearing to hang at the end (really just a display issue).
0.2.3.1032 6 Jan 2006
Added a button to the Queue tab on the main form: "Add Shutdown". This adds a shutdown job to the end of the queue. Automatic shutdown can still be set using the checkbox in the Settings form.
Revised: Removed the use of system jobs and added shutdown checkboxes to the Oneclick window and queue tab.
Shutdown status is now displayed in the window title if it's enabled.
Modified main window title to revert to name+version after the job queue has finished.
Fixed tri-state GUI display dependencies in x264ConfigDialog.cs
Sharktooth
6th January 2006, 05:10
x264 conditional compiling is broken again.
EDIT: Fixed and CVS updated.
0.2.3.1032a is "released". So please add any updates to the next version and make it 0.2.3.2
Doom9
6th January 2006, 09:11
I have something for discussion: with the addition of XviD AVC, we'll have two AVC and two ASP encoders.. and we already have two AAC encoder (perhaps three once dimzon integrated behappy?). There are two approaches to handle the two codec/one format approach. One is to have everything available in the appropriate dropdowns. That makes it very easy to see what you get, on the other hand it's more cumbersome internally because you have an xyzSetting object with the settings for each type of codec.. The other alternative is to offer just the codec type (like ASP, AVC, AAC) and have the encoder selection done in the settings. This makes it easier to integrate additional encoders, on the other hand, it's no longer apparent at first glance what is being used. And I'm sure you can come up with more pros and cons for each approach. Which one do you prefer?
Doom9
6th January 2006, 09:21
and about the shutdown: I think it wouldn't be such a bad idea to remove that from the settings, and have it in the queue, in addition to allowing to set it in the automated encoding setup windows.. and that checkbox should be non persistent.. so that in case you do want to shut down after processing, you actively requested it each time. That most certainly would get rid of the accidental shutdown problem, and at the same time I don't think it's so much a hassle to actively set this flag if you really want the PC to shut down.. it's a rather big step after all.
max-holz
6th January 2006, 09:30
A little style point; the left border of the video codec dropdown combo seems to be disapperead.
Ciao
charleski
6th January 2006, 10:19
0.2.3.1034 7 Jan 2006
Added a few fixes for conditional compilation
0.2.3.1033 7 Jan 2006
Small fix to ensure all the shutdown checkboxes reflect the current state correctly
[Since this is a bug fix I kept it as 0.2.3.1xxx and added it as a release]
berrinam
6th January 2006, 13:09
0.2.3.1035 6 Jan 2006
Fixed the x264 lossless bug
Fixed the x264 threads bug
This means (according to the bug thread) all known bugs have been solved, so we are ready for a new version number in that respect.
Doom9
6th January 2006, 13:57
btw, depending on how encraw comes along, we might also get tri-state in the xvid config dialog and certainly in the xvid avc dialog as well ;) More fun for me and more opportunities to introduce new bugs...
Sharktooth
6th January 2006, 15:42
I have something for discussion: with the addition of XviD AVC, we'll have two AVC and two ASP encoders.. and we already have two AAC encoder (perhaps three once dimzon integrated behappy?). There are two approaches to handle the two codec/one format approach. One is to have everything available in the appropriate dropdowns. That makes it very easy to see what you get, on the other hand it's more cumbersome internally because you have an xyzSetting object with the settings for each type of codec.. The other alternative is to offer just the codec type (like ASP, AVC, AAC) and have the encoder selection done in the settings. This makes it easier to integrate additional encoders, on the other hand, it's no longer apparent at first glance what is being used. And I'm sure you can come up with more pros and cons for each approach. Which one do you prefer?
I'm for the first method.
@devs: when you're releasing a new build on SF ensure you check the "Preserve my pre-formatted text" just below the changelog...
Sharktooth
6th January 2006, 16:22
CVS Update:
0.2.3.1036 (work in progress)
Changed "Codec" in "Encoder" in x264, snow, xvid and lavc dialogs titles
Fixed some conditional compilation warnings
bob0r
6th January 2006, 16:28
@berrinam
Not yet, not yet, annoying bob0r is posting bugs and asking questions :sly:
Sharktooth
6th January 2006, 17:19
CVS update:
Made x264DialogTriStateAdjustment() to restore some of the default settings when switching profiles or enabling options that enables a group.
It makes it crash without any message though...
It doesnt let me debug too. Any ideas?
Sharktooth
6th January 2006, 18:20
CVS update:
Reverted the previous changes
Completed the code to enable/disable controls and labels in both tri-state and encoding mode
Doom9
6th January 2006, 19:19
Is it just me or has the tri state thingie probably not been done the way I specified? I recall writing something about using the same code just for different objects (GUI versus x264Settings).. but when I had a quick look the last time I worked on MeGUI, it sorta looked different and I found pieces of the adjustments in the actual x264 commandline generation as well (I already moved it.. please wait for my next major update). There should be one method doing all the adjustments.. based on the settings options are enabled/disabled and the counterpart in the commandlinegenerator class would do the same with removing/adding options to the commandline. I still think that ought to work just fine when you just make sure you have every case covered.
charleski
6th January 2006, 20:16
Is it just me or has the tri state thingie probably not been done the way I specified? I recall writing something about using the same code just for different objects (GUI versus x264Settings).. but when I had a quick look the last time I worked on MeGUI, it sorta looked different and I found pieces of the adjustments in the actual x264 commandline generation as well (I already moved it.. please wait for my next major update). There should be one method doing all the adjustments.. based on the settings options are enabled/disabled and the counterpart in the commandlinegenerator class would do the same with removing/adding options to the commandline. I still think that ought to work just fine when you just make sure you have every case covered.
The code for the GUI has to cover the enabled state of the GUI element as well as its actual value (i.e. if a certain parameter can't be used, it must be unchecked and disabled). This is essential to avoid confusion for the user (the intial tri-state code contained several areas which didn't set the GUI display consistently even though it produced the correct commandline). The code for the commandline generator needs only to cover the actual values of the parameters. It's possible to route both decision flows through a single routine, but that would add some coding overhead.
BTW, it seems the "Fixed the "and close" checkbox in D2V Creator and LoadOnComplete control size" in 0.2.3.1031 took the 'and close' checkbox out of the d2v creator that pops up when someone selects an mpeg2 file in the avisynth creator, but not from the d2v creator that's produced directly from the menu selection. What was the rationale behind this? Unfortunately that broke the routing control I put in to allow the ability to load mpeg2 files directly in the avisynth creator (comments in the forums indicated that some were confused by the various options in the Tools menu so I put in some code to guide people through the process).
charleski
6th January 2006, 21:21
0.2.3.1037 7 Jan 2006
Removed the ability to save profiles with empty names. Added additional checks to ensure that these rogue profiles aren't loaded or saved.
Doom9
6th January 2006, 22:00
It's possible to route both decision flows through a single routine, but that would add some coding overhead. I didn't mean that.. but basically if in the GUI we have an option disabled (whether checked or not), then the corresponding commandline processing method would deactivate the option in question.
So if in the GUI we have level X disabled a,b,c, then in the corresponding commandline method we have a = false, b = false, c = false.
charleski
6th January 2006, 22:28
basically if in the GUI we have an option disabled (whether checked or not), then the corresponding commandline processing method would deactivate the option in question. Well, in general, if an option is disabled it just means that the user can't alter it. It might be mandatory for it to be on or off, which is why you have to modify the Checked state as well to reflect the actual required state, otherwise the way the config is presented to the user becomes confusing. There are actually four states involved: disabled checked, disabled unchecked, enabled checked and encabled unchecked.
So if in the GUI we have level X disabled a,b,c, then in the corresponding commandline method we have a = false, b = false, c = false.Unfortunately the commandline generator doesn't have access to the config GUI (which won't even be generated if the user just specifies a profile and goes directly to encoding). The check in the commandline generator is really just a safety feature TBH, as any settings generated by the config dialog (including profiles) should already have been verified, but it's better to be safe.
Doom9
6th January 2006, 22:42
It might be mandatory for it to be on or off, which is why you have to modify the Checked state as well to reflect the actual required stateBut that's just it.. tri state means checked, unchecked and don't care (disabled).. there shouldn't be a fourth mode. It's the method in the commandline generator that has to be aware if an option has to be true or false.
Let's take an example: I8x8mv. The control is enabled when the profile is set to high profile, and disabled otherwise. However, if you go to high profile, check it, then go to main profile, it should remain checked, but just be disabled. So the x264Settings.i8x8mv variable would still evaluate to true when it gets to the commandlinegenerator. Then in the method x264TriStateAdjustment, it would have to be set to false. That similarity extends to a lot more. In the GUI method x264DialogTriStateAdjustment you enable/disable controls without checking their checked state or position in the dropdown.. in the x264TriStateAdjustment you set the booleans to true/false as needed. Thats why I keep saying the whole thing is basically the same.. the method in the GUI enables/disabled GUI fields, the one in the commandlinegenerator sets variables to true/false.
godhead
7th January 2006, 01:19
I've submitted a patch for the following:
add support for the -name tag in mp4box
Description: N/A
Status: godhead is working on it
After talking with Doom9, I've implemented the feature using the :name=foo syntax that's been in older compiles of mp4box rather than the new -name switch. Also these are currently only applied to Video and Audio. Should these also be added to the Subtitles?
Hope one of the admins can get these changes integrated soon, so the patch isn't reflected against an old CVS.
Here's a quick list of changes
MuxSettings.cs
* Added VideoName property to hold the Video track name
MuxWindos.cs
* Added Label and Input controls for Video and Audio track names.
* Added Event to handle audio track name changes.
CommandLineGenerator.cs
* Added more string concats for track names on generateMP4BoxCommandline()
berrinam
7th January 2006, 01:35
Im not an admin, so I can't delete your patch, but I've committed it to the CVS, version 0.2.3.1038:
0.2.3.1038 7 Jan 2006
Added support for the :name tag in mp4box (patch by godhead)
stax76
7th January 2006, 01:38
It makes it crash without any message though...
It doesnt let me debug too. Any ideas?
There is a cure for almost all debugger weirdness, I've posted it before in the MeGUI thread ;)
http://msdn2.microsoft.com/en-us/library/d14azbfh.aspx
godhead
7th January 2006, 01:41
Im not an admin, so I can't delete your patch, but I've committed it to the CVS, version 0.2.3.1038:
0.2.3.1038 7 Jan 2006
Added support for the :name tag in mp4box (patch by godhead)
I just realized I forgot to validate the text inputs so spaces will cause problems. Do you want to roll that out and I'll submit another patch in a bit?
godhead
7th January 2006, 01:53
I just realized I forgot to validate the text inputs so spaces will cause problems. Do you want to roll that out and I'll submit another patch in a bit?
New patch submitted, please make these changes to the CVS and set the patches to closed. Thanks!
berrinam
7th January 2006, 02:51
Committed to CVS:
0.2.3.1039 7 Jan 2006
Fixed :name tag support so spaces won't cause problems (patch by godhead)
I can't close the patches.
Sharktooth
7th January 2006, 15:13
Closed.
Sharktooth
7th January 2006, 16:24
CVS Update:
http://forum.doom9.org/showthread.php?p=763847#post763847
Some logic is still to be revised though. i'll do it tonight or tomorrow.
bob0r
7th January 2006, 20:24
@sharktooth
you always forget to update AssemblyInfo.cs :eek:
Sharktooth
7th January 2006, 22:27
well... coz i steel need to fix a couple of things.
however now the version number is up to date.
http://files.x264.nl/?dir=./Sharktooth/megui/Sources
Mutant_Fruit
8th January 2006, 01:32
when distributing the binaries, you need to distribute the Data folder containing the ContextHelp.xml file aswell. Otherwise the tooltips are disabled. I'll grab a few bugs/feature requests and take a look at em tomorrow. I've been away the last few days.
Romario
8th January 2006, 01:46
Gyus, someone(my friend) told me yesterday that some options are still missing in MeGUI, I think on options which improve visual quality of the video on low bitrates?
Can someone explain me about that options.
berrinam
8th January 2006, 02:46
Come on, Romario. MeGUI is supposed to have all of the x264 options (I presume that's what you are talking about). If something is missing, it should be you telling us, not the other way around. Also, read the first post in this thread: If you don't "speak" C# this is the wrong thread to post in. You posted on the wrong thread, and it's not the first time. If there's an option missing, post it on the feature-request thread, where it belongs.
Sharktooth
8th January 2006, 18:09
CVS update:
0.2.3.2 8 Jan 2006
Added missing --bime turbo exclusion for conditional compilation
Fixed logic for "Turbo" in x264DialogTriStateAdjustment()
Bins on SF ( http://sourceforge.net/project/showfiles.php?group_id=156112 )
Doom9
8th January 2006, 18:55
A few notes regarding the x264 configuration redesign. Generally a good job but I have some issues: weighted b-prediction.. isn't that a b-frame option?
And is the number of reference frame really a quantizer option? I thought it was an ME option.
Last but not least, I can't shake the feeling that the misc options which have been put in the first tab should rather be somwhere less accessible.. they are rather esoteric imho. FourCC only applies to AVI anyway and the default is generally no problem (we should even consider dumping that option). The Number of threads can be auto-set which I tend to think should be done for everyone.. it reliably picks up HT and dual core processors. PSNR calculations is really not something joe average needs, and SAR is an option for experts anyway.
I think moving the misc groupbox away from the first tab would be doing more justice to the "keep only the most important options on tab1".. I see this generally implemented with what has been kept in the first tab.
Sharktooth
8th January 2006, 18:56
CVS Update:
0.2.3.2001 8 Jan 2006
Fixed BiME and Chroma ME options not showing in command line preview
Bins on SF (http://sourceforge.net/project/showfiles.php?group_id=156112)
Bah, i did already fix that... ensure you do a CVS update before committing new code to the CVS or make patches.
charleski
8th January 2006, 19:08
Let's take an example: I8x8mv. The control is enabled when the profile is set to high profile, and disabled otherwise. However, if you go to high profile, check it, then go to main profile, it should remain checked, but just be disabled. So the x264Settings.i8x8mv variable would still evaluate to true when it gets to the commandlinegenerator. Then in the method x264TriStateAdjustment, it would have to be set to false.
The problem I see is that the state of the GUI should exactly reflect the parameters that are going to be sent to the encoder. As a user, if I see that a checkbox is disabled, that just means I can't alter it myself as it depends on some other factor. But the boolean state of the checkbox (checked or unchecked) should reflect what the program is actually going to do.
To use your example, consider someone who knows a bit about the various options in x264 and is starting to use meGUI and is still a bit unsure. He first decides to use high profile and checks I8x8mv, but later on decides to switch to main profile and switches to that in the dropdown. As a result, several options become disabled, as they should. But wait! Even though I8x8mv is disabled, it's still checked! He knows that he can't use I8x8mv in main profile and it's not there in the commanline, but it's there in the GUI. Confusion! He knows the encoding is going to take several hours and he doesn't want to screw it up. The GUI is telling him one thing and the commandline another, which is right? TBH if that were me I'd switch back to high profile, uncheck I8x8 and then go back to main, just to be sure. But by then you've sown the seeds of doubt, and the user will start checking all the other options as well.
By making sure that the GUI state perfectly reflects what is actually going to happen we remove this confusion. When the user switches to main profile I8x8mv is unchecked (telling the user that the program isn't going to use it) and disabled (telling the user that he can't change that) - two different messages.
Sharktooth
8th January 2006, 19:18
Well.. actually turbo DOES NOT DO THAT, coz i patched it to behave as doom9 said.
Doom9
8th January 2006, 19:20
The problem I see is that the state of the GUI should exactly reflect the parameters that are going to be sent to the encoder. It used to be exactly like that. What you see is what you get. Then people came along asking why if they set an option and then switched from high profile to main profile (where it gets deactivated), it stays deactivated when they go to high profile again. That's where the whole tri-state thing comes from.
This is rather useful behavior when switching between things, but it does require the user to realize that deactivated means just that.. those options you can't edit, they are not active either.
Two-state is much easier to handle and there are less ways to screw up, but it's less convenient for those that know exactly what they're doing. Bottom line of tri-state as I have started it is deactivated = no influence on the outcome.
I've never read Microsoft's design guidelines.. I'm wondering if anybody has and know what a disabled control signifies.. if it should still have an influence no how the program reacts or not.
Sharktooth
8th January 2006, 19:21
A few notes regarding the x264 configuration redesign. Generally a good job but I have some issues: weighted b-prediction.. isn't that a b-frame option?
And is the number of reference frame really a quantizer option? I thought it was an ME option.
Last but not least, I can't shake the feeling that the misc options which have been put in the first tab should rather be somwhere less accessible.. they are rather esoteric imho. FourCC only applies to AVI anyway and the default is generally no problem (we should even consider dumping that option). The Number of threads can be auto-set which I tend to think should be done for everyone.. it reliably picks up HT and dual core processors. PSNR calculations is really not something joe average needs, and SAR is an option for experts anyway.
I think moving the misc groupbox away from the first tab would be doing more justice to the "keep only the most important options on tab1".. I see this generally implemented with what has been kept in the first tab.
Yeah, i will do that in the next updates.
Sharktooth
8th January 2006, 19:25
I've never read Microsoft's design guidelines.. I'm wondering if anybody has and know what a disabled control signifies.. if it should still have an influence no how the program reacts or not.
Exactly as Charleski said (a disabled checkbox that's checked has still a "checked" value but it cant be edited = forced). However we have different needs so we may stay away from the MS guidelines for a better usability.
Doom9
8th January 2006, 19:27
(a disabled checkbox that's checked has still a "checked" value but it cant be edited)Yeah, but what does that mean, is still has a checked value? Isn't a disabled control essentially not playing any role?
Sharktooth
8th January 2006, 19:29
It's a "forced on"/"forced off" option that has a checked/unchecked value (respectively).
However we dont' need forced options coz we have a dependancy rule: we require the "parent" option to be set to be able to select "child" options.
Sharktooth
8th January 2006, 20:34
CVS Update:
0.2.3.2002 8 Jan 2006
Some small design fixes in x264 configuration dialog
(Mostly groupboxes alignment)
godhead
9th January 2006, 05:00
Yeah, but what does that mean, is still has a checked value? Isn't a disabled control essentially not playing any role?
There's not a real design guideline for that, but I've seen the disabled property used both ways. Since we need to default values but not allow user edits, we actually use a 4-state control: on, off, disabled on, disabled off. The user should always be able to see the defaulted value even if they cannot edit it. The values should always be displayed to the user.
If this is a basic mode versus advanced mode problem, usually the visible property is used rather than disabled.
Just my view on it.
Doom9
9th January 2006, 09:13
Since we need to default values but not allow user edits, we actually use a 4-state control: on, off, disabled on, disabled off.Well.. disabled on and disabled off is the same thing in the current tri-state approach and everybody should stick to it when making any changes in that particular dialog.
Mutant_Fruit
9th January 2006, 13:15
I've been thinking about this problem, and i came up with this solution.
What we have at the moment is controls that are either Enabled and Checked, Enabled and Unchecked or lastly Disabled and unchecked.
What we need want is to "remember" previous states so that if an item is auto-disabled, we can restore its' previous state later.
What we can use is another method, which is called first before any GUI updates are processed when a dropdown is changed or a checkbox checked etc. This method will save the current settings as they are.
Then another one is run after the GUI updates are done. This second method takes another "snapshot" and compares what controls were disabled as compared to the previous snapshot. The second method then stores all the information relating to what controls were disabled in an array, along with the name of the control that caused the enabling/disabling to happen.
So array[0] might hold data like the following:
array[0][0]: MainProfileSelected
array[0][1]: Control1Disabled
array[0][2]: PreviousControl1Value
array[0][3]: Control2Disabled
array[0][4]: PreviousControl2Value
Then, what could be done is that the next time a control flicks, we run a scan through this array and see if we can find any element in the array with that controls name (i.e. we check position [0][0] to see if anything matches) and if we find a match, we "undo" the autochanges and restore the previous value.
Hopefully that makes sense to someone out there :p
EDIT: I'll implement it unless someone thinks it's a bad idea, or comes up with a better one.
EDIT2: There will have to be validation done to make sure that the values that are being restored fit with the current profile and suchlike.
Doom9
9th January 2006, 13:41
Why is this necessary? What's wrong with the "disabled = not used" approach? That works out just fine.. the only problems that creep up again is that somebody makes changes without going through the entire logic again to see if it still works out, or forgets that we have this kind of logic. Plus, anything has to survice the closing of the window (which the current tri-state does).. I really don't see keeping that mount of data someplace, it's a hassle and it blows up things beyond proportions.
Mutant_Fruit
9th January 2006, 13:59
Well, it'd be handy in some ways. For instance i'm selecting a load of options, and i accidently select one that disables 3 controls on a different page. When i reset the accidently changed control, i still have 3 controls which could have been previously set to certain values that are now definately not at those values anymore. I mightn't spot this. Being able to restore previous state would stop this.
Once the window is closed, the "restoration" data could be dropped safely. There'd be no point in persisting it beyond the life of the dialog.
I dunno whether its worth implementing or not, its just a few people seemed interested in having the previous state saved when controls got disabled/re-enabled so i thought this might be the best way to implement it if it were considared worth doing.
We're still using "disabled = not used", but with this we'd have the additional feature that if the control becomes reenabled, it gets restored to its previous value.
Doom9
9th January 2006, 14:15
When i reset the accidently changed control, i still have 3 controls which could have been previously set to certain values that are now definately not at those values anymore.That's not correct. Say you check turbo in 2 pass first pass. Then the ME, subq and nb reference settings become deactivated (if they do not, they should). In the commandline, subq goes to whatever is preset for turbo, me mode goes to dia and nb references goes to 1 (I think.. I don't have the code before me right now). The now disabled controls still show what you previously selected, so for instance subq6, me hex and 5 references. Now if you uncheck turbo again, those three controls become active again, the commandline shows -subq 6, -ref 5 as it should. So you have lost nothing at all.
And that's even preserved if you close the window. Since subq is still set to 6, and ref set to 5, and me to hex, once you close, then reopen, first the controls are all set to the values stored in x264Settings, then the final method call of the load method is "adjustSettings" or whatever the method is called that does this currently, and since turbo is set, the subq, me and nb_references controls are disabled, and the commandline once again contains -subq 1, -me dia and -ref 1. Come to think of it I've seen plenty of programs that behave the same way, and I, too, first didn't trust them to not make use of disabled but checked options.. but since we do have the commandline preview in MeGUI, that's not so much of a risk. the user clearly can see that a certain option is no longer contained in the commandline.
Perhaps it wasn't correct of my to equate disabled with not used, it can be used but set to a different setting that we control, as the example above shows.
Mutant_Fruit
9th January 2006, 14:25
Aye, but checkboxes (currently) don't keep their value.
For example (as said before), if i choose High profile, then enable all the macroblock options (such as adaptive DCT) and then i change to main profile and back to high profile, those boxes are no longer checked.
I'm not sure how many other checkboxes are affected by this kind of thing, so it mightn't be worth the effort to write the code to save their state, but it'd be possible if it was useful.
Doom9
9th January 2006, 14:43
For example (as said before), if i choose High profile, then enable all the macroblock options (such as adaptive DCT) and then i change to main profile and back to high profile, those boxes are no longer checked.Then who the heck broke that? It all worked nicely when I released my last build. So in the meantime somebody broke the functionality and all the confusion stems from that.
So let me say it once and for all: for the x264 configuration dialog, if an option is not to be accessible, it keeps its current value, but it's disabled. The rest is done in the x264TristateAdjustment method in the CommandlineGenerator class. It's rather frustrating for me to having spent hours to get this darned thing working only to have it broken again by somebody else :(
Sharktooth
9th January 2006, 16:07
i think the behaviour was modified when the whole tri-state was rewritten.
i've a local copy of the old method. i can restore it in few minutes (i'll do it tonight).
godhead
9th January 2006, 17:12
berrinam, go ahead and put me down for the following, since I already know the MP4 muxer and commandlinegenerator code from my work on track names.
Add support for the -sbr or -sbrx tags in mp4box commandline
Description: Add a checkbox in MeGUI MP4 Muxer which says something like "AAC is SBR", so that the audio information is correctly stored in MP4
Status : No-one is working on it
Doom9
9th January 2006, 17:31
Add support for the -sbr or -sbrx tags in mp4box commandlinePlease do not forget that this involves the automatic setting of that checkbox in auto-mode / one click mode when audio is being encoded to aac. That makes it a bit less than trivial ;)
Richard Berg
9th January 2006, 18:04
Isn't a disabled control essentially not playing any role?
No. A control that's disabled but checked means "I'm enabled and there's nothing you can do about it." The most common example of this state comes from installers. Typically you can check or uncheck optional components, but components required to make the program work will be checked-and-disabled.
stax76
9th January 2006, 18:20
No. A control that's disabled but checked means "I'm enabled and there's nothing you can do about it." The most common example of this state comes from installers. Typically you can check or uncheck optional components, but components required to make the program work will be checked-and-disabled.
You are both right, it depends on the case e.g. is it a child etc., a disabled control can also mean it has no relevance.
berrinam
9th January 2006, 20:54
Please do not forget that this involves the automatic setting of that checkbox in auto-mode / one click mode when audio is being encoded to aac. That makes it a bit less than trivial ;)
Actually, it turns out this isn't necessary. As far as I can see, all aac encoding by MeGUI is put straight into the mp4 container, and -sbr signalling isn't required with mp4 input, because the info is already there. This option is only really useful for people who are using externally encoded aac files.
Doom9
9th January 2006, 21:18
This option is only really useful for people who are using externally encoded aac files.Hmm, you're right. But it's something to be kept in mind if the winamp aac encoder is ever to be supported.
godhead
10th January 2006, 00:06
Please do not forget that this involves the automatic setting of that checkbox in auto-mode / one click mode when audio is being encoded to aac. That makes it a bit less than trivial ;)
Noted.
Richard Berg
10th January 2006, 02:30
What's the best way to generate a patch so it's easier for you to accept submissions?
berrinam
10th January 2006, 06:11
Noted.
godhead, it's not necessary to do that. See my post just below Doom9's.
dimzon
10th January 2006, 13:04
@all dev's
Hi!
I was @ new year vacation and I spend this time with my family mostly far from PC. But I found time to take closer look @ MeGUI sources. And I'm frustrating now!
I found some amount of non-optimal code architecture, including annoyng copy/paste programming paradigm... It's a really not good!
I really don't understand some decisions in it!
Take look @ audio-related staff. Why all configuration forms are created by copy/paste metodology? Hey, forms is objects and you can still use inheritance/poliphormysm with it! I really don't understand why does You use ugly ENUM<->Int casting, why not just use enums?
In other case I don't understand unnecesarry using of "Property Paradigm":
int someProperty;
public int SomeProperty
{
get{return someProperty;}
set{somePropert=value;}
}
why not use just fields to decrease code size:
public int SomeProperty;
(don't forget - You can switch from field to property @ first request in 1 minute!)
I believe we must stop implementing any additional features until full code review and refactoring!
Doom9
10th January 2006, 13:21
1) Forms: Please feel free to lay down a good foundation for GUI inheritance.. I only have limited experience with it, hence I implemented them all as separate forms but I do agree that it would make more sense and be easier to maintain to have basis forms and forms that derive from it. The same obviously also goes for the video config, muxer and settings forms. So when you start working at the audio, please do lay the groundwork for a major improvement in this area.
2) enums <-> ints... once again plain ugly and my fault.. I'm just not sure if you can bind enums to dropdowns.. I guess that's why I started with ints, then figured for code maintainability it would be better if the names of the options were spelled out, hence the enums. You'll see that in more recent codes, there are no such conversions anymore and I'm using the enums directly, as it should be. Once again, if you start working on the audio, please feel free to change that.
3) There however I have to disagree with you. Variables should not be declared public. In Java we have setters and getters to change/get variables, in .NET we have properties. In VS2k5 you can easily define your private variable, then using the refactoring functionality turn this into a property with about two clicks (I don't recall the exact procedure.. it's been a while since I watched that "what's new" video). And in both Java classes at university as well as coding practices for C# they tell you that accessing variables directly is bad style of programming. For most variables, you don't need any accessors because they are only used within the class where they are declared, but those that are to be accessed externally should use properties.
berrinam
10th January 2006, 13:21
I believe we must stop implementing any additional features until full code review and refactoring!
Although I agree with you, and it certainly would be nice to see the code more organised, this would mean a complete halt to development for a considerable time period. Could this code clean-up not be done gradually?
dimzon
10th January 2006, 13:36
3) There however I have to disagree with you. Variables should not be declared public. In Java we have setters and getters to change/get variables, in .NET we have properties. In VS2k5 you can easily define your private variable, then using the refactoring functionality turn this into a property with about two clicks (I don't recall the exact procedure.. it's been a while since I watched that "what's new" video). And in both Java classes at university as well as coding practices for C# they tell you that accessing variables directly is bad style of programming. For most variables, you don't need any accessors because they are only used within the class where they are declared, but those that are to be accessed externally should use properties.
C# is not Java. "Property Paradigm" is good for java @ early development stage - if you decide to add some logic @ properties later you does not need to replace direct field access by getter/setter call. But in C# it looks same:
obj.SomeFileld = value;
obj.SomeProperty = value;
So you can easy convert public field to property without massive codechange.
Until you does not expose your objects from MeGUI it's safe to use public fields instead of primitive public properties!
dimzon
10th January 2006, 14:12
this would mean a complete halt to development for a considerable time period
Definitly YES! Code structure will be significally changed during cleanup/refactoring. It's impossible to do such massive changes without halting development... I'm afraid everything must be altered and, maybe, backward compatiblity (saved jobs and profiles) will be broken...
Now let's discuss about MeGUI architecture.
I'm strongly prefer to keep main MeGUI architecture as simple as possible. As fact megui is job-based sofware so Job && JobList && JobExecutor is main GUI-less abstract classes. Another abstract classes would be JobProvider - some component wich provide some GUI for concrete job creation, tuning and tweaking and JoblessUtility - some additional visual staff (like bitrate calculator etc.)
AudioJobProvider/VideoJobProvider/MuxJobProvider implementations itself can contain multiple configureable and extensible components (pattern Facade)...
MeGUI must provide JobList management functionality and act as a host for multiple JobProviders and JoblessUtilities. It must provide additional bridge between JobProvider and JoblessUtility (for AviSynth script creation or bitrate calculator).
Doom9
10th January 2006, 17:11
Actually, you can use properties as full blown methods... the StatusUpdate contains a few examples, and there are some in other classes as well. For consistency purposes and design, every variable that needs to be available publicly should be wrapped in a property. Anything internal can stay a simple variable. This has a lot of advantages. Even inside the same project, with properties come nice descriptions that show up when using the commandline completion.. so even somebody not quite familiar with a class will be able to use those properties, whereas the use of the internal variables actually requires the study of the source.
JoblessUtility - some additional visual staff (like bitrate calculator etc.)You're getting a bit overboard here.. it's like you're trying to wrap in a job what isn't one.. I don't think that's a good idea, in fact that makes the whole thing appear stiff and artificial.
Another abstract classes would be JobProvider - some component wich provide some GUI for concrete job creation, tuning and tweaking andThat sounds nice an all and corresponds what I'm currently doing with the video encoding part (an incremental upgrade for the whole project though, first swap out just one part, then the next one, etc), but here's the problem with your approach: There's a great amount of interdependency between a VideoJobProvider and an AudioJobProvider or MuxJobProvider. For instance, if you're using x264 and mencoder and mp4 output, you don't get a single video job, or two or three, but another one that's a muxjob. Things get even more complex when you look at the auto-encoding section, which outputs video, audio and muxjobs at the same time. And then we have the one click mode.. which outputs all kinds of jobs at the same time (well.. almost). Then there's all the job postprocessing after a job.. where does that go? The Main GUI is much more than a VideoJobProvider and AudioJobProvider (and since there's no multiple inheritance in .NET, this already doesn't work and we have to move to interfaces).
I have already done a major refactoring once, redesigned a lot of the classes, and while in the end it's all nicer, it meant a really long time without even so much as a bugfix. Considering how MeGUI has grown, I don't think that's such a good idea. An incremental update, as I have begun to outline, where different parts of the entire project are marked off "under construction" and will be modified while the rest of the program continues to live, is a much more practicable approach.. it also lowers the pressure in having to get things done the right way right now as it will not be possible to make any big changes in the near future.
We can certainly implement many of your suggestions (e.g. JobExecutor, although the name is horrible, the concept is good, same for JobList), but I think it would be better to hammer out the details and do the whole thing in small steps so as to not break everything at once and then having to deal with hundreds of not thousands of compilation errors when trying to put it together, and then the millions of smallish bugs that will have crept in.
Sharktooth
10th January 2006, 17:25
i think the behaviour was modified when the whole tri-state was rewritten.
i've a local copy of the old method. i can restore it in few minutes (i'll do it tonight).
Done and CVS updated:
0.2.3.2003 10 Jan 2006
Restored x264 tri-state the way it was before the whole tri-state was rewritten to a single method (that implies grayed out controls means also they're disabled in the commandline)
However please do some testing and verify EVERY grayed out control is disabled in commandline :)
Doom9
10th January 2006, 17:28
Restored x264 tri-state the way it was before the whole tri-state was rewritten to a single method I really wonder what the rewrite contained then? It was meant to just mean the grouping of all this logic in one single method, but apparently somebody completely switched the way things were handled back to the two-state era.
Sharktooth
10th January 2006, 17:30
Dont remember who did it, but if you check the changelog it should be there (i think berrinam or charleski)
Also, x264 rev398 has a new switch "--nr <int>" (noise reduction, default value is 0).
dimzon
10th January 2006, 18:10
@Doom9
Ok, I understand You, lets continue architecture discussion.
1-st let's decide what kind of service must MeGUI provide for JobProvider. IMHO:
Centralized API for profiles/settings persistance
Centralized API for JobList navigation (to enum current jobs for dependant jobs )
let's decide what kind of information must Job provide. IMHO:
DependsOn - list of jobs to be complete before currenct job can execute
UniqueID - some unique id (maybe GUID?) for manajement puposes
Some virtual method or property set to fill JobList ListView item
Executor - method or property to obtain JobExecutor for current job
OutputFileNames - method or property to obtain list of output files
That sounds nice an all and corresponds what I'm currently doing with the video encoding part (an incremental upgrade for the whole project though, first swap out just one part, then the next one, etc), but here's the problem with your approach: There's a great amount of interdependency between a VideoJobProvider and an AudioJobProvider or MuxJobProvider. For instance, if you're using x264 and mencoder and mp4 output, you don't get a single video job, or two or three, but another one that's a muxjob. Things get even more complex when you look at the auto-encoding section, which outputs video, audio and muxjobs at the same time. And then we have the one click mode.. which outputs all kinds of jobs at the same time (well.. almost). Then there's all the job postprocessing after a job.. where does that go? The Main GUI is much more than a VideoJobProvider and AudioJobProvider (and since there's no multiple inheritance in .NET, this already doesn't work and we have to move to interfaces).
Ok, seems like abstract JobProvider is a really wrong idea... In other side we does not need polyphormism for Audio/Video job providers - all what we really need is ployphormism for JobExecutors. There will be such JobExecutors (i really don't know nothing about index/mux job yet - just only audio/video jobs)
generic command line audio encoder (fit 99.9% of audio encoding)
Nero AAC audio encoder (to eluminate standalone executable)
x264 encoder
xvidEncoder
generic Mencoder video encoder
generic ffmpeg video encoder
You're getting a bit overboard here.. it's like you're trying to wrap in a job what isn't one.. I don't think that's a good idea, in fact that makes the whole thing appear stiff and artificial.
No. I'm just thinking about some set of usefull utilities to be hosted @ MeGUI - there are a lot of small usefull tools we can integrate into MeGUI - like FourCC changer, AviSynth script creator/editor, tagger etc...
dimzon
10th January 2006, 18:15
Yet another question:
Does we really need Load/Update functionality @ JobList? How often does You use it?
dimzon
10th January 2006, 18:21
Some ideas about "one click mode"
I think a really reason for "one click mode" is because you can't create mux job for non-existing file in current implementation. Job.OutputFileNames main pupose is to provide list of "expected files" and JobProvider can enumerate pending jobs in JobList and refer to job output and add this job to DependsOn list :)
Doom9
10th January 2006, 18:44
No. I'm just thinking about some set of usefull utilities to be hosted @ MeGUI - there are a lot of small usefull tools we can integrate into MeGUI - like FourCC changer, AviSynth script creator/editor, tagger etc...But those are completely separate. The now partially integrated parts like the dgindex creator, or the avisynth script creator.. those were once completely separate utilities, and as it is today, most of their logic has been moved to common classes JobUtil and VideoUtil.. so the processing has been largely abstracted from the presentation classes. But there are other utils that are completely independent.. like the bitrate calculator, the quantizer matrix editor. And there are those that are multi-purpose, like the muxer.. it's used in different parts (manual, or auto-encode mode) and has different functionality (in part) in both modes.
let's decide what kind of information must Job provide. IMHO:The Job is one of the things that I think is rather well designed in fact.. it went through a complete redesign from the first version. The properties a job currently has are rather necessary I think. Clearly a job should have a name, should it not? And it needs a status (I see no sense storing that info someplace else), and I could go on about the other properties it has. The only debateable properties imho are position (I found this to be the most convenient way to restore the queue as it was prior to exiting.. you have to store that info someplace) and the commandline (it could be inferred.. and not every kind of job type imaginable in the future might have one. Inferring also has the advantage that all settings changes will certainly be picked up, some regeneration code in other classes can be eliminated, and finally you no longer have the problem where you move an application and the job still points to the old location).
DependsOn - list of jobs to be complete before currenct job can executeFirst off, the list is not necessary imho... it can be inferred.. a link to the one job that has to complete previous to the current one is enough, considering that the previous job will also have a link to the previous job, etc. Furthermore, I'm not so sure it's a good idea to be that strict. As it is now, you have the possibility to remove parts of a series of jobs.. processing is still possible.. those that know what they're doing can safely remove certain jobs without doing harm, so I don't consider it a "job X must have completed before this one" as a criteria that always has to be enforced no matter what.
UniqueID - some unique id (maybe GUID?) for manajement puposesWe already have that with the name.. it's always unique.
Some virtual method or property set to fill JobList ListView itemWhy would a non GUI class fill something in a GUI class? Wouldn't it be more reasonable to have the GUI class request certain information from the non GUI class for display purposes? After all we're trying to separate GUI and non GUI, so the Job should not be aware that there's such a thing as a GUI.
Executor - method or property to obtain JobExecutor for current jobOnce again, why should the job be aware of that? Shouldn't the JobExecutor be able to determine how and where a job should be executed? I see the Job as a dumb class.. it contains certain properties, other classes know what to do with it. For now, you can consider the class MeGUI to be the JobExecutor.. it gets the jobs from the JobList (so to speak.. it's a hashtable), looks at what kind of a job it is, then from that finds the proper JobExecutor (class derived from Encoder). That means that there is someone with the knowledge what to do with a certain kind of job, but I don't see that as a problem. You're perhaps thinking of a fully plug and play architecture but I'm scared of such a thing.. the rigorous constraints such an architecture requires, and the fact that it's highly unlikely MeGUI is going to be used for a lot of things we cannot think of right now (it has a clearly defined purpose.. we'll never use it to handle Email and the likes) is still somewhat slim. It's not like BeHappy where everyone can plug in a new encoder.. I actually want to be in charge of what features will be available from MeGUI and I never want to end up in a situation where somebody reports a bug or a problem that is caused by an external component. Think of the implications if somebody were to add an Ogg encoder for the whole process.. you gotta think encoder output, container and muxing... Perhaps it would be an interesting experiment to create something like that, but definitely only for the far future. Right now I rather have something that works just fine and does what I want it to, not what somebody else wants it to.
OutputFileNames - method or property to obtain list of output filesTwo comments here: Jobs currently have one output filename, and I don't see that changing. Second, it is possible that there can be multiple output files (in case of a dgindex job), but those are only known after processing... so then you'd have the paradox situation that when the whole thing goes into a processing class.. it has one output file, and when it comes back it suddenly has 5?
here will be such JobExecutors (i really don't know nothing about index/mux job yet - just only audio/video jobs)I already started with that.. I think you missed my notes on it. Currently, I have an interface IVideoEncoder, having 6 methods and an event:
setup, start, stop, pause, resume, changePriority and an even that returns a StatusUpdate object. There's the VideoEncoder that implements this interface, and which will pick the proper encoder once setup with the VideoJob has been called, a derived class CommandlineVideoEncoder which is a template for a generic commandline video encoder and offers methods to read from stdout and stderr and send the read lines somewhere, and finally the XviDEncrawVideoEncoder, which handles xvid_encraw.exe. Once I'm through with that, there's going to be another derived class from CommandlineVideoEncoder called x264Encoder or something like it, which implements the particularities of x264.exe, and another one for mencoder.exe.
Then if at some point somebody wants to add an encoder that makes direct use of an API, he can write a class derived from VideoEncoder, and thus the class will have to provide all the generic methods that encoding really needs.
A similar approach can be adopted for audio encoding and muxing. Perhaps the IVideoEncoder could be more generalized to a IJobProcessor or whatnot.. at the moment I'll be just happy if the whole video part runs as expected.. and if I have to redo parts for the most generic approach, so be it.. it's a learning experience as well after all.
Doom9
10th January 2006, 18:51
Does we really need Load/Update functionality @ JobList? How often does You use it?Yes, we need that.. it's a feature I make use of quite often.. it's a feature that is sorely missing from many other tools. I've often wished I could make changes to queues in other softwares, so I designed MeGUI to offer the missing functionality.
I think a really reason for "one click mode" is because you can't create mux job for non-existing file in current implementation. Job.OutputFileNames main pupose is to provide list of "expected files" and JobProvider can enumerate pending jobs in JobList and refer to job output and add this job to DependsOn listDid you really look through everything that goes on there? You cannot predict what output you may get from an indexing job.. You could for instance demux every audio track, demux no audio track, then there can be different audio types. There's a reason why an IndexJob has so many variables.. I wouldn't even dare think of changing anything in that department until you have stepped through the whole process, from the GUI coming up, to the end of postprocessing of an Index job created from one click mode in the debugger to see the whole scope of that process.. it's extremely extensive. The reason why only one job is created is twofold: 1) you don't know what audio files you're going to get, and 2) the whole "after index job" job creation requires that the input file be known.. since we do not know what audio we're going to get, it's not possible to create an audio job that then can be encoded (and I think it would be a very bad idea to create jobs that you cannot actually process because of missing input files), and the video job creation depends on the availability and possibility to open the script.. there's no video job that has not been opened.. that ensures that no matter what, our script can be processed.. and it's as far as we can go.. the rest is up to the actual encoder.
dimzon
10th January 2006, 19:29
Clearly a job should have a name, should it not?
...
We already have that with the name.. it's always unique.
job1, job2 - very informative, is'nt it? In other case we can provide user ability to set some additional label/name for a Job - it will be much more usable and informative...
And it needs a status (I see no sense storing that info someplace else)
Oh sorry, I just forget it!
The only debateable properties imho are position (I found this to be the most convenient way to restore the queue as it was prior to exiting..
Why not save joblist @ single file (and persist all jobs in right order)
and finally you no longer have the problem where you move an application and the job still points to the old location
why does you store full path to encoder? why not just save encoder name and get full path from configuration every time when job starts?
First off, the list is not necessary imho... it can be inferred.. a link to the one job that has to complete previous to the current one is enough, considering that the previous job will also have a link to the previous job, etc.
I like such mode much more... It's much more flexible... You can create 2 audio encoding job (to mp3 and to aac) and 2 videojob(to xvid and to x264) and create multiple mux job (to mp4 to avi to mkv)
Why would a non GUI class fill something in a GUI class? Wouldn't it be more reasonable to have the GUI class request certain information from the non GUI class for display purposes? After all we're trying to separate GUI and non GUI, so the Job should not be aware that there's such a thing as a GUI.
No, but it must provide data to fill. Something like ToString() but a little more complex...
Once again, why should the job be aware of that? Shouldn't the JobExecutor be able to determine how and where a job should be executed?
I believe it must and it alredy do! Take look @ you own VideoEncoder. It contains mencoder commandline, isn't it? Proposed Executor is flexible polymorphic replacement for it!
For now, you can consider the class MeGUI to be the JobExecutor...
Yes, and I don't like it! It contains a tons of ugly code like
if(job is AudioJob)
{
// bla-bla-bla
}
this is a realy fine place to use polyphormism instead of such code!
Two comments here: Jobs currently have one output filename, and I don't see that changing. Second, it is possible that there can be multiple output files (in case of a dgindex job), but those are only known after processing... so then you'd have the paradox situation that when the whole thing goes into a processing class.. it has one output file, and when it comes back it suddenly has 5?
1) Split 5.1 audio to six mono waves - just a sample!
2) It's possible to convert DGIndex into DLL with a rich API and wrap it into MeGUI :)
I already started with that.. I think you missed my notes on it. Currently, I have an interface IVideoEncoder, having 6 methods and an event:
setup, start, stop, pause, resume, changePriority and an even that returns a StatusUpdate object.
Yes, I know it, its fine... All what i want to do - use same interface for every encoder (audio/video/etc) - to avoid if(xx is TypeName) constructions in MeGUI...
Did you really look through everything that goes on there? You cannot predict what output you may get from an indexing job.. You could for instance demux every audio track, demux no audio track, then there can be different audio types.
Ok, I understand You! I really don't read OneClickMode code...
Yes, we need that.. it's a feature I make use of quite often...
Ok, let's keep this functionality...
You're perhaps thinking of a fully plug and play architecture
I'm thinking about partially plug and play architecture! Really, why not to be able to add another AAC encoder implementation? Or another AVC/ASP encoder? Or new source audio format via aviSynth plugin? It's easy!
Sharktooth
10th January 2006, 19:58
CVS Update:
0.2.3.2004 10 Jan 2006
Added --nr (noise reduction) x264 option support.
(even in tooltips)
Doom9
10th January 2006, 20:01
Really, why not to be able to add another AAC encoder implementation? Or another AVC/ASP encoder? Or new source audio format via aviSynth plugin? It's easy!Because it breaks things. Every encoder I add, I have to take care of all possible consequences. Let me give you an example: if I could just plug in any video encoder, I could add my xvidencrawvideoencoder. However, that encoder can only output raw files... MeGUI is painfully obvlivious of that and will offer mkv/mp4/avi output.. while the output files may just be named like that, they are indeed renamed raw files. S by making sure I get to see every encoder and write the full workflow for it, I can ensure that people can only try to do what makes sense. Asking for avi from xvid_encraw makes no sense.
Similarly, adding support for Winamp aac encoder actually means you need to sit down and think about the consequences first. That encoder gives raw aac files rather than MP4. That has an effect on something completely unrelated: bitrate calculations. Add Ogg Vorbis.. affects container selection and bitrate calculation. The list is long. It would be like supporting arbitrary input types in BeHappy.. you need to know the properties of the input stream so that you can create the proper AviSynth script. If I give you a format that you cannot handle, you have to refuse further processing, don't you? Same applies to MeGUI, except here the encoder output is also limited because there can be further processing.
1) Split 5.1 audio to six mono waves - just a sample!That's never going to be a functionality for MeGUI.
2) It's possible to convert DGIndex into DLL with a rich API and wrap it into MeGUIThat still doesn't solve the issue about getting multiple, and at the point of the start of the process yet unknown output files. And I don't see the point of doing that.. the way it's done now works just fine.
Yes, and I don't like it! It contains a tons of ugly code likePlease do show a better way (and by that I mean a set of classes ready to go.. they may only have dummy functionality but I want to see everything.. from the job to whomever processes the job, and there must be different jobtypes and different processory). If you have a job, at some point you have to pick if you're going to use the AudioEncoder, VideoEncoder or Muxer to do the processing, even though they all implement the same commands.
I believe it must and it alredy do! Take look @ you own VideoEncoder. You are mistaken. In fact, you could create an x264 job with a mencoder commandline, then if you change the x264 encoder to x264.exe in the settings, then try to start it.. it will try to send that job to the x264.exe commandline encoder ;) A Job doesn't know how it's going to be processed.. that's the job of other classes to find out and do the right thing with it. If I'll go back to creating the commandline just before job generation, it will in fact then be possible to create a mencoder x264 job, then change the encoder to x264, then start encoding, and encoding will be done by x264.exe. This is currently not possible (right now encoding would fail with a message that the commandline doesn't start with x264.exe) but that's the direction in which I'm heading. This also means a video job has to contain the output type, so that in case somebody does that change, changes an avi output mencoder job to an x264.exe job.. I can tell the user that x264 doesn't write AVIs.
No, but it must provide data to fill. Something like ToString() but a little more complex...And it does.. they're called properties. The GUI has to decide which date it wants to show.
job1, job2 - very informative, is'nt it? If you look at the queue, you have the codec type, and a lot more information about input/output/state/etc.. so yet, it's very informative. There's no way I'll ever allow people to edit jobnames on their own .
Sharktooth
10th January 2006, 21:13
CVS update:
0.2.3.2005 10 Jan 2006
Misc. x264 config dialog reworking
berrinam
10th January 2006, 21:23
From my testing with my interlace detection algorithm, I think I am ready to put it into MeGUI. However, I'm not sure how to treat it (ie as a Job, or something that just runs without a job). Here's a description of what happens when doing the analysis:
you press go. It analyses about 1% of the video by generating an AviSynth script and passing through that using the AVIFile wrapper, so that no external applications are used. If the source is interlaced/film, it runs through the file again to check field order.
As it is only analysing 1% of the file, it should be quite quick. Does this warrant a queued job, especially considering that if you use it in the AviSynth Creation Window, you won't want to close the window for the job to run? (I clearly think it doesn't but the same happened originally with DGIndex, so I want to try to get it right the first time).
Also, what sort of integration into MeGUI is wanted with this? I was thinking OneClick mode (obviously) would do this automatically, for better script generation, and AviSynth Window. In the OneClick mode it would be transparent to the user except for a checkbox: 'Automatic deinterlacing'. For the AviSynth window, it would have a button which says 'Analyse file...'. It would then analyse the video, tell the user the source type, and adjust the deinterlace filter combobox according to which filters are appropriate, and select the recommended one.
What do you think?
Also, about the 'Minimize to Tray' feature request: You say 'not a button'. I implemented this a little while ago with a menu item in the view menu, because I couldn't think of anywhere else to put it. Is this good enough?
Sharktooth
10th January 2006, 21:30
Use the [X] to minimize to tray... and File -> Exit to exit MeGUI.
Doom9
10th January 2006, 21:48
Also, what sort of integration into MeGUI is wanted with this? I was thinking OneClick mode (obviously) would do this automatically, for better script generationDefinitely. And the code has to be placed in the index job postprocessing routine.
AviSynth Window. In the OneClick mode it would be transparent to the user except for a checkbox: 'Automatic deinterlacing'. For the AviSynth window, it would have a button which says 'Analyse file...'. It would then analyse the video, tell the user the source type, and adjust the deinterlace filter combobox according to which filters are appropriate, and select the recommended one.sounds good as well.
Is this good enough?I think so. Some people prefer using the minimize box, but it's not the normal behavior of an app so I think using that menu will do just fine.
Use the [X] to minimize to tray... and File -> Exit to exit MeGUI.I don't agree. standard behavior of X is to exit.. I personally don't want MeGUI to go to the tray when I press X (or _ for that matter).. but being able to specifically tell it to go there, that might be useful. Of course, we need a small logo that shows up in the tray then.
berrinam
10th January 2006, 22:00
I don't agree. standard behavior of X is to exit.. I personally don't want MeGUI to go to the tray when I press X (or _ for that matter).. but being able to specifically tell it to go there, that might be useful. Of course, we need a small logo that shows up in the tray then.
The App.ico?
Doom9
10th January 2006, 22:12
The App.ico?No, app.ico is the big icon, the one you get when you put the app in the desktop. I'm talking about one of the size of that small icon you get in the upper left corner of an application. The icon in the tray has the same size (14x14 or 16x16 or something like that)
berrinam
10th January 2006, 22:27
Ah well, I'm using that icon for the moment, and it works fine. If someone wants to come along and design a better icon, feel free to, but it's not me.
berrinam
10th January 2006, 22:29
CVS Update:
0.2.3.2006 10 Jan 2006
Fix a crash in OneClick mode caused by audio stream's name not being set.
Fix a crash in OneClick mode when it detects too many files as DGIndex's output (made it's detection of these files more selective)
Load Defaults Button
Relocate the profile box in the individual codec configuration windows so it is accessible from all tabs
berrinam
10th January 2006, 22:39
CVS Update:
0.2.3.2007 10 Jan 2006
Add Minimize To Tray menu item
Fix the Load DLL bug
Fix the IVTC checkbox bug
Richard Berg
10th January 2006, 23:23
AutoEncode is broken in the most recent build. Select an AVS file, a WAV file, AutoEncode, accept the default option: null ref.
System.NullReferenceException: Object reference not set to an instance of an object.
at MeGUI.CommandLineGenerator.generateMP4BoxCommandline(String mp4BoxPath, MuxSettings settings, String input, String output)
at MeGUI.JobUtil.generateMuxJob(VideoJob vjob, SubStream[] audioStreams, SubStream[] subtitleStreams, String chapterFile, MUXTYPE type, String output)
at MeGUI.VideoUtil.generateJobSeries(String videoInput, String videoOutput, String muxedOutput, VideoCodecSettings videoSettings, AudioStream[] aStreams, SubStream[] audio, SubStream[] subtitles, String chapters, Int64 desiredSize, Int32 splitSize, Double containerOverhead, MUXTYPE muxtype)
at MeGUI.AutoEncodeWindow.queueButton_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I can't look at GPL code while at work, obviously, so can't investigate yet...
berrinam
10th January 2006, 23:53
CVS Update:
0.2.3.2008 10 Jan 2006
Update Minimize to Tray to work with conditional compiling
update compile.bat to work with .NET 2.0.50727. This only works if you have that exact version, so, hopefully, someone can find a better way to do this.
Mutant_Fruit
11th January 2006, 00:03
Just while on discussion of restructuring MeGUI. What do people think about moving all class definitions and related setters/getters to either seperate c# files or all in one c# file.
Its just if i wanted to make a change to the class, or several classes i can go to that class's c# file and make the change there without having to try and find where the getters and setters are in each dialog.
Thats just personal preferance really, but i think it makes code a bit easier to work with.
Doom9
11th January 2006, 01:02
@Mutant_Fruit: I don't understand what you want to do. Could you elaborate, perhaps with examples?
@everyone: I've run into a wall with the encoder reconstruction. the CommandlineVideoEncoder class used to implement the IVideoEncoder interface and I connected to it directly to the main form.. that worked as it should. Now that I changed all encoders to use that pattern, my VideoEncoder implements the interface instead.
Anyway, in the main class, I set the callback for status updates as follows.
vEnc.StatusUpdate += new VideoEncodingStatusUpdateCallback(enc_StatusUpdate);
Then when it's time to fire the event from the VideoEncoder class,
StatusUpdate(su); (line 61 in VideoEncoder.cs), StatusUpdate is null.
I might just be too tired, but right now I just don't see what I'm doing wrong. Compilable source code can be found here: http://forum.doom9.org/MeGUI-src.CVS.rar
Keep in mind, it's untested.. I just need this event routing to work to start testing properly.. and then there's all the fun in preventing all the use cases that don't work because encraw only supports raw output.
Richard Berg
11th January 2006, 01:04
If I were to suggest a "big" architectural change, it would be to eliminate all of the conditional compilation. Even if a user is only interested in the x264 or Snow features, it's not like the full MeGUI is more difficult to use than the special versions. Meanwhile the extra bugs, developer time, and (necessary but lacking) testing that come from separate versions affects everybody.
berrinam
11th January 2006, 05:36
CVS Update:
0.2.3.2009 10 Jan 2006
Fixed the AutoEncode crash caused by AudioStream.name being null
@Richard Berg: I agree with you. Doom9 also said something similar a while ago.
berrinam
11th January 2006, 07:13
@Doom9: Found the problem. Basically, you are setting the StatusUpdate value for the VideoEncoder vEnc with this line:vEnc.StatusUpdate += new VideoEncodingStatusUpdateCallback(enc_StatusUpdate);
However, when you call vEnc.start: (Form1.cs, line 3938)
if (vEnc.start(out error)) this goes on to the VideoEncoder.start(string) function (VideoEncoder.cs, line 100), which passes the start request onto its member called encoder with the line:(VideoEncoder.cs, line 103)
return encoder.start(out error); The point is this: the VideoEncoder called encoder sets itself up to call its own StatusUpdate function, which has not yet been set, because the StatusUpdate was set for vEnc. As it is, I'm not quite sure how your system is set up (ie, why does VideoEncoder have a VideoEncoder member variable?), so I haven't posted a fix, but I hope what I said helps you solve it.
@edit: Actually, a solution which avoids the bug is to turn StatusUpdate into a property, by replacing its declaration with the following code:
private event VideoEncodingStatusUpdateCallback statusUpdate;
public event VideoEncodingStatusUpdateCallback StatusUpdate
{
add
{
encoder.statusUpdate += value;
}
remove
{
encoder.statusUpdate -= value;
}
} and changing protected void sendStatusUpdateToGUI(StatusUpdate su)
{
StatusUpdate(su);
} to protected void sendStatusUpdateToGUI(StatusUpdate su)
{
statusUpdate(su);
} (the difference is in the capitalisation, making it access the variable directly as opposed to through the property) That seems to fix it.
kopavel
11th January 2006, 08:52
that's is normal if in 2-nd and 3-s pases in MeGUI we have parameters
--pass 3 in both comand strings?
But only in 3-pass section.
In 2-pass section there is --pass 2 (in 2-nd pass)
godhead
11th January 2006, 08:56
3) There however I have to disagree with you. Variables should not be declared public. In Java we have setters and getters to change/get variables, in .NET we have properties. In VS2k5 you can easily define your private variable, then using the refactoring functionality turn this into a property with about two clicks (I don't recall the exact procedure.. it's been a while since I watched that "what's new" video). And in both Java classes at university as well as coding practices for C# they tell you that accessing variables directly is bad style of programming. For most variables, you don't need any accessors because they are only used within the class where they are declared, but those that are to be accessed externally should use properties.
Another way to quickly create your private variable and property in VS2K5 is to use the keyboard shortcut, type "prop" and press tab and it will stub out a private variable and property for you.
I've only breifly looked over the code needed to make the changes that I've taken on, so my exposure has been the MuxSettings and CommandLineGenerator. I do feel there is some clean up that can be done but I didn't want to "rock the boat" during my first patch :)
I would like to change the CommandLineGenerator to use a StringBuilder, as it will probably be a bit easier to read. There's just so much string concatenation going on during the creation of the command line that it can get a bit confusing. I've always used the rule that if you're concating a string more than 4 times, it's probably best to move it to a StringBuilder.
If no one disagrees, I'll have this change completed tomorrow.
godhead
11th January 2006, 09:02
CVS Update:
0.2.3.2006 10 Jan 2006
Fix a crash in OneClick mode caused by audio stream's name not being set.
Fix a crash in OneClick mode when it detects too many files as DGIndex's output (made it's detection of these files more selective)
Load Defaults Button
Relocate the profile box in the individual codec configuration windows so it is accessible from all tabs
Did I miss something on the One-Click mode? Sorry about that, I'll take a look at the changes you made with a DIFF and make sure the same problem doesn't occur again when I add the subtitle names.
godhead
11th January 2006, 09:08
Sorry that I just caught up, but I'd like to suggest that if a redesign is going to occur that it be done in a branch of the code.
I think maybe Doom9 and dimzon (whoever else that wants to help here) should work out their redesign and stub out the architecture. Once the foundation has been designed, the rest of the developers can work on the actual implimentation.
This would allow the rest fo the developer's to continue with bug fixes and feature requests of the current code branch. The new requests that are implimented in this old branch become new requirements for the new branch.
I just wanted to make sure if a redesign does occur, we can continue supporting the existing users.
Doom9
11th January 2006, 09:27
I'm definitely going to remove the snow conditional compilation.. not sure about x264 yet. Since I'm implementing encraw support (no AVI output), I also have to rethink certain muxing mechanisms, so perhaps the dual video encoder thing for the same codec will also disappear, thus further uncluttering the code.
(ie, why does VideoEncoder have a VideoEncoder member variable?)It's a derived class actually... encoder will always be a subclass of VideoEncoder, but in order to use inheritance in the easiest way (no casting, no switches or ifs to call the variable of the proper type) I use the base type for the operations. Thanks for your analysis.. it definitely opened my eyes.. the one VideoEncoder that should return the status update is actually an inheritet member of CommandlineVideoEncoder and thus a different instance of a VideoEncoder class.
I would like to change the CommandLineGenerator to use a StringBuilder, as it will probably be a bit easier to read. There's just so much string concatenation going on during the creation of the command line that it can get a bit confusing. I've always used the rule that if you're concating a string more than 4 times, it's probably best to move it to a StringBuilder.Hmm.. did I never change that? At least the video commandlines are all generated by a StringBuilder.. feel free to change the muxing commandlines as well, it definitely makes sense.
VS2K5 is to use the keyboard shortcut,Which keyboard shortcut?
Sharktooth
11th January 2006, 11:49
CVS Update:
0.2.3.2010 11 Jan 2006
Reverted Levels -> MB changes.
Bins are up on SF.
Sources (until anonymous CVS gets in synch): http://files.x264.nl/?dir=./Sharktooth/megui/Sources
dimzon
11th January 2006, 12:04
If I were to suggest a "big" architectural change, it would be to eliminate all of the conditional compilation. Even if a user is only interested in the x264 or Snow features, it's not like the full MeGUI is more difficult to use than the special versions. Meanwhile the extra bugs, developer time, and (necessary but lacking) testing that come from separate versions affects everybody.
Agreed by 100% !!!
Let's remove conditional compilation!
Sharktooth
11th January 2006, 12:07
well, x264 conditional compilation is needed by my x264 and bobor's builds.
Just give us some time to integrate the full MeGUI before removing x264 CC.
However it would be much better if the x264 CC will remain.
dimzon
11th January 2006, 12:18
Because it breaks things. Every encoder I add, I have to take care of all possible consequences. Let me give you an example: if I could just plug in any video encoder, I could add my xvidencrawvideoencoder. However, that encoder can only output raw files... MeGUI is painfully obvlivious of that and will offer mkv/mp4/avi output.. while the output files may just be named like that, they are indeed renamed raw files. S by making sure I get to see every encoder and write the full workflow for it, I can ensure that people can only try to do what makes sense. Asking for avi from xvid_encraw makes no sense.
...
Add Ogg Vorbis.. affects container selection and bitrate calculation.
It means encoder must provide list of supported formats and MeGUI must handle it! I does not say - whe must support ANY format, i just say - we can support wide set (raw, mkv, mp4, avi) and every encoder must provide supported subset...
Please do show a better way
Polyphormism
You are mistaken. In fact, you could create an x264 job with a mencoder commandline, then if you change the x264 encoder to x264.exe in the settings, then try to start it.. it will try to send that job to the x264.exe commandline encoder ;) ...
This means - invalid architecture! Definitly You must use 2 different job types - one for mencoder another for x264 :)
And it does.. they're called properties. The GUI has to decide which date it wants to show.
Yet again - MeGUI has multiple ugly if(zzz is TypeName) here!
If you look at the queue, you have the codec type, and a lot more information about input/output/state/etc.. so yet, it's very informative.
Hey, i dont's say nothing about overall joblist! I just say jobname itset is not informative - it does not hold any sensitive information! So you does not need it except for management - so you can switch from jobname to jobID - so you can implement editable job titles to allow user mark some jobs :)
PS. Why nobody except Doom9 don't support this discussion?
berrinam
11th January 2006, 12:25
Did I miss something on the One-Click mode? Sorry about that, I'll take a look at the changes you made with a DIFF and make sure the same problem doesn't occur again when I add the subtitle names.
Well, I don't think that it is likely to be a problem with subtitles and OneClick (OneClick will probably never support subtitles), but it may occur with the AutoEncode mode. Have a look at the change I made to the generateMP4BoxCommandLine in version 2009 (the bug caused by the AutoEncode window). Basically, if you just check wethere they are null before checking their length, it should be fine. (Mind you, as adding subtitles in AutoEncode requires the Mux Window to be opened, you should check to make sure that the AutoEncode window also supports track names).
Cheers, berrinam
Sharktooth
11th January 2006, 13:15
CVS Update:
0.2.3.2011 11 Jan 2006
Enlarged the MeGUI-x264 video profile combobox in the main Form.
Sources: http://files.x264.nl/?dir=./Sharktooth/megui/Sources
Doom9
11th January 2006, 13:18
It means encoder must provide list of supported formats and MeGUI must handle it! I does not say - whe must support ANY format, i just say - we can support wide set (raw, mkv, mp4, avi) and every encoder must provide supported subset...I know you'd say that and I'm tempted to say over my dead body now. This is not the architecture I want to create. With each amount of flexibility you introduce, you complicate matters two, three, fourfold and I just don't have time to handle that. The architecture you want is about a 100 times as complex as the current one, making it virtually impossible for anyone to figure out how it works unless he's devised that architecture.
PolyphormismI said a working example.... throwing fancy words at me is not way to make a point. You can take a look at the source I posted very early this morning.. most code doesn't use that many levels of inheritance, yet there are still parts that need to be common but cannot be put in a common class. E.g. the setup in the various commandline encoders.. linking the event callback is an operation that has to be done prior to starting the process or you'll miss the first few commandline outputs. So, here you have your chance to make your point with those classes...
This means - invalid architecture! Definitly You must use 2 different job types - one for mencoder another for x264Actually, the new code can handle this just fine.. and it's all still one job type. It's up to the videoencoder to decide what kinda VideoJob it is and how it's to be encoded. I know you can twist that by 180 degrees and have all the logic in the job, but frankly I don't like that approach. If we take cars and drivers instead of encoders and jobs, your approach means the drivers has to know how the motor of the car needs to work... my approach with the intelligence in the encoder means the driver gets in, turns the key, and drives off.. the car does a lot under the hood that the driver never has to be bothered with.
Yet again - MeGUI has multiple ugly if(zzz is TypeName) here!In case of a job, that is a sideeffect of the upbringing of MeGUI.. it can be changed there. But please give an example of job dispatching to the encoder. Say you have a Job, and a JobHandler. So you pick a job from the queue, send it to JobHandler and tell it... process this. Let's further assume that the Job is of type VideoJob. So at some point, the JobHandler needs to figure out what kind of job it is to send it to the proper class for encoding (a class deriving from VideoEncoder in this case). How other than if (job is VideoJob) are you going to figure that one out? You could to a switch(job.JobType) so you don't use the is command, but it's essentially the same. And you could argue that the JobType property is in fact not necessary because the type can be derived from a Job via (job is OfTypeX).
The only way I see to not do any of this identification, is if a job knows how to encode itself.. and then we're in the situation of the car that knows how to drive itself. There's another way, and that's the job returning the encoder, but that's essentially the same approach.. car knows how to drive itself.. and if it cannot, it spits out a driver via the exhaust so that the driver can do the driving.
so you can implement editable job titles to allow user mark some jobs I completely and utterly fail to see the point of that. You can easily identify jobs with all the info you have in the queue, changing names just a way to introduce more hassle, starting with editable listviews, how you're going to assign names in a mode that returns multiple jobs, hassling the user to come up with names after indexing (keep in mind how one click works.. there's first one job.. then after indexing more are added)..
dimzon
11th January 2006, 14:08
With each amount of flexibility you introduce, you complicate matters two, three, fourfold...
I believe Your opinion is wrong. Just take look @ .NET Framework itselt architecture - it's fine, flexible and easy to use!
But please give an example of job dispatching to the encoder. Say you have a Job, and a JobHandler. So you pick a job from the queue, send it to JobHandler and tell it... process this.
void StartJob(Job someJob)
{
m_jobExecutor = someJob.CreateExecutor(); // Create executor
m_jobExecutor.StatusUpdate += ...; // Attach universal simplified event handler
m_jobExecutor.Priopity = m_priority; // Setup initial priority
m_jobExecutor.Start(); // Start processing!
}
Simple and elegant, isn't it?
is if a job knows how to encode itself.. and then we're in the situation of the car that knows how to drive itself.
No! Car don't know how to drive itself but it know how it works! MeGUI tell to Job "Start" and job starts. MeGUI tell to job "Abort" and it aborts :)
Doom9
11th January 2006, 15:03
Just take look @ .NET Framework itselt architecture - it's fine, flexible and easy to use!I've never looked at the source, but looking at how painful making a good GUI and creating controls that are standard in todays programs is, I dare doubt your statement. E.g. a good treeview with drag and drop, as it standard in Windows Explorer... it's a major pain in the ass unless you buy a pre-made component. Or another thing are listviews that are searchable by typing.. standard behavior in many windows programs.. yet you need to derive your own controls and extend them to get done what imho should already be available as pre-built components. I've been coding with C# for two years now but I hardly ever build derived components, and it's just the standard inheritance for forms, nothing more.
Simple and elegant, isn't it?Just as I feared, you want to make the care aware of the driver. It shouldn't be.
And by the way, image signatures are no longer enabled so you can safely remove those urls from your signature.
dimzon
11th January 2006, 15:25
Does anybody can connect to CVS via anonimous login? I can't
No tag specified for Export, using HEAD
In C:\Documents and Settings\DAlexandrov\My Documents\Visual Studio 2005\Projects\MeGUI: "C:\Program Files\TortoiseCVS\cvs.exe" "-q" "export" "-r" "HEAD" "MeGUI-src.CVS"
CVSROOT=:ext:dimzon@cvs.sourceforge.net:/cvsroot/megui
cvs export: failed to create lock directory for `/cvsroot/megui/MeGUI-src.CVS' (/cvsroot/megui/MeGUI-src.CVS/#cvs.lock): Permission denied
cvs export: failed to obtain dir lock in repository `/cvsroot/megui/MeGUI-src.CVS'
cvs [export aborted]: read lock failed - giving up
Error, CVS operation failed
In C:\Documents and Settings\DAlexandrov\My Documents\Visual Studio 2005\Projects\MeGUI: "C:\Program Files\TortoiseCVS\cvs.exe" "-q" "checkout" "-P" "MeGUI-src.CVS"
CVSROOT=:pserver:anonymous@cvs.sourceforge.net:80/cvsroot/megui
connect to cvs.sourceforge.net:80 failed: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Success, CVS operation completed
Sharktooth
11th January 2006, 15:38
Try several times :)
However a copy of the latest sources is here: http://files.x264.nl/?dir=./Sharktooth/megui/Sources
stax76
11th January 2006, 16:23
I've never looked at the source, but looking at how painful making a good GUI and creating controls that are standard in todays programs is, I dare doubt your statement. E.g. a good treeview with drag and drop, as it standard in Windows Explorer... it's a major pain in the ass unless you buy a pre-made component. Or another thing are listviews that are searchable by typing.. standard behavior in many windows programs.. yet you need to derive your own controls and extend them to get done what imho should already be available as pre-built components. I've been coding with C# for two years now but I hardly ever build derived components, and it's just the standard inheritance for forms, nothing more.
Regarding missing winforms bits, I know what you mean just to good. I had to implement lot's of that missing bits, great help was stuff found at CodeProject or somewhere else. In the beginning it can be rather painful, lot's of stuff requires knowing the framework internals (use Reflector, it outputs C# code almost as good as the source), knowing the Win32 API (read Petzold) or simply subclassing and owner drawing but once you get the hang of it most stuff can be done easy. Let's hope once WPF (codename Avalon) arrives Microsoft will still be committed to winforms.
godhead
11th January 2006, 19:32
Hmm.. did I never change that? At least the video commandlines are all generated by a StringBuilder.. feel free to change the muxing commandlines as well, it definitely makes sense.[/QUOT]
I didn't look at the video command lines, but I'll go ahead and make the changes to the muxing command lines.
[QUOTE=Doom9]Which keyboard shortcut?
in your code window type: prop (by the time you type the pr) your code complete window should be on the prop item, now press TAB twice and it will stub out a private member and property get/set for you. You can then use TAB to go between each of the portions that you need to change. VS2K5 has added a bunch of these code snippets.
Here's more information about code snippets and how to use the right click context menu to add snippets or surround code with snippets. Also includes instructions ont he snippet XML schema and how to create your own.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/codesnippets.asp
This article has a short list of the built-in snippets.
http://www.developer.com/net/net/article.php/11087_3557701_1
DeathTheSheep
11th January 2006, 21:50
Woah, um, about the "Quantisation" tab in the MeGUI x264 settings page...
Who's in charge of the spelling around here?? :D
Doom9
11th January 2006, 22:01
more trouble with that void StartJob(Job someJob)
{
m_jobExecutor = someJob.CreateExecutor(); // Create executor
m_jobExecutor.StatusUpdate += ...; // Attach universal simplified event handler
m_jobExecutor.Priopity = m_priority; // Setup initial priority
m_jobExecutor.Start(); // Start processing!
}
What do you do after that? An Indexing job has extensive postprocessing. In the simple case, it's just opening another window.. it then goes over loading demuxed audio tracks into the GUI, and ends up with automatic cropping, resizing, AviSynth script creation (based on profiles), audio, video and mux job creation.. so something must be very aware of the different jobtypes.. you can't just abstract everything. And since two video encoders are allowed for the same job, you can't abstract that either.. somebody needs to be there and say "okay, here's an x264 job, let's check the settings to see which encoder we're going to take".
When an audio job ends, it's not just up to a JobProvider to get the next job and a JobExecutor to execute the next job.. the next job can depend on the finished audio one, so the video job has to be consulted for a desired filesize, and for a desired final output size, then the audio size has to be gotten, bitrate has to be recalculated, in function of container and codec (xvid bitrate calculation is different because at least in case of mencoder it includes the container overhead), then the commandline has to be regenerated.
Doom9
11th January 2006, 23:21
About CSV: how do I get tortoise to store my password?
And can anybody enlighten me regarding the release process? I don't suppose that has anything to do with the CSV at all, does it but instead you have to download the latest code, build and upload that separately, right?
berrinam
11th January 2006, 23:34
Find out about storing your password from the TortoiseCVS FAQ: http://www.tortoisecvs.org/faq.shtml#sshkeys
I have no idea about releases, as I am not an admin and I can't do them.
PS. It's CVS, not CSV
Doom9
11th January 2006, 23:36
PS. It's CVS, not CSVArgh, I always get that wrong. But it's a shit system anyway.. now I'm stuck with a bunch of files that I can't upload... CVS conflict my ass.. my worst fears come true right away.
Doom9
12th January 2006, 00:35
new build is up. Changelog:
0.2.3.2012 12 Jan 2006
Completely rewrite the video encoder part. Should be less error prone, return more commandline feedback and it supports xvid_encraw
xvid_encraw support: For now, only raw and mp4 output will work properly because encraw can only output raw. Automated bitrate calculation will be
off because mencoder takes container overhead into account for xvid.. encraw won't (and it uses bit/s for the bitrate but that's handled)
Please test encraw in manual mode and report how it works
Removed various .Net 1.1 workarounds that are no longer needed and code that would cause warnings in .NET 1.1
Commandline generation has been changed for the video part to not include the binary name.. this allows the latest executable path to be used for encoding
0.2.3.2011 11 Jan 2006
Enlarged the MeGUI-x264 video profile combobox in the main Form.
I spent at least two hours for this release instead of the usual 10 minutes or so. Did I mention I hate CVS? I basically had to redo the code for a bunch of classes (all GUI classes incidentally).
bob0r
12th January 2006, 00:48
If i only wasn't so lazy and unskilled to install SVN on files.x264.nl :rolleyes:
Richard Berg
12th January 2006, 01:15
I wonder if the TFS MSSCCI (http://blogs.msdn.com/bharry/archive/2005/12/29/507993.aspx) plugin will work with VS Express...
Doom9
12th January 2006, 09:17
what would make SVN better (other than speed perhaps.. the speed of sourceforge is abysmal)? CVS chockes big time with GUI files, and I just have a feeling it has something to do with conditional compilation.. the diffs didn't look that much different, just the whole conditional stuff moved around a bit.. and my changes were really minor (like 2 or 3 lines only in many cases.. I had to adapt the commandline preview because the new video encoders only take the commandline parameters from the commandline parameter, the encoder path is given to them seperately)
buzzqw
12th January 2006, 09:52
the build "0.2.3.2012 12 Jan 2006" crash on start
while previus build 2010 is full fuctional
BHH
dimzon
12th January 2006, 09:58
I still can't start any work: http://forum.doom9.org/showthread.php?p=766164#post766164
And conditional compilation is breaking VS2005 code analyzer and refactoring, let's remove conditional compilation ASAP
Doom9
12th January 2006, 11:47
let's remove conditional compilation ASAPThat will never be fully possible. For starters, there's the CSC flag which is needed to make builds from the commandline (why there is a difference on how resources that are compiled in are handled between VS and csc I don't know, but it's a fact that they're different and that #if is needed to support both), then there's the SVN vs custom x264 build angle. I have no quarrel removing the snow build but I'm not so sure about the x264 one.
Sharktooth
12th January 2006, 14:24
what would make SVN better (other than speed perhaps.. the speed of sourceforge is abysmal)? CVS chockes big time with GUI files, and I just have a feeling it has something to do with conditional compilation.. the diffs didn't look that much different, just the whole conditional stuff moved around a bit.. and my changes were really minor (like 2 or 3 lines only in many cases.. I had to adapt the commandline preview because the new video encoders only take the commandline parameters from the commandline parameter, the encoder path is given to them seperately)
The revisioning system. It's much easier to manage and more functional.
However i updated the setenv.bat for .NET 2.0
berrinam
12th January 2006, 14:32
@dimzon: Perhaps you could persuade one of the MeGUI project admins to give you developer CVS access.
Sharktooth
12th January 2006, 14:33
CVS Update:
0.2.3.2013 12 Jan 2006
Updated Setenv.bat for .NET 2.0
Fixed all warnings in SettingsForm.cs for x264 conditional compilation
@Doom9: i can elaborate a method for identifying the x264 build and enable/disable different options so conditional compilation of x264 and x264 svn can be merged.
Doom9
12th January 2006, 14:39
@Doom9: i can elaborate a method for identifying the x264 build and enable/disable different options.But when do you do that? I mean it would have to be done upon loading of the program, at which point the x264.exe executable may not have been defined yet. And I don't see why you should have the executable defined until the point you're actually going to start encoding. Of course you could block all features unless properly configured, which may actually help n00bs, but which makes our lifes a lot more complex.. I may work on features despite being unable to use them with the current configuration.
Updated Setenv.bat for .NET 2.0I have never used that file.. I can build just fine with the latest compile.bat and calling nothing else.
Sharktooth
12th January 2006, 14:45
well... the latest compile.bat is not the "right" way to do things:)
just create a shortcut with this target:
C:\WINDOWS\system32\cmd.exe /k ""drive:\megui_sources_directory\setenv.bat""
and you will have a command prompt with all the variables set (set the correct path):
csc.exe and the other commandline compilers will be in the OS PATH, libs and includes paths will be defined, etc...
Doom9
12th January 2006, 14:57
csc.exe and the other commandline compilers will be in the OS PATH, libs and includes paths will be defined, etc...But you need nothing if that.. in compile.bat we have the path to a normal .NET 2.0 installation.. it will always be at that path regardless of whether you install just the runtime, sdk or even visual studio.. There's no need for include paths and the likes, to specify where the libraries are, nothing of that sort.
Sharktooth
12th January 2006, 14:59
But when do you do that? I mean it would have to be done upon loading of the program, at which point the x264.exe executable may not have been defined yet. And I don't see why you should have the executable defined until the point you're actually going to start encoding. Of course you could block all features unless properly configured, which may actually help n00bs, but which makes our lifes a lot more complex.. I may work on features despite being unable to use them with the current configuration.
when setting the x264.exe path in the configuration.
But you need nothing if that.. in compile.bat we have the path to a normal .NET 2.0 installation.. it will always be at that path regardless of whether you install just the runtime, sdk or even visual studio.. There's no need for include paths and the likes, to specify where the libraries are, nothing of that sort.
Ok. However i just use that way... and worked with both the old and new compile.bat with both NET 1.1 (with the old setenv.bat) and 2.0 without any problems
Doom9
12th January 2006, 15:15
when setting the x264.exe path in the configuration.So you start the GUI, go directly to the x264 configuration, configure a non SVN feature, then configure the x264 path to a svn build, which limits the GUI, but the job is already there, so when you start the job you have the usual "unrecognized commandline" error. Even worse, if after configuration of the executable, you go back to the settings, the program will crash because the subme dropdown only has 6 entries now, not 7.
Richard Berg
12th January 2006, 20:01
For starters, there's the CSC flag which is needed to make builds from the commandline (why there is a difference on how resources that are compiled in are handled between VS and csc I don't know, but it's a fact that they're different and that #if is needed to support both),
Use MSBuild instead of calling csc.exe directly.
then there's the SVN vs custom x264 build angle.
I don't think we need to work so hard to prevent users from selecting options that are incompatible with their encoder. Conditional compilation, tri-state, avc levels, etc. -- these have been the source of many bugs, several of them far worse for the user than a mere x264 error message. Most n00bs will use premade profiles.
Alternatives:
- nice friendly tooltips for options that won't work with standard SVN compiles
- package a few (not all; too many = confusing) of Sharktooth's profiles with main MeGUI releases
- like we did with "validate avc level", move all tricky to a menu choice like "validate encoder parameters", i.e. the user has to ask us validate instead of us doing it behind the scenes after every change
- even better: instead of replicating all of x264's logic ourselves, have "validate encoder parameters" call x264 with dummy input/output files and parse the log for "unrecognized commandline" errors
- I'm sure there are other solutions
ShAQ
12th January 2006, 21:44
Bug:
Missing dot (".") in Status Window.
http://img314.imageshack.us/img314/1774/zwischenablage011wy.png
Found in build 0.2.3.2012
Doom9
12th January 2006, 21:46
Missing dot (".") in Status Window.Where do you expect a dot? And where's the logfile? What's the locale of your windows, what's the comma separator on your windows, how does commandline output look if you run the encoder commandline from an actual commandline?
Doom9
12th January 2006, 22:02
@dimzon: here's the latest CSV checkout: http://forum.doom9.org/MeGUI-src.CVS.rar
I've never used anonymous CVS and I have no time to make tests for you.. CVS is more than a major pain in my butt already and it took me quite a while to get the whole thing set up..
berrinam
12th January 2006, 22:35
CVS Update:
0.2.3.2014 13 Jan 2006
Add Autmatic interlace detection in Avisynth window and OneClick
berrinam
12th January 2006, 23:00
CVS Update:
0.2.3.2015 13 Jan 2006
Apply Richard Berg's Progress Status menu item patch (makes it checkable, like VDub)
charleski
12th January 2006, 23:25
Does anybody can connect to CVS via anonimous login? I can't
No tag specified for Export, using HEAD
In C:\Documents and Settings\DAlexandrov\My Documents\Visual Studio 2005\Projects\MeGUI: "C:\Program Files\TortoiseCVS\cvs.exe" "-q" "export" "-r" "HEAD" "MeGUI-src.CVS"
CVSROOT=:ext:dimzon@cvs.sourceforge.net:/cvsroot/megui
You're using export? That may be the problem.
Just use Checkout to set up the files, Update to grab the latest versions later on, and Commit to send your changes back to the CVS repository.
SourceForge is slow at times, but that may be related to the fact that's it's free, despite having an international network of servers and a deep integrated backup system. After setting up the SSH part all I needed was 30 mins of RTFM with TortoiseCVS, so I'm not sure why people are having problems.
charleski
12th January 2006, 23:52
Exactly as Charleski said (a disabled checkbox that's checked has still a "checked" value but it cant be edited = forced). However we have different needs so we may stay away from the MS guidelines for a better usability.
I've been away for the past few days so couldn't check the board, but it looks like I need to reinforce the point. GUI standards are as important as standards anywhere else. GUI elements are supposed to work in a consistent manner across applications, we aren't working in a vacuum. Users have a right to expect the application to function in a similar manner to other tools that they run, and using the Enable property to double-up for Checked is a severe violation of that. Also, the GUI is not a memory. If you want to store a collection of settings for future reference, there's the profile system that can do exactly that. It's not unrealistic to expect users to realise that the Profile (Baseline, Main or High) and Level are important decisions that should be made first before you go twiddling other options for the encode.
Breaking GUI standards is just setting yourself up for a bunch of 'WTF's going on?' support posts further down the line and isn't worth it for the minimal returns it offers.
Richard Berg
13th January 2006, 00:00
I had problems with anonymous CVS the past few days -- I even posted to the tortoisecvs-users DL. Whatever was wrong, it works now.
berrinam
13th January 2006, 01:25
Another architectural query: why does MeGUI store currentX264Settings, currentLavcSettings, etc, and access these through huge if statements, when the current settings could be accessed through ((VideoProfile)videoProfiles[videoProfile.SelectedItem]).Settings It seems to be a little bit left over so that you can configure the settings without a profile, but the moment you have any profiles, this doesn't happen. As a result, it almost always is useless, and it clogs up the code (similarly with audio profiles). Can this be replaced?
berrinam
13th January 2006, 05:50
0.2.3.2016 13 Jan 2006
Add support for Drag 'n' Drop
Also added an Open menu item in the file menu, which uses the same code as drag'n'drop.
foxyshadis
13th January 2006, 06:21
If you really need GUI standards conformance:
Since disabled mode always means "unusable", why bother with a "disabled but checked" state at all? When updating the GUI to a more restrictive mode, uncheck anything about to be disabled, and when bringing it back to a mode that enables them, check whether they're supposed to be checked and recheck them. Then you still only need tristate, and shouldn't need to muck with actual tristate code much.
This is presuming your event handlers to change the internal options are for clicking the box, not for the box's state changing. If not, perhaps there's a way to disable it during the update?
[Yay! Drag & Drop!]
Richard Berg
13th January 2006, 07:00
Another patch attached. New features:
- context menu for queue (supports multiselect :))
- loading a video or audio job now switches to the Input tab
We should continue to debate massive refactoring if it's needed for big new features like audio filtering. Personally, I only refactor when something's actively annoying me. For example, the code cleanup in this patch:
- changed all job status variables from int -> enum JobStatus, eliminated all casts
- changed 'jobs' from old style Hashtable -> generic Dictionary<string, Job>, eliminated all casts
sillKotscha
13th January 2006, 08:25
Where do you expect a dot?
I'd say 677fps are not bad :D
Doom9
13th January 2006, 09:04
- changed all job status variables from int -> enum JobStatus, eliminated all castsurgh.. and I just did that on my own.. I expect another very painstaking commit process coming my way :( :( :(
It seems to be a little bit left over so that you can configure the settings without a profile, but the moment you have any profiles, this doesn't happen. As a result, it almost always is useless, and it clogs up the code (similarly with audio profiles). Can this be replaced?I often don't use profiles. If you see a better way, I'm sure I could warm up to it, but I don't want to force profiles on the users.. looking at the early days, most people didn't even realize there is such a thing as profiles.
By the way, does anybody know why when I did a CVS update on my whole directory, it didn't pick up all the new files and changes that berrinam recently added? I had to rever to my latest commited build (safely stored away.. fortunate for me) to start with ripping apart the muxer and implement it like the video encoders (as a stopgap.. the next thing is one more level of generalization).
dimzon
13th January 2006, 10:04
You're using export? That may be the problem.
Just use Checkout to set up the files
I'm trying both with same result. Every time I trying to get sources via anoninous access I get
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
and I can't get sources via developer access (i get ACCESS DENIED)
@dimzon: here's the latest CSV checkout: http://forum.doom9.org/MeGUI-src.CVS.rar
I've never used anonymous CVS and I have no time to make tests for you.. CVS is more than a major pain in my butt already and it took me quite a while to get the whole thing set up..
Please add me to project administrators...
Doom9
13th January 2006, 10:49
- changed 'jobs' from old style Hashtable -> generic Dictionary<string, Job>, eliminated all castsNeat.. while we're at it.. what posessed them not to make a typed ArrayList? I mean come on.. that's the feature I fell in love with in Java 1.5... typed Vectors, and the .NET equivalent would be an ArrayList. Why oh why can't I create an ArrayList<int> or ArrayList<Job>? That's the one feature in .NET 2.0 I've been looking forward to the most.
stax76
13th January 2006, 11:19
List<T>
dimzon
13th January 2006, 12:58
Current Settings form is to big to fit @ some screen resolutions. And I'm planning to add at least 3 new executables to it. So i decide to add TabControl and place all program paths @ separate page.
Does You agreed?
dimzon
13th January 2006, 13:26
new SettingsForm layout is here: http://www.mytempdir.com/381070
http://img202.imageshack.us/img202/8880/19pq1.png
http://img227.imageshack.us/img227/2506/24if.png
Doom9
13th January 2006, 13:36
So i decide to add TabControl and place all program paths @ separate page.Yeah, that's no problem.. the settings form is getting rather big.
dimzon
13th January 2006, 13:39
some little code cleanup in settings form:
http://www.mytempdir.com/381110
berrinam
13th January 2006, 13:42
Yeah, that's no problem.. the settings form is getting rather big.
Yep, and so is the AviSynth Window.
@dimzon: Those screenshots don't have the two buttons that I added recently: Reset Dialogs, and Configure Source Detector. I put the Source Detector one there in 2014 and the Reset Dialogs there in 2016. Just warning you, so we don't get clashes there.
dimzon
13th January 2006, 13:42
Yeah, that's no problem.. the settings form is getting rather big.
there was some problem - this stupid Visual Studio 2005 forget component names and event-handlers during Cut/Paste (VS 2003 works fine). So we can't just cut some amount of controls from form and then paste them into TabPage.
I modified InitializeComponent directly for this...
dimzon
13th January 2006, 13:44
Yep, and so is the AviSynth Window.
@dimzon: Those screenshots don't have the two buttons that I added recently: Reset Dialogs, and Configure Source Detector. I put the Source Detector one there in 2014 and the Reset Dialogs there in 2016. Just warning you, so we don't get clashes there.
Unfortunally i can't use CVS - i have no rights to get sources via ssh and anonimous access doesn't work for me! I'm using latest sources tarball from Doom9.
Sorry!
berrinam
13th January 2006, 14:12
Yes, I had exactly the same problem. Here's a link to the latest sources: http://rapidshare.de/files/10962720/MeGUI-src.CVS_2017.rar.html
Doom9
13th January 2006, 14:39
I modified InitializeComponent directly for this...Is going to get you in a world of pain.. each time somebody changes something in the GUI designer, it will reset those manual changes.. that's the reason we have 3 initializecomponent versions in the settings form.. one for each mode (I know that is as ugly as it gets.. not my choice, visual inheritance would most likely handle that just fine)
By the way, what are these optional output extensions good for?
dimzon
13th January 2006, 15:40
Is going to get you in a world of pain.. each time somebody changes something in the GUI designer, it will reset those manual changes..
Don't worry, it still work fine even after GUI designer :)
that's the reason we have 3 initializecomponent versions in the settings form.. one for each mode (I know that is as ugly as it gets.. not my choice, visual inheritance would most likely handle that just fine)
This is another reason to remove conditional compilation :) Let's do it!
By the way, what are these optional output extensions good for?
I really does'tn know (this is not my code)
dimzon
13th January 2006, 15:46
Yes, I had exactly the same problem. Here's a link to the latest sources: http://rapidshare.de/files/10962720/MeGUI-src.CVS_2017.rar.html
@Doom9
Dear Doom9, we really need working source version control solution, current situation is not acceptable! Source control allows to track and revert any changes, so don't worry about "destructive activity from developers". You can ever mark every succesfull build by tags/labels to be able to revert/switch to any version.
Sharktooth
13th January 2006, 15:49
So you start the GUI, go directly to the x264 configuration, configure a non SVN feature, then configure the x264 path to a svn build, which limits the GUI, but the job is already there, so when you start the job you have the usual "unrecognized commandline" error. Even worse, if after configuration of the executable, you go back to the settings, the program will crash because the subme dropdown only has 6 entries now, not 7.
No. You go to the megui settings dialog, use the "..." button to set the x264 path and MeGUI will detect the version and enable/disable the respective controls in the x264config dialog and load the default settings.
However .2017 binaries are now on SF.
dimzon
13th January 2006, 15:56
Dear Sharktooth
I'm sorry, can You tell me - why does you still need separate x264 build for MeGUI? It saves approx 50kb per download BUT creates a really discomfort for development and dramaticaly reduce productivity...
Sharktooth
13th January 2006, 16:01
Well, coz MeGUI-x264 requires only... x264 and it work as it is with my (and bobor's) x264 packages.
Including the full GUI means the user should look for additional software or i (or bobor) should distribute other software along with x264 (besweet, dgindex, faac, mp4box, etc).
At that point that wont be a x264 release anymore, but an encoding solution including x264 and will weight several megabytes.
max-holz
13th January 2006, 16:01
No. You go to the megui settings dialog, use the "..." button to set the x264 path and MeGUI will detect the version and enable/disable the respective controls in the x264config dialog and load the default settings.
However .2017 binaries are now on SF.
Sharktooth could you update http://files.x264.nl?
Ciao
Sharktooth
13th January 2006, 16:06
done;)
dimzon
13th January 2006, 16:09
Well, coz MeGUI-x264 requires only... x264 and it work as it is with my (and bobor's) x264 packages.
You are wrong!
It reques at least
donNet Framework
AviSynth
and you don't redistribute it with Your bundle!
PS. and nobody force users to download mencoder/dgindex/etc if they doesn't need this functioonality!
Sharktooth
13th January 2006, 16:19
well everyone that encodes to divx or xvid has avisynth and .NET framework is available thru Windows Update.
However including the full version will confuse/scare the end user with all the supported codecs, options, softwares etc. while the MeGUI-x264 is perfect and it is related to x264 CLI (only) as encoder.
max-holz
13th January 2006, 16:21
What is it xvid_encraw.exe?
Sharktooth
13th January 2006, 16:22
the xvid command line encoder.
max-holz
13th January 2006, 16:23
the xvid command line encoder.
Sorry where can I find it? I search for in my xvid installation directory but I couldn't find it.
Sharktooth
13th January 2006, 16:39
a 1.1 build by kurtnoise is here: http://kurtnoise.free.fr/xvid_encraw-1.1.0.zip
you can always get the source from the xvid CVS and compile it though.
FooFighter007
13th January 2006, 16:40
look here...
http://forum.doom9.org/showthread.php?t=98469
regards,
foo
dimzon
13th January 2006, 16:41
well everyone that encodes to divx or xvid has avisynth and .NET framework is available thru Windows Update.
90% of such people know about besweet/dgindex.
However including the full version will confuse/scare the end user with all the supported codecs, options, softwares etc. while the MeGUI-x264 is perfect and it is related to x264 CLI (only) as encoder.
Good solution will be to provide short explanation - which software is requed for each codec/option and provide download links...
Maybe we can create voiting poll for users to decide?
Sharktooth
13th January 2006, 16:42
yep, it's a good idea.
Sharktooth
13th January 2006, 16:58
bug reported here: http://forum.doom9.org/showthread.php?p=767418#post767418
Doom9
13th January 2006, 22:14
one thing: if anybody plans any refactoring, let me know in advance.. two people working on that concurrently causes major issue. My next commit is going to be a major pain because of the things Richard (no offense, you didn't know) changed after I started the next big undertaking of refactor the muxer architecture. Also please do the same if you're planning on touching the core (JobUtil and basically anything that deals with creating and processing jobs).
FYI, all the job related enums are going to be changed with my next update.
Richard Berg
13th January 2006, 22:25
It shouldn't take long if you have a good 3-way merge tool. Do a Google -- most of the commercial ones have a free trial.
Doom9
13th January 2006, 22:53
any suggestions? I'm a lazy n00b you know ;) ANd I just spent 4 indexing cycles to find out I put a stupid trim command in my avisynth script.. I can redo the d2v all I want if I keep using the restricted avs file... grrr. and I already started the debugger wanting to make sure avifile is really reporting that low framenumber.
One thing.. we do we have an AviReader and AviFile file? They do the same thing...
berrinam
13th January 2006, 22:59
CVS Update:
0.2.3.2018 14 Jan 2006
Fix up (auto)cropping crashes when the preview window is closed
As to the AviReader and AviFile.... looking at them, they aren't identical, because AviReader does some wrapping of the AviStreamGetFrame method that AviFile doesn't seem to.
Doom9
13th January 2006, 23:06
they aren't identical, because AviReader does some wrapping of the AviStreamGetFrame method that AviFile doesn't seem to.Yeah, avireader does more.. which bodes the question why the other one was added. Whatever might be missing from AviReader, I'm sure it could be added, couldn't it?
berrinam
13th January 2006, 23:08
Yeah, avireader does more.. which bodes the question why the other one was added. Whatever might be missing from AviReader, I'm sure it could be added, couldn't it?
Yes, I will do that. I just wanted to get Automatic Deinterlacing working for the time being, without having to fiddle around with AVIFile calls.
godhead
13th January 2006, 23:13
I just submitted a new patch. I was going to make the AAC is SBR fix and add subtitle naming, but noticed that I forgot a change to the MuxWindow that would keep someone from naming the second audio track. This patch fixes that issue and I also changed the string concats to use StringBuilder.
CommandLineGenerator.cs
* Changed generateMP4BoxCommandline() to use StringBuilder instead of string concats
* Changed generateMkvmergeCommandline() to use String Builder instead of string concats
MuxWindow.cs
* Fixed audioName.Text not changing when second audio track radio button is selected.
Doom9
13th January 2006, 23:16
Changed generateMP4BoxCommandline() to use StringBuilder instead of string concats
* Changed generateMkvmergeCommandline() to use String Builder instead of string concatsMeans more manual merging for me :(
Here's what I think should be expectable from a CVS tool: in case there are conflicts, it redownloads my last CVS checkout, does a diff (without needing any external soft), from my current code and the last CVS checkout in a useful form (two windows, colored to mark differences), then it downloads the latest sources, and puts them in another window.. that way at least for non GUI classes you can halfway intelligently merge your changes with the latest sources.
godhead
13th January 2006, 23:23
Means more manual merging for me :(
Here's what I think should be expectable from a CVS tool: in case there are conflicts, it redownloads my last CVS checkout, does a diff (without needing any external soft), from my current code and the last CVS checkout in a useful form (two windows, colored to mark differences), then it downloads the latest sources, and puts them in another window.. that way at least for non GUI classes you can halfway intelligently merge your changes with the latest sources.
I'm using TortoiseCVS with WinMerge for the Diff tool and it seems to be working well. I do a CVS Update before I create my patch and if there's merge conflicts, I'll preview them in WinMerge and figure out if I want my edits or the CVS Updated version. I would recommend you give WinMerge a try and see if you like it.
berrinam
13th January 2006, 23:23
Means more manual merging for me :(
Here's what I think should be expectable from a CVS tool: in case there are conflicts, it redownloads my last CVS checkout, does a diff (without needing any external soft), from my current code and the last CVS checkout in a useful form (two windows, colored to mark differences), then it downloads the latest sources, and puts them in another window.. that way at least for non GUI classes you can halfway intelligently merge your changes with the latest sources.
Get WinMerge: http://winmerge.sourceforge.net/
It's open source, and when installing, you can choose to integrate with TortoiseCVS to do just what you described (presuming you have TortoiseCVS installed).
EDIT: Heh, identical response to godhead.
Doom9
14th January 2006, 00:02
I have a wacky proposal regarding the conditional compilation. I think we can agree that most changes made only affect the full build. As the refactoring progresses, at some point, wouldn't it be possible for the main gui class to act mostly as a shell only, thus basically allowing multiple separate programs making use of the same classes.. if we use the same namespace, after an update of the full version, you could basically copy the changed files over, and recompile the other project without changes. Of course that requires a major overhaul of the current architecture, but if we're not looking at the shorter run, I suppose doable (and I'm pretty sure dimzon likes the idea as it gets close to the plugin approach). I'm doing something similar at work.. it's not a GUI program though but a service that I also have as an executable (because it's easier to debug), and in the end all I do is copy over the changed source files, compile, register and run the service.
berrinam
14th January 2006, 00:20
0.2.3.2019 14 Jan 2006
Add Richard Berg's right-click patch
Add godhead's Muxing patch
Richard Berg
14th January 2006, 01:14
I have a wacky proposal regarding the conditional compilation...
Right now the problem with CC is that it's everywhere -- in the middle of code blocks, forms declarations, logic tests, everything. If the various features of MeGUI become modular, then CC is actually ok. Imagine if the only CC in the program looked like this (pseudocode)
public MeGUI()
{
this.plugins += new Core();
#ifdef x264-only
this.plugins += new X264();
#elif
this.plugins += new OneClick();
this.plugins += new AVSScriptEditor();
....
}
Then the rest of the code you never have to worry about which variables/controls/logic/etc are present in which build.
berrinam
14th January 2006, 06:02
0.2.3.2020 14 Jan 2006
Make all profile comboboxes Sorted (fixes the bug, "mainForm profiles aren't sorted alphabetically")
Catch exceptions in source detection, and warn the user
Enforced "en-us" culture for double->string conversion (directshowsource fps) in AviSynthWindow
berrinam
14th January 2006, 07:21
0.2.3.2021 14 Jan 2006
Fix a bug which caused compile.bat compiled files to crash when opening AviSynth Script Creator
berrinam
14th January 2006, 14:07
0.2.3.2022 14 Jan 2006
Fix Autostart Queue time values bug.
Sharktooth
14th January 2006, 16:51
Binaries are up on SF.
max-holz
14th January 2006, 17:28
Binaries are up on SF.
Ciao Sharktooth, http://files.x264.nl is up to date?
Sharktooth
14th January 2006, 17:37
it is now.
Sharktooth
14th January 2006, 18:07
MeGUI-x264 doesnt work. Look at the bug report thread.
Mutant_Fruit
14th January 2006, 18:46
just posting up a patch on SF which fixes a few problems with AVI files in the AVISynth creator and a few general bugs....
EDIT: And its up.
berrinam
14th January 2006, 23:39
@Mutant_Fruit: There's no file attached
Mutant_Fruit
15th January 2006, 00:02
Its up now. I keep forgetting to check the checkbox to upload the file :P
berrinam
15th January 2006, 00:54
CVS Update:
0.2.3.2023 15 Jan 2006
Applied Mutant_Fruit's AviSynth script creator patch with 2 alterations:
-fix to still accept Drag & Drop files
-catch exception if file can't be opened with AVIReader
Doom9
15th January 2006, 01:39
hmm.. now this is weird. I did a new cvs checkout, then put all my patched files in.. then I commited my stuff. I had no conflicts whatsoever, but a couple merges. But the weirdest thing, I can't compile anymore now, I have 3 errors:
MeGUI.openVideoFile is missing
and MeGUISettings don't contain a SourceDetectorSettings
Something went wrong.. I ran CVS update on the files I felt should've been updated (the settings, settingsform, form1), and there was a merge, but where the heck are those changes?
Doom9
15th January 2006, 03:47
New CVS update:
0.2.3.2024 15 Jan 2006
New generalized muxer architecture
enum refactoring
fix for encoder FPS display on PCs using locals with non dot decimal separator
Doom9
15th January 2006, 13:47
New CVS update:
0.2.3.2025 15 Jan 2006
Bugfix: incorrect time elapsed / projected end time
Bugfix: Job FPS of xvid_encraw jobs was incorrect
New: Start and End time of job processing is added to the log
berrinam
15th January 2006, 14:00
0.2.3.2026 16 Jan 2006
Bugfix: another attempt at fixing missing Decomb.dll crash
Bugfix: reapplied the fix for multiple audio names. It was somehow lost in v2024
Doom9
15th January 2006, 20:38
0.2.3.2027 15 Jan 2006
Bugfix: Attempting to start a job that fails no longer returns a "no job found" error but the proper error message
Changed: Jobs are always encoded in their queue order regardless of their interdependence
Changed: Refactored the audio encoding part
Changed: Muxing / audio encoding progress is reported with two digits after the decimal separator
Mutant_Fruit
15th January 2006, 23:31
Jobs are always encoded in their queue order regardless of their interdependence
I assume its still impossible for pass3 to run without pass2 running? Or pass2 before pass1? I can't seem to get the code from the CVS to check.
berrinam
16th January 2006, 04:32
0.2.3.2028 16 Jan 2006
Added support for prerendering avs scripts.
Added a place-holder (but no support) for analysis passes of avs scripts.
Bugfix: Pressing Start in the queue tab will always change its name to stop, even if nothing does start.
Just as a side note: adding support for prerendering was really easy. I'm sure this was due to the recreated encoder architecture, because all I needed to do was add a commandline generator, a settings class, and adjust the job generation to include the prerendering script in the chain. Thank you.
Richard Berg
16th January 2006, 05:00
Good to hear. I was waiting for Doom9's refactoring before starting, but then anonymous CVS was b0rked for a day and you beat me to it ;)
Based on your experience, it should be equally easy to add my next feature: dvr-ms support. Just need to wrap dvrmstompeg (http://www.thegreenbutton.com/community/shwmessage.aspx?ForumID=26&MessageID=113435) the way you did avs2yuv, then feed it to dgindex.
berrinam
16th January 2006, 05:14
Just need to wrap dvrmstompeg (http://www.thegreenbutton.com/community/shwmessage.aspx?ForumID=26&MessageID=113435) the way you did avs2yuv, then feed it to dgindex.
Actually, I completely avoided any new programs. I just ran it through mencoder (so it wasn't exactly as zajc described -- I was intending to do that, but the commandline embedded in avs2yuv needed changing, and it crashed when I ran it with my updates, so I gave up on that)
Doom9
16th January 2006, 08:18
Just as a side note: adding support for prerendering was really easy. I'm sure this was due to the recreated encoder architecture, because all I needed to do was add a commandline generator, a settings class, and adjust the job generation to include the prerendering script in the chain. Thank you.I'm glad somebody found it useful. I'm considering many more changes (move the whole job handling away from Form1 for good.. that class is way too large and half the job creation is already in JobUtil).
I assume its still impossible for pass3 to run without pass2 running? Or pass2 before pass1?No, it's now up to the user. I'll use the "You are with stupid" smilie when people post "bug reports" because they moved the order of their jobs ;)
berrinam
16th January 2006, 11:31
I want to add support for running through an avisynth script (for two-pass avisynth scripts). My idea was to create a new Job type called AviSynthJob, and a new AviSynthProcessor. However, I am a bit confused: which class should AviSynthProcessor extend? IJobProcessor, or Encoder?
dimzon
16th January 2006, 12:23
Just proposal (don't kill me)
How about to drop LMP4 support (keep only XviD)
seems like LMP4 does'nt have ANY advantage over XviD:
XviD is Free like LMP4
XviD is faster
XviD provide better quality?
dimzon
16th January 2006, 12:29
Just another question:
does anybody perform x264 encoding via mencoder? I really prefer x254.exe (it's fresher)
Doom9
16th January 2006, 13:44
However, I am a bit confused: which class should AviSynthProcessor extend? IJobProcessor, or Encoder?Hmm.. why didn't I remove Encoder? I guess DGIndexer still derives from it.. so time for some additional refactoring. Encoder will definitely disappear, and it's proper to extend IJobProcessor.. it defines the event and functions each job processor must offer. In the end I'd like to just have a JobHandler class (it's already there, but not doing anything), which then dispatches the jobs to the proper processor. So in the GUI, pressing pause will result in a call to handler.pause(), rather than having to switch through all the different jobtypes.. so the guy no longer has to know what kind of types there are.
How about to drop LMP4 support (keep only XviD)Well.. it's always hard to give up something you've worked on.. but I have honestly not used it for anything than quick tests either (in its default config it's quite fast). If it causes me any grief during refactoring I might just get rid of it.
does anybody perform x264 encoding via mencoder? I really prefer x254.exe (it's fresher)the thought of removing it also crossed my mind.. the thing is.. we have avi output and x264.exe doesn't support that (neither does encraw). While mencoder can mux raw ASP and AVC streams into AVI, those AVIs cannot be played via VfW or DShow and are thus improper.. I've mentioned that in the mencoder list but so far nobody bothered to fix it. Time to ask for a good AVI muxer in the container forum.
Naturally, when the AVI muxing issue is resolved, x264 in mencoder is a goner. The same goes for the time when xvid_encraw offers all XviD features.
soresu
16th January 2006, 14:02
Just a quick (albeit probably dumb) question here. I was wondering what was meant by "Added support for prerendering avs scripts"?
berrinam
16th January 2006, 14:07
Check the feature request thread. It explains the feature in the first post.
dimzon
16th January 2006, 14:28
Naturally, when the AVI muxing issue is resolved, x264 in mencoder is a goner. The same goes for the time when xvid_encraw offers all XviD features.
Like to read this! Fine! Which additional features (except container) does You need in xvid_encraw? Maybe I can help to implement them?
Richard Berg
16th January 2006, 15:02
Keep in mind, our new Avisynth prerender feature relies on mencoder.
Richard Berg
16th January 2006, 15:32
I'm considering many more changes (move the whole job handling away from Form1 for good.. that class is way too large and half the job creation is already in JobUtil).
Definitely! The changes in my patch help abstract things a little bit -- e.g. functions like changeVideoOutputExtention and verifyVideoSettings now pass strings in & out instead of manipulating the forms directly -- but the knowledge contained in these functions shouldn't be "owned" by the MeGUI class in the first place. I've cleaned up the logic in many places, but it's still too complex, probably the source of many bugs, and very very difficult to extend.
Look at all the places where the MeGUI class has to know "insider information" about the various classes. That should never happen; we should be asking the classes (or their base interface) for info. For example, I split out part of the verification logic into MeGUI.isFirstPass(). Why should MeGUI have to figure this out? It should be a public property of the currently selected Encoder. The good news, I suppose, is that we can use the existing mess of code to figure out exactly what info needs to be available from each interface -- figuring this out when you originally designed the architecture would've been more "correct" but obviously harder.
Doom9
16th January 2006, 15:38
It should be a public property of the currently selected Encoder. Of the encoder? That implies you instantiate one (only jobhandler knows which), and send the settings to it.. shouldn't there be an easier way, like asking a VideoCodecSettings object?
figuring this out when you originally designed the architecture would've been more "correct" but obviously harder.Keep in mind that the redesign was done at a time when there was but one videoencoder, one audio encoder and nothing more.. and for starters there wasn't even a concept of a job.. it was configure.. then encode, then configure again, and encode again, etc.
Which additional features (except container) does You need in xvid_encraw?I've given syskin a list.. hopefully he'll come through with them. If the darned thing were written in C# I'd lay hands on it myself, but I like to avoid non managed languages unless I'm being paid not to.
dimzon
16th January 2006, 16:06
I've given syskin a list.. hopefully he'll come through with them. If the darned thing were written in C# I'd lay hands on it myself, but I like to avoid non managed languages unless I'm being paid not to.
I have take look @ xvidcore API. It's possible to write C# code to invoke it. Maybe it will be best solution for utilizing xvid in MeGUI?
Doom9
16th January 2006, 16:26
I have take look @ xvidcore API. It's possible to write C# code to invoke it. Maybe it will be best solution for utilizing xvid in MeGUI?Well.. if you are willing to do that, by all means :) Doing that might even make it possible to get AVI output..
Richard Berg
16th January 2006, 17:24
shouldn't there be an easier way, like asking a VideoCodecSettings object?
Maybe so. I haven't looked at the new interfaces enough to see exactly which object should encapsulate which knowledge. I'm just certain none of it should go in Form1.
It's possible to write C# code to invoke it.
If we don't mind adding dependencies on other code (including DirectShow), the same is true of dvrms -> mpeg2 conversion...the project I linked is already pure C#. At present, though, I think MeGUI is better set up to use external command-line tools. Running jobs "internally" means we need to spin off & synchronize with another thread, then refactor the Progress window, and probably more work I haven't thought of...
Doom9
16th January 2006, 17:37
well.. the dependency isn't any different from an encoder executable. The VfW dependency is already there and used quite heavily. I don't see how handling a dll would be much different from handling the commandline encoder.. we still keep track of number of frames encoded, just have to decode the frame first, send it to the encoder, receive a buffer back, and dump it to a file. The Progress window would still remain the same (well... it could use some improvement.. perhaps the statusupdate could have a message property and use more generic filesize1 and filesize2 names or an array of filesizes). Still.. those aren't very significant things imho. And the whole encoding thing is threaded anyway (now not so visible anymore.. it was much more apparent with the old code where I started threads myself)
Anyway, looking at the new encoders, any idea how a fully generalized JobHandler would look like? I'm still having somewhat of a beef at how much I can generalize.. I think a JobHandler -> VideoEncoder/AudioEncoder/Muxer -> Commandline(venc/aenc/mux) -> xyzencoder/muxer creates overhead and that basically there should be a basic CommandlineToolHandler.. but it's not possible that a xyzencoder inherits from both JobHandler and ComandlineToolHandler. Right now I'm unsure about the most efficient architecture that causes the smallest amount of code redundancy.
dimzon
16th January 2006, 17:41
Anyway, looking at the new encoders, any idea how a fully generalized JobHandler would look like? I'm still having somewhat of a beef at how much I can generalize.. I think a JobHandler -> VideoEncoder/AudioEncoder/Muxer -> Commandline(venc/aenc/mux) -> xyzencoder/muxer creates overhead and that basically there should be a basic CommandlineToolHandler.. but it's not possible that a xyzencoder inherits from both JobHandler and ComandlineToolHandler. Right now I'm unsure about the most efficient architecture that causes the smallest amount of code redundancy.
What is difference between JobHandler and ComandlineToolHandler? (I don't have fresh source code)
Doom9
16th January 2006, 18:04
JobHandler would be the generic implementation of IJobHandler.. it's the base class to handle any job. CommandlineToolHandler currently doesn't exist.. but it would be a base class to handle any commandline tool.. the actual commandline encoders and muxers would derive from it.
Richard Berg
16th January 2006, 18:11
Would this inheritance structure work?
x264Encoder
/ \
/ \
IVideoEncoder ICommandLineHandler
\ /
\ /
IJobHandler
dimzon
16th January 2006, 18:17
but it's not possible that a xyzencoder inherits from both JobHandler and ComandlineToolHandler
Richard Berg was first ;)
If CommandLineHandler is just a utility to wrap commandline tool execution You can use another pattern (pattern-adapter && pattern-strategy):
interface IJobHandler
{
...
}
interface IVideoEncoder:IJobHandler
{
...
}
class CommandLineHandler
{
...
}
class x264Encoder: IVideoEncoder
{
CommandLineHandler helper = new CommandLineHandler(...);
private void IVideoEncoder.Foo()
{
helper.Foo2(...);
}
}
dimzon
16th January 2006, 18:50
Seems like it's possible to write C# wrapper around libmatroska for muxing puposes :) So xvid_ecncraw with mkv output in C# can be a reality!
Doom9
16th January 2006, 20:08
@Richard: work of course, but I actually need some processing.. for instance the CommandlineHandler should at least offer methods to read and dispatch lines read from stdout / stderr.
The videoencoder right now has only little intelligence... it can figure out which VideoEncoder it needs based on the settings given in the job.. that logic still needs to go someplace and it's common logic. It can also calculate the completion percentage and fill in the filesize. Granted, the filesize could also be done by a class higher up the hierarchy.. if you go lower as in the two proposals, you end up having to copy&paste that code again.
Also, for both proposals: who handles the encoder instantiation so that in the main GUI, all that it finally does is call JobHandler.process(Job job)?
So xvid_ecncraw with mkv output in C# can be a reality!I'm glad you're volunteering. Though, I think the audio functionality should have priority as it allows the integration of yet another unique feature I have in mind for MeGUI: frame accurate cutting based on AviSynth.. once audio encoding uses AviSynth that'll be a realitiy and that is a strong USP for MeGUI.
And at some time we might have to rethink the GUI.. right now it starts with what is good for us advanced users who know how to get things done.. but a lot of people are overwhelmed by that and would be better of with something simpler aking the one click mode.
Richard Berg
16th January 2006, 21:31
Do you mean being able to AutoEncode directly from an AVS file (without having to split the audio out into a separate WAV)? That would be really great.
Doom9
16th January 2006, 23:24
Do you mean being able to AutoEncode directly from an AVS fileYup.. that's the goal.
Richard Berg
17th January 2006, 00:02
Awesome. I haven't looked at enough MeGUI architecture to answer the previous questions, but I'll keep refactoring here & there when it makes sense.
berrinam
17th January 2006, 01:07
0.2.3.2030 17 Jan 2006
Added support for analysis passes of avs scripts (the button was added in 2028)
Richard Berg
17th January 2006, 03:24
What does that do -- render out to null? For use with plugins like Call() and SSIM()?
Do I need to update my patch again?
berrinam
17th January 2006, 03:38
Yes, it just requests the frame and ignores it. Just as you said, for functions that write to files. This also includes 2pass scripts (eg DeDup and hybrid TIVTC). Perhaps 2pass AviSynth support should be added (it would allow for a better mode of IVTC'ing).
You might need to update your patch, but I'm not sure... actually, from your changelog, that doesn't seem to be the case.
I would integrate your patch into CVS, but I don't have access to it (pending approval of a mod). If you use the SourceForge patch tracker (http://sourceforge.net/tracker/?group_id=156112&atid=798478), then it's easier for me to access and integrate, because I don't have to wait for a mod's approval. OTOH, you need a SF account to post patches there.
Richard Berg
17th January 2006, 04:12
Forgot about mod approval -- I shouldn't use forum attachments, that's me being lazy. It's on SF now (http://sourceforge.net/tracker/index.php?func=detail&aid=1407878&group_id=156112&atid=798478). Here's a link (http://forum.doom9.org/showthread.php?p=768866#post768866) to the post with the changelist.
Richard Berg
17th January 2006, 04:22
Is it just me or is the menu bar still not working?
berrinam
17th January 2006, 05:01
Is it just me or is the menu bar still not working?
This is fixed in my local version. After I fix the CC issues, I will commit it (including your patch).
berrinam
17th January 2006, 05:19
New CVS Update (it's a big one)
0.2.3.2031 17 Jan 2006
Added Richard Berg's contextmenu changes patch:
Feature changes:
- queueContextMenu
- added Delete button
- fixed logic so buttons are disabled when no items selected
- changed order so most common items are toward the top
- added hotkeys
- audioOutput & videoOutput textboxes are now editable
- drag-n-drop is now disabled unless the Input tab is selected
- error messages related to audio & video job setup are now more helpful/detailed
Refactoring changes:
- new enum CodecType (works just like FileType)
- rewrote verifyVideoSettings & assorted helper methods, called it whenever queueing a video job
- ditto verifyAudioSettings
Other changes:
-added a contextmenustrip for the tray icon
-minimize to tray hides the progress window
-closing MeGUI while a job is running now calls abort instead of aborting manually
-fixed menus for megui-x264
-fixed loading of avs and hfyu jobs
-moved start/stop pause/play changes to a separate function
Doom9
17th January 2006, 09:25
I think we should set up someting like this: automatic daily CVS exports that are zipped along with a compile-x264.bat and compile-full.bat which compile the x264 and full release respectively, then publish this somewhere. That way we don't have to worry about making releases, and even the most clueless people can compile their own builds (that's what the compile files are for.. if you have the runtime, you can compile). That way, there are no more cumbersome releases for us to do and people can always use the latest code.
berrinam
17th January 2006, 10:21
Automatic CVS exports would be good. I don't know if they are possible. However, people will still want binaries, just because that is what they always get. We can't completely stop releasing binaries.
dimzon
17th January 2006, 12:05
I think we should set up someting like this: automatic daily CVS exports that are zipped along with a compile-x264.bat and compile-full.bat which compile the x264 and full release respectively, then publish this somewhere. That way we don't have to worry about making releases, and even the most clueless people can compile their own builds (that's what the compile files are for.. if you have the runtime, you can compile). That way, there are no more cumbersome releases for us to do and people can always use the latest code.
Take look @ Build Facility @ sf.net
dimzon
17th January 2006, 12:14
Also, for both proposals: who handles the encoder instantiation so that in the main GUI, all that it finally does is call JobHandler.process(Job job)?
I have an ansewer but You don't like it :) Job itself :) You can use pattern-facility:
Job provide some facility to create encoder
interface IJobHandlerFacility
{
IJobHandler CreateJobHandlerFor(IJob job)
}
interface IJob
{
IJobHandlerFacility HandlerFacility{get;}
}
...
job.HandlerFacility.CreateJobHandlerFor(job)
...
or You can wrap this call into job too:
abstract class Job:IJob
{
public IJobHandler CreateJobHandler()
{
(this as IJob).HandlerFacility.CreateJobHandlerFor(this)
}
}
Though, I think the audio functionality should have priority as it allows the integration of yet another unique feature I have in mind for MeGUI: frame accurate cutting based on AviSynth.. once audio encoding uses AviSynth that'll be a realitiy and that is a strong USP for MeGUI.
Yes, but I can't work on it without version control
And at some time we might have to rethink the GUI.. right now it starts with what is good for us advanced users who know how to get things done.. but a lot of people are overwhelmed by that and would be better of with something simpler aking the one click mode.
Agreed by 1000000% All my friends blame MeGUI for user unfriendly GUI
Doom9
17th January 2006, 12:19
Yes, but I can't work on it without version controlWhy? Mutant_Fruit and Richard Berg don't have CVS access and they are still contributing.
@I have an ansewer but You don't like it:You are right, I don't like it at all. To make matters worse, your approach requires that a job be aware of the MeGUI settings.. it has to return a jobhandler in function of the x264 / xvid encoder, and in the future which audio encoding mode is chosen. So you may have eliminated knowledge at one place only to put a lot of info inside a job that has no business being there.
dimzon
17th January 2006, 12:25
Why? Mutant_Fruit and Richard Berg don't have CVS access and they are still contributing.
I'm worry about conflicts (I need transactional atomic CheckIn/CheckOut).
berrinam
17th January 2006, 12:35
@Doom9: Is there a reason you want to restrict CVS access? I certainly think it would be easier to be able to avoid the patching system.
max-holz
17th January 2006, 12:45
As I can see in other project on sourceforge there is a restricted group of developers and other people that contribute submitting patches via bugzilla.
Doom9
17th January 2006, 13:15
@Doom9: Is there a reason you want to restrict CVS access?Considering that I was up till 4 am on Sunday morning because I fucked up a commit (or... CVS let me) and had to fix it (well, you were a big part of it teaching me how to handle the merge tool), I think that makes for a pretty strong argument to limited access.
I'm worry about conflictsExcept for the settings, I see no conflicts whatsoever. You have a look at all the audio encoding classes, add a little code that selects your own audio encoder, and after that you have full control. For starters you can also only add additional paths you need to MeGUISettings without exposing them in the GUI.. that will not cause any conflicts whatsoever. I don't think you should create a new class of Job, or AudioSettings but instead use what is already available.. the only changes really are to be made in the classes derived from AudioEncoder plus additional paths in MeGUISettings.
And in the end when you create a patch it's up to somebody with CVS access to integrate it..
dimzon
17th January 2006, 13:20
Considering that I was up till 4 am on Sunday morning because I fucked up a commit (or... CVS let me) and had to fix it (well, you were a big part of it teaching me how to handle the merge tool), I think that makes for a pretty strong argument to limited access.
In other hand I have 5-year expiriense working with source version control (not CVS but VSS)...
Except for the settings, I see no conflicts whatsoever. You have a look at all the audio encoding classes, add a little code that selects your own audio encoder, and after that you have full control. For starters you can also only add additional paths you need to MeGUISettings without exposing them in the GUI.. that will not cause any conflicts whatsoever. I don't think you should create a new class of Job, or AudioSettings but instead use what is already available.. the only changes really are to be made in the classes derived from AudioEncoder plus additional paths in MeGUISettings.
I want to perform some reactoring @ audio settings form (inheritance etc).
Ok, You can provide me fresh sources. Then I will add my functionality and sent it back to You. And merging with CVS woud be You problem. Does You agree?
Doom9
17th January 2006, 13:26
@dimzon: I've added you as a developer. However, when it comes to refactoring, the same rules still apply: ask me before you do anything. As far as the audio configuration dialogs go, you are cleared to modify those.. everybody else hands off please. Keep in mind though that I'd not yet like to lose the besweet encoding (it should be able to switch.. even if only by a non GUI exposed bool in the MeGUIsettings), and make your new audio encoder integrate with the current architecture.
dimzon
17th January 2006, 13:30
However, when it comes to refactoring, the same rules still apply: ask me before you do anything.
Ok. I will perform Audio Dialogs Refactoring & a little MeGuiSettings changes & cleanups
Keep in mind though that I'd not yet like to lose the besweet encoding (it should be able to switch.. even if only by a non GUI exposed bool in the MeGUIsettings), and make your new audio encoder integrate with the current architecture.
Ok.
dimzon
17th January 2006, 13:46
2 All
How does You commit changes to CVS?
I'm trying to use "Commit..."
In C:\Documents and Settings\DAlexandrov\My Documents\Visual Studio 2005\Projects\MeGUI\MeGUI-src.CVS: "C:\Program Files\TortoiseCVS\cvs.exe" "-q" "commit" "-m" "3 additional properties for faac, neroaac and lame" "MeGUISettings.cs"
CVSROOT=:ext:dimzon@cvs.sourceforge.net:/cvsroot/megui
cvs: rcs.c:4188: RCS_checkout: Assertion `rev == ((void *)0) || ((*__ctype_b_loc ())[(int) (((unsigned char) *rev))] & (unsigned short int) _ISdigit)' failed.
cvs [commit aborted]: received abort signal
Error, CVS operation failed
Doom9
17th January 2006, 13:55
never happend to you in 5 years? It happened for my second commit. Here's what you should not do: do a fresh CVS checkout, overwrite those files with your changed ones, then commit... that's what I did and it's no fun. I'm afraid it looks like you're in for a manual treat (I suggest a fresh checkout, compare files and merge your changes). But perhaps somebody knows more.. either way it looks like a bugreport for tortoise would be in order.
dimzon
17th January 2006, 14:02
never happend to you in 5 years?
Microsoft Visual Source Safe works fine!
dimzon
17th January 2006, 14:16
2 All
How does You commit changes to CVS?
I'm trying to use "Commit..."
In C:\Documents and Settings\DAlexandrov\My Documents\Visual Studio 2005\Projects\MeGUI\MeGUI-src.CVS: "C:\Program Files\TortoiseCVS\cvs.exe" "-q" "commit" "-m" "3 additional properties for faac, neroaac and lame" "MeGUISettings.cs"
CVSROOT=:ext:dimzon@cvs.sourceforge.net:/cvsroot/megui
cvs: rcs.c:4188: RCS_checkout: Assertion `rev == ((void *)0) || ((*__ctype_b_loc ())[(int) (((unsigned char) *rev))] & (unsigned short int) _ISdigit)' failed.
cvs [commit aborted]: received abort signal
Error, CVS operation failed
Ok. Just do not perform "unedit" command before
dimzon
17th January 2006, 15:56
Doom9, I have some questions/proposals:
1) Show command line @ AudioSettingsDialog
What I must output there (all processing except encoding is done by AviSynth script)
2) Multichannel code. Current solution consist of 2 radio buttons (stereo && 5.1) & 1 combo box (stereo, dpl, dpl2). I propose 1 combobox instead:
Name: Multichannel Processing
Values:
Keep Original Channel Count
Convert To Mono
Downmix to Stereo
DPL Downmix
DPL II Downmix
Doom9
17th January 2006, 16:02
2) Multichannel code. Current solution consist of 2 radio buttons (stereo && 5.1) & 1 combo box (stereo, dpl, dpl2). I propose 1 combobox instead:
Name: Multichannel ProcessingThat works for your dialog, but not the BeSweet one.. it needs to be told if the source is 2.0 is 5.1 (well, not exactly told.. but you need the construct a commandline that works for either 5.1 sources and keeps 'em that way, or works for 5.1 with downmix/2.0 sources). Changing these options in the existing dialog would make besweet encoding impossible as besweet neets to be told if it has to operate in 2.0 or 5.1 mode.. even though it would be perfectly capable of figuring that out on its own.
1) Show command line @ AudioSettingsDialog
What I must output there (all processing except encoding is done by AviSynth script) Well, you're still running a commandline encoder somewhere, are you not? So the commandline for it would be appropriate.
dimzon
17th January 2006, 16:46
That works for your dialog, but not the BeSweet one.. it needs to be told if the source is 2.0 is 5.1 (well, not exactly told.. but you need the construct a commandline that works for either 5.1 sources and keeps 'em that way, or works for 5.1 with downmix/2.0 sources). Changing these options in the existing dialog would make besweet encoding impossible as besweet neets to be told if it has to operate in 2.0 or 5.1 mode.. even though it would be perfectly capable of figuring that out on its own.
I'm planning to write managed wrapper around mediaInfo.dll to obtain original channel count in beSweet case..
Well, you're still running a commandline encoder somewhere, are you not? So the commandline for it would be appropriate.
Ok.
Doom9
17th January 2006, 16:54
I'm planning to write managed wrapper around mediaInfo.dll to obtain original channel count in beSweet case..Don't bother.. once your avisynth based encoding works and we are sure we're not going to lose functionality by removing the besweet part, the besweet part will be removed. It makes little sense to invest additional effort into something that is going to be gone sooner or later.
In addition, it wouldn't really always help.. consider the case where somebody is configuring audio first (e.g. creating a profile), and then loading the actual file. So in the end you'd have to override the commandline at the beginning of encoding to adapt in function of the source properties..
dimzon
17th January 2006, 17:03
2 all Developers
New file @ CVS - EmumProxy.cs
this is helper class to bind Enum's to UI with friendly names
use sample is commented out @ the end of file (take a look)
ps. May be not very optimal (private implementation is subject of change)
public enum DownmixMode
{
[EnumTitle("Keep Original Channels")]
DoNothong,
[EnumTitle("Convert to mono")]
ToMono,
...
[EnumTitle("Dolby Pro Logic II")]
ToDPL2
}
MyCombo.Options.AddRange(EnumProxy.CreateArray(new object[]{DownmixMode.DoNothong,...,DownmixMode.ToDPL2}))
Doom9
17th January 2006, 17:06
Why not just use ints? That works fine for the ProcessPriority enum (you can find it in Job.cs I think).. it is mapped to a dropdown.
Hmm.. on second thought, is the point to have the enum names in text?
dimzon
17th January 2006, 17:10
Don't bother.. once your avisynth based encoding works and we are sure we're not going to lose functionality by removing the besweet part, the besweet part will be removed.
Isn't existing technology implementation (BeHappy) enought to be sure? Maybe I will wait a little until You inspect BeHappy more careful?
So in the end you'd have to override the commandline at the beginning of encoding to adapt in function of the source properties..
I'm a really sorry, I do not understand You at all! Command line is _private_ implementation detail. You does not like about Job can create it's own encoder but You hold specific information for concrete encoder implementation!
dimzon
17th January 2006, 17:15
Why not just use ints? That works fine for the ProcessPriority enum (you can find it in Job.cs I think).. it is mapped to a dropdown.
If You change your enum order You must syncronize your changes with ComboBox.
Hmm.. on second thought, is the point to have the enum names in text?
Yes! You can specify friendly names for enum. This is MAIN point.
stax76
17th January 2006, 17:22
public enum DownmixMode
{
[EnumTitle("Keep Original Channels")]
DoNothong,
[EnumTitle("Convert to mono")]
ToMono,
...
[EnumTitle("Dolby Pro Logic II")]
ToDPL2
MyCombo.Options.AddRange(EnumProxy.CreateArray(new object[]{DownmixMode.DoNothong,...,DownmixMode.ToDPL2}))
}
That's nifty, exactly my way of doing things though I would automate much further. Is EnumTitle a .NET class? If so then I've missed it.
dimzon
17th January 2006, 17:28
Is EnumTitle a .NET class? If so then I've missed it.
:D
Yes, it's .NET class (but it's not a part of .NET Framework). Definitly - every MeGUI class is .NET class :)
EnumTitle is my custom attribute defined @ EnumProxy.cs
stax76
17th January 2006, 18:09
You could populate the list control by passing the enum type to a method, other than that my code is very similar:
Public Class ListBag(Of T)
Public Sub New(ByVal text As String, ByVal value As T)
Me.Text = text
Me.Value = value
End Sub
Private TextValue As String
Public Property Text() As String
Get
Return TextValue
End Get
Set(ByVal Value As String)
TextValue = Value
End Set
End Property
Private ValueValue As T
Public Property Value() As T
Get
Return ValueValue
End Get
Set(ByVal Value As T)
ValueValue = Value
End Set
End Property
Public Shared Sub SelectItem(ByVal cb As ComboBox, ByVal value As T)
Dim selectItem As Object = Nothing
For Each i As ListBag(Of T) In cb.Items
If i.Value.Equals(value) Then
selectItem = i
End If
Next
If Not selectItem Is Nothing Then
cb.SelectedItem = selectItem
End If
End Sub
Public Shared Function GetValue(ByVal o As Object) As T
Return DirectCast(DirectCast(o, ListBag(Of T)).Value, T)
End Function
Public Shared Sub PopulateList(ByVal l As IList)
For Each i As T In System.Enum.GetValues(GetType(T))
l.Add(New ListBag(Of T)(NameAttribute.GetEnumName(Of T)(i), i))
Next
End Sub
Public Overrides Function ToString() As String
Return Text
End Function
End Class
<AttributeUsage(AttributeTargets.All)> _
Public Class NameAttribute
Inherits Attribute
Public Sub New(ByVal name As String)
ValueValue = name
End Sub
Private ValueValue As String
Public ReadOnly Property Value() As String
Get
Return ValueValue
End Get
End Property
Public Shared Function GetEnumName(Of T)(ByVal value As T) As String
For Each i As FieldInfo In value.GetType.GetFields
If i.GetValue(value).Equals(value) Then
Dim attributes As Object() = i.GetCustomAttributes(False)
For Each i2 As Object In attributes
If i2.GetType Is GetType(NameAttribute) Then
Return DirectCast(i2, NameAttribute).Value
End If
Next
Return i.Name
End If
Next
Throw New Exception
End Function
End Class
dimzon
17th January 2006, 20:09
New base AudioConfiguration prototype - proposal
http://img388.imageshack.us/img388/5016/untitled1lt.png
FFWD
17th January 2006, 20:26
Dimzon, I see downmix to PLII in your screenshot. So is there a way to get a Dolby Pro Logic II AAC from a 5.1 AC3? Does it also work with HE-AAC files? And more important; does the decoding actually work? (my Logitech Z-5500 supports Pro Logic II)
Doom9
17th January 2006, 21:00
@dimzon: I think the load defaults button also couldn't hurt.. it was requested for video but it makes sense for audio as well. Other than that, it looks nice. Obivously this is only the prototype for AviSynth based processing, but since that's the direction we're heading in.. it looks how it should be.
berrinam
18th January 2006, 02:24
0.2.3.2032 18 Jan 2006
Bugfix: Scripts served by scriptserver now work (that's a good thing :D)
Bugfix: Fixed problems with comma locales in string->double conversions in source detection.
Is there a way to specify the locale across the entire GUI or do some other solution, as this problem keeps coming up?
berrinam
18th January 2006, 04:03
0.2.3.2033 18 Jan 2006
Bugfix: AviSynth errors are now displayed in the preview window (changes made by looking at AVIFile code).
EDIT: This code handles YV12 input differently from other input (because YV12 needs to be converted, whereas DIB is fine). As a result, it is possible to tell whether the AviSynth output is YV12, and if it isn't, warn the user that it won't work. What I'm saying is that it is possible for MeGUI to catch the 'unsupported input colorspace' error before it occurs. It could even suggest adding converttoyv12 if it isn't actually an error.
Richard Berg
18th January 2006, 04:23
Is there a way to specify the locale across the entire GUI or do some other solution, as this problem keeps coming up?
Not really. Programmers should know that anytime you do string manipulation, you need to decide whether current locale vs. invariant locale is appropriate. This is very easy compared with the problems I encounter with localized builds & non-unicode encodings :)
Doom9
18th January 2006, 09:30
you need to decide whether current locale vs. invariant locale is appropriate.Invariant doesn't seem to cut it.. I first tried that in the getFrameNumber methods in the video encoders.. it still didn't work on those comma locales, so I forced it to en-us.
dimzon
18th January 2006, 11:42
Dear Doom9
Can you answer on this post http://forum.doom9.org/showthread.php?p=769907#post769907
Doom9
18th January 2006, 11:50
Isn't existing technology implementation (BeHappy) enought to be sure?Looking at your configuration template I'd say yes.. as long as you can cover everything in the BESweet configuration groupbox we won't have any problems.
I'm a really sorry, I do not understand You at all! Command line is _private_ implementation detail. You does not like about Job can create it's own encoder but You hold specific information for concrete encoder implementation!Make that a "currently a job holds the commandline". However, that is going to change.. in fact as it is now it doesn't make a whole lot of sense and the commandline should only be generated from the settings when encoding is to take place. That'll even permit an encoder change at the last moment (for instance mencoder <-> x264). I already had it like that in the past.. there was a reason why I changed it but I can't quite remember right now why it was.. just hoping I won't break anything if I go back to the "encoder generates commandline" approach.
As it is now, it's already possible that you change the path of the encoder after creating the job and you can still encode (except for dgindex.. it still includes the binary name in the commandline).. so we're already halfway there.. but the other half mile is to be walked...
dimzon
18th January 2006, 11:55
Looking at your configuration template I'd say yes.. as long as you can cover everything in the BESweet configuration groupbox we won't have any problems.
Does it mean I can remove BeSweet-related code?
in fact as it is now it doesn't make a whole lot of sense and the commandline should only be generated from the settings when encoding is to take place
Does it mean we does'nt need "Show commandline" option @ configuration dialog?
Doom9
18th January 2006, 12:00
Does it mean I can remove BeSweet-related code?No, as I said.. keep all the code there.. I'll remove it in time. Just don't bother with anything BeSweet related.. write your own dialogs and your own encoder derived from AudioEncoder.
Does it mean we does'nt need "Show commandline" option @ configuration dialog?No, I think that's still good.. it also helps in development (you immediately see what the commandline will be.. the only changes that can come are bitrate related when the bitrate is being automatically calculated).
dimzon
18th January 2006, 12:00
Audio via AviSynth disadvantage
Current implementation (reading audio data via VfW) can't provide detailed information about script error.
Workaround: to work with avisynth.dll directly (without VfW). Unfortunally it's impossible bcz AviSynth API can be accessed only via C++. I'm planning to write wrapper in Managed C++ to provide full power of AviSynth functionality to .NET world...
dimzon
18th January 2006, 12:09
No, as I said.. keep all the code there.. I'll remove it in time.
As you can see I'm altering AudioSettings class (adding new items in emunerations etc). So I cant "Just do not touch BeSweet code" bcz it's break compilation. There are 2 way - perform appropriate adjustments in BeSeet-related code or just remove it @ forget it...
No, I think that's still good.. it also helps in development (you immediately see what the commandline will be.. the only changes that can come are bitrate related when the bitrate is being automatically calculated).
Does it mean I must invoke command-line creation logic twice (ones in audioSettingsDialog, ones before encoding startup)?
So does it mean I can do "getCommandLine()" - a virtual method for AudioSettings?
Doom9
18th January 2006, 12:50
Current implementation (reading audio data via VfW) can't provide detailed information about script error.Neither can any of the video tools.. that's why if I can't open the script via VfW, I do not allow encoding to proceed. I think your audio encoder should do something similar.. open it, see if the properties make sense, and if not, abort and ask the user to play the script in a media player.
As you can see I'm altering AudioSettings class (adding new items in emunerations etc). So I cant "Just do not touch BeSweet code" bcz it's break compilation.So use the variables you're going to add for the avisynth part, and leave the other ones in.. that means a bloated AudioSettings class, but that can be streamlined when we dump the besweet part.
Does it mean I must invoke command-line creation logic twice (ones in audioSettingsDialog, ones before encoding startup)? Yes.
So does it mean I can do "getCommandLine()" - a virtual method for AudioSettings?Since the encoder commandline is taken from the MeGUISettings class, that would mean your derived AudioSettings classes would need to be aware of the settings.. I don't think that's such a good idea. I like the current approch where the encoder and the GUI class have a reference to the settings better.. the job and its settings shouldn't be aware of settings which mostly don't affect them, should they?
dimzon
18th January 2006, 13:53
Since the encoder commandline is taken from the MeGUISettings class
Encoder executable path, not commandline. It's possible to generate commandline arguments without full path (and add real path later).
Doom9
18th January 2006, 14:01
Encoder executable path, not commandline.Yeah, sorry about that. I think we can do away with the necessity of also showing the executable path in the codec configuration, but having the rest (generated of course) is really nice.
Sharktooth
18th January 2006, 15:00
Sorry but i have an infection of the inner hear (dont know the english medical term) that causes me vertigos and other problems.
So i cant stay too much in front of the PC and cant read too much (i cant focus on text).
Bear with me... i'll be back.
dimzon
18th January 2006, 18:01
@Doom9
public interface IJobProcessor
{
/// <summary>
/// sets up encoding
/// </summary
/// <param name="job">the job to be processed</param>
/// <param name="error">output for any errors that might ocurr during this method</param>
/// <returns>true if the setup has succeeded, false if it has not</returns>
bool setup(Job job, out string error);
.NET Has PERFECT error reporting mechanism: Exceptions && Exceptions Hadling. Why does You try propose such ugly method?
Doom9
18th January 2006, 18:17
.NET Has PERFECT error reporting mechanism: Exceptions && Exceptions Hadling. Why does You try propose such ugly method?Because I don't like exceptions? It makes you have to wrap everything into a try/catch block.. and you shouldn't use exceptions for normal program flow.. For instance, if setup returns false because the encoder is not found, it would be a resource waste to resort to an exception for that. There are quite a few instances when an error is reported back that corresponds to regular program flow and thus shouldn't use an exception.
stax76
18th January 2006, 18:27
and you shouldn't use exceptions for normal program flow.
Are you sure? Never tried it but recently I thought it could be a cheap way to abort.
Doom9
18th January 2006, 18:29
Are you sure?It says so in all the literature I should get around to reading for my certification. And Exceptions are resource intensive (I don't recall the exact specifics... but throwing an exception slows you down quite a bit as opposed to using a return variable).
Richard Berg
18th January 2006, 19:51
I don't agree with dimzon in this specific example, but he has a good point. Having to pass error messages around as parameters -- making every caller store or otherwise handle them -- is usually unnecessary work for the programmer. The most helpful feature of exceptions isn't handling them, it's the option not to. If a method isn't equipped to handle some conditions, flow simply passes to the previous caller.
Throwing an exception is kinda expensive: it causes a hardware interrupt that has to be bubbled all the way up from the kernel. Figure a few thousand CPU cycles. But performance is totally irrelevant for asynchronous GUI apps like MeGUI...so long as you're not throwing exceptions in a tight loop you'd never notice.
A decent rule of thumb: exceptions should roughly correspond with problems that are important enough to show the user an error message. If a program throws & catches often without bothering the user, it's probably overusing exceptions. (It's crazy what you sometimes see if you run badly written software it under a debugger that's set to catch all native exceptions...)
With IJobProcessor.Setup, I think using an error parameter is appropriate. Any method that calls Setup should know what to do if it receives an error string. But it should be simpler: instead of having a bool and a string, just return a string; if it's not null, it's an error.
Mutant_Fruit
19th January 2006, 00:01
From what i've been told and what i've read:
Exceptions shouldn't be used to handle normal workflow. If a value you're using has a good chance of NOT being what you expect it to be, use an if statement to see if it's valid. Don't use try/catch to find out. Exceptions are what they say.... Exceptions. They should rarely (if ever) happen.
I'd agree with Richard Berg about not needing a bool AND a string. Thats about it from me... *looks for the 'i am a n00b' poster*
Richard Berg
19th January 2006, 01:12
I wouldn't take any of these rules too far. Exceptions and return values are just tools; good programmers simply choose the best one for the job. Worrying that you'll trigger an exception often enough that someone might call it "normal" is premature optimization, which we know is the root of all evil.
In this case, forcing the immediate caller of IJobProcessor.Setup to always test the return value works ok with our design, so no exception necessary. If IJobProcessor.Setup had dozens of possible entry points, using an exception would be better because it guarantees that someone in the call stack will do something about it.
dimzon
19th January 2006, 12:57
2 Doom9, Richard Berg, Mutant_Fruit
and you shouldn't use exceptions for normal program flow..
<offtopic>
Does and you know how does woking FileMapping/VirtualMemory/PageFile mechanism? Whe you trying to addreess to non-existing page in RAM processor will generate hardware interrupt (exception). Windows catch this interrupt, look for this page in PageFile, load it to the memory. So exceptions (sometimes) is a really fine to be used in normal program flow...
Another sample - for ASP.NET programmers. When You invoke Response.End exception is trown, really, try this code
try
{
Response.End();
}
catch(Exception e)
{
Response.Write(e.ToString());
}
And yet another sample for threadind: When you invoke thread.Abort() ThreadAbordet exeption is throwing
</offtopic>
But my sample IS NOT A NORMAL PROGRAM FLOW.
If JobProcessor can't setup it mean:
You trying to setup JobProcessor for unsupported job
Job configuration is invalid
JobProcessor configuration is invalid
Another shit happens
All options is exceptions, isn't it...
With IJobProcessor.Setup, I think using an error parameter is appropriate. Any method that calls Setup should know what to do if it receives an error string.
I really don't think You will have multiple places to call IJobProcessor.Setup, but if You really want to do it end you does'nt want to wrap your code using try/catch @ every place you can use PATTERN-ADAPTER for it:
public interface IJobProcessor
{
void Setup(Job job);
}
public class JobProcessorAdapter
{
private IJobProcessor _proc;
public JobProcessorAdapter(IJobProcessor p)
{
_proc = p;
}
public bool setup(Job job, out string error)
{
try
{
_proc.Setup(job);
return true;
}
catch(Exception e)
{
error = e.Message;
return false;
}
}
}
2 All developers
I have found another ugly code:
MyForm f = new MyForm();
if(f.ShowDialog()==DialogResult.OK)
{
// Do something
}
Proper way:
using(MyForm f = new MyForm())
{
if(f.ShowDialog(this)==DialogResult.OK)
{
// Do something
}
}
Doom9
19th January 2006, 13:30
I have found another ugly code:What is the problem with it? The local method variable will go out of scope as soon as you exit the method and will be garbage collected..
dimzon
19th January 2006, 14:14
What is the problem with it? The local method variable will go out of scope as soon as you exit the method and will be garbage collected..
Form implemets IDisposabe interface. It means it hold unmanaged resources. Unmanaged resources can't be collected via garbage collector.
Really, garbage collecter will be called only @ deficit memory. But you object can hold window handler or other handles, SqlConnections e.t.c.
Read this:
http://msdn.microsoft.com/library/default.asp?url=/msdnmag/issues/1100/GCI/TOC.ASP?frame=true
http://msdn.microsoft.com/library/default.asp?url=/msdnmag/issues/1200/GCI2/TOC.ASP?frame=true
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/dotnetgcbasics.asp?frame=true
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemidisposableclasstopic.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/deepc10192000.asp
dimzon
19th January 2006, 14:33
Dear Doom9.
MeGUI invokes DGDecode.dll direcly. It causes such problem:
DgDecode.dll must be im MeGUI folder or be avaluable @ PATH enviroment string.
In other hand DGDecode.dll MUST be @ avisynth\plugins folder in order to be able open scripts.
So I want to propose solution - let's open d2v files via AviSynth temporaly script file.
Mutant_Fruit
19th January 2006, 15:00
Whe you trying to addreess to non-existing page in RAM processor will generate hardware interrupt (exception)
Aye. This is what i would classify as an "exception". You've tried doing something that is 'impossible'. You can't access a non-existing page, so rightfully an exception should be thrown. This would be normal program flow.
But in this example assume the string "str_value" usually contains an integer, but could occasionally be null....
try
{
int result = Convert.ToInt32(str_value);
}
catch
{
int result = -1; //the string was null or contained invalid data
}
Thats the wrong way of doing it. The right way is this:
try
{
if(str_value != null)
int result = Convert.ToInt32(str_value);
}
catch
{
int result = -1; //string contained invalid data
}
You check to see if it's null BEFORE trying to convert it. That way exceptions will only happen when an "unexpected" event happens. Being null is an expected event that should be checked for.
dimzon
19th January 2006, 15:06
@Mutant_Fruit
But in this example assume the string "str_value" usually contains an integer, but could occasionally be null..
agreed 100%. But IF You cange this stament to
But in this example assume the string "str_value" MUST contains an integer then
try
{
int result = Convert.ToInt32(str_value);
}
catch
{
int result = -1; //the string was null or contained invalid data
}
is valid.
* You trying to setup JobProcessor for unsupported job
* Job configuration is invalid
* JobProcessor configuration is invalid
* Another shit happens
You MUST call JobProcessor for supported job type only
You MUST provide valid job
You MUST provide valid configuaration
So using exceptions in that case is good, is'nt it?
Doom9
19th January 2006, 15:15
* You trying to setup JobProcessor for unsupported jobCan't happen
* Job configuration is invalidCan't happen
* JobProcessor configuration is invalidCan't happen
* Another shit happensLike?
The only thing that can go wrong in the setup is that the encoder cannot be found.. other than that, nothing can go wrong. It is the job of a jobdispatcher to send jobs to where they belong (yeah I know you hate the "is" type checks.. but they ensure this never ever happens). Similarly, it must not be possible to create invalid jobs.. it's the job of the jobcreator to make sure it returns a valid job, or nothing at all.. incidentally it's done that way.. jobs that would be invalid are not returned, instead you get a null value and it's not added to the queue.
dimzon
19th January 2006, 15:20
JobProcessor configuration is invalid
Can't happen
No, it can. Executable path is JobProcessor configuration.
JobProcessor configuration is invalid
Like?
Don't know. Some shit (maybe) @ some implementation...
Mutant_Fruit
19th January 2006, 19:36
@Mutant_Fruit
agreed 100%. But IF You cange this stament to
"But in this example assume the string "str_value" MUST contains an integer"
then
try
{
int result = Convert.ToInt32(str_value);
}
catch
{
int result = -1; //the string was null or contained invalid data
}
is valid.
Aye. In that case it would be valid. But in my example we knew that at times the input could be null and at times it could contain an int. In that case we should check if it is null BEFORE we try to parse out an int to avoid throwing an exception when the str_value is null. In my example, a null value can be expected and so shouldn't throw an exception.
In your example, you are relying on an int being contained in the string (str_value MUST contain an int). Since the int MUST be there, an exception should be thrown if an int is not there (i.e. the string is null or contains text).
In my example, if the string was null i could return a value indicating a fail result, but i wouldn't use an exception to let the program know that the string was null.
bool ParseOutMyInt(string str_value)
try
{
if(str_Value != null)
result = Convert.ToInt32(str_value);
else
return false; // str_value is null, therefore not parsable
//do rest of code and return true for success
}
catch
{
return false; // it failed somewhere in the code.
}
Richard Berg
19th January 2006, 20:11
Guys, at the level you're worrying about, it's just a style preference.
Doom9
19th January 2006, 20:21
Form implemets IDisposabe interface. It means it hold unmanaged resources. Unmanaged resources can't be collected via garbage collector.
I think you're misreading the interface definition. Implementing IDisposable means you give the GC a method to call to make sure everything is being cleaned up. There's no need to call finalize for any of these classes listed if you are properly cleaning up after yourself. E.g. if you close the StreamWriter there's no need for using.. it just makes the close implicit. As long as your form doesn't hold a handle, or keeping streams/connections open, there's no problem with the garbage collection (at least I didn't find anything in the articles you linked to).
Where native resources are used, they should be properly cleaned up (but obviously nobody's perfect and I might have missed something.. but for instance the avi reader implements additional cleanup stuff because it goes native).
No, it can. Executable path is JobProcessor configuration.That's not the JobProcessor configuration.. it's the MeGUI configuration. I think it's pointless to argue about these interfaces.. they may not be final, but it's what it is now.. I'd really like you to commit some code instead of always trying to run headfirst against the wall that is me opposing changes all over the place. The whole job launching mechanism is bound to be changed in the future anyway.. and I don't like changes over and over. I only changed the encoding stuff because I needed to accomodate more encoders.. and bringing everything to the same level reacquainted myself with the code that I might have to modify in the future.
Since the risk is rather high that I'll do considerable parts of the refactoring in the future as well.. it really shouldn't be a cause to step on the brakes (which is what I feel you're doing.. everybody else here has commited some code for the current "broken" architecture). A major architectural overhaul is bound to take weeks if not months and I'm not the one to put development on hold just because things aren't very pretty right now.. they still work after all.
So I want to propose solution - let's open d2v files via AviSynth temporaly script file.No.. I love my dgdecode code...not only was it a major achievement for me (I've never written interop code without any help before), and wrapping it into AviSynth just adds another dependency. Your solution is what I consider the cheap way.. other softwares do that.. I prefer to do it the hard way. And why bother at all.. it works, it has never caused any problems. It seems just another instance where you want to run headfirst in a wall instead of letting things that work be. I've made the decision to wrap dgdecode a long time ago fully aware (and with already existing code to get frames via avifile) and I'm not about to reverse that now unless you come up with an awsome reason that blows me away.. the path thing is in my "I couldn't care less" category.
Doom9
19th January 2006, 20:24
Guys, at the level you're worrying about, it's just a style preference.That's what I'm saying.. let's keep thing that work the way they are. In the end, it's still my baby in a way so as long as I keep my fingers in MeGUI, you'll always have certain things that reflect how I approach a problem.. I have never used custom exceptions (well.. except when going through the mcad courses), so I'm unlikely to start now because I just don't like try/catch code and like to handle exceptions at low levels.
It's similar for the interfaces.. if I'm going to change them.. I'll have to change all classes implementing them because a CVS commit must not break compilation.. so it's my problem in the end and I can live with that.
Mutant_Fruit
19th January 2006, 20:35
Just put the new version of the ContextHelp.xml file (written by LiFe) up on SF. Also made a few changes to the contexthelp code to account for the fact that linebreaks are picked up from the XML correctly.
And i moved some checkboxes slightly as there was a bit of overlap.
Doom9
19th January 2006, 20:46
by the way, how would you like that I feed the cutlist to the avisynth based audio encoder? In the video world it's probably an array with two ints per line, a start and end frame. I figure just before encoding I open the AviSynth script, and put a trim line at the end of the script.
stax76
19th January 2006, 22:25
I think you're misreading the interface definition. Implementing IDisposable means you give the GC a method to call to make sure everything is being cleaned up. There's no need to call finalize for any of these classes listed if you are properly cleaning up after yourself.
I'm pretty clueless about the topic but do you confuse Dispose with Finalize? I think the GC calls Finalize but not Dispose. Using ensures Dispose is called under every circumstance, even when a exception happens similar like (try/catch) finally which is also executed in every circumstance (exception, break, goto...).
dimzon
20th January 2006, 09:41
there's no problem with the garbage collection (at least I didn't find anything in the articles you linked to).
FYI: Windows form holds window handles & GDI handles even if it was unvisible!
Really IDisposable.Dispose performs cleanup(line finalizer) + remove futher finalizer invokation via GC.SuppressFinalize().
Finalization and Performance
With this basic understanding of finalization we can already deduce some very important things:
First, objects that need finalization live longer than objects that do not. In fact, they can live a lot longer. For instance, suppose an object that is in gen2 needs to be finalized. Finalization will be scheduled but the object is still in gen2, so it will not be re-collected until the next gen2 collection happens. That could be a very long time indeed, and, in fact, if things are going well it will be a long time, because gen2 collections are costly and thus we want them to happen very infrequently. Older objects needing finalization might have to wait for dozens if not hundreds of gen0 collections before their space is reclaimed.
Second, objects that need finalization cause collateral damage. Since the internal object pointers must remain valid, not only will the objects directly needing finalization linger in memory but everything the object refers to, directly and indirectly, will also remain in memory. If a huge tree of objects was anchored by a single object that required finalization, then the entire tree would linger, potentially for a long time as we just discussed. It is therefore important to use finalizers sparingly and place them on objects that have as few internal object pointers as possible. In the tree example I just gave, you can easily avoid the problem by moving the resources in need of finalization to a separate object and keeping a reference to that object in the root of the tree. With that modest change only the one object (hopefully a nice small object) would linger and the finalization cost is minimized.
Finally, objects needing finalization create work for the finalizer thread. If your finalization process is a complex one, the one and only finalizer thread will be spending a lot of time performing those steps, which can cause a backlog of work and therefore cause more objects to linger waiting for finalization. Therefore, it is vitally important that finalizers do as little work as possible. Remember also that although all object pointers remain valid during finalization, it might be the case that those pointers lead to objects that have already been finalized and might therefore be less than useful. It is generally safest to avoid following object pointers in finalization code even though the pointers are valid. A safe, short finalization code path is the best.
FYI: Invoking IDisposable.Dispose() is good programming style anycase.
That's not the JobProcessor configuration... it's the MeGUI configuration.
Yes, Okay, I can call it
JobProcessor related MeGUI configuration is invalid
instead of
JobProcessor configuration is invalid
always trying to run headfirst against the wall that is me opposing changes all over the place
I'm afraid You get me wrong (my poor english can be a reason). I'm not forcing You to make any changes (and I'm not trying to do them myself) - it's just a discussion ;)
No.. I love my dgdecode code...not only was it a major achievement for me (I've never written interop code without any help before)
I understand your motivation (but I'm complete disagree with You).
and wrapping it into AviSynth just adds another dependency. Your solution is what I consider the cheap way...
Cheap != Wrong. And don't forget - You are using DGIndex.dll for AviSynth script generation - isn't it? Using DGIndex.dll is useless without AviSynth, so opening it via AviSynth is valid way.
the path thing is in my "I couldn't care less" category.
Just take look @ SettingsForm.cs. There are ugly code to work with PATH.
And how about DllHell (one version @ AviSynth plugin folder, another @ DGIndex folder, third @ MeGUI folder). Using AVS-way you are ensure - AviSynth plugin folder version are used!
dimzon
20th January 2006, 09:44
by the way, how would you like that I feed the cutlist to the avisynth based audio encoder? In the video world it's probably an array with two ints per line, a start and end frame. I figure just before encoding I open the AviSynth script, and put a trim line at the end of the script.
Just a question - What does start and end frame means for audio?
Doom9
20th January 2006, 09:59
Using ensures Dispose is called under every circumstance, even when a exception happens similar like (try/catch) finally which is also executed in every circumstance (exception, break, goto...).my code that makes access to resources where this could be a problem is structured such that any failures are handled. I came from C# from Java where there's no using, so I'm using a pattern that works on both platforms and cleans up after itself in all cases... exceptions included. So instead of arguing semantics.. either prove with current code where I'm not cleaning up properly, or drop it.. I'm about to lose my motivation to consider making any changes at all. you're back to the let's do everything different ways I told you in the beginning I was afraid of. Why don't you do something that actualy benefits the user like adding the avs based audio encoder and answering my question on how you want the cutlist..
It is a bad idea to take an existing project and change everything to your coding style.. what if the person whose style it corresponds leaves in midstream? What if you don't see it through? Don't answer that.. I've run a site for almost 6 years now and there's been only one other person I've been able to completely rely on.. all others have come and gone.. so that's what I expect will happen with MeGUI.. it's the open source approach.. people come and go.. but I know I'll stick around. Making changes just because they fit somebody's coding style better are useless changes for a project.
dimzon
20th January 2006, 10:09
either prove with current code where I'm not cleaning up properly, or drop it...
private void mnuToolsSettings_Click(object sender, System.EventArgs e)
{
#if FULL
SettingsForm sform = new SettingsForm(this.videoProfiles, this.audioProfiles,
this.videoProfile.SelectedIndex, this.audioProfile.SelectedIndex);
#else
SettingsForm sform = new SettingsForm();
#endif
sform.Settings = this.settings;
if (sform.ShowDialog() == DialogResult.OK)
{
this.settings = sform.Settings;
this.shutdownCheckBox.Checked = this.settings.Shutdown;
this.saveSettings();
// this is here to prevent output extension mismatches when the x264 encoder is changed
videoOutput.Text = changeVideoOutputExtention(videoOutput.Text);
}
}
sform still hold unmanaged GUI resources (windows handles, etc) until it be garbage collected. But it will no garbage collector invocation until deficit of memory. Deficit of memory != deficit of windows handles (.NET Runtime can't say - "ok, there are not enought GDI resources, let's collect garbage").
dimzon
20th January 2006, 10:11
Why don't you do something that actualy benefits the user like adding the avs based audio encoder and answering my question on how you want the cutlist..
I'm working @ audio right now && I was answered to Your question about cutlist.
Doom9
20th January 2006, 10:28
sform still hold unmanaged GUI resources (windows handles, etc)None of the articles you linked to ever said that.. it would be rather stupid for the .NET designer to by default have the most used GUI class to not be garbage collected by default. And code is no proof.. proff is tracking memory usage.. it's quite hard to prove memory waste in a garbage collected environment.. but if you want to change my mind, that's what you need to do.
I've never seen a form sample using using, and I've seen many samples using streamreader using my approach at cleaning up .
ust a question - What does start and end frame means for audio?That's what I wanted to know from how.. what do you want in order to write the proper avisynth script? I expect that the encoder takes care of that given a cutlist in a format it understands. If you have an FPS along with framenumbers, you could translate it into timecodes.. would that work.. or do you prefer to have timecodes to begin with (and if so in which format). Here's your chance to have things your way for once.. take it ;)
dimzon
20th January 2006, 11:03
None of the articles you linked to ever said that.. it would be rather stupid for the .NET designer to by default have the most used GUI class to not be garbage collected by default.
Seem's like You don't understand me at all. No, it garbage collected by default(at this point finalizer are used) BUT garbage collector invocation time is undeterminied. Just try to understand - Garbage Collector will be invoked only when you try to allocate memory (create new object) && there are not enought memoty @ managed pool. But it does'nt affect on other resources like GDI objects. It means if You still have enought memory @ managed pool && you still can get out of resources! If You don't trust me just take look @ System.Windows.Forms.Control (base for all winform controls including Form itself) decompiled code:
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
~Component()
{
this.Dispose(false);
}
protected override void Dispose(bool disposing)
{
if (this.GetState(0x200000))
{
object obj1 = this.Properties.GetObject(Control.PropBackBrush);
if (obj1 != null)
{
IntPtr ptr1 = (IntPtr) obj1;
if (ptr1 != IntPtr.Zero)
{
SafeNativeMethods.DeleteObject(new HandleRef(this, ptr1));
}
this.Properties.SetObject(Control.PropBackBrush, null);
}
}
if (disposing)
{
if (this.GetState(0x1000))
{
return;
}
if (this.GetState(0x40000))
{
object[] objArray1 = new object[] { "Dispose" } ;
throw new InvalidOperationException(SR.GetString("ClosingWhileCreatingHandle", objArray1));
}
this.SetState(0x1000, true);
try
{
this.DisposeAxControls();
ContextMenu menu1 = (ContextMenu) this.Properties.GetObject(Control.PropContextMenu);
if (menu1 != null)
{
menu1.Disposed -= new EventHandler(this.DetachContextMenu);
}
if (this.window.Handle != IntPtr.Zero)
{
this.DestroyHandle();
}
if (this.parent != null)
{
this.parent.Controls.Remove(this);
}
Control.ControlCollection collection1 = (Control.ControlCollection) this.Properties.GetObject(Control.PropControlsCollection);
if (collection1 != null)
{
for (int num1 = 0; num1 < collection1.Count; num1++)
{
Control control1 = collection1[num1];
control1.parent = null;
control1.Dispose();
}
this.Properties.SetObject(Control.PropControlsCollection, null);
}
base.Dispose(disposing);
return;
}
finally
{
this.SetState(0x1000, false);
this.SetState(0x800, true);
}
}
if ((this.window != null) && (this.window.Handle != IntPtr.Zero))
{
UnsafeNativeMethods.PostMessage(new HandleRef(this.window, this.window.Handle), 0x10, 0, 0);
this.window.ReleaseHandle();
}
base.Dispose(disposing);
}
Conclusion:
Settings form consist of more than 30 controls. It means every time you use it you will got unclosed GDI resources && at lest 30 unrequed object to be promoted to gen2 (finalizer effect).
And code is no proof.. proff is tracking memory usage...
Ok, if You still need it even afer decompiled code I can do it!
I've never seen a form sample using using, and I've seen many samples using streamreader using my approach at cleaning up .
Actually it means You got bad samples ;)
That's what I wanted to know from how.. what do you want in order to write the proper avisynth script? I expect that the encoder takes care of that given a cutlist in a format it understands. If you have an FPS along with framenumbers, you could translate it into timecodes.. would that work.. or do you prefer to have timecodes to begin with (and if so in which format). Here's your chance to have things your way for once.. take it ;)
Just one stupid question before - can you provide me usecase of it?
Doom9
20th January 2006, 11:19
can you provide me usecase of it?You capture from TV, and you want to cut out ads. Editing the video frame accurately is no problem, but the problem is make the audio match.. there's no way to cut at the exact points where the video was cut. So the way to have audio properly match video would be to decode the audio to wav, then cut using a wav editor, then encode to the final format. Using avisynth based audio encoding, we can skip the decode to wav and separate editing step by directly trimming the avisynth script. I have no problem doing that for the video avisynth script.. but I have no idea how it applies to your audio only avisynth scripts.
Actually it means You got bad samples What is bad in something like this:
StreamReader sr = null;
try
{
sr = new StreamReader("somefilepath");
string line = "";
while ((line = sr.ReadLine()) != null)
Console.WriteLine(line);
}
catch (Exception e)
{
Console.WriteLine("An exception has ocurred: " + e.Message);
}
finally
{
if (sr != null)
{
try
{
sr.Close();
}
catch (Exception x)
{
Console.WriteLine("an exception ocurred when closing the streamreader: " + x.Message)
}
}
}
This does just the same as
using(StreamReader sr = new StreamReader("somefile"))
{
string line = "";
while ((line = sr.ReadLine()) != null)
{
ConsoleWriteLine(line);
}
}
The latter is just a bit shorter (and I suspect there must be some error handling as well.. or does using catch those as well and what does it do with them?
Functionality wise, the first code bit ensures that the streamreader is in a state that it can be garbage collected because the ensured call to close ensures that any non managed references are properly disposed of.
dimzon
20th January 2006, 11:31
You capture from TV, and you want to cut out ads. Editing the video frame accurately is no problem, but the problem is make the audio match.. there's no way to cut at the exact points where the video was cut. So the way to have audio properly match video would be to decode the audio to wav, then cut using a wav editor, then encode to the final format. Using avisynth based audio encoding, we can skip the decode to wav and separate editing step by directly trimming the avisynth script. I have no problem doing that for the video avisynth script.. but I have no idea how it applies to your audio only avisynth scripts.
Hmmm. I can propose a little another algorytm. Create such script:
# Get audio && video
video = ...
audio = ...
# Dub them
audioDub(video,audio)
# Perform trimming
trim(....)
atfer this you can use this script as video source && as audio source both ;)
try
{
using(StreamReader sr = new StreamReader("somefile"))
{
string line = "";
while ((line = sr.ReadLine()) != null)
{
ConsoleWriteLine(line);
}
}
}
catch(Exception e)
{
Console.WriteLine(e.Message);
}
Both code are equal bcz:
public override void Close()
{
this.Dispose(true);
}
void IDisposable.Dispose()
{
this.Dispose(true);
}
Doom9
20th January 2006, 11:42
atfer this you can use this script as video source && as audio source bothI thought of that but the problem's are glaring: what if the user only wants to encode audio? I'm afraid manual mode means separated encoding. Your approach only works in case both audio and video are being encoded.. there's also the option on automated or one click mode where audio is only being muxed.. creating yet another problem because audiodub needs two parameters.
And doesn't Form.Close call Dispose?
dimzon
20th January 2006, 11:51
I thought of that but the problem's are glaring: what if the user only wants to encode audio? I'm afraid manual mode means separated encoding. Your approach only works in case both audio and video are being encoded.. there's also the option on automated or one click mode where audio is only being muxed.. creating yet another problem because audiodub needs two parameters.
Let's think together step by step... If user want oly to encode audio nobody force him to encode video but using both (audio & video) @ script allows him to be sync. Does you need trimming @ one click mode - no. Does you need trimming @ automated mode - I don't think so... Correct me if I'm wrong.
And doesn't Form.Close call Dispose?
Really no, bcz you can ReOpen form after closing ;)
public void Close()
{
if (base.GetState(0x40000))
{
object[] objArray1 = new object[] { "Close" } ;
throw new InvalidOperationException(SR.GetString("ClosingWhileCreatingHandle", objArray1));
}
if (base.IsHandleCreated)
{
base.SendMessage(0x10, 0, 0);
}
}
Doom9
20th January 2006, 12:05
Let's think together step by step... If user want oly to encode audio nobody force him to encode video but using both (audio & video) @ script allows him to be sync. Does you need trimming @ one click mode - no. Does you need trimming @ automated mode - I don't think so... Correct me if I'm wrong.Correction coming your way:
If user want oly to encode audio nobody force him to encode videoYes.. with audio only there's no trimming.
Does you need trimming @ one click mode - noYes you do.. it's definitely not possible in the current workflow as it requires manual interruption, but we have to come up with an intelligent way to handle that.. TV capture mostly means TS/PVA/MPG these days.. all that will go through DGIndex.. so indexing should run right away, then the user is prompted for editing after that (depending on filters we could theoretically load certain files via AviSynth's DirectShowSource.. but that has proven to be both instable, and it doesn't allow frame accuracy.. most DS parsers I'm afraid to say don't properly implement seeking by frame properly).
Does you need trimming @ automated mode - I don't think so... Yes you do.. but not necessarily.. both must be possible. For instance you could decide to keep an eventual AC3 (or even AAC) stream from the digital broadcast.. then there's no editing. But if you re-encode the audio, then there can be editing (not necessarily.. you may have captured an ad-free show / movie).
Really no, bcz you can ReOpen form after closingUmm.. uh, then why did I have to rewrite the progress window, including override close to make sure close it only called at the end of a job. Initially, pressing X would trigger the close. I still had the reference to the form, but when I tried to reopen it. I was getting an exception.. that's why I use show/hide now.
dimzon
20th January 2006, 13:58
@Doom9
Please, take look @ http://www.mytempdir.com/396614 - modified sources with Audio via AVS encoder (DimzonEncoder @ AudioEncoder.cs)
It's a little crap (reques refactoring/cleanups) but working...
For Nero7 encoding you need BeHappy.Extension.Encoder.Nero7AAC.exe from BeHappy
PS. I will not commit it to CVS until Your approval
Doom9
20th January 2006, 14:22
A question on the "using" statement. Right now I'm working with sql connections a lot.. using the pattern I outlined for the streamwriter. I'm also using transactions since I'm often running multiple statements that need to be executed all, or none. So using rids me of try/finally and manually closing.. however, what do you about the transaction? Basically I want to commit when all statements have been successfully executed, plus sometimes other conditions (like the statement returning something.. ).. when there's an exception.. it will be handled automatically and I'll break out of the using part. However, who makes sure if this happens my transaction is rolled back? And if an exception happens.. it's automatically caught.. but I need to send it to a tracewriter as well.. so how does the using approach if I can't put the commit/rollback in the finally and the tracewriter statement into the catch block?
dimzon
20th January 2006, 14:35
A question on the "using" statement. Right now I'm working with sql connections a lot.. using the pattern I outlined for the streamwriter. I'm also using transactions since I'm often running multiple statements that need to be executed all, or none. So using rids me of try/finally and manually closing.. however, what do you about the transaction? Basically I want to commit when all statements have been successfully executed, plus sometimes other conditions (like the statement returning something.. ).. when there's an exception.. it will be handled automatically and I'll break out of the using part. However, who makes sure if this happens my transaction is rolled back? And if an exception happens.. it's automatically caught.. but I need to send it to a tracewriter as well.. so how does the using approach if I can't put the commit/rollback in the finally and the tracewriter statement into the catch block?
System.Data.SqlCient.SqlTransaction:
private void Dispose(bool disposing)
{
if (disposing && (this._sqlConnection != null))
{
this._disposing = true;
this.Rollback();
}
}
public void Rollback()
{
if (this._sqlConnection == null)
{
throw ADP.TransactionZombied(this);
}
try
{
this._sqlConnection.ExecuteTransaction("IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION", "RollbackTransaction");
this.Zombie();
}
catch
{
if ((this._sqlConnection != null) && (this.GetServerTransactionLevel() == 0))
{
this.Zombie();
}
if (!this._disposing)
{
throw;
}
}
}
You can use as many try/catch insude/outside using() as you want.
And yes, if you need atomic transactions it's safe to use using().
You still need try/catch block around every statement if you want to send detailed info in traicewriter. Unfortunally I does'nt know why to do it (i believe - exception callstack is enought to understand where error occured)
Doom9
20th January 2006, 14:42
You still need try/catch block around every statement if you want to send detailed info in traicewriter. Unfortunally I does'nt know why to do it (i believe - exception callstack is enought to understand where error occured)I ended up doing that.. so while using gets rid of try/catch you have to reintroduce it.. thus severely reducing the code amount savings, and in the end it comes down to syntax. It may be good to teach a n00b to use using because he might forget about try/catch/finally and cleaning up after himself.. but it's what has been drilled into us at university. and in java there's no using so in java you need to write it the way I'm usually writing such code.
What happens with the exception that can be thrown in Dispose? Do you need to wrap a try/catch around the using to get it?
dimzon
20th January 2006, 14:43
about Form.Close() - it's invoke Dispose asyncronically via PostMessage to it's own handle, sorry...
But anycase using() for every IDisposable is a good programming style :)
dimzon
20th January 2006, 14:46
What happens with the exception that can be thrown in Dispose? Do you need to wrap a try/catch around the using to get it?
Yes it can be thrown and you catch it by outer try/catch block. But throwng exception @ Dispose is a very bad style. IDisposable.Dispose means: cleanup all and die :)
The Link
20th January 2006, 14:56
@Doom9
Please, take look @ http://www.mytempdir.com/396614 - modified sources with Audio via AVS encoder (DimzonEncoder @ AudioEncoder.cs)
It's a little crap (reques refactoring/cleanups) but working...
For Nero7 encoding you need BeHappy.Extension.Encoder.Nero7AAC.exe from BeHappy
PS. I will not commit it to CVS until Your approval
Sorry for posting in this thread but I have a stupid question to dimzon: Will you add support for avs (serving an audio stream) input in the audio section?
dimzon
20th January 2006, 15:01
Sorry for posting in this thread but I have a stupid question to dimzon: Will you add support for avs (serving an audio stream) input in the audio section?
Yes :) There are *.* filemask now :)
This streams will be included via Import() until you check "Force Decoding via Directshow" @ this case DirectShowSource will be used
PS. This source is for Doom9 only :) Nobody will not support unapproved by Doom9 code!
Doom9
20th January 2006, 15:01
Yes it can be thrown and you catch it by outer try/catch block. But throwng exception @ Dispose is a very bad style.But since there's no catch in using, if one of the regular commands inside the using block throws an exception, you still have to wrap each using block with a try / catch (or you put it elsewhere.. me I like to catch exceptions at the lowest level). So essentially it's a syntactical difference that comes down to convenience.. I do it the java way because that's what I learned before C#, and since I still use Java a lot, it's probably not a bad thing to keep your coding style so that you can seamlessly switch between languages.. if you get used to using too much, you might end up forgetting the cleanup parts in Java and leave connections open and the likes.
dimzon
20th January 2006, 15:05
I like to catch exceptions at the lowest level
As for me i like to catch them @ highest possible level - that's the difference. It's enought callstack to find where exception occured. So I prefer to keep my code as much easy as it possible ;)
PS. I'm waiting for You reaction @ my modified code
Doom9
20th January 2006, 15:14
PS. I'm waiting for You reaction @ my modified codeI'm still at work.. that using discussion can be seen as part of reflection on what I do on the workplace.. but megui code is something else ;)
Richard Berg
20th January 2006, 15:14
You don't ever want to catch an exception unless you're ready to handle it -- the whole point of exceptions is that they let you bubble up to the correct stack frame automatically.
// bad bad bad
try
{
SomeThing();
}
catch (Exception)
{
return "something didn't work";
}
(Yes, that's what I did in verifyOutputFilename(), but that's because the rest of MeGUI isn't set up to handle exceptions properly and I didn't want to make a major change.)
dimzon
20th January 2006, 15:16
You don't ever want to catch an exception unless you're ready to handle it -- the whole point of exceptions is that they let you bubble up to the correct stack frame automatically.
// bad bad bad
try
{
SomeThing();
}
catch (Exception)
{
return "something didn't work";
}
Agreed by 100%
Inc
20th January 2006, 15:17
Dear Doom9.
MeGUI invokes DGDecode.dll direcly. It causes such problem:
DgDecode.dll must be im MeGUI folder or be avaluable @ PATH enviroment string.
In other hand DGDecode.dll MUST be @ avisynth\plugins folder in order to be able open scripts.
So I want to propose solution - let's open d2v files via AviSynth temporaly script file.
Calling DgDecode via a temp. avs script is not needed the mpeg2Source() API call serves all needed informations to a common Avisynth VideoInfo structure.
Accessing/recognising the dgdecode.dll is also possible if the dll itself isn't present in the actual main appl. folder. You can parse the Avisynth entry in the systems registry where the full path to the installed avisynth plugins dir is given.
It could be used to obtain the full path to dgdecode.dll.
And if it isn't found (however) then an else operation could look into the curr. appl. folder. Thats how PARanoia does it.
Richard Berg
20th January 2006, 15:18
Here's a way to use Trim() with audio-only clips. You just need the framerate:
# MeGUI needs to write these lines
fps = 30000.0 # .0 at the end ensures the script parser does floating-point math
fps_denom = 1001.0
srcfile = "ncstate.wav"
trimstart = 500
trimend = 600
wav = WavSource(srcfile)
AudioDub(BlankClip(height=4, width=4, length=int((wav.audiolengthf / wav.audiorate) * (fps / fps_denom))+1,
\ fps=int(fps), fps_denominator=int(fps_denom)), wav)
Trim(trimstart,trimend)
BTW, worrying about deterministic finalization is silly in MeGUI. 30 GDI handles is not important the way a database or socket is.
dimzon
20th January 2006, 15:30
Accessing/recognising the dgdecode.dll is also possible if the dll itself isn't present in the actual main appl. folder. You can parse the Avisynth entry in the systems registry where the full path to the installed avisynth plugins dir is given.
It could be used to obtain the full path to dgdecode.dll.
And if it isn't found (however) then an else operation could look into the curr. appl. folder. Thats how PARanoia does it.
Unfortunally it's impossible to do in anything except Managed C++. You caninvoke LoadLibrary("full dll path") in C#, You can ever call GetProcAddress but You can't call exported procedures at all (you can't assign obtained via GetProcAddress to procedure). There are 2 possible worarounds: write proxy in Managed C++ or use something other (read: AviSynth) that can act as a proxy
Here's a way to use Trim() with audio-only clips. You just need the framerate
Yes, I know this method, i'm using same @ BeHappy (check it).
Unfortunally i'm afraid overflow @ very long audio streams length=int((wav.audiolengthf / wav.audiorate) * (fps / fps_denom))+1
dimzon
20th January 2006, 15:40
@Doom9
I'm sorry, don't get me wrong, I dont push You, but I want to know what does You think about DllHell using DGDecode.dll
By the way, if we decide to switch to AviSynth there are 2 ways to solve it
1) Do nothig, DGDecode from aviSynth\Plugins folder will be used
2) Add LoadPlugin("<DgIndexFolder>\DgDecode.dll") as first line @ scripts
Richard Berg
20th January 2006, 15:53
@dimzon -- does it overflow with >2 billion samples even if you use audiolengthf? I forget how it's stored internally.
dimzon
20th January 2006, 16:03
@dimzon -- does it overflow with >2 billion samples even if you use audiolengthf? I forget how it's stored internally.
for audiolengthf it can drop accuracy...
Doom9
20th January 2006, 16:33
(Yes, that's what I did in verifyOutputFilename(), but that's because the rest of MeGUI isn't set up to handle exceptions properly and I didn't want to make a major change.)And what would you propose instead? Isn't is so in Java that if you perform an operation that can cause an exception, you need to make sure it's handled (and rethrown if you don't want to bother with it)?
I do have all uncatched exceptions caught on the application level since a few builds. If you do something bad and you know it can go wrong, wouldn't it make sense to place the logic to handle what can go wrong right there at the point where you know exactly which operation you're dealing with? If you're not doing that, in order to identify where the exception belongs, you need to add your own custom exceptions, so catch and rethrow.. and that sounds like a lot of wasted effort to me.
I'm sorry, don't get me wrong, I dont push You, but I want to know what does You think about DllHell using DGDecode.dllDidn't I write "I don't care" already? I just don't care, period.
Richard Berg
20th January 2006, 16:50
I'm not sure which part of the code you're talking about right now. It depends on the situation.
In verifyOutputFilename it's not ideal, but ok because:
(1) the complete exception info is returned to callers
(2) it's not hard to make sure all of the methods that call it always stop execution at the right place & error out
Part 2 is already causing a little trouble (see bug report thread) - it's not as easy as I thought to figure out when the callers need to error - apparently blank input audio filenames are sometimes ok.
It's bad design if it causes your callers to look like this:
[code]
bool err = Method1();
if (err)
handleProblem();
err = Method2();
if (err)
handleProblem();
err = Method3();
if (err)
handleProblem();
[/quote]
That's what old C code looks like, and it's exactly what people wanted to avoid when they added exceptions to C++ and later Java/C#.
C# learned from Java -- checked exceptions was a nice idea, but in practice it's worse to handle an exception you shouldn't than to forget to handle one you should. It made people stick catch(everything) in places they shouldn't just so they could get the darn thing compiling during quick development, then forget to remove them in final code.
It's even worse if you violate Part 1. If your application "hides" exceptions it becomes much much harder to debug later on. When consultants are hired to help fix old buggy codebases nobody can figure out, the first thing they do is attach a debugger set to break on all thrown exceptions (default setting in windbg is for uncaught only, the problem Java designers were wrongly worried about) because missing the former loses so much helpful info.
Inc
20th January 2006, 17:00
Sorry for again getting to this C#-coding related (less MeGUI related) issue:
@Dimzon
I Hope that I didn't catch something totally wrong:
Unfortunally it's impossible to do in anything except Managed C++. You caninvoke LoadLibrary("full dll path") in C#, You can ever call GetProcAddress but You can't call exported procedures at all (you can't assign obtained via GetProcAddress to procedure).
?
1. Loading a Library
2. Calling (using cdecl) the given dll Function via its API function name string. There`s also a stdcall wrapper inside dgdecode.dll if C# doesnt support the cdecl calling convention.
(2b. ... or via a function pointer out of the obtained proc.adress)
3. Call mpeg2Source(...) incl. the d2v file name string and the pointer to an VideoInfo Structure.
4. Voilá
Im shure that this will work in C# ;)
OffTopic /off
dimzon
20th January 2006, 17:09
Sorry for again getting to this C#-coding related (less MeGUI related) issue:
1. Loading a Library
2. Calling (cdecl) the given dll Function via its API function name string. There`s also a stdcall wrapper inside dgdecode.dll if C# doesnt support the cdecl calling convention.
(2b. ... or via a function pointer out of the obtained proc.adress)
3. Call mpeg2Source(...) incl. the dsv file name string and the pointer to an VideoInfo Structure.
4. Voilá
OffTopic /off
Dear incredible, unfortunally this way doesn't work @ C#.
lib = LoadLibrary("lib.dll"); // this will work in C#
someFunctionAddress = GetProcAddress("SomeProcName"); //this will work in c# if someFunctionAddress type is int or IntPtr
myProc = someFunctionAddress ; myProc(); // this is impossible in c#
Doom9
20th January 2006, 17:12
Part 2 is already causing a little trouble (see bug report thread) - it's not as easy as I thought to figure out when the callers need to errorI thought you said the check would be done before entering the autoencode window? I guess it's a debateable point if an incorrect stream is silently discarded (I believe that's what I did but it's been half a year), or if a warning is shown and the dialog doesn't open.. but I don't think it would be a good idea to just error out once the user has configured everything in the dialog.. that would mean all the configuration was for nothing because the user has to go back to the main screen.
And as far as your bad sample goes.. I would think you'd find a way to abort after the call to Method 1. E.g. I break out immediately from loops when something isn't quite right.
I see exceptions mostly in the "I'm going to use this library of which I know nothing but the API" case.. when I know what's going to happen, why shouldn't I handle it right there and return a meaningful warning? E.g. the stdout parsing in the encoders.. they used to be a source of great pain.. now as it is.. if something breaks beause the output of encoder X has changed again, the application will still work.. perhaps some onscreen indicator will break, but in such a case, the log will tell there was an exception in method X. Come to think of it, dumping the line variable would make sense as well.. so if the syntax changes, something breaks, the user posts a logfile, I see the offending line and can reproduce the problem without even having to start an encoding session. You can't do that if you handle the exception someplace higher up the foodchain.. plus, if you do that, say just in the MeGUI class, wouldn't the encoder stop working at the point when an exception is thrown?
dimzon
20th January 2006, 17:50
I have take look @ d2vReader.cs.
WOW! I found a great woraround here:
this.lib = LoadLibrary(this.dgDecodePath); - just load library first. Very nice!
to Doom9, sorry, I was mistaken about path problem, everything work fine
dimzon
20th January 2006, 18:01
http://www.mytempdir.com/397199 - fresh sources for AVS audio input
godhead
20th January 2006, 18:13
It is a bad idea to take an existing project and change everything to your coding style.. what if the person whose style it corresponds leaves in midstream? What if you don't see it through? Don't answer that.. I've run a site for almost 6 years now and there's been only one other person I've been able to completely rely on.. all others have come and gone.. so that's what I expect will happen with MeGUI.. it's the open source approach.. people come and go.. but I know I'll stick around. Making changes just because they fit somebody's coding style better are useless changes for a project.
These are the exact reasons that I'm sticking to smaller bug fixes and feature requests. I'd rather leave the main development and features up to the main developer (Doom9 in this case). I look to that developer as being the architect and I just follow along with their plans and pre-defined style. If I see something majorly wrong, then I might suggest something for consideration. I avoid trying to step on anyone's toes.
This is the reason I bought up the code fork approach if you're really set on doing a refactoring of any significance.
Just my opinion, back to doing actual real life work so I can get some free time to do the MeGUI changes I've got assigned.
godhead
20th January 2006, 18:29
Dear incredible, unfortunally this way doesn't work @ C#.
lib = LoadLibrary("lib.dll"); // this will work in C#
someFunctionAddress = GetProcAddress("SomeProcName"); //this will work in c# if someFunctionAddress type is int or IntPtr
myProc = someFunctionAddress ; myProc(); // this is impossible in c#
FYI -> http://www.codeproject.com/csharp/dyninvok.asp
Richard Berg
20th January 2006, 18:58
I thought you said the check would be done before entering the autoencode window?
Forget half a year, I don't even remember what my change from last week did...will investigate after work :)
I would think you'd find a way to abort after the call to Method 1
If you don't handle the exception, your method will surely abort.
I see exceptions mostly in the "I'm going to use this library of which I know nothing but the API" case
Again, depends on the situation. I think your stdout handlers are fine. The interface between the parser and the main MeGUI window consists of a log string, which is a fine place to bubble up error messages.
OTOH, let's say you had a call stack looked like:
SomeDialog()
- ValidateInput()
--- ValidateFirstTextbox()
----- CalculateBitrate()
------- UnknownMathLibrary.Multiply()
Putting a try/catch block in CalculateBitrate() just because you're calling into an unknown library that might throw something -- or worse, lots of try/catches like in my earlier sample in one of the intermediate methods -- would be bad design. It's easier to write and much easier to debug if you do:
void SomeDialog_callback()
{
...
try {
ValidateInpute();
}
catch(ArgumentNullException e)
{
...
}
...other exceptions you know are common to hit somewhere in validation...
catch(Exception e)
{
// if you catch general Exception, make sure you do something with e.Message()
// and e.StackTrace too in debug builds...
}
}
stax76
20th January 2006, 19:36
frame accurate cutting based on AviSynth.. once audio encoding uses AviSynth that'll be a realitiy and that is a strong USP for MeGUI.
Turned out to require only trivial changes in StaxRip which supported cutting only using VirtualDubMod so far so next version will allow also cutting regardles of what encoder and muxer is used.
@Dimzon
Do you mind me using your BePipe with StaxRip? There is no license included.
I want to use the normal AVS script which also includes video. Is this gonna be much slower?
dimzon
20th January 2006, 19:46
@Dimzon
Do you mind me using your BePipe with StaxRip? There is no license included.
I want to use the normal AVS script which also includes video. Is this gonna be much slower?
Feel free to do it. Use encoder.cs from BeHappy - BePipe has some bugs.
stax76
20th January 2006, 20:49
:thanks:
Sharktooth
20th January 2006, 21:02
CVS Update:
0.2.3.2035
Fixed some x264 CC warnings
0.2.3.2034
Encoders paths have now their own tab in Settings (changes by dimzon)
@dimzon: please update the assemblyinfo version and the changelog the next time you commit some changesl, thanks:)
Doom9
20th January 2006, 21:40
Putting a try/catch block in CalculateBitrate() just because you're calling into an unknown library that might throw something I wouldn't use try/catch unless I knew the library would thrown an exception.. if it's not part of the API description then the normal thing to do (imho) is assume there are no exceptions or that whatever might be caused will be handled internally.. so the api description would mention what exception can be thrown, or return a value of -1 (as an example) to indicate something has gone wrong internally.
And by the way, about the dgdecode path.. it stands to reason that those opening d2v's in MeGUI have created their d2v's in MeGUI.. and unpacked the entire zip to a directory and configured the dgindex path there.. plus then copied the dll. So having it two places would be nothing special but rather the standard scenario.
Doom9
20th January 2006, 22:03
@dimzon: when I compile I get two warnings in AudioEncoder telling me the Thread.Resume/Suspend is back? Didn't I eliminate that with my latest CVS update? I cannot open any but the baseAudioConfigurationDialog in the GUI designer.. once again, choice or error? I thought visual inheritance wouldn't deny the ability to use the GUI designer. Here's the full error message I'm getting:
The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: lameConfigurationDialog --- The base class 'MeGUI.baseAudioConfigurationDialog' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.
Where is the distinction made if avisynth or besweet is to be used for audio encoding and where can this be configured?
And perhaps most importantly.. where do I get neroraw.exe?
Another thing: the FAAC config dialog seems to default to CBR but doesn't have a bitrate set.. it should have 128 kbit/s preset. And should it say kbit/s at least for CBR and something for VBR as well? Okay, that's my fault actually.. seems the original didn't have those indications either.
last but not least.. I can't seem to encode anything.. here's the log
The current job contains errors. Skipping chained jobs
Starting job job1 at 22:02:54
Job is an audio job. Commandline:
-core( -input "D:\DVDs\DVDVolume\VIDEO_TS\residentevil AC3 T01 3_2ch 448Kbps DELAY 0ms.ac3" -output "D:\DVDs\DVDVolume\VIDEO_TS\residentevil AC3 T01 3_2ch 448Kbps DELAY 0ms.mp4" -logfile "D:\DVDs\DVDVolume\VIDEO_TS\residentevil AC3 T01 3_2ch 448Kbps DELAY 0ms.besweet.log" ) -azid( -cbr 128 ) -ota( -g max )
successfully started encoding
Processing ended at 22:02:54
----------------------------------------------------------------------------------------------------------
Log for job job1
Error:
System.ApplicationException: Can't find audio stream!
at MeGUI.DimzonEncoder.encode()And that's bs.. the audio stream is properly configured.
Oh, the new jobs are also not being loaded upon startup.. and the commandline (not shown...), seems to be the besweet commandline
@update: debugging the code I found that the settings object is not being properly propagated.. the DimzonEncoder seems to think my faac.exe has no path associated with it even though I've properly configured it.
Richard Berg
20th January 2006, 22:08
so the api description would mention what exception can be thrown, or return a value of -1 (as an example) to indicate something has gone wrong internally.
Doesn't matter. You still wouldn't want to put a try/catch there. In fact, you might consider throwing an exception if you received -1 from the API.
Richard Berg
20th January 2006, 22:09
@anyone -- what does setting the Avisynth plugin dir in Settings -> Path do? Any reason we shouldn't pull it from the registry?
Doom9
20th January 2006, 22:23
I also believe you got lame's cbr and abr mixed up:
case BitrateManagementMode.ABR:
m_commandLine = "-b " + m.Bitrate + " --cbr -h --silent - \"{0}\"";
break;
case BitrateManagementMode.CBR:
m_commandLine = "--abr " + m.Bitrate + " -h --silent - \"{0}\"";
break;
--abr smells like abr, not cbr..
And what's up with if (priority == ProcessPriority.IDLE)
m_encoderThread.Priority = ThreadPriority.Lowest;
There's a ThreadPriority.Idle, isn't there?
Doom9
20th January 2006, 22:31
and I have no clue how to debug this thing.. I set a breakpoint in your encoder start, it starts a thread with threadstart parameter encode so I put a breakpoint in the encode method, only to find it never gets there..
Are you cleaning up after the encoder? Because if you create a file in the temp folder.. you better.. the automated cleanup after encoding isn't capable of finding that file. I actually meant to suggest that the file have the same name as the audio, just with avs appended.. so you clearly know whom it belongs to.
Also, as far as audio input goes.. enabling everything isn't such a good idea.. most filetypes aren't audio so it should only support those that we can handle.
Also, there's already a class wrapping AVIFile.. it would make sense that you use this one and make changes where needed (without breaking current functionality of course.. make sure you test encoding and avisynth script preview)
And some more things: I think your encoder should derive from audioencoder, or at least be called from it so there's a common path it goes through.. just like the 3 video encoders and 3 muxers use a common class. That also allows easy switching of encoders.
How about using the commandlinegenerator to generate encoder commandlines?
Last but not least I have to ask the dreaded question "how well did you test this?" I mean.. encoding doesn't even get to the point where it would fail because the encoder paths are not being propagated..
dimzon
21st January 2006, 10:46
@dimzon: please update the assemblyinfo version and the changelog the next time you commit some changesl, thanks:)
Hi, happy to see your health is better.
Isn't possible to get changelog automatically via CVS?
dimzon
21st January 2006, 11:49
when I compile I get two warnings in AudioEncoder telling me the Thread.Resume/Suspend is back?
Don't worry I will eluminate it later. This is my code from BeHappy.
By the way
Are you shure Your current encoder.pause implementation really pauses external process? I do not think so, maybe I'm wrong? You only pauses StdOut/StdErr reading from it, isn't it. It means encoding still work...
I cannot open any but the baseAudioConfigurationDialog in the GUI designer.. once again, choice or error?
I have yet checked it - everything is fine? Maybe this error is VS Express (I'm using full version now)
The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: lameConfigurationDialog --- The base class 'MeGUI.baseAudioConfigurationDialog' could not be loaded. Ensure the assembly has been referenced and that all projects have been built.
Does you compile project in VS before???
Where is the distinction made if avisynth or besweet is to be used for audio encoding and where can this be configured?
This is not exists yet. If you want to switch to BeSweet just replace aEnc= new DimzonEncoder() by aEnc= new AudioEncoder() @ Form1.cs
And perhaps most importantly.. where do I get neroraw.exe?
As I said before you need BeHappy.Extension.Encoder.Nero7AAC.exe from BeHappy - use it instead of neroraw. I plan to remove BeHappy-related code from it && rename to neroraw a bit later.
Another thing: the FAAC config dialog seems to default to CBR but doesn't have a bitrate set.. it should have 128 kbit/s preset. And should it say kbit/s at least for CBR and something for VBR as well? Okay, that's my fault actually.. seems the original didn't have those indications either.
Will be fixed later
last but not least.. I can't seem to encode anything.. here's the log
It means there are error @ avisynth script. You need NicAudio plugin for ac3/dts, MPASource for mp3
Oh, the new jobs are also not being loaded upon startup.. and the commandline (not shown...), seems to be the besweet commandline
I do not touch job-related commadline generation, your old code invoked there
debugging the code I found that the settings object is not being properly propagated.. the DimzonEncoder seems to think my faac.exe has no path associated with it even though I've properly configured it.
No, it does...
I also believe you got lame's cbr and abr mixed up
Thanx, Fixed
And what's up with if (priority == ProcessPriority.IDLE)
m_encoderThread.Priority = ThreadPriority.Lowest;
There's a ThreadPriority.Idle, isn't there?
No, look @ enum ThreadPriority@ MSDN - there are no ThreadPriority.Idle
and I have no clue how to debug this thing...
Place breakpoint @ DimzonEncoder::encode - everything is fine (I'm using VS2005 Proffessional Edition).
Are you cleaning up after the encoder? Because if you create a file in the temp folder..
Yes! Definitly everything is cleaned up (even uncomplete output if exception is occured)
I actually meant to suggest that the file have the same name as the audio, just with avs appended...
No. Name is obtained like:
System.IO.Path.GetTempPath() + "encode-" + Guid.NewGuid().ToString("N") + ".avs";
I'm strongly prefer using Guid's to avoid ANY conflicts.
Also, as far as audio input goes.. enabling everything isn't such a good idea.. most filetypes aren't audio so it should only support those that we can handle.
Really we need (I think) such filter:
All Supported Files (*.mp3,....)| *.mp3... | All files (*.*) | *.*
Bcz theoretically you can try to use any file via DirectShowSource. (RealAudio/WMA/AVI etc)
Also, there's already a class wrapping AVIFile.. it would make sense that you use this one and make changes where needed (without breaking current functionality of course.. make sure you test encoding and avisynth script preview)
Yes, i know, as i say before - this still reque refactoring. And I want to write direct avisynth.dll wrapper to got better error diagnostics (instead audio stream not found) in nearest future so i decide do not spent time to refactoring AVIFile usage now - it will be removed anycase when my wrapper will be done.
And some more things: I think your encoder should derive from audioencoder, or at least be called from it so there's a common path it goes through.. just like the 3 video encoders and 3 muxers use a common class. That also allows easy switching of encoders.
Current audio processing consist of 2 step's:
Decoding && DSP
Encoding
So AudioEncoder is not a valid name. I propose AudioJobHandler. I believe using AviSynth for Decoding && DSP is enought so we does not need polyphormism @ this point. Encoding in current impementation perform via command-line encoders via StdIn. In future is possible to define AudioEncoder class with such methods:
public interface IAudioEncoder
{
void Init(string outputFileName, int samplerate, int channels, int bitsPerSample);
void Done();
void Abort();
}
How about using the commandlinegenerator to generate encoder commandlines?
It will be used later (i do not want to change it until first initial commit. and I don't like it bcz this is one class wich knows about every commandline tool)
Last but not least I have to ask the dreaded question "how well did you test this?" I mean.. encoding doesn't even get to the point where it would fail because the encoder paths are not being propagated..
No, they was. I really don't understand why this code doesn't for for you. Try to extrac && compile fresh sources http://www.mytempdir.com/398686 @ clear folder
I'm waiting for your response!
max-holz
21st January 2006, 11:54
Where could I find neroraw.exe? I see this exe in the new program files tab of rev 2035.
The Link
21st January 2006, 12:08
Dimzon wrote in his posting above yours:
As I said before you need BeHappy.Extension.Encoder.Nero7AAC.exe from BeHappy - use it instead of neroraw. I plan to remove BeHappy-related code from it && rename to neroraw a bit later.
Doom9
21st January 2006, 13:08
I have yet checked it - everything is fine? Maybe this error is VS Express (I'm using full version now)I have VS 2k5 standard installed on this machine. However, today it seems to work.
Are you shure Your current encoder.pause implementation really pauses external process? I do not think so, maybe I'm wrong? You only pauses StdOut/StdErr reading from it, isn't it. It means encoding still work...Well.. stopping the reading of these outputs seems to do the trick.. it's not like you can tell an external process to just go to sleep (it starts with the problem that there's no processpriority.sleep) x264 takes a bit longer to react, but all the others pause instantaneously.
As I said before you need BeHappy.Extension.Encoder.Nero7AAC.exe from BeHappyI downloaded your latest Behappy release (December 29th).. there's no nero7aac.exe in it.
No, look @ enum ThreadPriority@ MSDN - there are no ThreadPriority.IdleOops, I mistook that for processpriority.idle (which does exist obviously since I'm using it for every encoder)
Place breakpoint @ DimzonEncoder::encode In the third encoding attempt it finally breaked there.. that was after I posted here.
Try to extrac && compile fresh sources I did that.. I used what you posted, opened that whole project and compiled.. there's no code from anyplace else.
Another few thoughts: every one of my encoders and muxers performs a check if the required files are there (executable).. before putting a line into the script that requires a plugin, in sticking with the current scheme of encoders, it should check if that plugin does exist (you do have to configure your avisynth plugin path in the settings.. so you know where to look - and in addition I think we could read that path from the registry so it would be pre-configured if the MeGUISettings object holds an empty string for that property)
void Init(string outputFileName, int samplerate, int channels, int bitsPerSample);
void Done();
void Abort();
Do you know all those properties? I certainly don't know them for a besweet encoder. And what does Done() do? What about pause/resume?
Really we need (I think) such filter:Well.. you can add the all files for completeness sake, but it should never be the default. The default filter should open just what kind of input types are supported (naturally you could name an mp3 audio.doc but that's not something we need to handle).
so i decide do not spent time to refactoring AVIFile usage nowWhy would you need to refactor it? I think it'll probably be enough to just add a few properties that work for audio since currently there's only video related stuff. And with all your critizizing of my code, I'm a bit surprised to see that the new audio encoder is at least as bad architecture wise.. I hope you'll understand where I might feel a bit miffed by that.. you don't go around critizizing and trying to make everybody change if you then don't live up to the standard yourself.
dimzon
21st January 2006, 13:36
IWell.. stopping the reading of these outputs seems to do the trick.. it's not like you can tell an external process to just go to sleep (it starts with the problem that there's no processpriority.sleep) x264 takes a bit longer to react, but all the others pause instantaneously.
WOW. Very interesting! This means we can't run encoder @ silen mode (without progress output) bcz we can't pause it in this case.
I downloaded your latest Behappy release (December 29th).. there's no nero7aac.exe in it.
;) not just nero7aac.exe BUT BeHappy.Extension.Encoder.Nero7AAC.exe
Another few thoughts: every one of my encoders and muxers performs a check if the required files are there (executable).. before putting a line into the script that requires a plugin, in sticking with the current scheme of encoders, it should check if that plugin does exist (you do have to configure your avisynth plugin path in the settings.. so you know where to look - and in addition I think we could read that path from the registry so it would be pre-configured if the MeGUISettings object holds an empty string for that property)
Yes, It can be done and I will implement it later. In addition i have an idea to implement "check all settings" feature - add one more item to menu. This feature must check every executable/plugin/etc and produce a report about possible troubles.
void Init(string outputFileName, int samplerate, int channels, int bitsPerSample);
void Done();
void Abort();
Do you know all those properties? I certainly don't know them for a besweet encoder.
You forgot again. BeSweet is not an encoder, its whole AudioJobProcessor (in my proposd terminology). AudioEncoder works after decoder/DSP so you know this parameters
And what does Done() do? What about pause/resume?
Sorry, my proposed interface was not complete yet
public interface IAudioEncoder
{
void Init(string outputFileName, int samplerate, int channels, int bitsPerSample);
void EncodeBlock(byte[] rawPcmData);
void Done();
void Abort();
// stop/pause/etc - TODO
}
Done means no nore aduo avaluable let's finalize.
Well.. you can add the all files for completeness sake, but it should never be the default.
Agreed by 100%. Yes, off couse! Current *.* filter is just for testing :)
Why would you need to refactor it? I think it'll probably be enough to just add a few properties that work for audio since currently there's only video related stuff.
I does not want to touch this code at all bcz I plan to replace it ASAP.
And with all your critizizing of my code, I'm a bit surprised to see that the new audio encoder is at least as bad architecture wise.. I hope you'll understand where I might feel a bit miffed by that.. you don't go around critizizing and trying to make everybody change if you then don't live up to the standard yourself.
Hey, I say "this code is crap && reques refactoring" isn't it? I just perform initially copy/paste of BeHappy.Encoder into MeGUI and perform a little tweaks to fit it to IEncoder interface - no more. I do not like this code myself and I plan to refactor it right after my managed Avisynth wrapper will be done. So do not bla me for it ;) And another reason which slowdown code refactoring still conditional compilation - it breaks VS2005 build-in code analyst features as well as it breaks my favorite ReSharper. Of couse this is not MeGUI problem but VS2005/ReSharper but i can't work productively without it. Just imaginate You switch form VS2005 to Notepad - for me this is the same when i switch from ReSharper to pure VS2005.
Doom9
21st January 2006, 14:11
WOW. Very interesting! This means we can't run encoder @ silen mode (without progress output) bcz we can't pause it in this case.No.. you can still read it.. but not process anything and thus no status updates.
not just nero7aac.exe BUT BeHappy.Extension.Encoder.Nero7AAC.exeThere's only one exe in the zip ;)
for me this is the same when i switch from ReSharper to pure VS2005.Visual Studio 2005 has a bunch of refactoring features built-in, and then you have those code templates (that I've never used). And they have no problem with conditional compilation. I can't imagine how ReSharper would help integrating all your duplicate VfW code and put it into the AviReader class.
dimzon
21st January 2006, 15:33
There's only one exe in the zip ;)
are you joking ???
sources
behappy.exe
behappy.exe.config
behappy.extensibility.dll
behappy.extension.encoder.nero7aac.exe
behappy.oggvorbis.encoder.extension
behappy.oggvorbis.encoder.extension.dll
downmix.extension
enc_aacplus.extension
ffmpeg-ac3.extension
flac.extension
lame.extension
nero7.txt
nero7aac.extension
nicaudio.extension
upmix.extension
wavpack.extension
http://img41.imageshack.us/img41/782/untitled5xh1.png
I can't imagine how ReSharper would help integrating all your duplicate VfW code and put it into the AviReader class.
Uhhh. I just tell You in prevoius post:
I does not want to touch this code at all bcz I plan to replace it ASAP.
ASAP == during 2-5 days (mostly AvisynthWrapper is alredy done, keep testing)
Richard Berg
21st January 2006, 16:51
@dimzon
I'm strongly prefer using Guid's to avoid ANY conflicts.
I think it's better to use DateTime.Now.Ticks for unique tempfiles/logs/etc
- much shorter/cleaner-looking that GUIDs
- filenames will always be in date order, makes finding the right one easy
Doom9
21st January 2006, 16:55
well.. in order to be consistent with the naming, the one click encoder uses the input file for avs scripts.. I think the most coherent thing would be that the name of a temporary avs file is the source name plus .avs appended. And there's one problem with moving things to the temp directory.. if something goes wrong, or the user doesn't have the cleanup option enabled.. you'll never find your temporary files as only those who've seen the code know where things go. I'm not happy at all to have applications that fill up my temp directory and force me to clean it on my own.. even if files are not being deleted, at least if I have them all together I'll realize quickly enough what I can get rid of. But perhaps I know too much so that I'm able to identify which files I no longer need?
Richard Berg
21st January 2006, 17:22
Just make it TempDir\MeGUI\<videofilename> + DateTime.Now.Ticks + ".avs"
That gives you everything you want: which input file it affects, proper sorting, and easy for a human to group by job or to blow away the whole directory.
dimzon
21st January 2006, 20:24
2 all developers
AviSynthWrapper is done. take look http://www.mytempdir.com/399806
berrinam
21st January 2006, 22:59
Small CVS update:
(In compile.bat) If there are no commandline arguments, do the same as compile all.
I haven't updated the version number, etc, because it doesn't affect anything else. I made this change so that compile.bat can be run without the commandline.
berrinam
21st January 2006, 23:03
@dimzon: This isn't compatible with current avs opening (ie for previewing), is it? As it is, if you want to preview a file, you need to open it with your wrapper, to check if there is an error, and then you open it with the current code if there isn't. Seems a bit wasteful to me.
dimzon
22nd January 2006, 10:51
@dimzon: This isn't compatible with current avs opening (ie for previewing), is it? As it is, if you want to preview a file, you need to open it with your wrapper, to check if there is an error, and then you open it with the current code if there isn't. Seems a bit wasteful to me.
I'm planning to add video support and create my own VideoReader later. Current implementation is for Audio...
dimzon
22nd January 2006, 12:02
@Doom9
Hi! How does You think, can I add this methods/properties to AudioCodecSettings:
/// <summary>
/// Must return command line arguments string for command-line audio encoder
/// {0} means output file name
/// {1} means samplerate in Hz
/// {2} means bits per sample
/// {3} means channel count
/// {4} means samplecount
/// {5} means size in bytes
/// </summary>
/// <returns>command line arguments</returns>
public abstract string GetCommandLineArguments();
/// <summary>
/// Must return logical flag
/// </summary>
public abstract bool IsRawPcmSupportedByEncoder
{
get;
}
/// <summary>
/// Must read executable path from settings
/// </summary>
/// <param name="from">settings to read path from</param>
/// <returns>path to encoder executable</returns>
public abstract string GetExecutablePath(MeGUISettings from);
/// <summary>
/// Return some additional code to be applied to the end of DSP
/// Example - 6==Audiochannels(last)?GetChannel(last,2,3,1,6,4,5):last{0}
/// </summary>
public abstract string AdjasmentAvisynthScript
{
get;
}
Doom9
22nd January 2006, 13:25
Hi! How does You think, can I add this methods/properties to AudioCodecSettings:If you need them, of course. Althought I'd name the last one AdjustAvisynthScript so that it's proper English ;)
umm wait.. why should the codec settings extract something from the settings? that should be the job of the encoder itself, shouldn't it? The settings should contains a little information about the actual encoding process as possible.. just enough so that the encoder can begin its work.. the encoder should have to intelligence to do whatever's needed to get the encoding done. It's also a question whether source properties really belong to the settings.. I'm afraid I didn't quick stick to that with the videosettings as well. If we have the means to figure out the source properties just before encoding, so that the encoder keeps whatever it needs for status updates, I think that would be the optimal approach.
dimzon
22nd January 2006, 13:40
@Doom9
OK, if you don't like it i will do not do it ;)
New audiosettings look (beSweet - related code is back)
http://img17.imageshack.us/img17/226/untitled9tg.png
Doom9
22nd January 2006, 13:46
umm.. the 24bit thing.. I haven't read the whole thread in the audio forum but I think I read something about avisynth automatically using the proper sample length so there won't be any overflows/cutoffs?
dimzon
22nd January 2006, 14:06
umm.. the 24bit thing.. I haven't read the whole thread in the audio forum but I think I read something about avisynth automatically using the proper sample length so there won't be any overflows/cutoffs?
If You will use 24bit or floating computations you will reduce ROUNDING ERRORS in CHAIN (where multiplication/division is used)
ConvertAudioTo32Bit
SomeOp
SomeOp
SomeOp
ConvertAudioTo16Bit
dimzon
22nd January 2006, 15:14
Doom9
please take look http://www.mytempdir.com/401361
PS. DimzonEncoder is better but still need refactoring
PS2. Maybe it's time to commit this code to CVS?
Doom9
22nd January 2006, 15:21
well.. did you take care of all the issues I've mentioned? checking for plugin existence, checking for encoder existence? move the encoder out of the audioencoder class? I'm also not quite happy about having to select which encoder is going to be used at configuration time.. I think it should be done at encoding time (I know, videoencoder needs an adjustment there as well).
dimzon
22nd January 2006, 15:36
well.. did you take care of all the issues I've mentioned? checking for plugin existence, checking for encoder existence?
Just partially... I have some idea how to do such check at better way in future:
Does you know how jUnit/csUnit/NUnit works? It's possible to create same infrastructure to provide API for checking installation/settings integrity...
move the encoder out of the audioencoder class?
It still in same file Yet. Now it is AudioEncoder descendant.
I'm also not quite happy about having to select which encoder is going to be used at configuration time.. I think it should be done at encoding time (I know, videoencoder needs an adjustment there as well).
I really don't understand what does you men exatly...
Doom9
22nd January 2006, 15:40
I really don't understand what does you men exatly...In the audio options, you have a radiobutton "encode via avisynth" and one "encode via besweet" .. if you go to the x264 or xvid codec setup.. there's no "use x264.exe" and "use mencoder.exe" radiobutton.. that is handled in the settings.
Also, classnames should reflect what a class does.. dimzonencoder does what now? ;)
dimzon
22nd January 2006, 15:44
In the audio options, you have a radiobutton "encode via avisynth" and one "encode via besweet" .. if you go to the x264 or xvid codec setup.. there's no "use x264.exe" and "use mencoder.exe" radiobutton.. that is handled in the settings.
Unfortunally AviSynth has a little different option set (and this option set is easy to increase using additional filters etc). So it's impossible (i think) to switch before them.
Also, classnames should reflect what a class does.. dimzonencoder does what now? ;)
Feel free to rename it as you wish ;)
dimzon
22nd January 2006, 15:57
And yet another programming trick. Does you know WinForms list controls (including ComboBox as well) can host any objects. object.ToString() is used to obtain string to display and you can access selected object via myCombo.SelectedItem property...
So i propose more modular audio settings editing solution. This is my proposal
1) define AudioSettingsProvider interface (or, maybe, class)
public interface IAudioSettingsProvider
{
void LoadDefaults();
bool IsSupportedSettings( AudioCodecSettings settings);
AudioCodecSettings GetCurrentSettings();
void LoadCodecSettings( AudioCodecSettings settings);
bool EditCurrentSettings( IWin32Window parentWindow, profiles, etc )
}
2) implement this interface in
FaacSettingsProvider (override object.ToString to return FAAC)
NaacSettingsProvider (override object.ToString to return NAAC)
LameSettingsProvider (override object.ToString to return Lame MP3)
3) fill AudioCodecComboBox using:
AudioCodecComboBox.Items.AddRange( new object[]{
new FaacSettingsProvider (),
new NaacSettingsProvider(),
new LameSettingsProvider() })
Volia.
To get current settings just call
(AudioCodecComboBox.SelectedItem as IAudioSettingsProvider).GetCurrentSettings()
to load settings from job:
foreach(IAudioSettingsProvider p in AudioCodecComboBox.Items)
{
if(p.IsSupportedSettings(settingsToLoad))
{
p.LoadCodecSettings(settingsToLoad);
AudioCodecComboBox.SelectedItem = p;
break;
}
}
stax76
22nd January 2006, 16:40
And yet another programming trick. Does you know WinForms list controls (including ComboBox as well) can host any objects. object.ToString() is used to obtain string to display and you can access selected object via myCombo.SelectedItem property...
It's important to know this and in most cases more robust, flexible and easier then DataBinding and other things. The only thing I'm disappointed is Microsoft don't have versions of this controls supporting generics, the GUI design time environment is already amazing so supporting this should probably be doable. VB's clunky cast syntax reminds me all the time that it would be a nice feature.
dimzon
22nd January 2006, 17:07
It's important to know this and in most cases more robust, flexible and easier then DataBinding
You can use then both @ same time:
private object[] _besweetDownMix = new object[]{....};
private object[] _avisynthDownMix = new object[]{....};
{
if(isBeSweetMode)
{
dowmixCombo.DataSource = _besweetDownMix;
}
else
{
dowmixCombo.DataSource = _avisynthDownMix;
}
}
Don't forget - you can use DataBinding for any IList (object.ToString() will be used to get representation)
stax76
22nd January 2006, 17:23
If overriding ToString gets you around using DisplayMember then it should be fine as well.
dimzon
22nd January 2006, 17:25
If overriding ToString gets you around using DisplayMember then it should be fine as well.
I prefer to owerrite toString bcz I know how it will be looked @ screen even if I do not touch default ComboBox settings ;)
stax76
22nd January 2006, 17:47
I prefer to owerrite toString bcz I know how it will be looked @ screen even if I do not touch default ComboBox settings
Me too, I don't recall using any DataBinding in StaxRip. Some people will try to solve everything with DataBinding while in many cases it's a poor solution.
berrinam
23rd January 2006, 08:42
0.2.3.2036 23 Jan 2006
Applied Mutant_Fruit's Context Sensitive Help update:
-Just attaching a new version of the contexthelp.xml as written by LiFe.
-I also made a few changes to the contexthelp method as i didn't realise that newlines would be correctly picked up from the xml file.
-Tooltips should no longer stretch across the entire screen. But could possibly do with nicer paragraphing.
Doom9
23rd January 2006, 09:25
@berrinam: did you see richard's patch?
Inc
23rd January 2006, 09:43
2 all developers
AviSynthWrapper is done. take look http://www.mytempdir.com/399806
Could you also offer the sources? :)
My comments:
I had a fast look over your header cs file where the functions of the avsredirect.dll are called.
1. You did declare the samplecount/offset etc. of the arguments in Getaframe() as Long. Did you let pass these valuesas proper Int64 by doing a Cast of the Long values to Int64? as the the orig avs function expects int64 values in here.
2. Seems you still handle the 3 -Y U V- planes separately by calling getvframe() as it was the orig state of avsredirect.dll for supporting FFmpegs native YV12 support. I modded the avsredirect so only the readpointer to the whole bitmap is returned, NO return to a VideoPlanestructure. Keep that in mind :) Thats why I also added the RGB24/32, YUY2 and YV12 output support.
dimzon
23rd January 2006, 09:49
Could you also offer the sources? :)
No problem
http://www.mytempdir.com/402921 - it uses AviSynth so it's LGPL anycase. Just keep in mind it's not finished yet
1. You did declare the samplecount/offset etc. of the arguments in Getaframe() as Long. Did you let pass these valuesas proper Int64 by doing a Cast of the Long values to Int64? as the the orig avs function expects int64 values in here.
long in c# means int64 :cool:
2. Seems you still handle the 3 -Y U V- planes separately by calling getvframe() as it was the orig state of avsredirect.dll for supporting FFmpegs native YV12 support. I modded the avsredirect so only the readpointer to the whole bitmap is returned, NO return to a VideoPlanestructure. Keep that in mind :) Thats why I also added the RGB24/32, YUY2 and YV12 output
support.
I doesn't touch video part yet - i'm planing to get it later
Doom9
23rd January 2006, 09:51
@dimzon: can you handle the cutlist format I proposed? And I really think the encoder should be separate.. so that if you do further work on it, it touches the smallest amount of files. The current AudioEncoder should just serve as an audio job dispatcher.
Inc
23rd January 2006, 10:00
- it uses AviSynth so it's LGPL anycase. Just keep in mind it's not finished yet
btw: Even if AVS is LGPL licensed the root wrapper code by Mobilehackers was released under the GPL thats why I kept it automatically as GPL when I modded the sources. So even the resulted dll is GPL'ed *imho* (not 100% sure)
If you want a preview of the frame or the audio, you can simply use the approaches I discribed in here:
http://forum.doom9.org/showthread.php?p=772595#post772595
There you will obtain a pointer where you can access the Bitmap-startingadress by using for example SetDIBits() of the Win API (or something similair in C#)
dimzon
23rd January 2006, 10:07
btw: Even if AVS is LGPL licensed the root wrapper code by Mobilehackers was released under the GPL thats why I kept it automatically as GPL when I modded the sources. So even the resulted dll is GPL'ed *imho* (not 100% sure)
Sorry, my fault:
Linking Avisynth statically or dynamically with other modules is making a combined work based on Avisynth. Thus, the terms and conditions of the GNU General Public License cover the whole combination.
Doom9
23rd January 2006, 10:27
well.. license wise MeGUI is GPL anyway so whatever parts are integrated fall under this license as well.
dimzon
23rd January 2006, 10:34
@dimzon: can you handle the cutlist format I proposed?
Lets define something like with (for better code maintenance)
public class FrameInterval
{
public long FirstFrame;
public long LastFrame;
}
public class Cutlist
{
// actual fps = FramerateNoninator/FramerateDeNoninator
public long FramerateNoninator;
public long FramerateDeNoninator;
public FrameInterval[] Intervals;
}
And I really think the encoder should be separate.. so that if you do further work on it, it touches the smallest amount of files.
I do not understand exatly what does you mean (my poor english can be a reason). Does you want i move my encoder in separate file? No problem in this case.
The current AudioEncoder should just serve as an audio job dispatcher.
AFAIK it is ;)
public virtual bool setup(Job job, out string error)
{
error = null;
if (((AudioJob)job).Settings.EncodeViaBeSweet)
encoder = new BeSweetEncoder(settings.BesweetPath);
else
encoder = new DimzonEncoder(settings);
return encoder.setup(job, out error);
}
And I want to perform CVS commit before continue. Can I?
By the way - what does you think about my proposal (http://forum.doom9.org/showthread.php?p=773033#post773033)
And I have another proposal about new "prerender" feature. I really have a beteter idea how it must be done!
let's define:
t1 = average time to read 1 avs frame
t2 = average time to encode 1 frame to losless
t3 = average time to decode 1 frame from lossles
t4 = average time to 1-st pass encode for 1 frame
t5 = average time to 2-nd pass encode for 1 frame
Assuming 2-pass encoding we need
t1 + t2 + t3 + t4 + t3 + t5 time to encode 1 frame
We can save marked t3 interval if we write some more intelligent code:
first pass:
1) Read frame from AviSynth
2) Encode it to lossless (it's possible to wrap VfW driver direcly via PInvoke) && save encoded frame @ temporaly stream
3) Encode it via x264 (send frame to it via StdIn like audio encoders do)
second pass:
1) Decode frame from loseless (it's possible to wrap VfW driver direcly via PInvoke)
2) Encode it via x264 (send frame to it via StdIn like audio encoders do)
So were are new unique features:
Since we are 100% controlling process we can use multiple hard drives to store losless temporaly files. Really if we are running out of space @ HDD1 we can start writing rest data to HDD2 etc...
It posiible to perform partially prerender. If we are running out of space @ HDD we can stop caching frames (for first N frames for second pass cached data will be used, for rest fromes - source AviSynth)
Invoking lossless encoder via MeGUI:
there are 2 way to do it:
It's possible to call VfW driver via PInvoke
Since there are open source losless encoders we can ceate our own .NET-friendly DLL ;)
Doom9
23rd January 2006, 10:51
Lets define something like with (for better code maintenance)Agreed.
Does you want i move my encoder in separate file? Yup..
And I want to perform CVS commit before continue. Can I?I still need to do a few testruns myself. Have you tested auto-mode and one click mode?
Now about your prerender suggestion.. wouldn't we incurr a loss of speed if we go from native -> managed -> native again as opposed to having the encoder read frames directly from the avisynth script? PInvoke isn't the most efficient thing after all, is it?
berrinam
23rd January 2006, 11:00
@dimzon: About the prerender scripting: What you suggested about skipping t3 has indeed been suggested before (I linked to zajc's post about it in the first post of the feature request thread). I did plan to implement it that way, using avs2yuv as the way of managing this, as this gives you the option of doing this. I think I even said when I added the support for this that I decided not to in the end, because:
1. avs2yuv wasn't flexible enough for MeGUI.
2. When I tried to make it flexible, my limited C++ skills resulting in the program crashing.
I scrapped that then. However, the t3 time interval is probably the least computer-intensive one. Especially with ffvhuff, which was designed only for speed and lack of colorspace conversions, the decoding speed is very high (I haven't measured it).
As to running it all through MeGUI.... yeesh, I thought the whole point of MeGUI was to get rid of VfW, and now you are suggesting going back to it? Also, using avi's and not splitting them across directories makes it more easy to use this outside of MeGUI (we don't want to create a monopoly on the video we just processed, do we?).
My real objection, of course, is that what you are saying is all too complex for me. I don't think directly controlling VfW is what we want with MeGUI, but a .NET-friendly DLL might not be too bad. Let's see what Doom9 thinks.
@dimzon: I'm planning some refactoring and quite a few changes to the currentNAACSettings, etc, as well as other audio in Form1.cs. Does this clash with the changes you have made?
@Doom9: No, I didn't see Richard's patch. I've found it now.
I objected a while ago to all the currentSomethingSettings in MeGUI, and you asked if I have a better idea. Here we go: update the VidCodecSettings property to have a get and set, and use this throughout MeGUI:
public VideoCodecSettings VidCodecSettings
{
get
{
VideoCodecSettings vSettings = null;
#if FULL
switch (videoCodec.SelectedIndex)
{
case 0:
vSettings = this.currentLavcSettings;
break;
case 1:
vSettings = this.currentX264Settings;
break;
case 2:
vSettings = this.currentSnowSettings;
break;
case 3:
vSettings = this.currentXvidSettings;
break;
}
#elif X264_ONLY
vSettings = this.currentX264Settings;
#elif SNOW_ONLY
vSettings = this.currentSnowSettings;
#endif
return vSettings;
}
set
{
#if FULL
if (value is x264Settings)
{
this.currentX264Settings = (x264Settings)value;
videoCodec.SelectedIndex = (int)VideoJob.CodecType.AVC;
}
if (value is lavcSettings)
{
this.currentLavcSettings = (lavcSettings)value;
videoCodec.SelectedIndex = (int)VideoJob.CodecType.ASP;
}
if (value is snowSettings)
{
this.currentSnowSettings = (snowSettings)value;
videoCodec.SelectedIndex = (int)VideoJob.CodecType.SNOW;
}
if (value is xvidSettings)
{
this.currentXvidSettings = (xvidSettings)value;
videoCodec.SelectedIndex = (int)VideoJob.CodecType.XVID;
}
#elif X264_ONLY
if (value is x264Settings)
this.currentX264Settings = (x264Settings)value;
#elif SNOW_ONLY
if (value is snowSettings)
this.currentSnowSettings = (snowSettings)value;
#endif
}
}Of course, I would do likewise for audio (audio seems even worse.... it has HEAPS of code all over the place, which I don't think has been changed for ages). What do you think?
dimzon
23rd January 2006, 11:07
Agreed.
Yup..
Ok. I will do it after CVS commit. By the way - what name does you propose for DimzonEncoder? Is AvisynthAudioEncoder good for it?
I still need to do a few testruns myself. Have you tested auto-mode and one click mode?
there are some bug, replace audioEncoder.cs http://www.mytempdir.com/403001
wouldn't we incurr a loss of speed if we go from native -> managed -> native again as opposed to having the encoder read frames directly from the avisynth script?
there are some trick to improve PInvoke perfomance. The first off all - avoid Marshaller work for strings, structures and bytearrays. It can be done using unsafe C# code or playing with CGHandle created with Pinned option.
Doom9
23rd January 2006, 11:13
update the VidCodecSettings property to have a get and set, and use this throughout MeGUI:sounds good (though in the end I think we'll go much further than this.. dimzon mentioned some stuff to think about).
dimzon
23rd January 2006, 11:13
@dimzon: I'm planning some refactoring and quite a few changes to the currentNAACSettings, etc, as well as other audio in Form1.cs. Does this clash with the changes you have made?
Please, do not touch audio-related stuff until my commit (I'm waiting for Doom9 approval).
Here we go: update the VidCodecSettings property to have a get and set, and use this throughout MeGUI:
<skiped/>
Of course, I would do likewise for audio (audio seems even worse.... it has HEAPS of code all over the place, which I don't think has been changed for ages). What do you think?
Does You read my proposal:
http://forum.doom9.org/showthread.php?p=773033#post773033
It's sutable for vide too ;)
Doom9
23rd January 2006, 11:28
I'm waiting for Doom9 approvalAnd I asked a couple critical questions.. have you checked how both besweet and avisynth audio encoding behave in manual, auto and one click mode? there must not be any commit unless the correct behavior has been checked everywhere. This change is too big to not check every mode at least once.
Is AvisynthAudioEncoder good for it?Yes, that would've been my suggestion
By the way, would you mind cutting down your signature? It kinda bugs me a lot.
dimzon
23rd January 2006, 11:35
have you checked how both besweet and avisynth audio encoding behave in manual, auto and one click mode?
Oh, sorry, missed them. No, i do not perform this check. I have not material to check one click mode (i'm @ ofice and my home PC is broked). Can you perform this check for me?[/QUOTE]
By the way, would you mind cutting down your signature? It kinda bugs me a lot.
What signature? Where?
dimzon
23rd January 2006, 11:38
@Doom9
addition about audio cutlist
We are propesed long(int64) for frames and nominators. Unfortunally AviSynth does support only int (int32).
I prefer to stand @ longs (for futher) but avoid values > int.MaxValues
Doom9
23rd January 2006, 11:57
Can you perform this check for me?I'm also at work.
What signature?Yours.. colored, bold, 7 lines and 8 links. It makes me think about a rule change.
I actually keep nbFrames as an int throughout the application.
BTW, when can you get started on the video part of the avisynth wrapper? And the whole nominator/denominator that fps was recently changed to already gives me a headache now.. it was so nice having a double and that's that.. it's what people commonly understand as a framerate. All those changes were imho extremely unnecessary and now have the sideeffects I expected.. they break existing applications.
dimzon
23rd January 2006, 12:22
I'm also at work.
I can't perform this check even @ home. Can You perform this check when yoiu will be @ home?
Or can somebody else, well known to Doom9, perform this check?
Yours.. colored, bold, 7 lines and 8 links. It makes me think about a rule change.
Oh, I understand. Is it better now?
BTW, when can you get started on the video part of the avisynth wrapper?
At first I must perform CVS commit
I must split AudioEncoder.cs and rename DimzonEncoder
Maybe some cleanups in AvisynthAudioEncoder
CVS commit
After this I can try start ideo part of the avisynth wrapper (Seems like you like it :cool: )
And the whole nominator/denominator that fps was recently changed to already gives me a headache now.. it was so nice having a double and that's that..
at least let's switch from double to System.Decimal (I believe it's easy to replace).
All those changes were imho extremely unnecessary and now have the sideeffects I expected.. they break existing applications.
In other hand you can make something like this
public class FramesPerSecond
{
public long Nominator
public long Denominator
public FramesPerSecond(System.Decimal fps)
{
Denominator = 1000000;
Nominator = (long)(fps * Denominator);
}
public System.Decimal ToDecimal()
{
System.Decimal fps = Nominator ;
fps/=Denominator;
return fps;
}
public static implicit operator FramesPerSecond(System.Decimal fps)
{
return new FramesPerSecond(fps);
}
public static implicit operator System.Decimal(FramesPerSecond fps)
{
return fps.ToDecimal()
}
}
this code allows you step-by-step conversion from Double/Decimal to Nominator/Denominator
berrinam
23rd January 2006, 12:25
Please, do not touch audio-related stuff until my commit (I'm waiting for Doom9 approval). Ok, sure thing. I'll wait. I'll apply Richard Berg's patch, but looking at it, there are no changes to the audio code -- only the AutoEncode setup.
Does You read my proposal:
http://forum.doom9.org/showthread.php?p=773033#post773033
It's sutable for vide too ;)Good proposal. I assume that this code:
foreach(IAudioSettingsProvider p in AudioCodecComboBox.Items)
{
if(p.IsSupportedSettings(settingsToLoad))
{
p.LoadCodecSettings(settingsToLoad);
AudioCodecComboBox.SelectedItem = p;
break;
}
}
would be in a property?
Doom9
23rd January 2006, 12:38
In other hand you can make something like thisThe thing is though, if you look at the discussion in the avisynth forum.. it's not such a nice denominator (http://forum.doom9.org/showthread.php?t=104681)
And it's really up to you to test your modifications.. not somebody else. We'll get nowhere if every dev just checks if something compiles.. that would imply that after every commit, there's a new build that will cause a long list of bugreports and somebody has to fix things again. You don't release stuff at work without having tested it, do you? Even if not using jUnit, the least amount of testing that should be done is playing through the most likely scenarios.
berrinam
23rd January 2006, 12:42
CVS Update:
0.2.3.2037 23 Jan 2006
Applied Richard Berg's filechecking bugfix
Fixed OneClickWindow to register the automatic deinterlacing settings
It has some changes to Form1.cs, but I don't think they would clash with dimzon's, and the changes are very few.
Also, dimzon, the correct word is not Nominator, but Numerator.
Doom9
23rd January 2006, 13:25
another question regarding the audio encoder: the exe currently has nero7 on it.. does it work with nero6 as well?
dimzon
23rd January 2006, 13:39
The thing is though, if you look at the discussion in the avisynth forum.. it's not such a nice denominator (http://forum.doom9.org/showthread.php?t=104681)
Ok, lets stay @ double (or, maybe Decimal, it's better)
And it's really up to you to test your modifications.. not somebody else.
As I said before I have not ability to check this functionality at all. In other side I does'nt think I boreke something (i does not perform any changes in this part of code & does not perform any structural changes and project still compile).
AutoEncode works fine (just tested on Version() avs :) )
You don't release stuff at work without having tested it, do you? Even if not using jUnit, the least amount of testing that should be done is playing through the most likely scenarios.
We have special QA division ;)
the correct word is not Nominator, but Numerator.
thanx
Doom9
23rd January 2006, 13:44
As I said before I have not ability to check this functionality at all.Why not? Don't tell me you don't have any DVDs and digital streams whatsoever.. and there are freely downloadable VOB trailers just in case.
dimzon
23rd January 2006, 13:46
another question regarding the audio encoder: the exe currently has nero7 on it.. does it work with nero6 as well?
Yes an No ;)
really current encoder work with both dll versions but it will not perform any channel workaround (it just read data from stdin and sent it to nero dll)
dimzonEncoder assumes Nero7 is used and adds such workaround script @ the end of AVS:
6==Audiochannels(last)?GetChannel(last,2,3,1,6,4,5):last
really it's possible to add checkbox @ settings form or AudioSettingsDialog to switch before versions.
By the way - you can use Nero7 aac encoder without Nero7 installed.
place my executable + bsn.dll from besweet + aacenc32.dll + aac.dll + neroipp.dll + mfc71.dll at same folder and enjoy ;)
dimzon
23rd January 2006, 13:50
Why not? Don't tell me you don't have any DVDs and digital streams whatsoever.. and there are freely downloadable VOB trailers just in case.
If You can provide me a VOB for testing wich size is <=10-20 MB i will be happy ;)
And I can't download multimedia content directly (i'm behinde evil corporate firewall) so you need to archive it with passwo twice (this firewall can read archive toc)
Doom9
23rd January 2006, 14:02
You have no DVDs and hang out in this place, no DV, no digital TV? I'm wondering what you're doing here then.. why be a member of a digital video forum if you do not have any digital video to process? I wouldn't download VOBs at work either but there's always the option of downloading from home. I'm getting the excuses feeling again. I don't find it plausible that any member here would not have any digital video he or she could process..
Doom9
23rd January 2006, 14:19
If supporting Nero6 means changes, then I guess we need another dropdown in the settings.. depending on that value, you'd then add or not add the nero6 workaround.
stax76
23rd January 2006, 14:37
You have no DVDs and hang out in this place, no DV, no digital TV?
I got some stuff in case somebody is looking for something, has anybody some DV samples?
I've processed some of my samples probably more than 100 times, funny thing is with every watch of a sample I either hate or like it a little bit more :)
dimzon
23rd January 2006, 14:47
You have no DVDs and hang out in this place, no DV, no digital TV?
As i said before I'm working on non-usial HW configuration now. My primary HDD still broken and I'm working @ 20GB HDD now. This HDD is bloated by instrumental tools and I running approx 500MB free only so I can't test on full-size DVD. If testing on small AVI is enought to test OneClick mode I will do it.
And I have not internet connection avaluable @ home :scared:
dimzon
23rd January 2006, 15:03
@Doom9
I have found some mpg file but seems like MeGUI for OneClickMode (never used before) searching for some additional file with txt extension in same folder. I really doen't know where to get it...
gets information about a video source based on its DVD Decrypter generated info file
Doom9
23rd January 2006, 15:17
doesn't matter if you don't have it and I suppose that's in berrinam's guide. and come to think of it, testing auto-mode should be enough because one click mode is based on the same code.. the jobs are just created after indexing so that comes down to the same as auto-mode.
dimzon
23rd January 2006, 15:38
doesn't matter if you don't have it and I suppose that's in berrinam's guide. and come to think of it, testing auto-mode should be enough because one click mode is based on the same code.. the jobs are just created after indexing so that comes down to the same as auto-mode.
Auto mode works fine, can I perform commit?
Doom9
23rd January 2006, 15:50
if you've tested both besweet and avisynth mode, then yes. good luck
dimzon
23rd January 2006, 16:09
if you've tested both besweet and avisynth mode, then yes. good luck
0.2.3.2038 23 Jan 2006
Commit by dimzon
-New audio encoding mode via AviSynth
-Refectored && redesigned AudioSettings dialogs
-AviSynth wrapper (only audio)
-Don't forget to put avisynthwrapper.dll into executable folder
-avisynthwrapper.zip contains avisynthwrapper.dll sources
-use BeHappy.Extension.Encoder.Nero7AAC.exe from BeHappy instead of neroraw.exe for nero encoding
dimzon
23rd January 2006, 16:21
http://vzlaird.narod.ru/x264/ContextHelp.xml --> russian translation ;) Maybe we can add support for multiple languages for this file via configuration switch?
this is not full MeGUI localisation but at least meaningfull localazed information about codecs...
dimzon
23rd January 2006, 16:26
@Doom9:
How I have multiple posiible ways what to do. I can:
perform futher AviSynthAudioEncoder refactoring
create video-part for the AviSynthWrapper
implement proposed changes (IAudioSettingsProvider in Combo)
add support for Nero 6 AAC encoder
create neroraw.exe
What does You want I do first ?
Doom9
23rd January 2006, 16:30
well.. if I can chose: 5, 4, 1, 2
Wait with number 3 because the whole shebang should be redone. I'm planning on first compiling a list with all the functions and their classes that we have now, then decide what should go where, any possible naming changes, and then finally the implementation.
dimzon
23rd January 2006, 16:37
well.. if I can chose: 5, 4, 1, 2
Wait with number 3 because the whole shebang should be redone. I'm planning on first compiling a list with all the functions and their classes that we have now, then decide what should go where, any possible naming changes, and then finally the implementation.
create neroraw.exe
how i must commit it to CVS? if i commit compiled executable + sources in zip file - is it OK?
Doom9
23rd January 2006, 16:42
hmm.. you have to ask somebody more familiar with the CVS system.. I tend to think this shouldn't be part of the megui source tree but something else. I don't really know what we can do to achieve that.. ideally I think it (and the avisynth wrapper) should be a separate subtree, so you can check them out and compile independently of megui.
dimzon
23rd January 2006, 17:00
hmm.. you have to ask somebody more familiar with the CVS system.. I tend to think this shouldn't be part of the megui source tree but something else. I don't really know what we can do to achieve that.. ideally I think it (and the avisynth wrapper) should be a separate subtree, so you can check them out and compile independently of megui.
this is extremely easy console application, it does not produce any compilation troubles so i decide to add it to MeGUI solution. You can still compile MeGUI only OR you can compile them both or you can build neroraw only. If You don't like my way we can remove it from solution/CVS anytime
PS. It's alredy @ CVS :cool:
dimzon
23rd January 2006, 17:26
add support for Nero 6 AAC encoder
0.2.3.2039 23 Jan 2006
Commit by dimzon
-Support for Nero6 AAC
http://img227.imageshack.us/img227/4347/untitled9mq1.png
dimzon
23rd January 2006, 18:32
btw: Even if AVS is LGPL licensed the root wrapper code by Mobilehackers was released under the GPL thats why I kept it automatically as GPL when I modded the sources. So even the resulted dll is GPL'ed *imho* (not 100% sure)
If you want a preview of the frame or the audio, you can simply use the approaches I discribed in here:
http://forum.doom9.org/showthread.php?p=772595#post772595
There you will obtain a pointer where you can access the Bitmap-startingadress by using for example SetDIBits() of the Win API (or something similair in C#)
PVideoFrame f = clip[clip_num]->GetFrame(frm, env);
g_lasterr[0] = 0;
return (int)f->GetReadPtr();
I really doesn't like this implementation. PVideoFrame is smartpointer.
It means it will be destroyed right after function exits. So you have no warranty actual frame data still @ obtained adress
(depends on memory manager implementation && current heap fullness)
There are 2 ways howto fix it
First way means providing buffer into rotune and filling it actual data. This is mostly clear way. Unfortunally it cost additional CPU cycles for copyng memory and reques additional memory.
Second way is storing PVideoFrame f in dynamicaly-allocated memory and returning it outside your dll. It means you need 3 functions instead one:
frame = avs_getvframe(clip_num, frm, env) - returns &f
avs_getvframepointer(frame) - returns (*frame)->GetReadPtr();
avs_disposevframe(frame) - must deallocate memory: (*frame=NULL; free(frame))
berrinam
23rd January 2006, 21:22
doesn't matter if you don't have it [stream information.txt] and I suppose that's in berrinam's guide.Hmmm.... not at the moment. As it is, I am not convinced whether that will work. It seems to rely on the audio being in the first two track IDs (presuming the user chooses track 1 and track 2). Can this be assumed to always be the case? If so, I will put it into the guide.
Doom9
23rd January 2006, 22:02
Can this be assumed to always be the case? I'm not really sure.. there are 8 tracks you can chose from and I always thought they'd map to the 0x8* used for AC3 tracks, but I have no clue how it works for PCM, MPEG or DTS (DTS uses 0x88 and 0x89).
berrinam
23rd January 2006, 22:25
Perhaps it is necessary, then, to rethink about integrating MediaInfo.dll?
Inc
23rd January 2006, 22:32
AC3 ... 0x80 to 0x8?
DTS ... 0x88 or 0x89
PCM ... 0xA0 to 0xA?
MP2 ... 0xC? to ????
klicker4546
24th January 2006, 01:13
0.2.3.2039 23 Jan 2006
Commit by dimzon
-Support for Nero6 AAC
I'm just wondering, where can I find the latest source code to compile it? Don't tell me on sourceforget in the MeGUI cvs. Could anyone please upload it somewhere?
I'd really appreciate.
berrinam
24th January 2006, 01:26
I'm just wondering, where can I find the latest source code to compile it? Don't tell me on sourceforget in the MeGUI cvs. Could anyone please upload it somewhere?
I'd really appreciate.
The people who can upload the sources are the same people who can upload the compield versions, so I don't see why you are asking for this. You either have to wait until someone who can upload does, (in which case you will get a binary -- why would you want to compile?) or get it sooner, which does mean the Sourceforge CVS.
klicker4546
24th January 2006, 01:30
The people who can upload the sources are the same people who can upload the compield versions, so I don't see why you are asking for this. You either have to wait until someone who can upload does, (in which case you will get a binary -- why would you want to compile?) or get it sooner, which does mean the Sourceforge CVS.
Thanks for your quick reply. I've tried to deal with the Sourceforge CVS, but experienced problems with the anonymous login. Since I don't know if that's fixed, I was just wondering if it's possible to get the sources here. Or can you tell me how to download the latest changes from the CVS?
I guess I have to be patient then. ;)
Inc
24th January 2006, 01:44
Don't tell me on sourceforget in the MeGUI cvs.It gots its sense why such appl. sources are at Sourceforge.net
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/megui login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/megui co -P modulenamehttp://sourceforge.net/cvs/?group_id=156112
Try this line using CygWin's cvs.exe for example, thats how I do download mencoder and ffmpeg sources when I do need them.
Im not shure if it works since I saw some lines above something about an anonymous login issue?
Also DevC++ or any other CVS Win32 browser could do such D/L Jobs.
berrinam
24th January 2006, 03:11
0.2.3.2040 24 Jan 2006
Commit by berrinam:
-Fixed d2v/audio extension bug
-Stopped progress window opening on a new job when MeGUI is minimized.
-Fixed AviSynthJobs to open the progress window when required
-Fixed AutoEncode to work with prerender jobs
berrinam
24th January 2006, 04:03
0.2.3.2041 24 Jan 2006
Commit by berrinam:
-Fix the incorrect fps displayed in the bitrate calculator due to new DGIndex fps signalling
Doom9
24th January 2006, 04:48
Perhaps it is necessary, then, to rethink about integrating MediaInfo.dll?Well.. I think some tests would be in order to determine how it works with the non standard streams. As you know, there are but 8 tracks you can select from within DGIndex and in a way they need to be able to extract everything (8 tracks is the maximum DVD offers).. so I think the mapping is dynamic and it's likely that if you have three tracks, they'd be track 1 - 3. Let's ask neuron2 to make sure (well you ask.. I gotta take the 5:05am train to get to the airport).
dimzon
24th January 2006, 11:56
CVS Update:
fixed compilation bug involved by my previous update (changed compile.bat)
klicker4546
24th January 2006, 13:43
Thanks for your help. I've tried it several times now to login to the megui cvsroot. Without any succes. There's everytime a timeout. Think I've read something about it before. Does anyone know how to get it working?
:confused:
It gots its sense why such appl. sources are at Sourceforge.net
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/megui login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/megui co -P modulenamehttp://sourceforge.net/cvs/?group_id=156112
Try this line using CygWin's cvs.exe for example, thats how I do download mencoder and ffmpeg sources when I do need them.
Im not shure if it works since I saw some lines above something about an anonymous login issue?
Also DevC++ or any other CVS Win32 browser could do such D/L Jobs.
dimzon
24th January 2006, 13:44
0.2.3.2042 24 Jan 2006
Commit by dimzon:
-fixed some compilation warnings
dimzon
24th January 2006, 14:01
0.2.3.2043 24 Jan 2006
Commit by dimzon:
-changed Thread sync to fix some compilation warnings
dimzon
24th January 2006, 15:15
0.2.3.2044 24 Jan 2006
Commit by dimzon:
-AvsReader (not checked yet, not used anymore)
dimzon
24th January 2006, 15:53
0.2.3.2045 24 Jan 2006
Commit by dimzon:
-Modified AvsReader are now used for Avs preview ;) Everyting works fine...
http://img296.imageshack.us/img296/8974/untitled4pi.png
dimzon
24th January 2006, 15:59
@Doom9
I need you assistance for AvsAudioEncoder refactoring. Take look @ it. Sometimes it's looks like CommandLineAudioEncoders, sometimes not. Maybe we can create CommandLineAudioEncoder ancestor to collect all common code in it? (I can't do it without Your approval bcz it is architectural change)
PS. Does we need mediaInfo.dll wrapper? I can write it.
Richard Berg
24th January 2006, 16:10
Thanks for your help. I've tried it several times now to login to the megui cvsroot. Without any succes. There's everytime a timeout. Think I've read something about it before. Does anyone know how to get it working?
In my experience the last few weeks, it's down about half the time. I just wait a few hours and try again :(
klicker4546
24th January 2006, 16:28
Ok, I see. Think I will manually downlaod the changes, so far I can find them in the webcvs. :)
In my experience the last few weeks, it's down about half the time. I just wait a few hours and try again :(
dimzon
24th January 2006, 17:15
Does we need mediaInfo.dll wrapper? I can write it.
there alredy are C# wrapper bundled with Dll
dimzon
24th January 2006, 17:36
2 all devs
this.path = Environment.CurrentDirectory;
peoples are confused when they start MeGUI from command line and does'nt see their settings/jobs/etc...
I propose such replacement:
this.path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
what does You think about?
Mutant_Fruit
24th January 2006, 21:29
Wouldn't this work better:
string path = Application.StartupPath;
I believe it returns the path that the exe is in.
ChronoCross
25th January 2006, 00:17
for those of you who want it:
http://www.chronocrossdev.com/apps/megui/MeGUI-0.2.3.2045.rar
Includes the source files.
dimzon
25th January 2006, 11:37
Wouldn't this work better:
string path = Application.StartupPath;
I believe it returns the path that the exe is in.
Yes, it's better ;)
dimzon
25th January 2006, 12:17
0.2.3.2046 25 Jan 2006
Commit by dimzon:
-FAAC Settings && FAAC Settings Dialog - performed little cleanup && bugfix
dimzon
25th January 2006, 12:28
0.2.3.2046 25 Jan 2006
Commit by dimzon:
-nothing, just marked AviReader by [Obsolete] attribute (it's time to switch to AvsReader). not affected anywhere except you get warnings during compilation now
stax76
25th January 2006, 12:39
Yes, it's better ;)
Funny to see that even devs with deep .NET knowledge didn't knew this one ;)
dimzon
25th January 2006, 12:55
Funny to see that even devs with deep .NET knowledge didn't knew this one ;)
Impossible to know everything... ;)
Doom9
25th January 2006, 13:44
-Modified AvsReader are now used for Avs preview ;) Everyting works fine...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..
I'll have a look at the avsaudioencoder tonight.
dimzon
25th January 2006, 14:10
0.2.3.2047 25 Jan 2006
Commit by dimzon:
- VideoPlayer can play avs via string (does not need temporaly avs files)
- AviSynth generator does'nt create preview.avs && temp.avs more
http://img93.imageshack.us/img93/5926/untitled2cc.png
dimzon
25th January 2006, 14:13
@Doom9
Hello
Can I perform this modification: http://forum.doom9.org/showthread.php?p=774275#post774275
(I'm asking bcz I do not know -it is a bug or a feature)
dimzon
25th January 2006, 14:20
2 all devs
found such 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!
Doom9
25th January 2006, 14:25
use string path = Application.StartupPath; please.. and for such small things... just do them. Come to think of it feel free to refactor the classes deriving from audioencoder to improve efficiency..
dimzon
25th January 2006, 14:49
use string path = Application.StartupPath; please.. and for such small things... just do them.
As I said before I just dosn't know - it's a bug or a feature. Using enviroment.CurrentDirectory allows to use multiple MeGUI settings set using different startup folders ;)
By the way - what about my proposal about IAudioSettingsProvider in ComboBox? It will reduce code complexity a lot.
@All Devs (incl Doom9)
Don't get me wrong, I'm looking @ current sources and I have such proposal.
At first let's read such 3 truth:
Every encoder use AviSynth script as input - so we can encode only openable via AviSynth sources
Now MeGUI contains good AVS wrapper with rich diagnostic capabilities
AVS wrapper can parse avisynth scripts from string (you doesn't need temporaly files anymore)
According this staments i propose to remove such unnecesary code from MeGUI. At first I must say - I know You spent time to write it and You are proud by it (and You have a reason to be proud of it bcz PInvoke code sometimes is not easy). But removing such code allows us to simplify MeGUI and improve code maintenance. Less lines of code - less amount of bugs, is'nt it?
So I propose to remove such code:
AviReader.cs - actually we does not need it, AvsReader works fine. Even if you need to open non avisynth file you can use "AviFile(fileName)" without creating temporaly file
DirectShow.cs - now we can just use "DirectShowSource(fileName)"
d2vReader.cs - now we can just use "LoadPlugin(...)\r\nMpeg2Source(fileName)"
dimzon
25th January 2006, 15:30
0.2.3.2048 25 Jan 2006
Commit by dimzon:
- fixed improper path detection when running MeGUI from commandline
- add support for improved accuracy for audio processing via AviSynth
- workaround bug (noise @ the beginning) when using normalization for 16 bit audio
(now if AutoGain is checked 32bit transformation is forced )
klicker4546
25th January 2006, 16:01
Hi dimzon,
is there any guide for the audio processing via Avisynth within MeGUI? I guess I will need behappy to make it work. But how??? :confused:
0.2.3.2048 25 Jan 2006
Commit by dimzon:
- fixed improper path detection when running MeGUI from commandline
- add support for improved accuracy for audio processing via AviSynth
- workaround bug (noise @ the beginning) when using normalization for 16 bit audio
(now if AutoGain is checked 32bit transformation is forced )
Doom9
25th January 2006, 16:03
is there any guide for the audio processing via Avisynth within MeGUI? I guess I will need behappy to make it work. But how???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
25th January 2006, 16:15
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!
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...
dimzon
25th January 2006, 17:16
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?
if (!inf.IsYV12() )
{
res = env->Invoke("ConvertToYV12", AVSValue(&res, 1));
}
Easy, isn't it?
Doom9
25th January 2006, 17:18
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.
dimzon
25th January 2006, 17:27
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()...
pest
25th January 2006, 17:47
2 all devs
found such 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?
AVIReader *reader=new AVIReader(fileName);
if (!reader) blahblah
dimzon
25th January 2006, 17:50
Why 2 local objects?
AVIReader *reader=new AVIReader(fileName);
if (!reader) blahblah
Sorry, don't understand Your post at all
Mutant_Fruit
25th January 2006, 18:01
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...
dimzon
25th January 2006, 18:09
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!
pest
25th January 2006, 18:11
Ups, I forgot you where using C#, perhaps its different than in C++
AVIReader reader;
creates a local object
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#
stax76
25th January 2006, 18:43
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. ;)
berrinam
25th January 2006, 22:28
To all devs:
Make more use of "Don't show me this again" in dialogs.
Description: See http://forum.doom9.org/showthread.php?p=772750#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.
berrinam
25th January 2006, 22:43
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
25th January 2006, 22:50
@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
25th January 2006, 23:09
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.
Mutant_Fruit
25th January 2006, 23:45
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.
berrinam
26th January 2006, 00:39
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
26th January 2006, 01:18
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:
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.php?p=772747#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.
Inc
26th January 2006, 09:26
AviFile32 API performs RGB24 conversion
Not at all, it depends on how you set up the decompression in AVIStreamGetFrameOpen().
Here a piece of 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.
Doom9
26th January 2006, 11:15
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.
Inc
26th January 2006, 11:46
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.
dimzon
26th January 2006, 11:51
@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'?
By default MeGUI trying to use MPASource for mpeg audio, NicAc3Source for ac3, NicDtsSource for dts, WAVSource for wav, Import for AVS and DirectShowSource otherwise. Checking 'force decoding via directshow' will switch to DirectShowSource for any file (including MP3, AC3 etc). It can be used for advanced audio processing (using FFDSHOW) for example. Another usecase if AviSynth Source Plugin is buggy but you still able to play source file via DirectShow - you can switch to DirectShow for decoding
Actually, it *should* pick up wav audio, too:
if (file.IndexOf(trackNumber) != -1 &&
(file.EndsWith(".ac3") ||
file.EndsWith(".mp3") ||
file.EndsWith(".mp2") ||
file.EndsWith(".mpa") ||
file.EndsWith(".dts") ||
file.EndsWith(".wav"))) // It is the right track
{
audioFiles.Add(file);
}However, that code is case sensitive, which means it requires the extension to be in lower case (that's the bug).
2all devs!
I have found a huge amount of such extension-checking code spreaded by the sources. I propose such replacement for it:
// In some utrility class
public static string[] ListOfAudioExtensions = new string[]{".mp3", ..., ".dts"}
public static bool HasExtension(string fileName, string[] ExtensionList)
{
...
}
//Using
if(Utility.HasExtension(file, Utility.ListOfAudioExtensions))
{
...
}
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.
http://sourceforge.net/docs/compile_farm
Unfortunally there no Win32 support ATM :scared:
I fully agree with that. If using the avisynth script creator, we should do the conversion automatically.
Ok. Since x264 use AVIFile32 API we have not another choice...
kritip
26th January 2006, 13:28
Unfortunally there no Win32 support ATM :scared:
I didn't read the whole article, but couldn't one of the x86 machine, if its running gcc, just cross compile for win32, pretty sure gcc can do that. Wether you can on the sourceforge system is another matter though.
KriTip
dimzon
26th January 2006, 13:49
I didn't read the whole article, but couldn't one of the x86 machine, if its running gcc, just cross compile for win32, pretty sure gcc can do that. Wether you can on the sourceforge system is another matter though.
KriTip
Unfortunally there are not .NET 2.0 support for non Win32 (AFAIK Mono implements 1.1 only)
Doom9
26th January 2006, 13:50
since when can gcc handle c# and windows .net libs?
I got a PM this morning from somebody willing to volunteer to do the build stuff.. the question is how we get the sources to him and where we publish the builds. I suppose there's some webadmin function on sourceforge so the releases could probably be put on the webspace that's currently not in use.. but what about the sources considering the anonymous CVS is down half the time? Is there any automatic source export.. like press a button and get a zip file with the latest CVS checkout?
Doom9
26th January 2006, 13:52
I have found a huge amount of such extension-checking code spreaded by the sources. I propose such replacement for it:The problem with that is.. often these checks go only over a limited amount of extensions.. as in "if it's .mp3 or .ac3 you can put it into avi.. if it's anything else you cannog", and "if it's .aac or .mp4 you can put it into mp4, otherwise not".
kritip
26th January 2006, 13:52
please delete this post
kritip
26th January 2006, 13:52
Indeed your both correct :) I'll shut up from now on ;)
KriTip
berrinam
26th January 2006, 13:55
since when can gcc handle c# and windows .net libs?
I got a PM this morning from somebody willing to volunteer to do the build stuff.. the question is how we get the sources to him and where we publish the builds. I suppose there's some webadmin function on sourceforge so the releases could probably be put on the webspace that's currently not in use.. but what about the sources considering the anonymous CVS is down half the time? Is there any automatic source export.. like press a button and get a zip file with the latest CVS checkout?
I'm pretty sure that you can grant someone developer read-only CVS access. If you register them as part of the project, then wouldn't that be a solution?
dimzon
26th January 2006, 13:56
0.2.3.2051 26 Jan 2006
Commit by dimzon
-Rewritten AvisynthWrapper.dll (now it will be more friendly with multithread code)
-Rewritten AvisynthWrapper.cs (to use new API from AvisynthWrapper.dll)
The problem with that is.. often these checks go only over a limited amount of extensions.. as in "if it's .mp3 or .ac3 you can put it into avi.. if it's anything else you cannog", and "if it's .aac or .mp4 you can put it into mp4, otherwise not".
ListOfAllAudioExtensions = new string[]{...}
ListOfAudioInAviExtenssions = new string[]{"mp3","ac3"}
ListOfAudioInMp4Extenssions = new string[]{"aac","mp4","m4a"}
e.t.c.
the main goal is to collect all of supported extensions in just one place
Doom9
26th January 2006, 14:24
If you register them as part of the project, then wouldn't that be a solution?If that is possible, then it would indeed be a solution.
the main goal is to collect all of supported extensions in just one placeIt may only be a stopgap solution (in the end, wouldn't it be convenient when needed, the app could ask for Muxer.getMuxer(MuxType), and then do a Muxer.getSupportedExtensions, or Muxer.IsInputSupported.
Keep in mind though, since code is replicated in so many places.. there's a lot of testing you will have to do to make sure your changes don't break anything anywhere.
dimzon
26th January 2006, 14:38
(in the end, wouldn't it be convenient when needed, the app could ask for Muxer.getMuxer(MuxType), and then do a Muxer.getSupportedExtensions, or Muxer.IsInputSupported.
Yes, this is definitly right solution.
Dear Doom9, I still waiting your answers by my questions and proposals.
Richard Berg
26th January 2006, 15:21
I'm pretty sure that you can grant someone developer read-only CVS access. If you register them as part of the project, then wouldn't that be a solution?
Project admins can configure who has what kind of CVS access. If you do this, please add me too -- anonymous CVS sux ;)
Doom9
26th January 2006, 15:24
So I propose to remove such code:
* AviReader.cs - actually we does not need it, AvsReader works fine. Even if you need to open non avisynth file you can use "AviFile(fileName)" without creating temporaly file
* DirectShow.cs - now we can just use "DirectShowSource(fileName)"
* d2vReader.cs - now we can just use "LoadPlugin(...)\r\nMpeg2Source(fileName)"
Isn't AviReader already not in use anymore? If so it would only make sense to remove it. But keep in mind, I want that YV12 warning message before that.. it's way more important than cleaning up.. cleaning up only helps developers.. colorspace checking helps the user.
I can't comment on the DirectShow.cs file.. I don't know where it's being used and I've never even taken a look at what's inside.
As far as the d2vreader goes.. it's not done by switching a few statements.. the preview is closely connected to the reader so I have my reservations.. and come to think of it.. we get the DAR from the d2v.. you can't get that from AviSynth, can you? If you load the d2v via AviSynth, your 720x576 input becomes a 1:1 DAR.. you don't know whether it's a 4:3 or 16:9 source anymore, and that information is quite crucial, and you can't get it anywhere else reliably (keep in mind, we don't always have the info file and the info file only applies to one click mode.. not the avisynth script creator). So effectively, by eliminating the d2v reader, you introduce another manual step: DAR selection.. and since people don't have to run dgindex manually, they never get to see that.. so effectively either they know themselves, or they get the info from a tool that displays it.
Richard Berg
26th January 2006, 15:32
Being able to read d2v's shouldn't be cut. In addition to Doom9's point, we need the info in them in order to give the user helpful error messages. For instance, a very common problem is that d2v's hardcode the full path and don't work with relative paths. Simple for MeGUI to read the full path & check for file existence; hard for the user to debug without help.
dimzon
26th January 2006, 15:45
we get the DAR from the d2v.. you can't get that from AviSynth, can you?
Really d2vReader contains 2 independend blocks of code
1) PInvoke around DGDec.dll (it's really buggy, i got GPF @ trying to open d2v created by older version on DGIndex. AviSynth in other hand provide valid diagnostic message)
2) Direct d2v parsing via opening text stream
I suggest to remove PInvoke around DGDec.dll and replace it to AviSynth invocation... Or, maybe, better way is to move d2v parsing code into separate class d2vParser (bcz I found some code with direct d2v parsing, we can collect all related code in d2vParser) - and remove d2vReader at all and use AvsReader when you need video frame from it ;)
AviReader.cs used in some place to get FPS to provide it to DirectShowSource
http://forum.doom9.org/showthread.php?p=774773#post774773
So I waiting for sample AVI files from Mutant_Fruit
http://forum.doom9.org/showthread.php?p=774888#post774888
DirectShow.cs used to try to construct FilterGraph to know - is it possible to open file via DirectShowSource or not. I suggest trying "DirectShowSource(fileName)" is enought now to get a valid diagnostics
dimzon
26th January 2006, 15:49
But keep in mind, I want that YV12 warning message before that..
Can you write which message text I must write for it (my english is poor so provide me this message)?
Doom9
26th January 2006, 16:03
Your video source uses the {0} colorspace. Video encoding requires the YV12 colorspace. Add ConvertToYV12() at the end of your AviSynth script and try again.
{0} is the actual colorspace of the video.
dimzon
26th January 2006, 17:13
0.2.3.2052 26 Jan 2006
Commit by dimzon
-Removed AVIReader (now everything is made via AvsReader)
-Small bugfix opening Script Creator window
dimzon
26th January 2006, 18:23
0.2.3.2053 26 Jan 2006
Commit by dimzon
-AviSynth wrapper now returns information about source colorspace && audio sampletype
dimzon
26th January 2006, 18:25
@Doom9
Dear Doom9, please take look @ AvisynthWrapper.cs && AvsReader.cs
Maybe it's better to merge AviSynthClip && AvsReader to one class (AvsReader)
Inc
26th January 2006, 19:06
0.2.3.2053 26 Jan 2006
Commit by dimzon
-AviSynth wrapper now returns information about source colorspace && audio sampletype
do you mean the dll itself? That was already given ....
typedef struct AVSDLLVideoInfo {
// Video
int width;
int height;
int raten;
int rated;
int aspectn;
int aspectd;
int interlaced_frame;
int top_field_first;
int num_frames;
int pixel_type; // <-----------------
// Audio
int audio_samples_per_second;
int sample_type; // <-----------------
int nchannels;
int num_audio_frames;
int64_t num_audio_samples;
} AVSDLLVideoInfo;
dimzon
26th January 2006, 19:13
do you mean the dll itself? That was already given ....
I mean my avisynthwrapper.dll now provide both before/after conversion. So you can open script forcing RGB24 but will obtain information about original colorspace
Dayvon
26th January 2006, 19:30
Not to spam your thread or anything, but I just wanted to thank you MeGUI dev's. I just got done backing-up/encoding the Band of Brothers series, and your utility worked perfectly. More no hassle rendering than I've done in a long time. Thanks for your hard work, and great GUI!!
Dave
berrinam
26th January 2006, 21:26
Your video source uses the {0} colorspace. Video encoding requires the YV12 colorspace. Add ConvertToYV12() at the end of your AviSynth script and try again.
{0} is the actual colorspace of the video.
What about asking 'Do you want me to fix this up by adding ConvertToYV12() to the end of the script'?
Doom9
26th January 2006, 21:30
well.. I had that part typed out, then I somehow moved away, and once again coming back my text was gone.. thus the shorter message.. yes, having a dialog which would offer the automatic adding would be good, but then we also need the re-opening of the source
Inc
27th January 2006, 09:18
I mean my avisynthwrapper.dll now provide both before/after conversion. So you can open script forcing RGB24 but will obtain information about original colorspace
? That was alreay done as inf.pixel_type was taken from the original frame before forcing the conversion to RGB/YUY2/YV12
vi->pixel_type = inf.pixel_type
And the outgoing Cspace is determined by the Cspace requested in the avs_getvframe(....,....,"RGB") command.
I do think we should merge the project AvsRedirect and AvsWrapper as its getting confusing. If you have questions about whats integrated and what could be done better, lets do it together. ;)
dimzon
27th January 2006, 11:45
What about asking 'Do you want me to fix this up by adding ConvertToYV12() to the end of the script'?
How does you want to patch such script
blablabla
blablabla
blablabla
return last
blablabla
blablabla
blablabla
blablabla
I propose a little another method. Let's create additional avs @ same path:
filename = <originalFileName>.ConvertToYV12.avs
Import(<originalFileName>).ConvertToYV12()
we can do it automatically for every script ;) (even without colorspace checking)
dimzon
27th January 2006, 11:48
? That was alreay done as inf.pixel_type was taken from the original frame before forcing the conversion to RGB/YUY2/YV12
vi->pixel_type = inf.pixel_type
And the outgoing Cspace is determined by the Cspace requested in the avs_getvframe(....,....,"RGB") command.
avisynthWrapepr returns both - original && forced pixel type
I do think we should merge the project AvsRedirect and AvsWrapper as its getting confusing. If you have questions about whats integrated and what could be done better, lets do it together. ;)
No. I have branch it to avoid any backward-compatibility support. It must work only with complimentary AvisynthWrapper.cs. You can use it's source code to merge parts back to AVSRedirect throught...
Inc
27th January 2006, 11:54
No. ...
You can use it's source code to merge parts back to AVSRedirect throught...
The source code, and main add ons are from new_avsRedirect.dll ;) So no need to merge things "back" ;)
however ....
berrinam
27th January 2006, 12:31
How does you want to patch such script
blablabla
blablabla
blablabla
return last
blablabla
blablabla
blablabla
blablabla
I see that a script like that could be a problem, but who really does that? There's not any point in writing return last in a script. If everything is in variables, then what you would do is just write the line "video", or whatever your variable-name is. The only appropriate place for return is in AviSynth functions. Also, why would you have more text after you have returned the video?
I propose a little another method. Let's create additional avs @ same path:
filename = <originalFileName>.ConvertToYV12.avs
Import(<originalFileName>).ConvertToYV12()
Is this really necessary? In my local implementation, it just appends ConvertToYV12() to the end of the script. It then checks if the modified script is fine, and if not, it tells the user, who can choose whether to abort. I agree, your method is guaranteed to work and might be a more elegant solution because of this, but:
1. It creates an extra file to be deleted, and the unexpecting user may be surprised to find two avisynth files where there should only be one. Which one should he/she choose?
2. It requires more code restructuring to handle the fact that there is ANOTHER file.
3. As I said above, that situation should never really arise, and my implementation will abort gracefully in this situation: telling the user that appending converttoyv12 didn't work, and giving the user the option of aborting.
People who really know a lot about scripting will almost definitely not want the quick fix ConvertToYV12() at the end of the script, because, for most sources, it should have been YV12 in the first place, and so they will want to work out where the non-YV12 colorspace came from. I think it is only these people who will be writing the scripts with return last in them.
we can do it automatically for every script ;) (even without colorspace checking)I think that shouldn't be done, because:
1. It adds additional pointless filters. Why slow the encoding down (even though not by much).
2. It will hide problems that the experienced AviSynth user will want to know about. If there is a conversion to RGB, these people won't want it hidden by a ConvertToYV12 at the end, because colorspace conversions cause quality loss.
Never-the-less, none of these points actually give much reason against either of our implementations, so let's see what Doom9 says.
dimzon
27th January 2006, 12:36
0.2.3.2054 27 Jan 2006
Commit by dimzon
-SourceDetector doesn't create temporaly AVS anymore
dimzon
27th January 2006, 12:41
I see that a script like that could be a problem, but who really does that?
I do ;)
Actually I usereturn last instead of commenting/removing rest lines of script. Such trick (return last) is not a good programming style for regular code but avisynth scripts is mostly temporaly (just encode and forget) so i prerer this way bcz it is faster ;)
berrinam
27th January 2006, 13:14
I still don't like this return last. As you said, it's not good programming style. Also, would you seriously just let MeGUI do your ConvertToYV12 wrapping? If you found out it isn't YV12, wouldn't you go: "Hang on a minute, what's up? My source should be YV12, so where's it been converted away from YV12? I better fix it up"
Ok, how about this: I'm just about to commit my version, which manages the "don't ask me again" dialogs as well as all the error messages. If Doom9 wants your way, then you just change the ConvertToYV12 section of the code. There are two places you should look at: JobUtil.prepareVideoJob, which calls the function VideoUtil.checkVideo(string)
berrinam
27th January 2006, 13:40
0.2.3.2055 27 Jan 2006
Commit by berrinam:
-Added video input checking (video exists, has no errors, colorspace==yv12, mod16) and warns the user
-Refactored dialogs, added MessageBoxEx reference, and removed MPEG2SourceChoice
-Removed OneClickDefaults.cs, OneClickDefaultWindow.cs/.resx
dimzon
27th January 2006, 13:48
0.2.3.2055 27 Jan 2006
Commit by berrinam:
-Added video input checking (video exists, has no errors, colorspace==yv12, mod16) and warns the user
-Refactored dialogs, added MessageBoxEx reference, and removed MPEG2SourceChoice
-Removed OneClickDefaults.cs, OneClickDefaultWindow.cs/.resx
AvsReader avi = AvsReader.OpenScriptFile(avsFile);
if (!avi.Clip.HasVideo)
return "AviSynth script has no video";
Take look @ AvsReader.OpenScriptFile first:
_enviroment = new AviSynthScriptEnvironment();
_clip = parse? _enviroment.ParseScript(script, AviSynthColorspace.RGB24) : _enviroment.OpenScriptFile(script, AviSynthColorspace.RGB24);
if (!_clip.HasVideo)
throw new ArgumentException("Script doesn't contain video");
Doom9
27th January 2006, 13:55
If Doom9 wants your way, then you just change the ConvertToYV12 section of the code. There are two places you should look at: JobUtil.prepareVideoJob, which calls the function VideoUtil.checkVideo(string)I don't think such breakout scripts should be of our concern.. those who write advanced scripts should be knowledgeable enough to figure out what can go wrong.. our main concern has to be making things work for the users that have very little or no AviSynth knowledge at all.
@dimzon: why do you use _ prefixes for variable names when the rest of the project uses no such thing? It's breaking with style. I generally like to use the java style notation (somevariablename becomes someVariableName.. first letter small, subsequent letters at positions where a word could be separated in capital letters). I know I'm not being consistent but I think considering that so many people are working on this now, we really should strive to be consistent throughout the code. The same goes for comments.. every method should have one (once again I've been too lazy in the past), and I'm also no fan of the whole if something ? then : else notation.. it makes a program harder to read, and forces you to read the entire line, then hammer out the logic in your head rather than just read over the if and know what it's all about.
dimzon
27th January 2006, 14:31
why do you use _ prefixes for variable names when the rest of the project uses no such thing?
first of all - unfortunally MeGUI project doesn't have consustent style across it' sources at all
second - AFAIK Java has not fixed (only one style applicable) notation
third - I'm using Microsoft-proposed style.
this means:
all nonpublic fields must start with _ (private int _someInt)
all nonpublic methods must have lowercase fiirst char (private int someInt() )
all public methods must have upper case first char (public int SomeInt() )
its really usefull notation: looking @ such code
_script = generateScript(val);
Start();
You can say:
_script is protected field, Start() is public and generateScript is protected method without looking @ definition.
But if You don't like this stye feel free to change it using Refactoring features of VS2005 (right click on name and choose Refactor->Rename)
The same goes for comments.. every method should have one
It's my fault. Unfortunally my english is poor so I believe reading source will give you better infotmation against reading comments.
and I'm also no fan of the whole if something ? then : else notation.. it makes a program harder to read, and forces you to read the entire line, then hammer out the logic in your head rather than just read over the if and know what it's all about.
Agreed, sometimes it's harder to read then if/else...
Doom9
27th January 2006, 14:43
all nonpublic fields must start with _ (private int _someInt)But Microsoft also suggests the use of properties for publicly accessible variables.. thus you can use what you're using for methods and transfer it directly to variables. Any variablename starting with a lowercase letter is private, anything that's exposed is a property which has the same name but starts with a capital letter. I think I've been following that style pretty closely where variables are concerned.
However, I don't quite see the necessity to see the difference.. if you're working "inside" the class.. you don't really care whether a method is public or not. If you're working "outside" the class.. if it's private you won't even get to see it.. plus then there are the protected and internal intricacies that you can cover with changing just one letter. If working "outside" a class, if intellisense doesn't pick up a method name you know is there.. you have to go back and change the access modifier anyway.
Come to think of it.. iirc most samples I've seen using the _ notation were done by programmers coming from a language that doesn't have properties and doesn't commonly work with setters/getters. I'm not used to seeing _ in variable names in msdn samples (for C# of course)
dimzon
27th January 2006, 15:31
if you're working "inside" the class.. you don't really care whether a method is public or not.
When I'm looking @ ugly code insude class can say - ok, this method use only nonpublic features, I can refactor it ;)
Come to think of it.. iirc most samples I've seen using the _ notation were done by programmers coming from a language that doesn't have properties and doesn't commonly work with setters/getters. I'm not used to seeing _ in variable names in msdn samples (for C# of course)
http://www.akadia.com/services/naming_conventions.html
http://dotnet.mvps.org/dotnet/faqs/?id=namingconventions&lang=en
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconnamingguidelines.asp
dimzon
27th January 2006, 15:46
added MessageBoxEx reference
What is MessageBoxExLib.dll ?
Where I can find it's source code?
Doom9
27th January 2006, 15:46
Your last link, the official guidelines is very enlightening. It suggests the use of the camel notation for protected fields and method parameters, and discourages the use of public fields (instead it suggest properties just like I've been using, and the use of the pascal notation)
Basically the only difference is in terms of method names, where I've always been using camel notation (which is how I was taught to code in Java).
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconcapitalizationstyles.asp[
When I'm looking @ ugly code insude class can say - ok, this method use only nonpublic features, I can refactor it What do we have refactor tools for? So that they help when you refactor a method that could have an influence on others ;) I saw nothing on the MSDN .NET coding guidelines about prepending _ for private variables and use of capital letters for methods only if they're public. Since those are guidelines for creating class libraries, it wouldn't make a whole lot of sense to come up with guidelines for how you handle things internally.
I don't mind much using capitalization to differ between exposed and non exposed methods, but it's already inconsistent (the guidelines suggest to use camel notation for protected variables.. versus pascal for all (and thus also protected) methods).
The articles you linked to also contradict each other (e.g. Microsoft says no to Hungarian notation, http://www.akadia.com/services/naming_conventions.html suggests it for protected variables). Since IDEs tell you what type a variable is if you hover over it, and also tell you once you start typing and get to chose from the available variables, I don't see the point of hungarian notation at all, and they even use it inconsistently (no hungarian for OleDBConnection? and then there are probably a hundred more exceptions).
dimzon
27th January 2006, 15:53
Your last link, the official guidelines is very enlightening. It suggests the use of the camel notation for protected fields and method parameters, and discourages the use of public fields (instead it suggest properties just like I've been using, and the use of the pascal notation)
Basically the only difference is in terms of method names, where I've always been using camel notation (which is how I was taught to code in Java).
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconcapitalizationstyles.asp[
As I said - it's easy to convert one style to another via Refactoring features from VS2005. Unfortunally VS2005 ignores code blocks in inactive CC blocks. That's a reason why I'm agains conditional compilation! By the way - what is Your desision about it (seem's like MeGUI full wins 3:1 )
http://forum.doom9.org/showthread.php?t=105776
dimzon
27th January 2006, 16:07
Yet another reason why i prefer underscope for nonpublic fields:
private string avsScript;
public Init(string avsScript)
{
avsScript = avsScript; // won't work
this.avsScript = avsScript; // will work;
}
compare it to:
private string _avsScript;
public Init(string avsScript)
{
_avsScript = avsScript; // will work
this._avsScript = avsScript; // will work;
}
and when you looking @ method implementation you can't tell exatly - is you accessing to methid argument or private field until you scroll up && look @ method definition
Doom9
27th January 2006, 16:14
why on earth would it matter whether this.avsScript is protected or private (keep in mind.. MS suggests avsScript in case of a protected class variable). _variable looks butt-ugly.. I don't consider myself to put much weight on appearances but I do seem to have a strong opposition to code I think looks ugly.
what is Your desision about it (seem's like MeGUI full wins 3:1 ) I still like the stripped down edition.. it was created for a reason and that's getting people on the hook even if they're just looking for a tool do to video encoding.. then you offer the easy upgrade path to a much more extensive functionality so it's easier to get the cautious people onboard.
ChronoCross
27th January 2006, 16:38
If I remember correctly the _privateVariable was originally implemented in C. it's the style that most of the older professors I take use. it's what I've been taught to use for C. But for java and C++ I simply use lowercase of the first word uppercase of the second.
Doom9
27th January 2006, 16:53
How about this:
Use properties for all variables that are externally exposed (including protected, unlike what MS says - they suggest camel notation which is inconsistent with the suggestion of pascal for all exposed methods), and use pascal notation for those (as MS suggests for properties). Use pascal notation for all publicly exposed methods (as MS suggests). Use camel notation for any non exposed method and variables. That's fully consistent and pretty.
So we'd have
private int myPublicExposedVariable, myProtectedExposedVariable2, myPrivateVariable;
protected MyPublicExposedVariable{...}
public MyProtectedExposedVariable{..}
public MyMethod(int someParameter)
{
this.myPrivateVariable = someParameter;
}
myPrivateMethod(int myPrivateVariable)
{
this.myPrivateVariable = myPrivateVariable;
}
I don't think this.myPrivateVariable = myPrivateVariable is a problem... on the contrary.. it forces you to think a little when you name method parameters the same as class variables.
dimzon
27th January 2006, 17:07
I don't think this.myPrivateVariable = myPrivateVariable is a problem... on the contrary.. it forces you to think a little when you name method parameters the same as class variables.
this will works while you are writing code from the scratch. But if You are changing non your code or refactoring it it's easy to make a mistake...
Thats why I strongly prefer _ pefix for private fields (please, stop name it variables, it's not variables but fields)
dimzon
27th January 2006, 17:09
@By the way - seems like we have something like flamewar now ;)
Maybe we will stop it (as I said before it's esy to convert to another notation using VS2005 refactoring->rename feature) and switch to more meaningfull topic (ie - what to do next)
Doom9
27th January 2006, 17:30
as I said before it's esy to convert to another notation using VS2005 refactoring->rename featureBut there's no "switch to approved notation" refactoring so each variable will have to be changed.. so it's important we stop using different notations. The fact that large parts of the code were written by myself make this rather easy though.. it would be a major waste of time to change things.. so consider my examples above as the howto for any further changes. berrinam, who also added his own classes, also stuck to the same notation as I've been using as far as I can see.
And by the way, if you add an element in Visual Studio.. it's default accessor is private and it uses camel notation.. no _. So the _ prefixes are most definitely out.
In terms of where to go.. we need an as-is analysis.. compile a list of what we have in terms of job management and processing, and then design to to-be scenario. One crucial point will certainly be the mapping between the IDictionary containing the jobs and the GUI.
dimzon
27th January 2006, 18:01
But there's no "switch to doom9 approved notation" refactoring so each variable will have to be changed.. so it's important we stop using different notations.
Ok, throught I still doen't like private fields without _ ...
One crucial point will certainly be the mapping between the IDictionary containing the jobs and the GUI.
take look @ ListView.VirtualMode property - it's fine
By the way - I have small (approx 4 kb each) 16*16 icons - we can show them in Queue (red for error, green for complete etc)
Doom9
27th January 2006, 18:15
By the way - I have small (approx 4 kb each) 16*16 icons - we can show them in Queue (red for error, green for complete etc)Sounds like a good idea.. I don't think they can replace the status string but perhaps if added at the beginning they can give a quicker overview.
stax76
27th January 2006, 18:19
Every dev has his own style so the project initiator is in charge of enforcing a style. IIRC MS recommends camel case for fields but on the same time they recommend to access them using 'this' because otherwise there would be no destinction between fields and params.
public void SomeMethod()
{
m_someField = null; // IIRC ungarian notation / popular for C++, obsolete for .NET
_someField = null; // popular but like too many abbreviations not recommend for .NET, .NET code should be easy to read and look nice
someField = null; // not good because params use it too, IIRC used by SharpDevelop
SomeField = null; // my style, properties use PropName/PropNameValue pattern, IIRC MS code generators use it too!
this.someField = null; // recommend by MS but not very popular
}
dimzon
27th January 2006, 18:38
Sounds like a good idea.. I don't think they can replace the status string but perhaps if added at the beginning they can give a quicker overview.
http://www.mytempdir.com/413057
ChronoCross
27th January 2006, 18:41
this.someField is required when using Python. It's basically the main syntax when building classes. Else alot of the code won't work. but for a majority of people programming actual apps this isn't necessary cause python isn't used by companies.
Doom9
27th January 2006, 19:23
this.someField = null; // recommend by MS but not very popularI've started using it as well. In VS2k3, when you start typing, it doesn't show you local and global variables, hence I had to resort to typing this. to get a list of globals.. this is no longer the case with VS2k5 though.. it shows all the variables right away.
By the way, where the heck does "field" come from? I learned about methods and variables in college (and prior to OO programming, functions in Pascal in high school)
dimzon
27th January 2006, 19:29
By the way, where the heck does "field" come from? I learned about methods and variables in college (and prior to OO programming, functions in Pascal in high school)
this is oop term. You say structure fields, not structure variables, isn't it. Ad object is struct + methods...
dimzon
27th January 2006, 19:42
@Doom9
Why not to talk via ICQ?
Richard Berg
27th January 2006, 19:52
@Doom9 -- field : variable :: method : function
I hate _field personally. I only use _ for parameters to constructors:
public class MyClass
{
private int x, y;
// don't feel like making up another name (xParam? myX? xInput?)
// so I use _x
public MyClass(int _x)
{
this.x = _x;
}
public MyClass(int _x, int _y)
: this((_x + _y) / 2)
}
...and even that is just a C++ trick that's stuck with me...not condoned by the other C# guys I work with. (Initializer lists aren't as powerful in C#, though they're certainly "better" from an OO standpoint).
Everywhere else, _ is banished like ALLCAPS; both remind me of C/Win32 (ugh).
berrinam
27th January 2006, 23:16
Video cutting in the AviSynth creator for removal of ads, etc
Description: Since video and audio can be done through AviSynth cutting can be completely precise. Use should be done using the trim statement.
Status: No-one is working on this yet.I think Doom9 had some plans about this. Am I right, and if so, what were/are they?
Dayvon
28th January 2006, 00:46
Hey guys...
I was messing around in Paint Shop the other day, and I decided to make an icon for MeGUI. I use this dock thing and the default icon looks pretty boring so I made this thing up. I figured I'd let you guys have at it if you want, if not, then by all means it'll just be my personal MeGUI icon.
If you do like it however, you're totally free to use it. The fonts are freeware fonts, and the I have a higher resolution version if you want it. I tried to run with the same colors as Gordian Knot just for familiarities sake.
Anyway, I can't do code developing, but I can do this. So let me know what you think...
http://church.crossingatwoodland.com/ChurchFiles/SermonText/MeGUI2Icon.png
charleski
28th January 2006, 01:33
Sorry I haven't been around. Work has kept me off the net (unless I sign up for some costly coverage, to which I might succumb).
It's good that you're arguing about the whole private/public issue. My own take on it would be that readability is paramount - C sacrificed that a long time ago and C# is, in part, an attempt to make the language intelligible again. On that score, any extra characters, like '_' are a NO-NO, and need to be consigned to the dustbin along with *, ^, @ and their relatives. (Unfortunatley '@' still survives courtesy of the lingering evil of printf).
Prefix camel notation wins for a simple reason: a complete stranger can take a look at the code and work out what's going on (as long as they have the basic logical ability), without having to wonder if there's some arcane messaging that he/she is missing.
I spend enough of my professional life inwardly screaming at the problems junior (and often senior) docs have at providing properly intelligible message streams, so I'm sensitive to this :).
Mutant_Fruit
28th January 2006, 17:18
@dimzon:
What do you mean by this warning you put in:
#warning use Property pattern for this
if(player == null)
player = new Player();
What do you mean by Property Pattern?
Mutant_Fruit
28th January 2006, 17:52
Patch for the calculator up in SourceForge. Fixes quite a few bugs, increases max length to 24 hours, 59 mins, 59 secs (doesn't seem to have any reprecussions that i know of). Added DVD-9 as a destination medium.
Fixed a bug in the main form aswell when you tried to queue a job with no input selected.
berrinam
29th January 2006, 01:25
There's a discrepancy in AR handling between x264 and xvid and lavc ASP. x264 uses Sample Aspect Ratio, lavc ASP uses PAR, and xvid has to use a rounded version of PAR. I was going to suggest that MeGUI removes this discrepancy by modifying the SARX and SARY properties so that subclasses of VideoCodecSettings override them in the correct way. This would mean that every interface would just have to select the PAR (which seems more intuitive to me), and MeGUI would convert that into the correct format.
The problem is that the conversion requires knowledge of the videos resolution. As it is, the AR in MeGUI is all wrong, and the code is hard to manage. What do you suggest?
Kostarum Rex Persia
29th January 2006, 17:12
Peoples, can anyone post a link to newest build of MeGUI, 0.2.3.2055, because I can't find download link on the MeGUI official project page on SourceForge.
Thanks.
Doom9
29th January 2006, 17:37
look who's popping up on my radar the same day they got unsuspended. There's a sticky with a guide and a download link.
@berrinam: what's the diff between x264's SAR and lavc's PAR anyway? Isn't it the same (and by the same token the same as XviD's custom PAR option). Am I correct to assume that if custom PAR were implemented, the exact same code could be used?
SeeMoreDigital
29th January 2006, 17:48
@berrinam: what's the diff between x264's SAR and lavc's PAR anyway? Isn't it the same (and by the same token the same as XviD's custom PAR option). Am I correct to assume that if custom PAR were implemented, the exact same code could be used?Agreed... There's no difference as far as I have been able to determine ;)
stax76
29th January 2006, 18:00
@SeeMoreDigital
Thanks for clearing this, everytime I read terms like AR, PAR, SAR, DAR and the likes I feel a sudden headache.
SeeMoreDigital
29th January 2006, 18:10
You're not the only one :eek:
berrinam
29th January 2006, 22:25
Agreed... There's no difference as far as I have been able to determine ;)Well, when I was testing it out, I entered the same two numbers into lavc and x264 in MeGUI, and x264 was properly scaled, whereas lavc was not.....
I thought that lavc was Picture Aspect Ratio, or Display Aspect Ratio, whereas x264 was Sample Aspect Ratio. Perhaps I got incredibly confused, because it seems not to be working for me, although it does for everyone else....
Doom9
29th January 2006, 22:36
I've finally had a look at the sources to look for possible refactoring in the future, and made some (rather random) notes:
configAudioButton_Click -> explore possible simplifications
videoConfigButton_Click -> explore possible simplifications
difference between video and audio: for video there's but one settings object per codec, for audio the settings of a stream do not necessarily correspond to a settings object accessible via dropdowns
isFirstPass, verifyVideoSettings -> VideoUtil
verifyOutputFile -> jobUtil
verifyInputFile -> jobUtil
startEncoding -> jobUtil
startNextJobInQueue -> jobContainer
loadJobs -> jobContainer
getFreeJobNumber -> jobContainer
addJobToQueue -> ??
getVideoJobs, addVideoJob -> jobUtil
removeJobFromQueue -> jobContainer
ideas: automatic script checking upon opening even if preview is not being opened. store properties of the script right away
getAudioJob() -> move to another place
addVideoJob(bool autostart) -> move to another place
improve profile -> dropdown mapping
discard audio streams only when accessing the auto encoder -> the two audio streams are always accessible in the main gui
jobs should provide a means to get a string array with everything required to create a ListViewItem for the queue
Use ListViewItem.Tag to attach the job to the listviewitem
improve profile management.. attach profiles to dropdown in a way
move containment to a new ProfileManager
Other things I'd like to achieve: easy encoding for specific devices (like PSP, video iPod). In case of the PSP that will require running an additional job.
I also found that ffmpeg can mux raw avc into AVI and generally mux AVIs so I'll be using that as a muxer in the future (I haven't found the syntax for splitting yet). Would it perhaps make sense to use ffmpeg only for raw -> video avi and then use a tool like avimuxgui for muxing/splitting.. the advantage of that would be multiple audio tracks, splitting, more allowed input types. The downside is job generation that gets more complex.
I also think the automated job generation for video should look something like this: you send the I/O and configuration and the desired output type. The JobUtil has to ask the VideoEncoder if it can provide the output type. If not, it should return a list of alternatives. JobUtil would then ask the Muxer if it has a muxing path from one of the possible encoder outputs to the desired output types. If that's the case, a job of the desired type has to be created.
berrinam
30th January 2006, 06:55
Other things I'd like to achieve: easy encoding for specific devices (like PSP, video iPod). In case of the PSP that will require running an additional job.
Well, that's partly what I had in mind for the new types of profiles I added. Profiles could be made for these specific tasks, and distributed, just like Sharktooth's AVC video profiles.
I've made one according for the iPod to the arstechnica settings. I can't test this, as I don't have a video iPod, but I've attached the group of profiles so you can get an idea as to how they work.
While it would be possible to make a profile that works with PSP (restricting the width to 320 maximum), from what I've read, this wouldn't get the best out of the PSP, as it supports a maximum of 76800 (320x240), but they can be at different ratios, like 368x208. I can't see a way to make the current OneClick structure (I presume OneClick is the way to go if you want an easy way for the users) manage both. Perhaps it needs another way of signalling the resolution than just maximum width?
dimzon
30th January 2006, 11:13
I've finally had a look at the sources to look for possible refactoring in the future, and made some (rather random) notes
WOW! Seems like you change your mind :cool:
Perfectly!!!
By the way: what I can do now? I'm planning to write Cropping dialog (like one in VirtualDub) but I can switch to refactoring
What do you mean by Property Pattern?
Somethink like this (not shure yet)
private Player playerInstance;
private Player player
{
get
{
if(playerInstance==null)
playerInstance = new Player()
return playerInstance;
}
}
@Mutant_Fruit
I'm still waiting avi samples wich you are not able open via DirectShow without direct FPS specification
Inc
30th January 2006, 11:48
Well, when I was testing it out, I entered the same two numbers into lavc and x264 in MeGUI, and x264 was properly scaled, whereas lavc was not.....
I thought that lavc was Picture Aspect Ratio, or Display Aspect Ratio, whereas x264 was Sample Aspect Ratio. Perhaps I got incredibly confused, because it seems not to be working for me, although it does for everyone else....
Imho "Lavc" uses Aspect or AR (here DAR) and "x264" SAR (here PAR).
Doom9
30th January 2006, 11:54
I'm planning to write Cropping dialogUh, why is this necessary? We already have a video player that can do everything.. just showing the video, setting of intro end and credits start frames, zone management and even crop preview (keep in mind cropping is done via the AviSynth script creator window). Of course, we could have a BasePreview class, and subclasses that expose additional capabilities, but then we'd once again have to pick the proper class somewhere and end up needing a lot if/then/else or case statement.
@berrinam: couldn't we use the level enforcement to adjust the resolution for the PSP? That should take AR into account and thus always result in the optimal resolution. It only gets complicated if we move outside the one click domain.. e.g. having a "PSP" and "iPod" checkbox in the AviSynth script creator..
berrinam
30th January 2006, 11:58
@berrinam: couldn't we use the level enforcement to adjust the resolution for the PSP? That should take AR into account and thus always result in the optimal resolution. It only gets complicated if we move outside the one click domain.. e.g. having a "PSP" and "iPod" checkbox in the AviSynth script creator..I thought of that, but there's no suitable level: http://forum.doom9.org/showthread.php?t=101345
Level 1.2 doesn't allow 320x240 at 29.97, and Level 1.3 allows up to 352x288, which is too high.
Imho "Lavc" uses Aspect or AR (here DAR) and "x264" SAR (here PAR).
I've given up trying to work out what the situation with all of the various ARs is. There is more about it here: http://forum.doom9.org/showthread.php?t=105809, where some people say they've had no problems with MeGUI's AR handling, and others say it is useless. I remember that when I did AR signalling for OneClick, I tried it out and it worked on my samples. I have no idea what the current situation is now, and no-oen seems to agree with anyone else.
dimzon
30th January 2006, 12:06
keep in mind cropping is done via the AviSynth script creator window
it means i need to set crop values and open file in preview to see - does I perform proper cropping or not and return to AviSynth creator window again and fix croppping values if not etc...
And I want to do something like this:
http://img89.imageshack.us/img89/7026/untitled5uc.jpg
berrinam
30th January 2006, 12:09
it means i need to set crop values and open file in preview to see - does I perform proper cropping or not and return to AviSynth creator window again and fix croppping values if not etc...Huh? It automatically opens a preview window that updates as you change the cropping values.
Inc
30th January 2006, 12:17
My next step is to include an auto-cropper code based on a border luma threshold and an individual count of samples to be parsed to the new avsredirect.dll, so Dimzon could merge that future piece of c++ code to his AvsWrapper which is used in MeGui. Also it would be imho helpful to build a dll from PARanoias internal resize routines so that feature also could be used in MeGUI.
I've given up trying to work out what the situation with all of the various ARs is. There is more about it here: http://forum.doom9.org/showthread.php?t=105809, where some people say they've had no problems with MeGUI's AR handling, and others say it is useless. I remember that when I did AR signalling for OneClick, I tried it out and it worked on my samples. I have no idea what the current situation is now, and no-oen seems to agree with anyone else.
There are only a few things I have to know:
As I catched in here that PAR equals to SAR, then the values could be easely calculated, BUT! Maybe Im wrong as I also heared that the PAR values should be vice versa if using as SAR? Like 128/117 in PAR is 117/128 in SAR mode ?
Also how does x264's decoder show the image when using a non 1:1 SAR? Means will the image resized in the decoder correctly to its final state by resizing the height or the width?
In PAL a 720x576 should later be shown as 788x576 (1:1) for example.
dimzon
30th January 2006, 12:44
Huh? It automatically opens a preview window that updates as you change the cropping values.
Anyway i think VirtualDub - like window is much more comfortable (you can drag cutting lines with mouse)
Doom9
30th January 2006, 12:46
@dimzon: as berrinam pointed out.. the minute you load a file into the avisynth creator, a preview pops up and you can see the effects of any cropping changes in real-time.
@incredible: we already have these two features in MeGUI.. and they work quite well.
Doom9
30th January 2006, 12:56
Level 1.2 doesn't allow 320x240 at 29.97, and Level 1.3 allows up to 352x288, which is too high.You gotta love Sony.. standards my lower backside...
I have no idea what the current situation is now, and no-oen seems to agree with anyone else.it goes to show that telephony people should stay far away from video. What's wrong with square pixels everywhere and one stretch factor for playback? That's easy and everybody can understand it if you show them three images. I have yet to see anyone who can give a formula on how to relate DAR, image width, height and SAR/PAR.
dimzon
30th January 2006, 14:30
http://img300.imageshack.us/img300/2603/untitled14it.jpg
You can drag blue cropping lines via Mouse - exatly like in VirtualDubMod!
dimzon
30th January 2006, 14:49
0.2.3.2057 30 Jan 2006
Commit by dimzon:
-New experimantal crop dialog (not complete working yet)
Doom9
30th January 2006, 14:57
I don't think using the mouse serves much of a purpose other than being eye candy. When you get right down to it, in the end you have to use the up/down buttons to fine control your cropping. And the AViSynth dialog is closely connected to the reader.. you do realize that by creating another dialog, you'll have to redo everything. Cropping also has to be done either on an avs script or a d2v. Then you have the whole autocrop thing, which also goes straight to the script creator, and the anamorphic story (which requires knowledge about input and output resolution).
VDub also doesn't have autocrop.. a very useful feature.. plus you need to see the results of autocropping.
I also think VDub's ordering of the values is suboptimal.. the way I resolved it, the 4 values are placed with respect to the image in a gamepad like order.. everybody knows immediately which is which.
dimzon
30th January 2006, 15:25
And the AViSynth dialog is closely connected to the reader.. you do realize that by creating another dialog, you'll have to redo everything.
Mostly no. Current VideoReader API is fine - is very easy to create "yet another player connected to VideoReader"... If my solution will be Approved by You we can perfor a little refactoring to make this dialog & player ancessors of same class...
And I really doesn't like how current MeGUI implementation works with cropping preview.
By the way
Using current powerfull avisynth wrapper is possible to mimic VirtualDub (name it standard de-facto) in filters tuning (it's easy to create filter tuning dialog with preview ability)
I also think VDub's ordering of the values is suboptimal.. the way I resolved it, the 4 values are placed with respect to the image in a gamepad like order.. everybody knows immediately which is which.
Ok, I hink You are right...
Doom9
30th January 2006, 15:33
And I really doesn't like how current MeGUI implementation works with cropping preview.Why? What's wrong with it?
dimzon
30th January 2006, 16:13
Why? What's wrong with it?
I'm sorry, but it is uncomfortable for me.
Just get from CVS latest CropDialog (rev 1.2) and compare usability a little... Is'nt CropDialog a more comfortable?
http://img202.imageshack.us/img202/3364/untitled35xo.jpg
Doom9
30th January 2006, 16:24
Is'nt CropDialog a more comfortable?I don't see how. Plus the existing dialog is freely resizeable ;) Being a dialog, once you close it, you no longer get to see anything.. with the existing one.. you can close it all you want, the values stay visible and accessible.
dimzon
30th January 2006, 16:45
Plus the existing dialog is freely resizeable ;)
This feature doesn't need for cropping
Being a dialog, once you close it, you no longer get to see anything.. with the existing one.. you can close it all you want, the values stay visible and accessible.
It means I just must transfer cropping values to AviSynth creator window, is'nt it? My dialog still uncomplete yet...
I don't see how.
Well... If You don't like it I will remove it ASAP. Just answer - to remove or not to remove (to be or not to be ;) )
Doom9
30th January 2006, 17:09
This feature doesn't need for croppingUmm.. I know my screen can handle HDTV natively, but most people are not that lucky.. which results in a window that is larger than their screen and that's not very convenient, would you not agree?
What I like about my approach (and GKnot, where I took the idea from), is that you can theoretically crop without ever seeing the preview, and that you can tend to other related tasks with the preview still on screen. I just don't see how the new approach is better, not just different.
it's easy to create filter tuning dialog with preview abilityNow that would be a useful feature. Even more useful would be a before - after view.
SeeMoreDigital
30th January 2006, 17:32
Hi dimzon,
For those (few) of us who like to keep the black mattes....
Would it be possible to add a function that could intentionally "add" black mattes to a source that's found to have furry and/or poorly aligned matte-to-image edges?
Cheers
Dayvon
30th January 2006, 18:00
Hey guys... I posted this earlier, but it either got ignored or missed since it was at the bottom of a page. So I'm reposting it....
I was messing around in Paint Shop the other day, and I decided to make an icon for MeGUI. I use this dock thing and the default icon looks pretty boring so I made this thing up. I figured I'd let you guys have at it if you want, if not, then by all means it'll just be my personal MeGUI icon.
If you do like it however, you're totally free to use it. The fonts are freeware fonts, and the I have a higher resolution version if you want it. I tried to run with the same colors as Gordian Knot just for familiarities sake.
Anyway, I can't do code developing, but I can do this. So let me know what you think...
http://church.crossingatwoodland.com/ChurchFiles/SermonText/MeGUI2Icon.png
dimzon
30th January 2006, 18:03
@SeeMoreDigital
Sorry, misunderstood you. Can You repeat it using a little more cmplex english?
@Dayvon
Looks fine for me, waiting for Doom9 response
dimzon
30th January 2006, 18:06
0.2.3.2058 30 Jan 2006
Commit by dimzon:
-Some refactoring (AVS generation code moved from VideoUtil to ScriptServer)
@Doom9
please, take look @ changed files, does You approve such refactoring?
SeeMoreDigital
30th January 2006, 18:41
@SeeMoreDigital
Sorry, misunderstood you. Can You repeat it using a little more cmplex english?Sure...
If I had a source with poor looking mattes, like this: -
http://img235.imageshack.us/img235/1180/badmattesexample5ip.jpg
Would it be possible to configure your application to "overlay" mattes, so the source/encode could (in theory) look like this: -
http://img371.imageshack.us/img371/5404/overlaymatte9wz.jpg
Cheers
Doom9
30th January 2006, 18:53
why would you not simply cut away bad borders? Keeping black bars is detrimental to image quality.
And the last time I checked, we have a feature request thread ;)
dimzon
30th January 2006, 18:57
why would you not simply cut away bad borders?
Agreed
@Doom9
I'm waiting for your solution about crop Dialog (remove or continue) and for futher refactoring.
SeeMoreDigital
30th January 2006, 19:08
why would you not simply cut away bad borders? Keeping black bars is detrimental to image quality.Agreed.... but far less so if the matte is razor sharp, ie: pixel perfect. As true "black" does not require many bits to process.
And the last time I checked, we have a feature request thread ;)Sorry about that, it's easy to get carried away in the excitement. Please move my posts accordingly ;)
Cheers guys
berrinam
30th January 2006, 21:51
I had cleaned up the suggestResolution method, and documented the algorithm for calculating the Sample Aspect Ratio (which is, as I see it, a stretching amount, when taken as a fraction, sarx/sary). As I said earlier, I believe the problem with all of this is that only x264 uses sarx and sary -- I think lavc uses an overall ratio like DAR, which prescribes the ratio of displayWidth / displayHeight. SMD says it doesn't but from my testing..... I think it does.
Anyway, assuming I am correct about what methods of signalling these codecs use, how would you do the MeGUI architecture? I still think that it would be nice for the user if they could enter the same number in any codec in MeGUI and have the correct aspect ratio come out. Similarly, the programmer would want to avoid codec-specific handling of AR. It should just work out one AR and tell it to each codec, which works out how to convert that.
That would mean that MeGUI would have to handle conversion between AR methods. So here's the problem: the algorithm for conversion between formats is not so hard, but it requires that it knows the number of pixels. In some cases, the number of pixels is only known at the moment the job is run (look at the case where you add a non-working AviSynth script to the job and you then fix it up later -- this could happen in three cases I see: prerendering, two-pass scripts, and the user just being annoying). Perhaps the solution would be to regenerate the commandline just before the job is run, and tell the commandline generator what the resolution is (it does make sense that it should convert it -- it is just a triviality of what to put in the commandline:D)
So..... what do you think?
Also, for your reference, the cleaned up suggestResolution code:
public static int suggestResolution(double readerHeight, double readerWidth, double customDAR, CropValues cropping, int horizontalResolution,
bool signalAR, out int sarX, out int sarY)
{
double fractionOfWidth = (readerWidth - (double)cropping.left - (double)cropping.right) / readerWidth;
double inputWidthOnHeight = (readerWidth - (double)cropping.left - (double)cropping.right) /
(readerHeight - (double)cropping.top - (double)cropping.bottom);
double sourceHorizontalResolution = readerHeight * customDAR * fractionOfWidth;
double sourceVerticalResolution = readerHeight - (double)cropping.top - (double)cropping.bottom;
double realAspectRatio = sourceHorizontalResolution / sourceVerticalResolution; // the real aspect ratio of the video
realAspectRatio = getAspectRatio(realAspectRatio); // Constrains DAR to a set of limited possibilities
double resizedVerticalResolution = (double)horizontalResolution / realAspectRatio;
int scriptVerticalResolution = ((int)Math.Round(resizedVerticalResolution / 16.0)) * 16;
if (signalAR)
{
resizedVerticalResolution = (double)horizontalResolution / inputPixelCountRatio; // Scale vertical resolution appropriately
scriptVerticalResolution = ((int)Math.Round(resizedVerticalResolution / 16.0) * 16);
// sarX
// ---- must be the amount the video needs to be stretched horizontally.
// sarY
//
// horizontalResolution
// -------------------------- is the ratio of the pixels. This must be stretched to equal realAspectRatio
// scriptVerticalResolution
//
// To work out the stretching amount, we then divide realAspectRatio by the ratio of the pixels:
// sarX horizontalResolution realAspectRatio * scriptVerticalResolution
// ---- = realAspectRatio / -------------------------- = --------------------------------------------
// sarY scriptVerticalResolution horizontalResolution
sarX = (int)Math.Round(realAspectRatio * resizedVerticalResolution);
sarY = (int)Math.Round(horizontalResolution);
return scriptVerticalResolution;
}
else
{
sarX = 0;
sarY = 0;
return scriptVerticalResolution;
}
}
berrinam
30th January 2006, 21:53
@dimzon: I find the current way of cropping nicer, in that it gives white bars instead of a line where you are cropping to. My reason for saying this is nicer is that you can look at it and see what the film you are going to get is, and you won't be distracted by the junk on the outside. It is harder to see exactly if there is any black on one side of a line (your approach) than if there is any black at all.
Finally, you can't crop by odd values in YV12.
SeeMoreDigital
30th January 2006, 22:10
I had cleaned up the suggestResolution method, and documented the algorithm for calculating the Sample Aspect Ratio (which is, as I see it, a stretching amount, when taken as a fraction, sarx/sary). As I said earlier, I believe the problem with all of this is that only x264 uses sarx and sary -- I think lavc uses an overall ratio like DAR, which prescribes the ratio of displayWidth / displayHeight. SMD says it doesn't but from my testing..... I think it does.I still maintain there "shouldn't" be any difference ;)
Cheers
Doom9
30th January 2006, 23:42
Perhaps the solution would be to regenerate the commandline just before the job is run, and tell the commandline generator what the resolution isUh.. regeneration is okay by me (I was meaning to do that myself), but I don't think there should be any knowledge of resolution in the commandline generator. When doing things manually (so from the avisynth script creator).. you should assume the resolution won't change anymore. In case of one click job series, it should be taken care off. And then I guess I will have to wonder why we have that prerender job that breaks things ;) It's that sort of inter job type dependency (the dgindex postprocessing and automated job series consisting of audio and video put that to the extreme) that makes it really hard to have a structure where each job is really separated.
BTW, I haven't heard a word about my brainstorming on refactoring.
berrinam
31st January 2006, 06:54
0.2.3.2059 31 Jan 2006
Commit by berrinam:
-Fixed up AR handling in MeGUI. Everything is now set as PAR, and any conversions required are done just in time for encoding
-Fixed up compile errors
-Applied Mutant_Fruit's bitrate calculator patch
ChronoCross
31st January 2006, 07:22
Damn I just compiled 2058 about an hour ago. doesn't matter cause the anoncvs won't be updated for a few hours. I'l prepare another release before work.
dimzon
31st January 2006, 11:33
BTW, I haven't heard a word about my brainstorming on refactoring.
http://forum.doom9.org/showthread.php?p=777457#post777457
@Doom9 && @berrinam
I do not like current cropping solution bcz of window overlapping problem. Really, crop controls are placed in one window && preview is in another window. When you trying to change cropping values AvsGenarator window && underlayng MeGUI main vindow overlaps preview window. And when I clicking to preview window it overlaps AvsGenarator window incl. cropping controls.
@berrinam
I still waiting answer for a question: where I can get sources of MessageBoxExLib.dll
berrinam
31st January 2006, 12:15
@Doom9 && @berrinam
I do not like current cropping solution bcz of window overlapping problem. Really, crop controls are placed in one window && preview is in another window. When you trying to change cropping values AvsGenarator window && underlayng MeGUI main vindow overlaps preview window. And when I clicking to preview window it overlaps AvsGenarator window incl. cropping controls.I agree. That should just be fixed by correcting the ordering of the windows, though. It doesn't warrant a redesign of the cropping.
I still waiting answer for a question: where I can get sources of MessageBoxExLib.dll
I've added the sources to the CVS repository. They come from a codeproject sample, with some stripping down by me. However, there is still a lot left there which isn't used.
dimzon
31st January 2006, 12:19
I agree. That should just be fixed by correcting the ordering of the windows, though. It doesn't warrant a redesign of the cropping.
Unfortunally no - it can't be complete solved via windows ordering. It can be solved only bying monitor with bigger resolution and/or placing preview & crop controls in same window
Doom9
31st January 2006, 12:28
my main beef with having everything in one window is that crop values and preview don't necessarily go together. I sometimes make scripts where I already know the crop values so I don't need any preview.. same goes for autocrop.. basically you could live without preview. That's where the separation approach comes in very handy. And it's also important to point out that my approach comes from GKnot.. people with a GKnot background are used to it. You apparently are more used to VDub (which I've given up on ages ago.. except for VfW encoding I do nothing in VDub anymore) which explains your liking of that approach. But let's not forget that in VDub, once the dialog disappears, so does your opportunity to make any further changes.
I'm further assuming that your screen solution is rather smallish.. is it not?
berrinam
31st January 2006, 12:32
Unfortunally no - it can't be complete solved via windows ordering. It can be solved only bying monitor with bigger resolution and/or placing preview & crop controls in same window
It hasn't really caused me much problems (except for the main window coming back on top), but it would also be good if you could look at what I said about your cropping window: http://forum.doom9.org/showthread.php?p=777764#post777764
verifyOutputFile -> jobUtil
verifyInputFile -> jobUtil
startEncoding -> jobUtil
startNextJobInQueue -> jobContainer
loadJobs -> jobContainer
getFreeJobNumber -> jobContainer
addJobToQueue -> ??
getVideoJobs, addVideoJob -> jobUtil
removeJobFromQueue -> jobContainer
addJobToQueue sounds like it should go in jobContainer. Similarly for addVideoJob. I think jobUtil should be able to generate the jobs, but not be at all connected to management of the queue, because jobcontainer is about managing the queue.
Also, your refactoring using the IJobProcessor interface means that vEnc, aEnc, muxer, indexer can all be put into one variable -- processor. Since we are only running one thing at once, we only need one processor, and it saves all the if statements which are all over the place.
ideas: automatic script checking upon opening even if preview is not being opened.Agreed
store properties of the script right awayWhy? If there are any problems that can be fixed, they can be fixed immediately. If not, the user might have fixed them without MeGUI realizing it, and storing the values would mean that MeGUI thinks the script still doesn't work even if it does. I think it would be better to call checkVideo() twice.
Other things I'd like to achieve: easy encoding for specific devices (like PSP, video iPod). In case of the PSP that will require running an additional job.What is the situation with this? iPod is perfectly feasible, as I think I have shown you. Should this be distributed? Perhaps also the other method of choosing resolution I mentioned (maximum total pixels)?
Doom9
31st January 2006, 12:53
your refactoring using the IJobProcessor interface means that vEnc, aEnc, muxer, indexer can all be put into one variable -- processor.Yup, that's definitely the plan. The main form should only link the buttons to the appropriate processor commands.
Should this be distributed?Yup. For the PSP I guess we could define a virtual level which is a combination of actual buffer requirements and resolutions compatible with the PSP. And once encraw is up to the task and I add levels there as well, we can do the same for xvid.
It is harder to see exactly if there is any black on one side of a line (your approach) than if there is any black at all.I second that. Initially, I thought about just drawing a line over the video like VDub, but thinking of how hard it is to take arbitrary rectangular screenshots with the line rectangle, I opted for blanking out everything that's going to be cropped away.
dimzon
31st January 2006, 13:20
my main beef with having everything in one window is that crop values and preview don't necessarily go together.
100% Agreed. It means we must keep crop controls & AvsGenerator form BUT allow opening CropDialog with it's own crop controls (We can combine this 4 Numeric UpDown in custom control for better reusing)
You apparently are more used to VDub which explains your liking of that approach.
Actually I'm using VirtialDub for cropping only. I'm opening uncropped AVS via VD, then going to cropping, perform visual cropping and coping crop values to my script back...
But let's not forget that in VDub, once the dialog disappears, so does your opportunity to make any further changes.
You can open this dialog again && it will "remember" it's cropping values. Just only one think you lost is current frame. My CropDialog does not complete yet (development is frozen && i'm waiting for Doom9 decision) so it does'nt do it...
I second that. Initially, I thought about just drawing a line over the video like VDub, but thinking of how hard it is to take arbitrary rectangular screenshots with the line rectangle, I opted for blanking out everything that's going to be cropped away.
Seems like You && berrinam take my CropDialog as comlete solution. But it still incomplete, I know about odd cropping for YV12 and it's no problem to replace blue lines by white regions (we can even add checkbox right @ CropDialog ;) )
stax76
31st January 2006, 13:56
And it's also important to point out that my approach comes from GKnot.. people with a GKnot background are used to it. You apparently are more used to VDub (which I've given up on ages ago.. except for VfW encoding I do nothing in VDub anymore) which explains your liking of that approach.
It's just too obvious where both approaches are derived ;), personally I don't have high requirements regarding advanced crop features and also did't had/denied too many advanced crop requests (don't recall anything I could understand and reproduce) and I didn't get much positiv or negativ feedback about the cropping feature. I like to do things quick and easy which I achieve by mouse hovering, clicking, dragging and wheel, needs some habituating but then I think it's fun.
dimzon
31st January 2006, 14:18
0.2.3.2060 31 Jan 2006
Commit by dimzon:
-Using NicMPASource instead of MPASource in AviSynthAudioEncoder.cs
Inc
1st February 2006, 01:22
I had cleaned up the suggestResolution method, and documented the algorithm for calculating the Sample Aspect Ratio (which is, as I see it, a stretching amount, when taken as a fraction, sarx/sary). As I said earlier, I believe the problem with all of this is that only x264 uses sarx and sary -- I think lavc uses an overall ratio like DAR, which prescribes the ratio of displayWidth / displayHeight. SMD says it doesn't but from my testing..... I think it does.
I did some tests on Lavc's ASP and x264's AVC, both muxed into mp4.
I used a straight 16:9 (in here I mean anamorph) Pal stream left at 720x576.
When using the mp4 container in my tests x264 uses SAR or PAR where Lavc ASP and lavc XVID do use the DAR. Both (x264 and lavc ASP) played back properly in a std. Dshow appl. like MPC or Zoomplayer (via FFdshow) but not the xvid one. VLC and its internal routines/codecs did show the x264, lavc ASP and lavc XVID ones properly. - But VLC compensates the SAR by squeezing the height!
When using the avi container (mencoder/Lavc's ASP or mencoder/Xvid ) the DAR-Flag isn't recognised when using a std. Dshow appl. (see above).
VLC does playback these avis properly.
Also ...
When I do enter the avisynth Script creator and importing a d2v (PAL 720x576) it shows me a DAR of straight 16:9 1,778 which isnt correct D1 ITU anamorph 720 results in 1.832 which equals almost to 175/96.
http://img494.imageshack.us/img494/3408/unbenannt18gw.gif (http://imageshack.us)
When using PARanoia's SAR of 35/24 in x264 or DAR of 175/96 in lavcASP .. each muxed into a mp4 container the circle results 1:1 round in a sw/player like Zoomplaer or MPC:
http://img471.imageshack.us/img471/2964/720x576anamorph5gy.th.gif (http://img471.imageshack.us/my.php?image=720x576anamorph5gy.gif)
At the very end of my resulted script I do see that here the therm "SAR" is used for the "16:9" -DAR-.
# Set SAR in encoder to 16 : 9
I think that could result in confusings? Or is it only Lavc ASP encoding related?
berrinam
1st February 2006, 08:37
@incredible: Thanks for doing the tests
When using the mp4 container in my tests x264 uses SAR or PAR where Lavc ASP and lavc XVID do use the DAR.Hang on, XviD isn't part of libavcodec. I assume you simply mean through mencoder?
Both (x264 and lavc ASP) played back properly in a std. Dshow appl. like MPC or Zoomplayer (via FFdshow) but not the xvid one. VLC and its internal routines/codecs did show the x264, lavc ASP and lavc XVID ones properly. - But VLC compensates the SAR by squeezing the height!Yep, in my testing, I used mplayer for checking my results, and everything worked in mplayer, although not necessarily in all the other players. mplayer also upscales, instead of downscaling (or so it claims). I am somewhat surprised that XviD works so reliably, because, from my testing, mencoder has a bug with signalling XviD's AR, which means that it can only be set using one of XviD's four presets. As a hack, MeGUI rounds any AR to the closest preset (see the function VideoUtil.roundXviDPar), so there can be quite a discrepancy with the AR.
Also ...
When I do enter the avisynth Script creator and importing a d2v (PAL 720x576) it shows me a DAR of straight 16:9 1,778 which isnt correct D1 ITU anamorph 720 results in 1.832 which equals almost to 175/96.This is also the case when not doing anamorphic encodes. It's not my area, though -- Doom9 decided against ITU resizing, and I have had no problems with the resulting resizing (as in, no stretching-related problems. Perhaps there is a slight distortion, but too small for me to notice).
At the very end of my resulted script I do see that here the therm "SAR" is used for the "16:9" -DAR-.I've added that to the list of bugs. Perhaps it will be fixed sometime.
Inc
1st February 2006, 09:41
Hang on, XviD isn't part of libavcodec. I assume you simply mean through mencoder?Yep, sorry, I meant the mencoder way via its inlcuded xvid library
from my testing, mencoder has a bug with signalling XviD's AR, which means that it can only be set using one of XviD's four presets.
yep, I figured that out too this mornig. Only the ntsc/pal preset DARs do work.
It's not my area, though -- Doom9 decided against ITU resizing, and I have had no problems with the resulting resizing
ok, his decision, but if a ITU compilant input is assumet as 1,7778 then finally you "could" end up in a 1024/1050 error factor if not treating the source ITU compilant as a 720x576 content just gets scaled to 1024x576 and not to 1050 in the sw/player ... but everything depends on the specific users eyes ;).
dimzon
1st February 2006, 11:10
to ALL
Maybe just drop LMP4 support at all (XviD is better in all - it's free, faster and provide better quality...
Why you are spenting time writing workaround for unusable codec - let's spent this time for more important things
dimzon
1st February 2006, 11:17
0.2.3.2061 1 Feb 2006
Commit by dimzon:
-Upmix stereo to 5.1 seems to work now
http://forum.doom9.org/showthread.php?p=778156#post778156
Doom9
1st February 2006, 14:25
@dimzon: actually.. the workaround is for xvid because there's no commandline tool that properly signals custom DARs. Custom DARs work fine for LMP4.
Inc
1st February 2006, 14:32
I do think its also up on the used containerformat and the Playback appl.
As said, VLC does recognise the DAR or SAR signals of menc_XVID, menc_ASP and x264 properly (all in mp4), if I do remeber even in Avis. But when using Dshow decoders via Dshow playback apps. then the mess begins in case of menc_XVID and btw. AVIS in general.
dimzon
1st February 2006, 19:09
Just now first time take look @ Avisynth_c API embeded into avisynth.dll
Seems like I can remove AvisynthWrapper.dll at all (maybe not right now, bcz i'm a little busy)
dimzon
1st February 2006, 19:17
0.2.3.2062 1 Feb 2006
Commit by dimzon:
-Fixed bitrate parameter when encoding FAAC via BeSweet
Doom9
1st February 2006, 21:07
@dimzon: I'm looking forward to the removal of avisynthwrapper.dll ;)
Now, compiling the latest build returns a bunch of warnings:
VideoUtil.cs(54,10): warning CS1030: #warning: 'Seems like no one call this
method!'
AviSynthWindow.cs(1019,26): warning CS0618: 'MeGUI.VideoUtil.getResizeLine(int,
int, int)' is obsolete: 'Use ScriptServer.GetResizeLine instead. Use
ScriptServer.ListOfResizeFilterType to fill your comboboxes'
AviSynthWindow.cs(1020,28): warning CS0618:
'MeGUI.VideoUtil.getDenoiseLines(bool, int)' is obsolete: 'Use
ScriptServer.GetDenoiseLines instead. Use
ScriptServer.ListOfDenoiseFilterType to fill your comboboxes'
JobUtil.cs(761,28): warning CS0618: 'MeGUI.VideoUtil.getDenoiseLines(bool, int)'
is obsolete: 'Use ScriptServer.GetDenoiseLines instead. Use
ScriptServer.ListOfDenoiseFilterType to fill your comboboxes'
JobUtil.cs(762,26): warning CS0618: 'MeGUI.VideoUtil.getResizeLine(int, int,
int)' is obsolete: 'Use ScriptServer.GetResizeLine instead. Use
ScriptServer.ListOfResizeFilterType to fill your comboboxes'
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
I don't know who added them but as a general rule, double clicking on compile.bat should not return any warnings whatsoever. If there's unused code, get rid of it, if methods in one class are not to be used anymore, make sure nobody uses them anymore.
Inc
1st February 2006, 22:13
Just now first time take look @ Avisynth_c API embeded into avisynth.dll
Seems like I can remove AvisynthWrapper.dll at all (maybe not right now, bcz i'm a little busy)
An 'approach' of accessing the dll .... (till now I didnt went into the C Interface, so you have to try)
AVS_ScriptEnvironment * env =
avs_create_script_environment(AVISYNTH_INTERFACE_VERSION);
AVS_Value arg = avs_new_value_string(script);
AVS_Value args = avs_new_value_array(&arg, 1);
AVS_Value res = avs_invoke(env, "Eval", args, 0);
if (avs_is_error(res))
{
// Error mess. here
return -1 ;
}
arg = res;
res = avs_invoke(env, "ConvertToRGB32", args, 0);
AVS_Clip * clip = avs_take_clip(res, env);
avs_release_value(res);
const AVS_VideoInfo * inf = avs_get_video_info(clip);
Doom9
1st February 2006, 22:17
if anybody has an idea how to get x264's output if it aborts immediately (see http://forum.doom9.org/showthread.php?t=106667) please let me know.. it's pretty annoying not to get any feedback.. obviously that indicates something went terribly wrong, but having the error right there in the log would make things easier.
Doom9
1st February 2006, 22:58
here's one for dimzon: I'm finally trying out avisynth audio encoding.. works like a charm. I'm just curious about the first pass.. I sorta figured that would go away with AviSynth.. so exactly what is happening during the first pass? Oh, and can we parallelize that because right now only one core is busy ;)
By the way, during the second pass, the cores seem better utilized.. and while I haven't verified yet, I think I'm even seeing a speed boost (akin what you get when encoding in VfW for single threaded codec thanks to the separation of input reading/decoding and encoding.. ).
dimzon
2nd February 2006, 11:32
@dimzon: I'm looking forward to the removal of avisynthwrapper.dll ;)
After analyzing Avisynth_C API i decide to recall this proposal. Unfortunally Avisynth_C API is callable via PInvoke but is very nonoptimal for it.
Mosly every function in this API recieve STRUCT like AVS_Value by value.
int someFunc(AVS_Value value)
It means dotNet Marshaller will be used for every invokation and there are no way for optimization... And Avisynth_C API is more atomic - You need 4x more invocation to achive same effect (and mostly every invocation recieve struct ByVal)
In other way using ByRef (like AvisynthWrapper.dll)
int someFunc(AVS_Value* value)
Is much more friendly for dotNet PInvoke bcz You can create GCHandle and pin your structure in memory then just transmit structure address directly into function.
I don't know who added them but as a general rule, double clicking on compile.bat should not return any warnings whatsoever.
First of all please point me @ this rule.
Second - using custom warnings allows and ObsoleteAttribute is very helpfull when you working @ big project with many developers. I does not wont to touch too much files at ones bcz I afraid onyone else will change this code @ same time and I dos'nt wont perform merging at all... But using custom warnings and ObsoleteAttribute I can tell to other developers and it will act as reminder @ every compilation. As You can see this warnings will be eluminated by me or other developers during 5-10 commits...
I'm just curious about the first pass.. I sorta figured that would go away with AviSynth.. so exactly what is happening during the first pass?
first pass (I name it prepocessing) is 100% controlled by AviSynth. it caused by using Normalize() function.
dimzon
2nd February 2006, 14:53
@Doom9
I still waiting meaningfull response from You
What I must do now?
Doom9
2nd February 2006, 15:16
I does not wont to touch too much files at ones bcz I afraid onyone else will change this code @ same time and I dos'nt wont perform merging at allAre you the same guy who started out telling everybody megui needs to be redone from scratch? Shouldn't the first rule of refactoring be that you must realize you're going to create conflicts and break a lot of stuff? I recall 300 compiler errors just when putting dgindex processing in as a job instead of something the form does.
What I must do now?There are no musts in a volunteer project. But perhaps a should. For instance, I could imagine a job having a method/property to return a string array that can be used to construct a listviewitem being something useful since the whole bind job to listview will have to be rethought during refactoring. I noted that we can use the ListViewItem.tag to attach a job to the GUI, but then the item and object are still not bound and ideally they ought to be (so if you move an item up/down, its position element gets incremented/decremented, likewise for setting status, etc).
Then you can consider what a generic jobprocessor and jobqueue will have to do. The processor will implement ijobprocessor of course, but there's the little annoying detail that somebody someplace needs to be aware of jobtypes (and not the job itself) and does the proper postprocessing. For instance, after audio encoding comes video encoding so we have to update the bitrate (of 1 up to 3 video jobs). Or after indexing comes audio processing so you first have to find those audio files.. that kind of thing. Make sure you step through the current handling in the debugger once to get a feeling what really has to be done.. there's a lot of interdependency between jobs I'm afraid.
dimzon
2nd February 2006, 15:43
Are you the same guy who started out telling everybody megui needs to be redone from scratch?
FYI: refactoring != from_scratch
Shouldn't the first rule of refactoring be that you must realize you're going to create conflicts and break a lot of stuff?
No. The first rule of refactoring is: ALL DEVELOPMENT ARE FROZEN DURING REFACTORING PROCESS (nobody adds new features etc). Refactoring reques EXCLUSIVE source lock until it will be done (to avoid merge hell).
There are no musts in a volunteer project. But perhaps a should.
Sorry, this is my poor english ;)
For instance, I could imagine a job having a method/property to return a string array that can be used to construct a listviewitem being something useful since the whole bind job to listview will have to be rethought during refactoring. I noted that we can use the ListViewItem.tag to attach a job to the GUI, but then the item and object are still not bound and ideally they ought to be (so if you move an item up/down, its position element gets incremented/decremented, likewise for setting status, etc).
I believe you need update position property only before saving joblist. In this case can just enumerate ListViewItem collection and reassign it
For instance, after audio encoding comes video encoding so we have to update the bitrate (of 1 up to 3 video jobs).
Just fast incomplete proposal - Add something like "Content Job" term - job wich produce some data to be included in target file (Audio, Video). Set of "Content Job" may be managed by special manager:
JobManager m = new ContentJobManager();
m.RegisterJob(audioJob, JobSubtype.IntermediateData)
m.RegisterJob(videoPass1Job, JobSubtype.TempData || JobSubType.AdjustBitrate)
m.RegisterJob(videoPass2Job, JobSubtype.IntermediateData|| JobSubType.AdjustBitrate)
m.RegisterJob(muxJob, JobSybtype.FinalData || JobSubType.UseAsBitrateProvider)
Or after indexing comes audio processing so you first have to find those audio files.. that kind of thing.
Maybe better to write our own VOB parser to know dgindex output before job start?
Doom9
2nd February 2006, 15:58
Maybe better to write our own VOB parser to know dgindex output before job start?VOB isn't the only input ;) You seem to be forgetting about the multitude of different things megui supports quite a lot. Digital TV is becoming more and more important..
No. The first rule of refactoring is: ALL DEVELOPMENT ARE FROZEN DURING REFACTORING PROCESS (nobody adds new features etc). Refactoring reques EXCLUSIVE source lock until it will be done (to avoid merge hell).well.. if more than one person works at it, manual merges are still a very real possibility.. and that isn't limited to a refactoring process.. it can happen all the time, especially since there's so much intelligence sitting in the main class.
cc979
2nd February 2006, 16:23
i've re-install windows, avisynth and megui and that
i setup megui plugins using "C:\Program Files\GordianKnot\AviSynthPlugins"
but it wants decomb.dll in the "C:\Program Files\AviSynth 2.5\plugins" is that normal or a little bug ?
dimzon
2nd February 2006, 16:38
VOB isn't the only input ;) You seem to be forgetting about the multitude of different things megui supports quite a lot. Digital TV is becoming more and more important..
Maybe I can take look @ DGIndex code and split it into 2 parts (or we can ask neuron2 to do it) - stream parsing library (Dll) and GUI (exe). In this case we can use this stream parsing library directly ;)
well.. if more than one person works at it, manual merges are still a very real possibility.. and that isn't limited to a refactoring process..
Yes, but during refactoring process merging is headbreaking, really!
it can happen all the time, especially since there's so much intelligence sitting in the main class.
It's the reason why we need split it ASAP.
Dayvon
2nd February 2006, 16:40
i've re-install windows, avisynth and megui and that
i setup megui plugins using "C:\Program Files\GordianKnot\AviSynthPlugins"
but it wants decomb.dll in the "C:\Program Files\AviSynth 2.5\plugins" is that normal or a little bug ?
LOL. Wrong thread buddy, and possibly even wrong sub-forum. Go post this question in this thread (http://forum.doom9.org/showthread.php?t=105920).
Doom9
2nd February 2006, 17:21
[qutoe]stream parsing library (Dll) and GUI (exe). In this case we can use this stream parsing library directly[/quote]That's not nearly good enough. Didn't I already tell you once the major issue with digital TV streams? A TS can contain multiple PIDs, audio and video. You could have a TS that contains broadcasts from multiple channels. You can't have any sensible mapping with a TS player that allows you to pick the chain and in function of the video makes different audio streams available.. And if the input is VOB, we have the DVD Decrypter info file so we know the output.. not the precise name since we have the delay in the filename, but extension and the beginning of the track name.
Yes, but during refactoring process merging is headbreaking, really!Remember that I was up till 4 am one Sunday when I merged in my new audio encoding and muxing code.. I consider it inevitable. Even if you refactor your own software, I actually like to just move things around without too much help.. then I break things all over the place, but fixing them shows me all the code that I need to recheck to make sure nothing has been broken in the end. If you just have your refactoring tools that rename anywhere, and you still screwed up somewhere.. it'll be so much harder to find where things went wrong. And you know how I am when it comes to testing what changes you've made.. there's no such thing as testing enough.. only testing too little. My major change releases generally come out hours after I finished coding.. in between all I do is testing various scenarios.
dimzon
2nd February 2006, 18:07
That's not nearly good enough. Didn't I already tell you once the major issue with digital TV streams? A TS can contain multiple PIDs, audio and video. You could have a TS that contains broadcasts from multiple channels.
Sorry, never read about it, i doesn't know nothing about TVStreams
And if the input is VOB, we have the DVD Decrypter info file so we know the output.. not the precise name since we have the delay in the filename, but extension and the beginning of the track name.
That's why I don't like current solution at all. We are using to many dependecies ( DVDDecrypter is dead, isn't it). And we have no full control over them ( filenames is unpredictable etc). That's why we need better solution (like parsers in Dll's or rewritten in C# from scratch). When I take look @ OneClickMode implementation I decide NEVER USE IT MYSELF (really) bcz I don't trust such potencial-unstable solution... And as You can see this solution create a huge problems in MeGUI architecture
Remember that I was up till 4 am one Sunday when I merged in my new audio encoding and muxing code.. I consider it inevitable. Even if you refactor your own software, I actually like to just move things around without too much help.. then I break things all over the place, but fixing them shows me all the code that I need to recheck to make sure nothing has been broken in the end. If you just have your refactoring tools that rename anywhere, and you still screwed up somewhere.. it'll be so much harder to find where things went wrong. And you know how I am when it comes to testing what changes you've made.. there's no such thing as testing enough.. only testing too little. My major change releases generally come out hours after I finished coding.. in between all I do is testing various scenarios.
Actually I do not understand what does you want to tell me. I know what is refactoring well, I perform it @ my work.
Doom9
2nd February 2006, 21:05
DVDDecrypter is dead, isn't itNot really.. combine it with any on-the-fly decryption layer and it'll live forever.
bcz I don't trust such potencial-unstable solutionPhew, that's just what you want to tell the potential user. Come on.. it works quite well for those who've actually tried it.
Actually I do not understand what does you want to tell me.If you're just going to rename methods, using the built-in tools is fine. But if you're going to change parameters (and thus logic inside the method), it's better to actually break things, compile, see where the errors are, and thus finding all the places that could potentially cause problems. Say you're changing video job creation.. then you need to test every scenario where video jobs are being created to know your changes didn't silently break something that you'll only see at runtime. Any fancy pants refactoring help tool can't figure that one out, in fact they make you forget about those things, where plain manual refactoring results in a lot of break then fix scenarios.. and during the fixing you can strategically place breakpoints for later testing.
dimzon
3rd February 2006, 11:14
But if you're going to change parameters (and thus logic inside the method), it's better to actually break things, compile, see where the errors are, and thus finding all the places that could potentially cause problems. Say you're changing video job creation.. then you need to test every scenario where video jobs are being created to know your changes didn't silently break something that you'll only see at runtime. Any fancy pants refactoring help tool can't figure that one out, in fact they make you forget about those things, where plain manual refactoring results in a lot of break then fix scenarios.. and during the fixing you can strategically place breakpoints for later testing.
Agreed by 100%. Just one exception - at starting refactoring phase I strongly prefer to keep original methods (redirecting it on newer one inside) and mark original methods by [Obsolete]
berrinam
3rd February 2006, 11:19
My 2 cents: with the various function changes (like you moving some things to ScriptServer), I think MeGUI is small enough for that not to be a particularly serious problem. Those functions were only called in at most two places (AviSynth Creator, and OneClick encoder), and so the changes are small. Merging with that sort of thing should not be a problem.
WinMerge, from my experience, is able to pick that sort of thing up. The real problems come from trying to merge WinForms generated code....
dimzon
3rd February 2006, 15:56
0.2.3.2063 3 Feb 2006
Commit by dimzon:
-New very experimental stereo->5.1 upmix modes (using Sox avisynth filter) - try it && report!
thanx to NorthPole
http://forum.doom9.org/showthread.php?p=779538#post779538
berrinam
4th February 2006, 09:11
configAudioButton_Click -> explore possible simplifications
I'm working on this at the moment, and I am trying to do this by making all of the configuration dialogs extend a VideoConfigurationDialog, and this also uses visual inheritance, like described in the Feature Request thread. The thing I am wondering is whether it is worth extending this to the entire GUI, which would mean making a ProfilableConfigurationDialog class, which handles profiles. This could be extended by the four things that use profiles (video, audio, avs, oneclick), and that would save using all the profile code multiple times. However, it's a lot of work, and I thought that (a) it is better to check whether you agree first, and (b) it might be easier to do it for the Video config dialogs, then extend it to all of MeGUI later. Well, option (b) is clearly not easier, but it is for the present time.
So, what do you think?
Doom9
4th February 2006, 11:29
The audio configuration dialogs already use visual inheritance (dimzon introduced that). Do all dialogs that contain profiles really act the same? If so, a three tiered architecture (ProfileDialog, AudioDialog: ProfileDialog, NaacConfigurationDialog: AudioDialog) could make sense.. but it really comes down to how much in common there is. I know audio and video have a lot but I'm somewhat unsure about the rest. I guess in the spirit of breaking the least amount, going just for video might be preferable as an intermediate step.
BTW, I have no plans for the weekend so chances are I go on a refactoring spree. so please keep Form1 and JobUtil untouched, or at least everything that concerns the generation and management of jobs.
Doom9
4th February 2006, 13:18
@dimzon: with the avisynth encoding (I haven't heard anything negative about it.. people just need to set it up properly but with berrinam's guide that's not really a problem either and so I'm even considering disabling the radiobutton to see where it leads.. ) we can now look into more encoders again. You already have a winamp aac encoder wrapper so perhaps we could support that now. And then there's vorbis for mkv.
Richard Berg
4th February 2006, 20:49
So, what do you think?
I think better to keep the AudioConfig & VideoConfig inheritance hierarchies separate. But make a general Profile class that all of them use. So that if we decide something like "nullable means don't overwrite current value" (idea from another thread), it automatically applies to all dialogs that use profiles.
berrinam
4th February 2006, 21:30
but it really comes down to how much in common there is. I know audio and video have a lot but I'm somewhat unsure about the rest. I guess in the spirit of breaking the least amount, going just for video might be preferable as an intermediate step.The bit that they all have in common is the profile management. At the moment, the occurrences of profiles behave slightly differently -- video profiles have a load defaults button, as well as safe profile alteration. But yes, the way I am currently looking at would make changes throughout the program, because it would mean reducing everything to a Profile and a Settings base class, and there would be a lot more casting as the result. While I think it would be a worthwhile change, I'll stick with the video for the moment.
I think better to keep the AudioConfig & VideoConfig inheritance hierarchies separate. But make a general Profile class that all of them use. So that if we decide something like "nullable means don't overwrite current value" (idea from another thread), it automatically applies to all dialogs that use profiles.
There is already a Profile class which Video-, Audio-, AviSynth-, and OneClick- Profiles all extend, but all it has is a Name value. I don't see how something like that can be used easily in all dialogs... I think I've missed something
pcaca
4th February 2006, 23:56
About the problem in x64 discused here:
http://forum.doom9.org/showthread.php?t=106740
I managed to do anonymous CVS checkout and get the latest source files. I changed platform to x86 in configuration properties for MeGUI and neroraw projects in VS2005 and succsesfuly compiled the solution. Now the bug is fixed in Windows XP x64 and task manager shows that MeGUI is 32-bit application, so I can open d2v files and avs scripts in MeGUI.
I am student of Computer Science and maybe sometimes in future (when i learn more C#) i will join the developement of MeGUI.
Doom9
5th February 2006, 00:48
Major announcement: since I started refactoring (currently doing profiles.. with the provider as dropdown items as dimzon suggested), and considering all the changes that lie ahead, I decided to dump conditional compilation effective immediately. I'll make a commit after redoing the profiles so that you can resynch and I think it would be prudent to let development rest until then as this is a major change that affects every single file.
Doom9
5th February 2006, 13:28
grr.. SN25P is at it again.. won't boot from my Raptor anymore. Thank good I kept the somewhat messed up XP on my Deathstar.
Doom9
5th February 2006, 17:55
Man was that a bad idea moving profiles out of form1.. I'm still working on it, but I'll leave something for berrinam. A few points to be considered: attach profiles to dropdowns like I did with codecsettings in the main form (see dimzon's sample code). Make the dropdown non editable.. right now adding, switching and deleting is sort of a chance game.. you don't really know if it works the way you intended. E.g. you select a profile, then type something, then press delete.. the profile you selected is being deleted.. but on screen you have a profile name that doesn't exist. So that could be made to be perfectly deterministic.
Also, in my next commit you'll see that the audio dialog launching has been extremely streamlined.. the same should be done for video.. the reason I didn't do this yet is because the different video dialogs have different parameters that are given to it so the streamlining has to start there.
Mutant_Fruit
5th February 2006, 22:35
What files other than the ones i've listed below could be updateable from the AutoUpdate window? I got that list from all the "filepaths" in the settings section.
mencoder
besweet
mp4box
mkvmerge
x264
xvid_encraw
dgindex
faac
neroraw
Basically, anything that is needed by MeGUI that a user might need should be included in this list. This will allow for on-the-fly downloading (if the user wants) so if a plugin isn't found, it can be downloaded and set up in the background.
Doom9
5th February 2006, 22:39
I wouldn't worry about besweet anymore.. it's going to be phased out. For mp3 encoding via avisynth we need lame. On top of that, for audio processing via avisynth we need nic's audio plugins.
Doom9
5th February 2006, 23:12
0.2.3.2053 5 Feb 2006
Commit by Doom9
- Moved all profile handling to the new ProfileManager class
- Use of List<> and IDictionary<,> instead of ArrayList and HashTable (not all classes have been checked)
- Refactored audio / video codec settings in the main GUI. Using the SettingsProvider approach dimzon suggested
- Simplified a bunch of methods in the main GUI
- Output name textboxes are disabled where applicable if the output selection button is disabled
- Conditional compilation removed
I also tried to live up to the coding guidelines I outlined a few pages ago.. at times it was news for me too so I hope I managed to do a halfway passable job.
Now for the future:
@berrinam: if you're going to create a common base class for the video codec settings, you might also want to look into the possibility to attach profiles to the dropdown as I did with video/audio settings in the main GUI.. and then propagate that throughout the program.
My next stop will be the encoding refactoring now to further cut down the size of the main class and while I'm add it, give the whole avi thing a serious review.
berrinam
6th February 2006, 06:55
What files other than the ones i've listed below could be updateable from the AutoUpdate window? I got that list from all the "filepaths" in the settings section.Have a look at my MeGUI guide in the sticky. It should have a list of everything that might possibly be required (in particular, various dlls, like audio encoding dlls, avisynth filter dlls). Just go through the first post and find all the links. The second post should have no links, just instructions. Also, don't forget that AviSynth should be downloadable. I didn't think of putting that in my guide, because everyone on this forum already knows about AviSynth.
This will allow for on-the-fly downloading (if the user wants) so if a plugin isn't found, it can be downloaded and set up in the background.
I think that AviSynth plugins should also be checked for. As far as they go, you will either have to find the location of the AviSynth plugins folder by using the registry, and then check whether the files exist, OR you could have a series of test scripts to see if each particular plugin works. Basically, the scripts would look as follows:
blankclip(possibly some settings, like colorspace here)
TDeint()
And then dimzon's AviSynth wrapper could tell us whether this produces an error, basically telling us whether the plugin is correctly set up. However, I just realised you would need to know the AviSynth plugins location anyway, so that you can install them there. Still, I think the second approach is better, because it is actually testing what we want to know, instead of doing another test to approximate it.
berrinam
6th February 2006, 06:57
Does anyone know if YV12 codecs are still required for MeGUI? Doesn't dimzon's Avisynthwrapper.dll remove the need for the YV12 codecs?
Doom9
6th February 2006, 09:23
Does anyone know if YV12 codecs are still required for MeGUI? Doesn't dimzon's Avisynthwrapper.dll remove the need for the YV12 codecs?Afaik, the encoders still use AVIFile to read the AviSynth script.. so while MeGUI could live without it, the encoder chain still needs it.
Has anybody ever thought the audio handling was cumbersome (at least for programmers), there are a lot of checks in there to make sure the output name and settings for each audio stream are correct. Would it be bad if instead of having so many checks, just have the encoder check if a stream is properly set up and return an error if it's not (possibly with an option to adjust whatever is wrong.. I'd tend to say the settings should override the output extension)?
dimzon
6th February 2006, 11:51
@dimzon: with the avisynth encoding (I haven't heard anything negative about it.. people just need to set it up properly but with berrinam's guide that's not really a problem either and so I'm even considering disabling the radiobutton to see where it leads.. ) we can now look into more encoders again. You already have a winamp aac encoder wrapper so perhaps we could support that now. And then there's vorbis for mkv.
I'm happy after you refactoring ;) It's easy to add new encoders now!
dimzon
6th February 2006, 12:19
@Doom9
just proposals:
private void initializeDropdowns()
{
this.fileType.SelectedIndex = (int)VideoJob.FileType.MP4; // MP4
this.videoCodec.Items.AddRange(new object[] { new LavcSettingsProvider(), new X264SettingsProvider(), new SnowSettingsProvider(), new XviDSettingsProvider() });
this.videoCodec.SelectedIndex = (int)VideoJob.CodecType.AVC;
this.audioCodec.Items.AddRange(new object[] { new NeroAACSettingsProvider(), new LameMP3SettingsProvider(), new FaacSettingsProvider() });
this.audioCodec.SelectedIndex = 0;
}
1) I prefer to use Singleton pattern
public class LavcSettingsProvider : IVideoSettingsProvider
{
...
private static IVideoSettingsProvider instance = new LavcSettingsProvider();
public static IVideoSettingsProvider Instance {get{return instance}}
}
So yor array initialization code can look like this:
new object[] { NeroAACSettingsProvider.Instance...)
2) I strongly prefer to use static readonly field wich contains encoders array:
public static readonly object[] VideoCodecs = new object[] {...}
...
this.videoCodec.DataSource=VideoCodecs;
3) Using Singleton pattern you can use such code:
this.videoCodec.SelectedItem = X264SettingsProvider.Instance;
instead this:
his.videoCodec.SelectedIndex = (int)VideoJob.CodecType.AVC;
so you does'nt need to add items in predefined order
dimzon
6th February 2006, 12:26
Does anyone know if YV12 codecs are still required for MeGUI? Doesn't dimzon's Avisynthwrapper.dll remove the need for the YV12 codecs?
By the way - I think "installed XviD" is good requemrnt for your guide. I do not recommend Helix YV12 at all - it caused bugs (HW falture, system halts) @ my office PC...
dimzon
6th February 2006, 14:57
0.2.3.2065 6 Feb 2006
Commit by dimzon
- Fixed bug opening Avs Generator window
- Fixed BlockAlign bug in AviSynthAudioEncoder
- Simplified d2vReader code (now it just forwards it's calls to AvsReader executed on Mpeg2Source(fileName) script)
@Doom9
d2vReader still experimental, we can undo it any time ;)
dimzon
6th February 2006, 15:48
0.2.3.2066 6 Feb 2006
Commit by dimzon
- AvsSettings && AvsGenerator window refactoring - now it's easy to add new denoisers/resizers
- AvsSettings && AvsGenerator window refactoring - complete moving from int to enum for denoisers/resizers
WARNING: Moving from int to enum caused serialization error on old Avisynth profiles
old profiles (from previous versions) doesn't load now!
@ automatic deinterlacer author
I want to perform same settings with Deinterlace methids, unfortunally there are too complex code here. Can You take look @ current denoisers/resizers processing (including how are they using in GUI) and do the same for deinterlacer?
Doom9
6th February 2006, 16:48
@dimzon: berrinam wrote the automatic interlace detection
I'll look into implementing your suggestions.
I've also been musing about job generation and I think I'll go into this direction. There's a muxerfactory where you send your desired video codec type and audio codec types as well as subtitle types to. The factory performs a two pass iteration over all registered muxers.. if it finds a direct way, it returns the muxer. If it does not, a second iteration is performed, in which the first match for the video format is taken. Then the output format of that muxer is sent to another iteration with the audio and subtitle streams. That way, we can cover indirect cases like x264.exe -> raw, then raw -> avi with avc2avi, then avi to avi with audio with avimuxgui (I'm thinking about that.. it offers splitting, multiple audio tracks and even aac audio support).
A similar mechanism could be used for the video encoders.. or perhaps even an integration. Say I want x264 in AVI (and I'm dumping mencoder for that scenario.. maintaining two encoders for the same thing is a major pain), the encoder would report "I can do raw, mp4 and mkv output", so we'd pick the first output format, then ask the muxer factory for a muxing path from raw avc to avi. Another option would be to prevent any muxing for simple video encoding.. right now muxing jobs are added even in plain video encoding (say you want snow in mkv.. ).. but perhaps muxing should only be taken into account in automated modes? (and thus asking for snow with output type mkv and then pressing queue would return in a warning telling the user that the encoder cannot provide the desired output format and that the auto mode has to be used. That would also simplify job generation.. we have the same codepath for auto mode and one click mode.. if simple encoding no longer includes any muxing, the existing codepath for the automated encoding can be used.. you just don't send it any of the additional configuration options available in auto mode.
The point of these factories is of course to have one jobprocessor, which takes a job, finds the proper processor for it and initiates processing.
What do you think.. is this flexible enough to handle use cases we cannot see right now?
dimzon
6th February 2006, 16:58
if it finds a direct way, it returns the muxer. If it does not, a second iteration is performed, in which the first match for the video format is taken.
Very close to DirectShow GraphBuilder isn't it :D :D :D
but perhaps muxing should only be taken into account in automated modes?
Yes, it's good decision
What do you think.. is this flexible enough to handle use cases we cannot see right now?
Hmmm. It's really hard to say. At first look everything seems Ok...
By the way
I'm now contacting with AviMUX_GUI author asking him to add some functionality to be able provide good integration between MeGUI and AviMux_GUI. Seems like we can use it for AVIMuxing (AFAIK AviMux_GUI is the best tool for AVI muxing)
ChronoCross
6th February 2006, 17:03
I won't be able to make a new release build until late tonight(which is the usual weekday time for new builds.)
I'm considering making a Utility Kit in which I've gathered all the needed programs and dll's and organized them to be super efficient folders. I'll put this on the site as well I'm just working out some of the kinks.
I wanted to ask you if you preferred if I addeda GPL thing to my builds. I haven;'t been doing so simply because the ones on sourceforge never had it. Let me know.
Doom9
6th February 2006, 17:12
well.. AVIMuxGUI has a powerful scripting language.. while running a GUI program doesn't offer any feedback, I think we can live with that if the rest works out and if I can throw out all the ugly container check code.
I wanted to ask you if you preferred if I addeda GPL thing to my builds. I haven;'t been doing so simply because the ones on sourceforge never had it. Let me know.I think to be fully compliant, the file or at least a file telling you where to get the license should be added. I've never much cared for it though.. those who download the sources will see the GPL notice in the majority of files, so it should be clear to anybody what they can and cannot do with the code.
foxyshadis
6th February 2006, 17:15
By the way
I'm now contacting with AviMUX_GUI author asking him to add some functionality to be able provide good integration between MeGUI and AviMux_GUI. Seems like we can use it for AVIMuxing (AFAIK AviMux_GUI is the best tool for AVI muxing)
Everyone I know says that Avimux-gui creates files with bad indices that cause seeking problems, and that virtualdubmod is significantly better. Maybe that's only older versions, I don't know, but I was chewed out for using it. ^^;
dimzon
6th February 2006, 17:22
well.. AVIMuxGUI has a powerful scripting language.. while running a GUI program doesn't offer any feedback, I think we can live with that if the rest works out and if I can throw out all the ugly container check code.
:D :D :D
In Russia there are proverb (approx):
Fools has the same thought
Hi!
I'm working on MeGUI ( http://forum.doom9.org/showthread.php?t=96032 ) and I'm searching for sutable AviMuxer now. Your AviMuxGUI is perfect, unfortunally there are no easy way to obtain current muxing progress from external process.
Is it possible to add such features:
1) ability to read scripts ( http://www-user.tu-chemnitz.de/~noe/Video-Zeug/AVIMux%20GUI/script.html ) from stdin - it will allow as to avoid temporaly files
2) ability to write progress, diagnostic messages and log into stdout
thanx!
Dmitry Alexandrov wrote:
> Hi!
> I'm working on MeGUI ( http://forum.doom9.org/showthread.php?t=96032 )
> and I'm searching for sutable AviMuxer now. Your AviMuxGUI is perfect,
> unfortunally there are no easy way to obtain current muxing progress
> from external process.
> Is it possible to add such features:
> 1) ability to read scripts (
> http://www-user.tu-chemnitz.de/~noe/Video-Zeug/AVIMux%20GUI/script.html
> <http://www-user.tu-chemnitz.de/~noe/Video-Zeug/AVIMux%20GUI/script.html>
> ) from stdin - it will allow as to avoid temporaly files
I'm not sure how this would be supposed to work: How would AVI-Mux
GUI, once it has been launched, notice that you want to send a file
using stdin? Or did you just think about a command line parameter
telling AVI-Mux GUI to load a script file from stdin on startup? Even
that would require some changes, because AVI-Mux GUI relies on knowing
the file size of any file it opens for reading. Also, AVI-Mux GUI
relies on being able to seek in any file it opens.
> 2) ability to write progress, diagnostic messages and log into stdout
That's certainly possible.
Alex
Hi
2006/2/6, Alexander Noe' <alexander.noe@s2001.tu-chemnitz.de>:
Dmitry Alexandrov wrote:
using stdin? Or did you just think about a command line parameter
telling AVI-Mux GUI to load a script file from stdin on startup? Even
Yes, i think actually about this!
that would require some changes, because AVI-Mux GUI relies on knowing
the file size of any file it opens for reading. Also, AVI-Mux GUI
relies on being able to seek in any file it opens.
You can read all stdin to temporally buffer ( i really doesn't think somebody can provide script larger than 64k )
> 2) ability to write progress, diagnostic messages and log into stdout
That's certainly possible.
Fine!
Bye.
FYI: There are yet another way how to obtain progress from GUI application: it's possible to get text from any window via Win32 API ;)
Mutant_Fruit
6th February 2006, 20:52
Ok... so i have a few requests so i can get cracking on some more parts of the AutoUpdate section.
The files are just going to be hosted on a standard HTTP site (not FTP?) so can i get some write access to somewhere where i can stick up a few files for testing purposes?
Richard Berg
6th February 2006, 23:03
@Mutant_Fruit: PM on the way.
berrinam
7th February 2006, 11:03
@ automatic deinterlacer author
I want to perform same settings with Deinterlace methids, unfortunally there are too complex code here. Can You take look @ current denoisers/resizers processing (including how are they using in GUI) and do the same for deinterlacer?
Using enums and stuff? The problem is (which I'm sure you also encountered) that there are multiple variables which determine the filtering done. In particular, the field order can be TFF, BFF or not set at all, and the source can be anime or not. This means that it is much simpler to dynamically generate the filters than to have them all listed statically. If there is some way of using EnumProxy to dynamically create a data provider, then I could do that. But if not, then the enums I would have to make are:
-progressive source (empty)
-interlaced source, TFF
-interlaced source, BFF
-interlaced source, use d2v info
-film source, TFF anime
-film source, TFF non-anime
-film source, BFF anime
-film source, BFF non-anime
-film source, use d2v anime
-film source, use d2v non-anime
-hybrid interlaced/progressive, TFF
-hybrid interlaced/progressive, BFF
-hybrid interlaced/progressive, use d2v
-hybrid film/progressive with all of those
-hybrid film/interlaced with all of those.
You get the point.
berrinam
7th February 2006, 11:54
One thing that can't be distributed so easily is profiles that use CQMs. I don't know how many people want to use CQMs, but it is still a restriction, because it means that things like Sharktooth's profiles must be limited to the standard 'flat' or 'jvt' QMs. The reason that the CQMs can't also be (easily) distributed with the profiles is that CQMs are stored in MeGUI as an absolute pathname. Is there some way to reorganise this to make it more flexible?
dimzon
7th February 2006, 12:48
0.2.3.2067 7 Feb 2006
Commit by dimzon
- EnumProxy improvements
- ScriptServer refactoring - now it's possible to add new resizers/denoisers just via Enum modification
2 all dvelopers.
Now you can attach any object to enum member and access it via EnumProxy::Tag property.
Take look @ ScriptServer.cs for sample - it's fine!
Doom9
7th February 2006, 13:08
does anybody have an idea how I can get x264.exe to give me all its stdout and stderr output (see stuff like this: http://forum.doom9.org/showthread.php?t=106951 .. has been posted a couple times recently).. if x264 exists immediately with an error, no matter what I tried, I never get to see the actual error line, even though I'm making sure that I'm reading stdout and stderr till the end even if the process has already exited. Also, does anybody have an overview over the x264 exit codes?
shon3i
7th February 2006, 15:37
When you add support to encode audio via Coding Tehnologies. and please fix shutdown feature
dimzon
7th February 2006, 16:00
0.2.3.2068 7 Feb 2006
Commit by dimzon
- ScriptServer refactoring
- Some ResizeType enum members are renamed
dimzon
7th February 2006, 17:44
@ AutoUpdate feature developer
http://www.codeproject.com/tools/updater.asp
dimzon
7th February 2006, 19:39
0.2.3.2069 7 Feb 2006
Commit by dimzon
- Better diagnostics for d2v
- Fixed some resource leak in VideoUtil
Doom9
7th February 2006, 21:10
found a couple nasty bugs:
avs creator: when opening a d2v, then closing the preview and subsequently trying to preview again, we're trying to resurrect the disposed preview window.. that won't work. The preview window has to be reinitialized completely anew.. using would actually come in handy here as it prevents you from reusing a reference that has been disposed.
filename check: if you set x264 to 3 pass first pass, then try to access the autoencode, the autoencodewindow constructor throws an exception.
berrinam
8th February 2006, 09:37
This means that it is much simpler to dynamically generate the filters than to have them all listed statically. If there is some way of using EnumProxy to dynamically create a data provider, then I could do that.
I've figured out how to convert it all into your EnumProxy versions, but it doesn't make it any more readable :(. I still think it should be done dynamically, otherwise too many enums must be created, and I thought of something which can't be done by enums: the ScriptServer function, Portionize. It adds trim statements so that the filter is only applied on selected parts. This must be done at runtime, as we don't know beforehand where the trimming is going to take place.
I realize you are a much better coder than me, so if you have any suggestions, I'm open to them.
dimzon
8th February 2006, 12:58
@berrinam
according current solution (deintelace filters generates dynamically) what does AviSynthSettings::DeinterlaceMethod property means?
dimzon
8th February 2006, 13:27
0.2.3.2070 8 Feb 2006
Commit by dimzon
- Fixes in d2vReader (d2v parsing now work fine on non en-US locales)
- Cosmetics in AviSynthWindow (better controls enabling/disabling)
- Compile.bat now force x86 compilation
dimzon
8th February 2006, 13:44
0.2.3.2071 8 Feb 2006
Commit by dimzon
- Fixed languages bug in settings form
dimzon
8th February 2006, 14:05
0.2.3.2072 8 Feb 2006
Commit by dimzon
- Fixed languages bug in mkvMuxer / mp4Muxer forms
dimzon
8th February 2006, 14:25
0.2.3.2073 8 Feb 2006
Commit by dimzon
- Refactored LanguageSelectionContainer, removed 2 languages with duplicate ISO code
dimzon
8th February 2006, 15:17
0.2.3.2074 8 Feb 2006
Commit by dimzon
- Initial profiles refactoring @ audio dialogs - it look's much more understandable now (still need more refactoring yet)
dimzon
8th February 2006, 15:39
0.2.3.2075 8 Feb 2006
Commit by dimzon
- Fixed bug in Form1.cs (losted EventHandler @ audioProfile.OnSelectedIndexChange event)
dimzon
8th February 2006, 16:09
0.2.3.2076 8 Feb 2006
Commit by dimzon
- MeGUISettings.AvisynthPluginsPath is now static. It read/write value from/to HKLM\SOFTWARE\AviSynth\Plugindir2_5 registry key directly
- SettingsForm now override avisynth plugins dir in registry (using MeGUISettings.AvisynthPluginsPath)
ChronoCross
8th February 2006, 16:13
Jesus. I go to sleep for 5 hours and now there have been 7 updates lol!!!. I won't be able to make another build for a few hours as I'm at work. I wanted to know what the platform x86 does in relation to native 32-bit systems? Is it just a compatibility flag fo 64-bit systems or does it actually change the way it compiles?
dimzon
8th February 2006, 16:17
0.2.3.2077 8 Feb 2006
Commit by dimzon
- CropValues are now class (not struct) - it allows to transmit null value
dimzon
8th February 2006, 16:20
Is it just a compatibility flag fo 64-bit systems or does it actually change the way it compiles?
I don't check it, but I believe it's same...
godhead
8th February 2006, 17:15
I'e been super busy with real life and work, so I haven't had much free time for other projects. but I just wanted to say, DAMN! I come check the thread and Dimzon has been on a tear with updates. Good Job!
Were the language changes you made, the fix I had originally signed up for? If so, thanks for picking up my slack.
I should have some more time in a couple of weeks and I'll try to catch up with MeGUI Development at that time.
dimzon
8th February 2006, 17:26
@all developers
may be this is reason of non-working shutdown checkbox?
http://www.csharpfriends.com/Forums/ShowPost.aspx?PostID=39822
Doom9
8th February 2006, 17:33
hmm.. it also prevents you from logging out (I have such apps at work.. but the behavior is always desired as those apps are receiving logging events at a central place (logging to the HD is also in effect but the logs go to separate files depending on the kind of event)).
But somebody who has that problem would have to state if the app was minimized to the tray or not. I also think it couldn't hurt adding a "automated shutdown is enabled.. initiating shutdown now" to the log so that we know how far the app actually got.. there's already a log entry in case a shutdown was tried but failed.
dimzon
8th February 2006, 17:42
according non-working shutdown checkbox:
dwReason
[in] Reason for initiating the shutdown. This parameter must be one of the system shutdown reason codes.
If this parameter is zero, the SHTDN_REASON_FLAG_PLANNED reason code will not be set and therefore the default action is an undefined shutdown that is logged as "No title for this reason could be found". By default, it is also an unplanned shutdown. Depending on how the system is configured, an unplanned shutdown triggers the creation of a file that contains the system state information, which can delay shutdown. Therefore, do not use zero for this parameter.
dimzon
8th February 2006, 17:55
0.2.3.2078 8 Feb 2006
Commit by dimzon
- Attempt to fix shutdown problem under WindowsXP
(providing SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_NONE | SHTDN_REASON_FLAG_PLANNED as reason in ExitWindowsEx)
dimzon
8th February 2006, 18:52
0.2.3.2079 8 Feb 2006
Commit by dimzon
- fixed stupid bug in ScriptServer.ListOfDenoiseFilterType (thanx to The Link)
berrinam
8th February 2006, 20:56
@berrinam
according current solution (deintelace filters generates dynamically) what does AviSynthSettings::DeinterlaceMethod property means?
Absolutely nothing. It shouldn't be there. It was in there before automatic deinterlacing, and nobody removed it when automatic deinterlacing was added. If you have a look in the AviSynth profile configuration window, second tab, you will see that there is a list of deinterlacing filters. The DeinterlaceMethod property corresponds to that, but it is now ignored when generating the script.
Richard Berg
8th February 2006, 22:18
I wanted to know what the platform x86 does in relation to native 32-bit systems? Is it just a compatibility flag fo 64-bit systems or does it actually change the way it compiles?
It doesn't change the compiled MSIL. It just sets a flag within the image that tells the .net loader it should be JIT'd to x86 machine code. By default the loader JITs it to the platform's native instruction set, which if you install dotnetfx64 on an x64 machine is x64. On 32bit platforms the native instruction set is x86 to begin with so there's no difference.
berrinam
9th February 2006, 09:49
0.2.3.2080 9 Feb 2006
Commit by berrinam
- Removed the deinterlace filter type in the AviSynthSettings and its corresponding combobox in the settingsdialog
- Fixed up AviSynth profiles
- Fixed up enabling/disabling of controls in AviSynthWindow: the avs profiles are accessible without loading a file, and the script box is disabled without a loaded file
This commit still doesn't use dimzon's EnumProxy syntax. It could be changed to use these, but they still wouldn't use enums.
dimzon
9th February 2006, 11:17
I still think it should be done dynamically, otherwise too many enums must be created, and I thought of something which can't be done by enums: the ScriptServer function, Portionize. It adds trim statements so that the filter is only applied on selected parts. This must be done at runtime, as we don't know beforehand where the trimming is going to take place.
Ok, just one proposal
Current solution reques 2 complimentare arrays - array with titles and array with script itself. Maybe it's better to create such class:
public class PieceOfScript
{
public string Script;
private string title;
public PieceOfScript(string title, string script)
{
this.title = title;
this.Script = script;
}
public override string ToString()
{
return this.title
}
}
in this case you need only one array:
ArrayList arr = new ArrayList();
You can add deinterlacer using constructor:
arr.Add(new PieceOfScript("my deinterlacer" , "bla-bla-bla"));
and populate array via DataBinding:
deintarlaceCombo.DataSource = arr;
to get script you can use something like this:
string deinterlaceLines = (deintarlaceCombo.SelectedItem as PieceOfScript).Script
berrinam
9th February 2006, 11:50
0.2.3.2081 9 Feb 2006
Commit by berrinam:
- Enabled Vorbis calculation in the bitrate calculator
- Renamed SAR (Sample Aspect Ratio) to DAR (Display Aspect Ratio) in a few places
- Fixed empty pathname in One Click Encoder bug
- Fixed bug with the Bitrate Calculated bitrate not propogating onto the codec
@dimzon: Your suggestion sounds like a good medium. And while I'm at it, I'll convert it to List<PieceOfScript>.
dimzon
9th February 2006, 12:18
And while I'm at it, I'll convert it to List<PieceOfScript>.
Feel free to do it BUT I really think ArrayList is enought (just my opinion, I really does'nt like to use generics everythere even without explicit needs).
Really - seems like you does not need to address to arr items via indexer.
You are using foreach construction - in this case ICollection is used and strongly typed generic is not requed at all
ComboBox.DataSource use IList interface, in this case strongly typed generic is not requed too...
dimzon
9th February 2006, 12:29
@Doom9
about cropping
As I said before I don't like current cropping look & feel:
Window overlaping problem - when i trying to change crop values AvisynthWindow && underlayng main form overlap preview and via versa
I does not view which data is cropped (all cropped regions are filled by white)
I does not view resolution after crop and MOD information
You are asked me to remove CropDialog, I can do it but mentoined above problems still exists in current solution
Doom9
9th February 2006, 12:55
Window overlaping problem - when i trying to change crop values AvisynthWindow && underlayng main form overlap preview and via versaIt's just a preview.. it doesn't matter much where exactly on the screen it is (and how large it is for that matter.. it can be resized) There is no absolute need to have no overlap at all unlike your solution.
I does not view which data is cropped (all cropped regions are filled by white)That is desired behavior. In fact, years of freeform image capturing for guides have thaught me the hard way that lines on top of things just don't work properly.. if it's either there or gone you know exactly what is happening.. with a thin line, it's so much harder to discern borders.
# I does not view resolution after crop and MOD informationI don't get that.
dimzon
9th February 2006, 13:13
There is no absolute need to have no overlap at all unlike your solution.
This overlapping is very annoyng for me, really.
That is desired behavior. In fact, years of freeform image capturing for guides have thaught me the hard way that lines on top of things just don't work properly.. if it's either there or gone you know exactly what is happening.. with a thin line, it's so much harder to discern borders.
As I said before i propose to make it optional - fill all cropped area by white or draw lines - it can be controlled via checkbox.
I don't get that.
Sorry, don't understand your answer...
By the way - as I said before I propose to keep both cropping variants. We can place cropping "gamepad" on AviSynth window and duplicate it @ CropDialog.
dimzon
9th February 2006, 13:22
by the way:
there are new Nero7 AAC beta
http://www.mp3-tech.org/content/?48kbps%20AAC%20public%20test
http://www.mp3-tech.org/tests/aac_48/nd_audio_02_feb_2006.7z
Doom9
9th February 2006, 13:35
This overlapping is very annoyng for me, really.And on the other hand of the spectrum we have people telling me it's not enough like GKnot (GKnot does it the way I do it). It's just a matter of approach.. I like the GKnot one. And I have yet to hear one single complaint about this way of doing things.. now I'm sure you can dig up some VDub fans to make your point.. but GKnot has been around for years and it separates controls from preview as well.
dimzon
9th February 2006, 13:52
And on the other hand of the spectrum we have people telling me it's not enough like GKnot (GKnot does it the way I do it). It's just a matter of approach.. I like the GKnot one. And I have yet to hear one single complaint about this way of doing things.. now I'm sure you can dig up some VDub fans to make your point.. but GKnot has been around for years and it separates controls from preview as well.
as I said before I propose to keep both cropping variants. We can place cropping "gamepad" on AviSynth window and duplicate it @ CropDialog.
stax76
9th February 2006, 14:09
You could make a poll about what cropping approach people like most, I propose to include as poll options VD, GK, StaxRip, MeGUI and all other applications that have good cropping support.
dimzon
9th February 2006, 14:11
You could make a poll about what cropping approach people like most, I propose to include as poll options VD, GK, StaxRip, MeGUI and all other applications that have good cropping support.
as I said before I propose to keep both cropping variants. We can place cropping "gamepad" on AviSynth window and duplicate it @ CropDialog. Using this option we can satisfy mostly all users ;)
Doom9
9th February 2006, 14:21
You can't have it both ways. The GKnot solution requires a separate preview window which is always opened. Then you want to open yet another window with the same content? That just doesn't make a whole lot of sense.
dimzon
9th February 2006, 14:30
You can't have it both ways. The GKnot solution requires a separate preview window which is always opened. Then you want to open yet another window with the same content? That just doesn't make a whole lot of sense.
No, I can. Take look @ VDub - it have 2 video panels (input && output) and when you open cropping dialog you get yet one video panel, isn't it?
Doom9
9th February 2006, 14:34
It isn't the same.. VDUB shows in/out in the main window.. it's always there. MeGUI and GKnot on the other hand are modal.. they show preview when necessary / requested. Either way.. you wanted a decision.. you have it.. just because you don't like it doesn't mean I'm going to change my mind. I can be rather stubborn and I'm not about to change things to make them different, not considerably better, and in my eyes.. your solution isn't considerably better, just different.
dimzon
9th February 2006, 15:55
0.2.3.2082 9 Feb 2006
Commit by dimzon:
- Removed CropDialog
- Fixed ugly bug in DataBindings (no more syncronized languages bug etc)
dimzon
9th February 2006, 19:27
0.2.3.2083 9 Feb 2006
Commit by dimzon:
- Additional refactoring @ Form1.cs:
new class: CodecManager
new property: IVideoSettingsProvider.CodecType
new property: MeGui.currentVideoSettingsProvider
new property: SET: MeGui.CurrentVideoSettings
2 custom warnings around calc invocation
@Doom9
please, take look @ changes!
Doom9
9th February 2006, 20:09
new property: MeGui.currentVideoSettingsProvider
new property: SET: MeGui.CurrentVideoSettingsWhy are those necessary? Aren't we just moving back to what it was before with that?
berrinam
9th February 2006, 21:07
0.2.3.2084 9 Feb 2006
Commit by berrinam:
- Removed conditional compiling around prerender generation (this would have caused it to do not generate prerender jobs)
- Fixed the video checking so that it checks the file sent to prerender jobs, as opposed to the one created by them
- Some refactoring in the deinterlace filters, to use the new class, DeinterlaceFilter.
Doom9
9th February 2006, 22:54
fyi.. tomorrow I'll start refactoring job generation and processing.. so please keep your hands off anything that touches them. It'll at least take until Sunday to arrive at a working state.. perhaps even longer.
berrinam
9th February 2006, 23:12
I hope this didn't clash with what you are doing:
0.2.3.2085 9 Feb 2006
Commit by berrinam:
- Redo codec configuration dialogs. They all extend from VideoConfigurationDialog.
- Creating a new video profile now works in the same way that new audio profiles do.
It shouldn't -- there were very few changes made to architecture.
Additional notes:
All the video dialogs extend from the one class, and it is set up so that, for EditSettings, the only bits that need to be codec-specific is the constructor. Once you have constructed them individually, you can use common code for all the rest (including the AVC levels... that information is included in the base class, even though it is only used by x264. The idea is that someday we will have more AVC codecs). Maybe some refactoring of EditSettings would be worthwhile, as there is still some code which is duplicated.
berrinam
10th February 2006, 06:37
0.2.3.2086 10 Feb 2006
Commit by berrinam:
- Fix bug which caused changing x264's b-frames not to trigger an update.
- Fixed zones bug in configuration dialogs
- Removed a line of conditional compilation. compile full-svn is now identical to compile full
dimzon
10th February 2006, 11:30
Why are those necessary?
Yes.
Aren't we just moving back to what it was before with that?
No
ChronoCross
11th February 2006, 01:58
0.2.3.2087 10 Feb 2006
Commit by berrinam:
- Re-add SVN conditional compiling, which just removes RDO2 and renames the window
- Fix up some display problems with x264 configuration
berrinam
11th February 2006, 13:51
0.2.3.2089 11 Feb 2006
Commit by berrinam:
- Fix AviSynth profile changing in the AviSynth window. It now uses SelectedItem.ToString() instead of SelectedText. This should cause it to actually use the profiles now
0.2.3.2088 11 Feb 2006
Commit by berrinam:
- Fix up crf workings with new x264 config dialog. All this code should be redone. It's in a mess.
Doom9
11th February 2006, 15:25
Originally Posted by Doom9
Why are those necessary?
Yes.Not quite the answer you can give to a why question. However, I found them to be very useful in my current work. You're going to love it.. now not only are codec options tied to dropdowns, but the whole encoder choice, filters for open/save dialogs, container types are all dynamically generated (well.. will be once I'm done), making it very easy to add another encoder. The same also goes for audio and muxers. support for raw AAC will be added because avimuxgui needs it, and because the winamp encoder can't provide mp4 output.
And asp profiles and levels are also looming now that xvid_encraw seems rather feature complete (now I just need an asp level table). Support for besweet encoding may have to go as well.. if it's no extra work to keep it around, I might get rid of it at some later point, but looking at the while input output type thing, it's likely that my next commit will get rid of besweet encoding. On top of that, x264/xvid encoding via mencoder will no longer be possible either (it's possible to have multiple encoders for the same thing but I don't think I want to bother with that anymore). However, looking at AAC, we have a similar situation so I'll raise the question again: should we have just audio codecs in the dropdown and have some encoder selection behind that (nero, faac, winamp), so that encoders and codecs are clearly separated, or keep muddying the water by having encoder types in the audio codec dropdown as well?
All this code should be redone. It's in a mess.Are you volunteering?
berrinam
11th February 2006, 22:38
Are you volunteering?Only if I know what is going on there.
1. What is the standard we are adopting with enabled/disabled and checked/unchecked? So basically, if it is disabled but checked, what do we interpret that as?
2. Do I run all modifications from one method (the way it currently works), or do I have separate event handlers for the separate things that need handling (the way it worked before I redid the dialogs)?
Doom9
11th February 2006, 23:40
if it is disabled but checked, what do we interpret that as?Same as enabled and checked.
Do I run all modifications from one method It's probably better to have the enabling/disabling and unchecking in a single method.. that makes it easier to follow the logic and find bugs.
berrinam
12th February 2006, 06:12
How should MeGUI respond in the following situations:
1. The user selects High Profile, checks i8x8, then selects main profile, which unckecks it. The user the selects High Profile again. Does this revert back to i8x8 checked, or not?
2. If it does, then what happens if we have the above, but when the user goes back to main profile, he/she unchecks all of the options. When going back to HP, it would be a surprise to find one of them checked again (or even all of them checked again).
I think the easiest solution is just to disable things to meet the required level, and not re-enable them again. I believe that MeGUI used to work that way, and the benefit of that is the user knows what to expect. I think any other way is too predictable.
Sorry that I am not informed about this situation. I know that people were discussing it a while ago, but I just kept out of it as it didn't affect me much either way -- profiles mean you shouldn't need to be fiddling with all of that stuff much, anyway.
Doom9
12th February 2006, 14:04
Does this revert back to i8x8 checked, or not?It doesn't check it.. checking it would mean tri-state.. the gui remembering what was set before. Main profile doesn't allow i8x8, so when you select main profile, i8x8 becomes unchecked, and disabled. When you select the high profile again, i8x8 becomes enabled but remains unchecked. Thats WYSIWYG. The only place where there is no WYSIWYG is for automated job series.. you can't show 2/3 jobs in the GUI at once.
berrinam
12th February 2006, 20:22
It doesn't check it.. checking it would mean tri-state.. the gui remembering what was set before. Main profile doesn't allow i8x8, so when you select main profile, i8x8 becomes unchecked, and disabled. When you select the high profile again, i8x8 becomes enabled but remains unchecked. Thats WYSIWYG. The only place where there is no WYSIWYG is for automated job series.. you can't show 2/3 jobs in the GUI at once.
Ok, sure. That makes it all much easier to manage. I thought that people wanted it differently in the past, though, which was causing all the problems....
Mutant_Fruit
13th February 2006, 01:00
Just an update for ye: The code for the AutoUpdate section is about 90% finished. I'm just tidying it up a bit and trying to break it. When its done, i'll post it up here and i'm sure ye'll all have ideas on how to make it better. Theres probably much better ways of doing some things, so please, point them out.
Even if it isn't deemed good enough, it could do as a base for someone else to work off to write a better AutoUpdate section. But feel free to let rip about how bad it is (so long as ye give me pointers on how to improve) :P
berrinam
13th February 2006, 06:47
The only place where there is no WYSIWYG is for automated job series.. you can't show 2/3 jobs in the GUI at once.
Same with turbo? If you check turbo in a first pass mode, then it disables heaps of options, so you will have to reenable them yourself?
berrinam
13th February 2006, 08:23
However, looking at AAC, we have a similar situation so I'll raise the question again: should we have just audio codecs in the dropdown and have some encoder selection behind that (nero, faac, winamp), so that encoders and codecs are clearly separated, or keep muddying the water by having encoder types in the audio codec dropdown as well?I think that all the different encoders should be listed in the main form, because there can be a substantial difference between encoded output, depending on the encoder (just look at XviD vs. DivX vs. 3ivX vs. LMP4, etc). This situation is different from the video situation, because the same encoder core is still used, irrespective of whether mencoder or x264CLI is used for x264 encoding.
Perhaps the codec dropdowns for audio and video should show the standard in brackets, so we get something like this:
x264 (AVC)
XviD AVC (AVC) [when this comes]
XviD (ASP)
LMP4 (ASP)
Snow (Snow)
and
FAAC (AAC)
NAAC (AAC)
LAME (MP3)
Sharktooth
13th February 2006, 09:01
before getting to the hospital i was working on a method to recognize the x264 build version (svn or custom) at runtime.
well, since i dont know when i will be able to get out of this situation i decided to share the concepts of this method so it can be implemented by someone so some CC code can be removed.
The x264 build can be identified from the output of the cli encoder. My build has "built by Sharktooth" in stderr (see this patch: http://files.x264.nl/force.php?file=./Sharktooth/x264_patches/x264_signature.diff ), so invoking x264.exe and parsing the output will reveal if it is SVN or my build.
Second step, checking the megui settings at every startup and when defining/changing x264.exe path. if x264.exe path is defined just do the previous check and store the result in settings.
Third step, removing all the conditional compilation differences between x264/full and x264/full-svn, adding the same conditions at runtime (checking the settings) by enabling and disabling the affected controls.
The actual differencies between svn and my builds are: subme 7 and adaptive quantization.
This method doesnt need much effort to be implemented and can be also used for other custom builds by other ppl and it's really easy to update.
when i'll be back i'll implement a complete and intelligent CLI option parsing method with automatic command line generation.
Doom9
13th February 2006, 09:04
Same with turbo?Yup. The only exception are the automated modes.. they cannot be represented because they are megui internal (and create multiple jobs)
dimzon
13th February 2006, 11:09
However, looking at AAC, we have a similar situation so I'll raise the question again: should we have just audio codecs in the dropdown and have some encoder selection behind that (nero, faac, winamp), so that encoders and codecs are clearly separated, or keep muddying the water by having encoder types in the audio codec dropdown as well?
I'm agree with berrinam in this case - http://forum.doom9.org/showthread.php?p=784971#post784971
By the way: take look @ IVideoSettingsProvider.CodecType property ( Xvid returns ASP bcz XviD is MPEG4 ASP )
dimzon
13th February 2006, 11:15
Re-add SVN conditional compiling, which just removes RDO2 and renames the window
I propose a little different approach. Mabe bettet just to march unsupported by SVN features by "(*)" in GUI:
Example
RDO
RDO2 (*)
dimzon
13th February 2006, 11:17
@Doom9
Where are your commit?
Sharktooth
13th February 2006, 11:23
I propose a little different approach. Mabe bettet just to march unsupported by SVN features by "(*)" in GUI:
Example
RDO
RDO2 (*)
Have you read my previous post?
Doom9
13th February 2006, 13:01
take look @ IVideoSettingsProvider.CodecType property ( Xvid returns ASP bcz XviD is MPEG4 ASP )I changed that.. CodecType reflects the actual encoder.. For audio I'm still undecided
Where are your commit?I'm nowhere near done, it'll take much longer to get it all done because it involves changing so much hardcoded stuff.
dimzon
13th February 2006, 13:03
I changed that.. CodecType reflects the actual encoder...
Can you tell me why? Is'nt XviD MPEG4 ASP? Does it mean XviD AVC will return XviD_AVC ?
Doom9
13th February 2006, 14:41
Does it mean XviD AVC will return XviD_AVC Yes.. it is completely irrelevant for megui to know if something is avc or asp.. it's important to know which codec is to be used though (this is done implicitly via settings, and from that I now can get the proper encoder to handle such a job, as well as the filter to be set on the fileopen dialog (which input types.. at the moment it's avs for all encoders, which containers are supported, and the fileopen dialog filter for the output filename (all extensions the encoder supports directly without any muxer interference).
dimzon
13th February 2006, 14:49
(this is done implicitly via settings)
In this case why does you duplicate this information in yet another property? I think CodecType must provide us codec family (like ASP for Lavc/XviD/DivX, AVC for x264 and XviDAVC etc)
as well as the filter to be set on the fileopen dialog (which input types.. at the moment it's avs for all encoders, which containers are supported, and the fileopen dialog filter for the output filename (all extensions the encoder supports directly without any muxer interference).
How about to add somethig like this:
FileType[] IVideoSettingsProvider.GetSupportedInputTypes()
FileType[] IVideoSettingsProvider.GetSupportedOutputTypes()
instead of writing switch on CodecType?
Polyphormism is great, use it!
Doom9
13th February 2006, 15:21
uh.. please just sit back and relax.. I changed a LOT of enums, removed things that are no longer needed, grouped everything together to a common place.
instead of writing switch on CodecType?There are no more switch statements.... you won't recognize the code anymore once I'm done.. it's really a huge change.
dimzon
13th February 2006, 15:24
There are no more switch statements.... you won't recognize the code anymore once I'm done.. it's really a huge change.
Ok, will wait your commit !
berrinam
14th February 2006, 11:47
Apart from the x264 dialog, only some small changes:
0.2.3.2090 13 Feb 2006
Commit by berrinam:
- Fix applyForceFilm so that it works with DGIndex 1.4.6 as well as previous versions (resolved fractional framerate issue)
- Catch video errors in applyForceFilm so that it doesn't cause a silent crash. Left a warning note about the d2vReader.
- Redo x264 TriState code
Doom9
14th February 2006, 12:25
- Redo x264 TriState codeDon't you mean remove?
By the way, the x264 dialog has some stuff in the first tab that really doesn't belong.. fourcc can be dumped (mencoder for x264 is no longer supported in the refactored version), psnr is really not an option you want to confront people with in the first tab and I also have severe doubts about sar (that's something for advanced users and special interest groups) and the number of threads (seeing as we can set this automatically).
Sharktooth
14th February 2006, 12:31
SAR could be automatically set as well.
it just needs the original movie AR to be set somewhere (for example in the video preview)...
Doom9
14th February 2006, 12:33
SAR could be automatically set as well.It is done in one click mode and if you create your avs with the avisynth script creator and activate that option. It really can't be done in any other case.. if the user loads a self-inflicted avs file, we have no clue as to the source resolution and aspect ratio of the source.
dimzon
14th February 2006, 12:38
It is done in one click mode and if you create your avs with the avisynth script creator and activate that option. It really can't be done in any other case.. if the user loads a self-inflicted avs file, we have no clue as to the source resolution and aspect ratio of the source.
Maybe we can add some magic macros to avs script? Something like
bla bla bla
bla bla bla
# $MeGUI_SAR(1.34)
and analyze avs when opening?
Doom9
14th February 2006, 12:57
And what would be the point of that? If the user knows what to type, they can to go the codec configuration and do it themselves. If not.. its already being kept when you create an avs from within megui and in one click mode.. I really dont see any other place where it would possibly make sense to add anything.
dimzon
14th February 2006, 13:14
And what would be the point of that? If the user knows what to type, they can to go the codec configuration and do it themselves. If not.. its already being kept when you create an avs from within megui and in one click mode.. I really dont see any other place where it would possibly make sense to add anything.
It allows to create external software for AVS creation.
In this scenario user can use software X with rich WYSIWYG AVS editing abilities to create script then just use this script as input in MeGUI. Off couse software X must know about such magic macros.
Looking in the future it's possible to add such AVS parsing directly into some encoders and other software can use this macro too. It can even be "standart-de-facto" as lame tag is :D
By the way: I propose C#-like XML comments syntax for this (it allows additional extensibility in future)
### <ClipGlobals>
### <SAR>1.321</SAR>
### </ClipGlobals>
Sharktooth
14th February 2006, 14:37
i like the idea.
dimzon
15th February 2006, 21:16
finally I have internet connection @ home
now I can write code @ nights ;)
dimzon
17th February 2006, 09:17
I believe such way is much better then slices http://forum.doom9.org/showthread.php?t=102119
according slicev I must say: at least Russian community doesn't like it at all. For multipass encoding there are much better methods (without quality sacrifice)
Sharktooth
17th February 2006, 09:21
2 slices = -0.001db to -0.01db... not that big quality loss and it will enable multithreaded decoding too...
i would reccomend always using 2 slices (threads) even on non multicore/HT CPUs coz it will help decoding with nero (on those CPUs) and future multithreaded decoders.
dimzon
17th February 2006, 11:15
2 slices = -0.001db to -0.01db... not that big quality loss and it will enable multithreaded decoding too...
My friends from Russian community tells me about ugly quality of HDTV AVC encoded with 6 slices coming from satellite...
Sharktooth
17th February 2006, 11:32
6 slices are maybe excessive. however i tested 1 and 2 slices and there's no visible difference.
dimzon
17th February 2006, 11:36
however i tested 1 and 2 slices
Don't forget - multicore CPU is our future! So existing speedup is not good for them
dimzon
17th February 2006, 16:25
0.2.3.2091 17 Feb 2006
Commit by dimzon:
- Fixed UI bug in LameConfigurationDialog
bkman
18th February 2006, 09:04
Sorry to interject, but can I ask when the next "stable" release is planned? I have been using Chrono's builds, but they are rife with bugs. Like deleting intermediate files even if muxing fails... Yeeesh.
Sharktooth
18th February 2006, 09:17
check the bugreport thread and if the bugs you're experiencing are not yet reported please post them so the devs can fix them.
the new stable will be released when all reported bugs will be fixed.
Sharktooth
18th February 2006, 11:50
@devs: what's the status of those patches: http://sourceforge.net/tracker/?atid=798478&group_id=156112&func=browse
fight2win
18th February 2006, 11:57
please fix shutdown feature
Ya chronocross dude, pls fix shutdown feature!
Sharktooth
18th February 2006, 12:08
please dont start posting "fix this! fix that!"... the bug has been reported and devs (not chronocross) are working on fixes.
berrinam
18th February 2006, 13:21
@devs: what's the status of those patches: http://sourceforge.net/tracker/?atid=798478&group_id=156112&func=browse
I've posted comments on all but two of them saying that they are applied and should be deleted, but not being an admin, I was unable to do that.
berrinam
18th February 2006, 13:42
@devs: Can you look over at my post here (http://forum.doom9.org/showthread.php?p=787266#post787266)? I meant to post it in this thread, but I posted it in the wrong place. I left it there because it seems somewhat appropriate, so can you look over there anyway?
@dimzon: I was looking through the audio encoder code to see how to add the various forms of upmixing to the AviSynth Script Creator. I don't really like the current way it works: you have all the required filters embedded in your AviSynth script, which means that (a) if the script were actually written to a file, it would be unnecessarily long, (b) no-one else can access the filters, because they are hidden by MeGUI, and (c) they can't be replaced or tweaked by the savvy user.
What I propose is that they be exported as actual scripts (*.avsi files) which be put in the AviSynth plugins directory, and they will be autoloaded. When we get AutoUpdate from Mutant_Fruit, it can be joined into that. I also think it would be a good idea to refactor the audio processing into the ScriptServer class, just like denoising and resizing. Of course, that depends on the response to the post I linked to above.
I also don't think that GUID mess is really a good idea once users start to look at the scripts. Shouldn't those mixing filters be just like any other filters and the authors (whoever they are) should be responsible for not naming them in ways that clash?
Sharktooth
18th February 2006, 13:52
could anyone review the status of those uncommitted patches and eventually (if ok) commit them so we can close them and go for the next "stable" release before implementing new features.
Mutant_Fruit
18th February 2006, 19:28
Ok, i've been quite busy over the last two weeks finishing off a college assignment, but i've finally got around to having a working "beta" of the AutoUpdate.
Check the form1 Load event to see where i initially call the updater. Please, feel free to bitch and moan about how i didn't do this or didn't do that. I wouldn't be surprised if i did things in a roundabout kinda way.
Even if ye don't want to use this code, any pointers on how i could make it better would be greatly appreciated.
Currently nothing is being written to the log textbox, but that will change soon. Also, i amn't saving the settings to a file yet (but i have written code to load the settings :rolleyes:). Break it in any way you can. And any advice on improving (or complaining about how a certain section is just stupid) is appreciated.
http://www.fileshack.us/files/741/AutoUpdate.zip
EDIT: The XML file and "updated versions" can be found on http://megui.org if you want to take a look at what i have there.
EDIT: At the moment only 7-8 files are supported for the AutoUpdate, but this could be extended to any file that MeGUI uses (i.e. lame, avisynth and whatever else you please)
dimzon
19th February 2006, 13:00
@dimzon: I was looking through the audio encoder code to see how to add the various forms of upmixing to the AviSynth Script Creator. I don't really like the current way it works: you have all the required filters embedded in your AviSynth script, which means that (a) if the script were actually written to a file, it would be unnecessarily long, (b) no-one else can access the filters, because they are hidden by MeGUI, and (c) they can't be replaced or tweaked by the savvy user.
At first you must realize - current solution is JUST A FAST HACK to add AviSynth audio to current MeGUI architecture to avoid any significant refactoring (Doom9 ask me about it)
Just spent 1-2 hours to take look @ BeHappy and BeHappy source - there are another and much more flexible way for it. Maybe we can use same ideology in MeGUI?
Sharktooth
19th February 2006, 17:16
sourceforge added the possibility to migrate from cvs to svn.
docs are here:
http://sourceforge.net/docs/E09/en/#use
i propose the migration to SVN since it's faster and it's much better than CVS.
opinions?
dimzon
19th February 2006, 19:00
sourceforge added the possibility to migrate from cvs to svn.
docs are here:
http://sourceforge.net/docs/E09/en/#use
i propose the migration to SVN since it's faster and it's much better than CVS.
opinions?
cool! seems like it can work over http(s)
but take look @ SVN Limitations first
Sharktooth
19th February 2006, 19:36
CVS Update:
0.2.3.2092 19 Feb 2006
Commit by Sharx1976:
- Fixed a few bugs with number of frames changing from what the user inserts (patch by Mutant_Fruit).
ChronoCross
19th February 2006, 22:54
I'll make a build as soon as I get caught up. I was out of town for the weekend.
Doom9
20th February 2006, 13:02
what about tools to use svn? and I guess most importantly: is the anonymous svn any better than the anonymous cvs (which by all reports sucks big time as it's almost never online).
dimzon
20th February 2006, 13:05
what about tools to use svn? and I guess most importantly: is the anonymous svn any better than the anonymous cvs (which by all reports sucks big time as it's almost never online).
As I said before take look @ SVN limitation first
and I still worry about losing previous history during migration
Sharktooth
20th February 2006, 14:14
what about tools to use svn? and I guess most importantly: is the anonymous svn any better than the anonymous cvs (which by all reports sucks big time as it's almost never online).
if you use tortoisecvs then there's tortoisesvn. or classic svn commandline tools.
for example videolan uses svn.
for what concerns the anonymous svn on SF, well... i dont know.
Doom9
20th February 2006, 15:09
As I said before take look @ SVN limitation firstNothing listed there really has me concerned. But then again I also haven't seen any advantages yet.
BTW, an update on the refactoring: I've been sick since Wednesday and prior to that didn't have the motivation (plus that week-end before I had a little party with the usual after effects that prevent you from doing anything really productive the day after) to get much done. Right now, video encoding is working, including an automatic container dropdown selection in function of whatever encoder can be found for the desired codec. I've finally settled for doing this for audio as well, but there we mostly have no container, and only offer container selection in case of MP4 (I'm afraid AAC in AVI requires raw AAC).. MP4 will be the default though (you just have to register the mp4 container before the none container when registering the avisynth audio encoder). Other than that I have the muxpath selection code written but that's it. And right now I feel like shit so I'm not much for doing anything productive for work so naturally nothing goes for megui either :(
Sharktooth
20th February 2006, 15:45
Nothing listed there really has me concerned. But then again I also haven't seen any advantages yet.
better revisioning system, easier management, faster access (except the SF svn server box is slower so it will be basically as fast as cvs for now), less crashing, better win32 client with more functionalities, better patching system (svn diff will automatically produce a unified diff from your local copy and the svn repository), etc....
dimzon
20th February 2006, 21:23
white = Blankclip(white) #pseudo-code
black = blankclip(black) #pseudo-code
conditionalfilter(inputclip, white, black, "YDifferenceFromPrevious*0.5 + UDifferenceFromPrevious*.25 + VDifferenceFromPrevious*.25", "<", ".5")
I don't see why your C++ code would be faster than Assembly-optimized AviSynth code.
Maybe You are right
I'm worry about possible overhead caused by AviSynth itself especially conditionalfilter. Maybe we need AviSynth developers consultation?
dimzon
20th February 2006, 21:38
@berrinam
maybe we can use FrameEvaluate instead of ConditionalFilter to set global variable
FrameEvaluate(inputclip,"global g_bIsSceneChange = ( YDifferenceFromPrevious*0.5 + UDifferenceFromPrevious*.25 + VDifferenceFromPrevious*.25 < .5)?false:true")
in this case I can add special method to AviSynth wrapper to allow read-only access to global numeric/bool/string variables :cool:
berrinam
20th February 2006, 23:36
I'm worry about possible overhead caused by AviSynth itself especially conditionalfilter. Maybe we need AviSynth developers consultation?Yes, there could be some form of overhead. I agree that FrameEvaluate would be a better way, if possible.
@berrinam
maybe we can use FrameEvaluate instead of ConditionalFilter to set global variable
FrameEvaluate(inputclip,"global g_bIsSceneChange = ( YDifferenceFromPrevious*0.5 + UDifferenceFromPrevious*.25 + VDifferenceFromPrevious*.25 < .5)?false:true")
in this case I can add special method to AviSynth wrapper to allow read-only access to global numeric/bool/string variables :cool:
Yes, if you can do that, that is a better way. I didn't think that was possible, but if you can do it, that's great. Once you've done that, we could also use that for automatic source detection, because that uses frame evaluate and outputs the results to a temp file.... skipping the temp file would be nice.
@all devs: Also, what do you think about what I proposed on the Guide thread? I suggested that we replace MeGUI's cropping and resizing code with AviSynth. I'm sure it would be much faster.
dimzon
20th February 2006, 23:49
@all devs: Also, what do you think about what I proposed on the Guide thread? I suggested that we replace MeGUI's cropping and resizing code with AviSynth. I'm sure it would be much faster.
I must take look @ current code first but i do not think it would be too much faster.
Richard Berg
21st February 2006, 04:01
Why should MeGUI do its own cropping & resizing? That sounds like a really bad idea. What advantage would that have? Who would write that code? Would it handle all colorspaces correctly? Would it obey all of Avery's guidelines (http://www.virtualdub.org/blog/pivot/entry.php?id=86#body)? Would it be faster than all of Avisynth's ASM routines?
berrinam
21st February 2006, 06:09
I must take look @ current code first but i do not think it would be too much faster.Not faster? MeGUI is written in the slow C#, whereas AviSynth is ASM optimized. Just as Richard says,
Would it be faster than all of Avisynth's ASM routines?
I can see the overheads: a new filter would have to be applied every time the cropping or size is changed, and perhaps the entire filter-chain would have to be re-rendered. But still, the AviSynth cropping and resizing functions are definitely faster than the MeGUI/C# ones, so if there was a way to run specific filters on a source of your choice, then it would be faster (something like the way you always convert the output to the same colorspace for previewing). Basically, the idea is that we could replace the two functions, VideoUtil.crop and VideoPlayer.resizeBitmap, with AviSynth's cropping and resizing functions respectively. I don't see how that would be slower, if it were possible.
Why should MeGUI do its own cropping & resizing?Well, it currently does (not on the final file, but for previewing in the AviSynth creator, and in the main window). The cropping code was written by Doom9 as an adaptation from the GK one, and I made it significantly faster by using unsafe code in C#. The resizing code uses C#'s bilinear resizing. The other issues you mentioned are not a problem, because they it is just used for the preview, not the final thing.
dimzon
21st February 2006, 08:42
I can see the overheads: a new filter would have to be applied every time the cropping or size is changed, and perhaps the entire filter-chain would have to be re-rendered.
Yes, I mean exatly this. Dont't take me wrong BUT recreate/reparse AviSynth every time when you rerform resize/cropping and re-rendering filter chain - it cam be a real CPU killer for slow scripts (like my scripts are - i'm using fft3dfilter)
I see realiy yet another solution for it:
AviSynthClip original = ....;
...
AviSynthClip resized = original.Execute("bilinearresize(640,480)");
unfortunally this approach requres significant research and changes in AviSynth wrapper. And there can be threading issues...
berrinam
21st February 2006, 10:17
Yes, I mean exatly this. Dont't take me wrong BUT recreate/reparse AviSynth every time when you rerform resize/cropping and re-rendering filter chain - it cam be a real CPU killer for slow scripts (like my scripts are - i'm using fft3dfilter).Yes, I can see that clearly is a problem. However, for cropping, that should never happen -- the preview for cropping should only have a source filter. I think that the preview in the AviSynthWindow could certainly benefit from this sort of thing, even if not the preview for the main form.
Also, the current situation suffers from this problem, too; for resizing and recropping, the image is re-requested from AviSynth, but this problem may be alleviated by AviSynth's internal caching.
I see realiy yet another solution for it:
AviSynthClip original = ....;
...
AviSynthClip resized = original.Execute("bilinearresize(640,480)");
unfortunally this approach requres significant research and changes in AviSynth wrapper. And there can be threading issues...That is the sort of thing that I was talking about. I still don't know how plausible it is, but now we at least agree with each other.
dimzon
21st February 2006, 10:23
Yes, I can see that clearly is a problem. However, for cropping, that should never happen -- the preview for cropping should only have a source filter
Source can be other AVS including slow filters
but now we at least agree with each other
Yes
Richard Berg
21st February 2006, 17:51
Ok, so it's just for preview. Why not use the videocard to scale then? Heck, we could even use VMR9 -- we already require .Net 2.0 so requiring DX9 is no big deal.
Doom9
21st February 2006, 18:21
I got lost about 1.5 pages ago.. one post seems to have no relation to the next and I'm supposed to see posts and only Swede, bond and myself can physically delete messages in this subforum..
Richard Berg
21st February 2006, 18:31
Well, that's what happens when you put discussion about the entire product into one thread. FWIW, I was talking about how to get rid of the custom resizer code that's apparently in MeGUI. Since it's used for playback, the obvious answer is to let the playback control handle scaling.
stax76
21st February 2006, 19:16
I'm using like AutoGK the AutoCrop filter for auto crop.
For fast drawing I access private .NET internals with Reflection:
Public Function GetBMPFromDib(ByVal pDIB As IntPtr) As Bitmap
Dim pPix As IntPtr = New IntPtr(pDIB.ToInt32() + Marshal.SizeOf(GetType(BITMAPINFOHEADER)))
Dim mi As MethodInfo = GetType(Bitmap).GetMethod("FromGDIplus", BindingFlags.Static Or BindingFlags.NonPublic)
Dim pBmp As IntPtr = IntPtr.Zero
Dim status As Integer = GdipCreateBitmapFromGdiDib(pDIB, pPix, pBmp)
Return CType(mi.Invoke(Nothing, New Object() {pBmp}), Bitmap)
End Function
To draw cropped and scaled I'm using this code:
Dim factorX As Single = CSng(Control.Width) / img.Width
Dim factorY As Single = CSng(Control.Height) / img.Height
Dim left As Single = CropLeft * factorX
Dim right As Single = CropRight * factorX
Dim top As Single = CropTop * factorY
Dim bottom As Single = CropBottom * factorY
Dim rectDest As RectangleF = New RectangleF()
rectDest.X = left
rectDest.Y = top
rectDest.Width = Control.Width - left - right
rectDest.Height = Control.Height - top - bottom
Dim rectSrc As Rectangle = New Rectangle()
rectSrc.X = CropLeft
rectSrc.Y = CropTop
rectSrc.Width = img.Width - CropLeft - CropRight
rectSrc.Height = img.Height - CropTop - CropBottom
g.DrawImage(img, rectDest, rectSrc, GraphicsUnit.Pixel)
Dim sb As SolidBrush = New SolidBrush(Color.White)
g.FillRectangle(sb, 0, 0, left, Control.Height)
g.FillRectangle(sb, 0, 0, Control.Width, top)
g.FillRectangle(sb, Control.Width - right, 0, right, Control.Height)
g.FillRectangle(sb, 0, Control.Height - bottom, Control.Width, bottom)
All this is pretty fast as StaxRip demonstrates.
dimzon
21st February 2006, 19:32
For fast drawing I access private .NET internals with Reflection
This is a really dirty hack! Do not use it!
Richard Berg
21st February 2006, 20:25
I still don't understand why we'd stoop to the level of writing resizer code, blitting raw DIBs to the screen, etc. That's what DirectX is for.
Doom9
21st February 2006, 20:46
finally some good news from the refactoring front: audio now uses the same logic as video.. codecs and encoders are registered, and upon selecting an audio codec, the supported output types (containers) are gotten. Audio input and output filters are set according to whatever an encoder supports and audio job generation now fully resides outside form1.
I don't think at this point it makes a lot of sense to argue about resizing. Have a mouthful of this: currently we have a preview with intro/credits setting preview, another one for zones, and another one for plain preview without any possibility to set anything. On top of that there will be a cutter window as well. Now, when should they be accessible, does it make sense to limit their number, and where are the individual settings saved (intro/credits, zones, cutlists)?
Who cares if the resizeable preview is a bit slower than it can be.. those are just beautifying issues that can be looked into if there are no open feature requests and bugs and no more oustanding refactoring.. now when the whole project is in the thick of all of those categories.
dimzon
21st February 2006, 21:22
@Doom9
talking about RAW AAC output - i don't like it bcz we need explicit SBR signaling.
In this case I propose to use special markers in filename:
bla-bla-bla (SBR).aac
Richard Berg
21st February 2006, 21:23
Well, if it's already done, then so be it. Don't mess with it unless it's broken or too slow.
Doom9
21st February 2006, 21:25
i don't like it bcz we need explicit SBR signaling.The default is MP4 output for all encoders (well... you can control that by the order in which you send back the container types when you register the output types with the encoder). The thing is I need raw aac for aac in avi.. other than that.. it's the users fault if he screws things up.. we can only do so much to prevent people from doing stupid things. And of course.. when I create the muxjob I can set that flag manually when I look at the audio streams..
stax76
21st February 2006, 21:33
This is a really dirty hack! Do not use it!
My code is full of hacks and dirty tricks like cloning complex object graphs with serialization or comparing complex object graphs with reflection, or aborting by throwing exceptions, not everybody considers that as hack by the way ;)
Sharktooth
22nd February 2006, 23:13
CVS update:
0.2.3.2093 22 Feb 2006
Commit by Sharx1976:
- Fixed a bug in the calculator introduced in 0.2.3.2092 (patch by Mutant_Fruit).
berrinam
23rd February 2006, 10:30
0.2.3.2094 23 Feb 2006
Commit by berrinam:
- Fixed bug in 'One Click Profile Setup' which didn't allow selected profile to be selected
Sharktooth
23rd February 2006, 10:45
i cleaned the SF patches section a bit.
There are still 2 patches there, any comments?
@berrinam: what does your previous post mean? it should be 2094, not 2092...
note:
CVS Update:
0.2.3.2092 19 Feb 2006
Commit by Sharx1976:
- Fixed a few bugs with number of frames changing from what the user inserts (patch by Mutant_Fruit).
berrinam
23rd February 2006, 11:01
@berrinam: what does your previous post mean? it should be 2094, not 2092...Yep, typo.... fixed.
Doom9
23rd February 2006, 11:02
@berrinam: I've been meaning to make some suggestion to the one click tool (which I still consider your baby.. I may have messed it all up twice now but that only makes the mess mine): 1) Enable the codec dropdown and make it limit the video profiles that remain accessible (aking to limiting profiles when you enter a codec configuration dialog), 2) have two audio profiles so that the two audio tracks can have different settings, 3) Upon selecting the container, limit the audio profiles to whatever's supported (that really goes into territory I'm currently working on).
Let me elaborate three: What do you guys (all developers) think about the following workflows:
1) a: user selects video codec, b: user selects audio codec, c: user selects container, d: megui picks the proper output type for audio and video (that's the most complex case.. as you know we can have .264/mp4/mkv output from x264.exe for instance and .aac or .mp4 output from nero/faac)
2) a: user selects video codec, b: user selects video output type (basically container.. but I call it type because there are two types of no container, raw avc and raw asp), c: user selects audio codec, d: user selects audio output type (same logic as for video), e: megui offers compatible containers (if any). This is what I currently have mostly working for the one click mode
3) a: user selects container, b: megui limits audio and video codec selection to whatever it can accomodate with the existing muxers, c: user makes further choices in audio/video codec and output types
Keep in mind, all three are done fully automatic.. there's a videoencoderprovider, an audioencoderprovider and a muxprovider and between the three of them, they do all the work (so you can ask the muxprovider questions like "I have a raw avc stream, two mp3 streams, what can you mux that into?)
Doom9
23rd February 2006, 11:06
about the patches: 1408670: that's by design and should not be removed. Plus, it's already a moot point as that restriction will be gone with my next commit (when that will be, god only knows.. once again I managed to set out to do something and end up doing something else completely.. making the whole setup structure flexibly.. yesterday I completely rewrote all bitrate calculation routines even to adapt to that new flexibility.. now even if at some point I should fall on my head and relax the two audio stream restriction, the calculator can accomodate that now with no changes (except the gui needs changes of course)).
Hasn't 1417477 already been integrated?
berrinam
23rd February 2006, 11:12
@berrinam: I've been meaning to make some suggestion to the one click tool (which I still consider your baby.. I may have messed it all up twice now but that only makes the mess mine): 1) Enable the codec dropdown and make it limit the video profiles that remain accessible (aking to limiting profiles when you enter a codec configuration dialog), 2) have two audio profiles so that the two audio tracks can have different settings, 3) Upon selecting the container, limit the audio profiles to whatever's supportedI may have a look at these after your commit, but I'm quite busy at the moment, so I don't know how soon to expect anything.
(that really goes into territory I'm currently working on).
Let me elaborate three: What do you guys (all developers) think about the following workflows:
...
I prefer 1) and 2), because they don't require the user to know which containers support which formats. I don't see too much difference between them except that 2) allows more customisability in container formats, and 1) is easier for beginners.
Doom9
23rd February 2006, 11:26
[quote]except that 2) allows more customisability in container formats, and 1) is easier for beginners.[quote]Actually, 2) places additional limitations because the video and audio output types have already been chosen. E.g. AACinMP4 is a nogo if you're aiming for AVI (avimuxgui does raw aac only), and similarly, currently rawaac is a nogo for mkv/mp4 (not because the muxers can't handle it, but because I block it and will only allow it when I'm ready to automatically send the SBR flag to the muxer along with the audio stream to ensure proper flagging in all cases.. aacinmp4 requires no such flagging).
But 1) is the most complex.. when you go auto mode, you disregard output extensions completely and have to redo everything manually (well.. you ask muxer and encoder providers what they can do and somehow try to match it, then apply whatever changes need to be done because when you go from the main gui to the autoencode window, the output types are already given).
Sharktooth
23rd February 2006, 11:30
ok... all patches on SF have been "closed".
ChronoCross
23rd February 2006, 19:20
0.2.3.2094 23 Feb 2006
Commit by berrinam:
- Fixed bug in 'One Click Profile Setup' which didn't allow selected profile to be selected
Sharktooth
23rd February 2006, 20:31
it should be 0.2.3.2095...
EDIT: ehr... no.
ChronoCross
23rd February 2006, 20:40
From #x264:
[01:35] > sharktooth: the version count is off on megui. someone doubled up numbers
[01:37] > sharx1976 got confused when he committed.
[01:38] > then berrinam only looked at the next one down (where the numbering was wrong) so he committed under 2094 rather than 2095
This might be intentional numbering if the commit of 2093 was only slightly corrected, which I think it was because he commited nearly the same thing 2 minutes later with a one line offset.
ChronoCross
23rd February 2006, 20:46
0.2.3.2095 23 Feb 2006
Commit by berrinam:
- Fixed bug in 'One Click Profile Setup' which didn't allow selected profile to be selected
I re-released a build of 2095(removed). It's identical to 2094 but the numbering and changelog are correct.
Sharktooth
23rd February 2006, 21:33
no.... it's 2094... everything was ok.
sorry for the confusion.
Doom9
24th February 2006, 09:02
I'm in a bit of a pickle. I'm trying to develop the world's smartest muxer based on the following public enum VideoCodec { LMP4, X264, SNOW, XVID, ANY };
public enum VideoType { AVI, RAWASP, RAWAVC, MP4, MKV, NONE };
public enum AudioCodec { MP3, AAC, VORBIS, ANY };
public enum AudioType { MP3, AC3, RAWAAC, MP4AAC, VORBIS, MP2, DTS, NONE, CBRMP3, VBRMP3 };
public enum SubtitleType { SUBRIP, VOBSUB, NONE };
public enum ContainerType { AVI, NONE, MP4, MKV };
public interface IMuxing
{
List<VideoType> GetSupportedVideoTypes();
List<AudioType> GetSupportedAudioTypes();
List<SubtitleType> GetSupportedSubtitleTypes();
List<ContainerOutputType> GetSupportedContainers();
List<ContainerType> GetSupportedContainerTypes();
List<ContainerType> GetSupportedContainerInputTypes();
Muxer GetMuxer(string muxerPath);
string GetOutputTypeFilter(ContainerType containerType);
string GetVideoInputFilter();
string GetAudioInputFilter();
string GetSubtitleInputFilter();
}
Then I have a class MuxProvider which holds a list of IMuxing implementations (each one reflecting one of the existing muxers). So far so good, now that MuxProvider needs to tell me if it can mux something:
a VideoType, an array of AudioType, an array of SubtitleType. And I don't want direct paths, I want any imaginable indirect path to be considered as well. How do you get this done without first shooting yourself? And keep in mind.. muxing paths can be as long as your number of known IMuxing interfaces, but obviously you want the most efficient path.. so for each possible muxer every input type has to be tried and it may be that you have a muxer that does your video and one of the audio types, then you attach another one to it which does the other audio type and subtitle types, and then on top of that you may have another one that just takes one container and gives you another (I'm thinking ahead to the "new container" PSPMP4).
dimzon
24th February 2006, 10:01
List<VideoType> GetSupportedVideoTypes();
why not just VideoType[] . Keep in mind - this is "static constant arrays" - you doesn't need List<> here...
I want any imaginable indirect path to be considered as well. How do you get this done without first shooting yourself?
Hm. AFAIK this is well-khown class of task for Graph theory, there must be ready solution...
Doom9
24th February 2006, 10:45
why not just VideoType[] Because I want to write code like if (mySupportedVideoTypes.Contains(VideoType.RAWASP) ..... and not iterate through the VideoType array.
dimzon
24th February 2006, 10:59
Because I want to write code like if (mySupportedVideoTypes.Contains(VideoType.RAWASP) ..... and not iterate through the VideoType array.
;)
FYI
if (-1!=Array.IndexOf(mySupportedVideoTypes, VideoType.RAWASP) ).....
Doom9
24th February 2006, 13:07
neat trick.. all those static stuff they never tell you about. But -1 !=, eww, I was taught that the value you compare to always comes last.
By the way, I have a little roadmap for you. The next stable release will see the end of major refactoring (so that may delay release since there's still quite a bit of work to be done.. that muxing chain is the most complex though) and should have no open bugs. mencoder xvid and x264 encoding will no longer be possible and avi muxing will be done via avc2avi/avi mux gui. BeSweet audio will no longer be supported.
The release after that should contain a refactored audio encoder, support more audio encoders (winamp, vorbis), should contain the one click changes I previously outlined (2 audio profiles, selection of video codec -> video profile), implement PSP support for x264 and xvid based on a separate profile (and then level verification -> resolution), xvid level and profiles, psp output support via additional muxer (new muxing type PSPMP4.. that's what I call the ContainerType of the atomchanger). With that, it's then possible to ship one click profiles that allow to create perfect PSP output.. then we can also do the same for the video iPod.
Other than that I can see a refactoring of all dialogs that contain profiles (perhaps make it a GUI component that the various dialogs can integrate), add full zone option support for xvid, and finally frame accurate cutting.
dimzon
24th February 2006, 13:18
But -1 !=, eww, I was taught that the value you compare to always comes last.
I'm writing in many languages, some of them use same sign "=" as comparission and assigment. This is VERY common error (at least for me) for C/C++ code:
if(variable=1234)
and sometimes such error is hard to detect
using my pattern (constant first)
if(1234=variable)
you will get compilation error ;)
Sharktooth
24th February 2006, 23:26
CVS Update:
0.2.3.2095 24 Feb 2006
Commit by Sharx1976:
- Some work on aesthetics
@devs: any news for the SVN?
berrinam
25th February 2006, 00:37
@devs: any news for the SVN?
I don't know how much work is involved in the change, but all I can see that is useful for us in terms of the differences is the better revisioning system, considering that we have no idea how fast SF SVN would be. So, if it is easy to change and we won't lose anything, then go ahead. I'm sure TortoiseSVN is very similar to TortoiseCVS.
Sharktooth
25th February 2006, 00:41
I don't know how much work is involved in the change, but all I can see that is useful for us in terms of the differences is the better revisioning system, considering that we have no idea how fast SF SVN would be. So, if it is easy to change and we won't lose anything, then go ahead. I'm sure TortoiseSVN is very similar to TortoiseCVS.
Well, all what it should be done is "migrating"... but SF has an automated procedure for that. It may require some time but MeGUI is not a big project so it will be ready in some minutes (or hours at least).
TortoiseSVN is quite identical to TortoiseCVS.
ChronoCross
25th February 2006, 00:49
I'm in favor of SVN. Personally I like it better than cvs.
Sharktooth
25th February 2006, 09:34
well let's wait the doom9's final "verdict" :)
dimzon
25th February 2006, 12:00
I'm against SVN migration
i'm worry about history lose
i really don't like it bcz i cant delete file from SVN
Doom9
25th February 2006, 13:24
i'm worry about history loseI don't.. never had any history when I was working on megui alone and there's no history when I make huge architectural changes over weeks without any commit. If you worry, you can check out revision by revision since the start of the CVS.
i really don't like it bcz i cant delete file from SVNWhat's the problem with that.. those files just disappear from public views.. most databases on this planet work this way.. hardly anybody hard deletes data anymore.
berrinam
26th February 2006, 04:25
@Mutant_Fruit: I tried out your automatic updating, and I am impressed. I made a few notes, about some big and some small problems:
CurrentVersion flag never appears to be set. This causes it always to update. I just read your last post, and realised that you still need to read that data from the xml file. I don't like that system, because it could easily get out of sync with the actual version of the file. If there was some way to use the version signalled by the exe itself, that would be better.
Should be able to force an update check.
Should be able to turn off update checking altogether.
Should also perhaps be support for new versions of MeGUI, and also all the AviSynth plugins and AviSynth itself. I presume this will come later.
'Update' should turn into 'OK' when finished
FileX/Y doesn't have a space in it, when displayed in the status bar.
What is the other textbox there for?
Perhaps it would be nice to have a small log of what succeeded and what didn't, etc. Is that what the textbox is for?
It crashes if you select neroraw or anything else not on the server
The status bar says finished before you've even started anything.
How easy is it to put everything in a different folder, because I don't think the root directory is the best place to keep all the files.
What is the feasibility of zipping the files to make downloads smaller?
Could we have something more descriptive than N/A if it doesn't have the information? Something like 'Files Not Found', 'Version unknown', etc
Mutant_Fruit
26th February 2006, 12:15
@Mutant_Fruit: I tried out your automatic updating, and I am impressed. I made a few notes, about some big and some small problems:
CurrentVersion flag never appears to be set. This causes it always to update. I just read your last post, and realised that you still need to read that data from the xml file. I don't like that system, because it could easily get out of sync with the actual version of the file. If there was some way to use the version signalled by the exe itself, that would be better.
I realise this. I've investigated a few methods for getting version numbers. It seems that most of the .exe programs can be made display their version number on-screen, therefore i can redirect stdout and read out their version number. However, with dll files, most of them don't have the version number embedded. Therefore there doesnt seem to be a way for me to check the version of those files.
Should be able to force an update check.
That's possible. There's a button now called "Update" in the tools method which will display the Update window and allow an update.
Should be able to turn off update checking altogether.
That was already possible. You just set the auto-update interval to 0 days in settings. Maybe i should make that more obvious.
Should also perhaps be support for new versions of MeGUI, and also all the AviSynth plugins and AviSynth itself. I presume this will come later.
Yup, AviSynth plugins and AviSynth can easily be added, however MeGUI will be a little trickier. The problem is that if MeGUI is running, i can't replace the MeGUI .exe with the new .exe, but if MeGUI isn't running i can't move the .exe over automatically. This could be possible if i created a secondary program (only a few lines) who's job it is is to copy the new .exe over the old .exe after MeGUI closes, then it could restart MeGUI automatically.
'Update' should turn into 'OK' when finished
I'll do that now
FileX/Y doesn't have a space in it, when displayed in the status bar.
Status bar is gone now, it's been completely replaced by the "log" textbox. I only thought of using a "log" a few mins before i uploaded that temp version, which is why it did nothing.
What is the other textbox there for?
Thats the log textbox, it displays details about everything that goes on.
Perhaps it would be nice to have a small log of what succeeded and what didn't, etc. Is that what the textbox is for?
I agree, and you're right.
It crashes if you select neroraw or anything else not on the server
Fixed already.
The status bar says finished before you've even started anything.
Aye, i realised that was slightly confusing. That "finished" was actually referring to the fact it had downloaded the update .xml file, and then parsed it successfully. It makes more sense with the log textbox now.
How easy is it to put everything in a different folder, because I don't think the root directory is the best place to keep all the files.
Thats a thing i was going to bring up alright. I was going to ask if i should make a default "Plugins" folder or something similar. That should be easy
What is the feasibility of zipping the files to make downloads smaller?
That's already 80% finished or so. I had a bit of trouble with the zip library not acting the way i thought it would, but its working now.
Could we have something more descriptive than N/A if it doesn't have the information? Something like 'Files Not Found', 'Version unknown', etc
Thats been taken care of in the log textbox.
What i'm looking for most now is a fullproof way of finding out the versions of dll files. For example: MessageBoxExLib.dll has the dll version in it (right click and go to properties->version), but AvisynthWrapper.dll doesn't. In that case, the only way i could know the version is to store it from the XML data and hope nobody switches the dll file.
berrinam
26th February 2006, 12:29
I realise this. I've investigated a few methods for getting version numbers. It seems that most of the .exe programs can be made display their version number on-screen, therefore i can redirect stdout and read out their version number. However, with dll files, most of them don't have the version number embedded. Therefore there doesnt seem to be a way for me to check the version of those files.Have you tried just going by modified date?
That was already possible. You just set the auto-update interval to 0 days in settings. Maybe i should make that more obvious.When I did that, it actually did the opposite -- it checked every time I opened MeGUI.
MeGUI will be a little trickier. The problem is that if MeGUI is running, i can't replace the MeGUI .exe with the new .exe, but if MeGUI isn't running i can't move the .exe over automatically. This could be possible if i created a secondary program (only a few lines) who's job it is is to copy the new .exe over the old .exe after MeGUI closes, then it could restart MeGUI automatically.I can see that, but I think MeGUI is likely to be updated quite frequently at the moment, so it's quite an important feature IMHO.
Thats a thing i was going to bring up alright. I was going to ask if i should make a default "Plugins" folder or something similar. That should be easySounds good, but don't call it plugins. That's too similar to AviSynth plugins and could cause heaps of confusion.
What i'm looking for most now is a fullproof way of finding out the versions of dll files. For example: MessageBoxExLib.dll has the dll version in it (right click and go to properties->version), but AvisynthWrapper.dll doesn't. In that case, the only way i could know the version is to store it from the XML data and hope nobody switches the dll file.
Or, as I said, going by date modified... or finding some way to force the dlls to store the version. AviSynthWrapper, for instance, is part of the MeGUI project itself, so if it's the only problem, then that shouldn't be too hard to fix.
Also, it just occurred to me that if we have lots of things that can be autoupdated, perhaps it would be a good idea to group them by category, so the user isn't confronted with a huge list? Perhaps audio binaries, video binaries, avisynth plugins, and miscellaneous?
The rest of it looks very promising.
Mutant_Fruit
26th February 2006, 12:57
Or, as I said, going by date modified... or finding some way to force the dlls to store the version.
It'd be possible to check the "date created" of the dll on the clients computer and check that against the "date uploaded" on the server computer to see if it needs updating. That'd be a handy trick if i don't have the version numbers, but not completely foolproof.
Also, it just occurred to me that if we have lots of things that can be autoupdated, perhaps it would be a good idea to group them by category, so the user isn't confronted with a huge list? Perhaps audio binaries, video binaries, avisynth plugins, and miscellaneous?
I'll look into that as soon as i get the zip section working 100%. Tis a good idea.
Also, code-wise, if you see anything that isn't good, or that could be done better, let me know. I'm always up for improving.
Also, the code for "AutoUpdate" is called like this on startup...
if(this.settings.UpdateInterval>0) // AutoUpdate is on
{
....Start the autoupdate thread....
}
So setting the interval to 0 should make it NOT check for updates... Testing that now.
EDIT: Sure it works now anyway. I'll upload the newer beta version just so ye can see what it looks like now.
EDIT2: Here is the latest source. I'm still working on the zip handling.
http://www.fileshack.us/files/741/MeGUIAutoUpdate.zip
Sharktooth
26th February 2006, 14:22
For those who haven't subscribed to the SF mailing list (regarding SVN):
I am pleased to report that our Subversion beta was successful
and we launched our Subversion service sitewide earlier this week.
In addition, we've completed deployment of new web servers and
made further enhancements to our service monitoring and uptime
monitoring capabilities. Upcoming software map and search
improvements remain on track for March and April deployments,
respectively.
Subversion General Availability
-------------------------------
The SourceForge.net team is pleased to announce the General Availability
of Subversion service to SourceForge.net-hosted projects, effective
2006-02-21. This service offering is in addition to our existing CVS
service; as with all of our services, projects may select (and enable in
the project admin pages) the portion of our offering that best meets
their needs.
We wish to extend our thanks to the many projects and developers who
have helped us to test our Subversion service as part of our six-week
beta, which completed last week. Our particular thanks go to these
projects, whose members provided substantial feedback regarding the
new service:
* Inkscape - http://sourceforge.net/projects/inkscape/
* DejaVu Fonts - http://sourceforge.net/projects/dejavu/
* ScummVM - http://sourceforge.net/projects/scummvm/
* evilnet - http://sourceforge.net/projects/evilnet/
Our Subversion service includes:
SSL-based Repository Access:
* Developer Subversion access via HTTPS, auth is requested when you
perform a write operation
* Anonymous Subversion access via HTTPS
* No sync delays between developer and anonymous Subversion access
* Per-developer access control over repository access (ACL support to be
added in the future) via the SourceForge.net permissions system
Web-based viewing:
* Web-based repository access via ViewVC (formerly known as ViewCVS)
On-demand self-service backups and mirroring capability:
* Read-only rsync access to the repository to permit backups and
remote mirroring
Ease of migration:
* Automated self-service migration of your SourceForge.net project CVS
repository, CVS tarball, or Subversion dump to our Subversion service
Well-considered add-ons to basic service:
* A selected set of hook scripts, including commit email support and
CIA bot support
* Statistics tracking of Subversion repository activity
Service may be enabled by project administrators in the "Subversion"
section of the Project Admin pages.
Complete service documentation is available at:
http://sf.net/docs/E09/
Documentation is provided for supported clients at:
http://sf.net/docs/F06/ for the command-line SVN client
http://sf.net/docs/F07/ for TortoiseSVN
Our support of Subversion has been based on substantial research and
testing in the past few months, which we have pursued specifically based
on requests from the community. SourceForge.net continues to consider
new technologies and evaluate community requests in further
strengthening our service offering.
berrinam
26th February 2006, 21:10
It still crashes with neroraw, because currentFile.UpdateURL is null.
There is still a space missing when it says 'Updating mencoder. File1/7'
InvalidOperationException thrown in ParseUpdateData(), because it doesn't have access to that. Use Invoke(delegate) for that. I think that may be causing 'Update' not to change to 'OK'
Setting UpdateInterval to 0 does indeed turn off automatic updates. I do think this should be explicit, anyway. Also, if it is at any other value, it ignores it and checks every time you open MeGUI.
The log is good.
I might look at the code later, but that's all I have time for now.
Mutant_Fruit
26th February 2006, 22:00
Setting UpdateInterval to 0 does indeed turn off automatic updates. I do think this should be explicit, anyway. Also, if it is at any other value, it ignores it and checks every time you open MeGUI.
Thats be design at this point, otherwise it'd be a pain in the ass resetting the "lastUpdated" DateTime each time i wanted to put the code through a test.
As for the rest of the bugs, i've either fixed em already, or will do now. Thanks for the pointers.
berrinam
28th February 2006, 06:08
0.2.3.2096 28 Feb 2006
Commit by berrinam:
- Updated Source Detection to recognize sources that need decimation
dimzon
28th February 2006, 14:18
0.2.3.2097 28 Feb 2006
Commit by dimzon:
- AviSynthWrapper: now it's possible obtain value of script integer variable (AviSynthClip.GetIntVariable)
Just quick sample how to use:
using (MeGUI.AviSynthScriptEnvironment env = new MeGUI.AviSynthScriptEnvironment())
{
using (MeGUI.AviSynthClip clip = env.ParseScript("global test=123\n\rversion()\n\r", MeGUI.AviSynthColorspace.Unknown))
{
int i=0;
try
{
i = clip.GetIntVariable("test",0);
}
catch(Exception eee)
{
MessageBox.Show(eee.ToString());
}
MessageBox.Show(i.ToString());
}
}
dimzon
28th February 2006, 14:38
Hi!
Seems like i can implement such magic features in AviSynthWrapper:
Ability to add our own callback functions to AvsScript:
clip.RegisterCallback(new CallBackDelegate(...))
so it's possible to call something like:
version()
MeGUI_Callback(some arguments)
Ability to set variable values
clip.SetVariable("variableName", 12345)
Ability to check function existence
clip.IsFunctionDefined("Mpeg2Source")
berrinam
28th February 2006, 20:38
0.2.3.2097 28 Feb 2006
Commit by dimzon:
- AviSynthWrapper: now it's possible obtain value of script integer variable (AviSynthClip.GetIntVariable)
Sounds great! It's now possible to remove all temporary files in Source Detection. What happens if you are trying to get something else, like a boolean?
Ability to add our own callback functions to AvsScript:Woah, that's pretty powerful. I can't think why it would be useful, though.
Ability to set variable values
clip.SetVariable("variableName", 12345)Similarly with this.
Ability to check function existence
clip.IsFunctionDefined("Mpeg2Source")
Do you know if this also works with conditional functions, like IsCombed()?
dimzon
28th February 2006, 21:14
Sounds great! It's now possible to remove all temporary files in Source Detection.
Yes, this is feature for You ;)
What happens if you are trying to get something else, like a boolean?
Exception will be thrown ;) Variable must be exatly integer. Does You really need something else? I can add float/boolean but I really does'nt want ( i can but doesn't want ) to add string (bcz of marshaller performance slowdown)
Keep in mind - each feature reques approx 1hrs so ask if You really need it - otherwize it's better to spent my free time to more critical/important features ;)
Do you know if this also works with conditional functions, like IsCombed()?
I can't find IsCombed() in AviSynth manual - what is it?
berrinam
28th February 2006, 21:29
Yes, this is feature for You ;)Thank you. :D
Exception will be thrown ;) Variable must be exatly integer. Does You really need something else? I can add float/boolean but I really does'nt want ( i can but doesn't want ) to add string (bcz of marshaller performance slowdown)Never mind, then. I can cope with integers only -- AviSynth can do the conversion easily enough for me. I was just wondering.
I can't find IsCombed() in AviSynth manual - what is it?It's part of the Decomb package from neuron2. The relevance of that is that it's just like YDifferenceFromPrevious (which is part of AviSynth) -- it can only be accessed from inside one of the conditional functions, like FrameEvaluate, etc.
dimzon
28th February 2006, 22:10
It's part of the Decomb package from neuron2. The relevance of that is that it's just like YDifferenceFromPrevious (which is part of AviSynth) -- it can only be accessed from inside one of the conditional functions, like FrameEvaluate, etc.
I don't know, must test...
jellysandwich
1st March 2006, 07:03
There seems to be a small inconsistency in the deblocking tooltip. It says that "in loop deblocking is part of the normal operation of MPEG-4 AVC and should not be disabled," but says disabled for the default and recommended values.
js
berrinam
1st March 2006, 07:27
That should have been posted in the Bug Report Thread, but you are indeed correct, never-the-less. Fixed in .2098:
0.2.3.2098 1 March 2006
Commit by berrinam:
- Fixed discrepancy with x264 config information about the deblocking filter.
- Fixed 8x8dct/i8x8 discrepancy in x264 config.
dimzon
1st March 2006, 10:14
@all developers
Can anybody point me on tasks wich does not inersect with Doom9 refactoring?
berrinam
1st March 2006, 11:53
@all developers
Can anybody point me on tasks wich does not inersect with Doom9 refactoring?
You could try fixing these last two known bugs:
AviSynth Script Creator access a dead PreviewWindow
Description: when opening a d2v, then closing the preview and subsequently trying to preview again, we're trying to resurrect the disposed preview window.. that won't work. The preview window has to be reinitialized completely anew.. using would actually come in handy here as it prevents you from reusing a reference that has been disposed.
Status: Not yet solved.
Exception with AutoEncode x264 3pass 1st pass
Description: if you set x264 to 3 pass first pass, then try to access the autoencode, the autoencodewindow constructor throws an exception.
Status: Not yet solved.
Heh heh heh.... we're approaching a somewhat stable build again, just as Doom9 is about to commit his refactoring. :S
berrinam
1st March 2006, 11:56
Also perhaps this:
Warn user if an instance of MeGUI is already running
Description: There's not really much point in running multiple copies of MeGUI, and it can cause problems. It would be a good idea to warn the user that there is a copy already running. See http://www.codeproject.com/csharp/restricting_instances.asp for how to implement this.
Status: No-one is working on it.
dimzon
1st March 2006, 12:07
0.2.3.2099 1 March 2006
Commit by dimzon:
- Fixed bug: AviSynth Script Creator access a dead PreviewWindow
dimzon
1st March 2006, 12:14
0.2.3.2100 1 March 2006
Commit by dimzon:
- Fixed possible resource leak in VideoPlayer
Doom9
1st March 2006, 13:43
just as Doom9 is about to commit his refactoring. :SYou're presuming that I'm almost done.. I had some private stuff again last week-end and real life will continue next week-end as well.. but this morning on the way to work I almost had a breakthrough in this whole muxer chain thing.. it's not perfect (you have to register a muxer multiple times, once for each output type.. but at this point there's no muxer that supports multiple containers so it won't show), but it appears to be workable.. but I better not jinx it as it's not done yet. If there are indeed no outstanding issues (but I think there are.. for instance reading out the exit code once the videoencoder process ends.. at least for x264.exe that should be done and if it's not 0, then su.HasError should be set so that even when x264 craps out without telling us why, at least the job is flagged as an error and subsequent jobs are not started.. that doesn't get rid of the problem that megui should write out what went wrong and x264's output never makes it into the redirected stderr/stdout (and nobody has an idea why :(), but at least we properly signal that there has been an error and don't start any subsequent jobs that are doomed to fail as well). Then there's the deleting intermediate files when something went wrong issue (don't think it's in the buglist but then again I have not seen a good report on this as well.. good report being a deterministic "when does it happen"). And then there's the shutdown thing..
dimzon
1st March 2006, 13:46
You're presuming that I'm almost done...
WOW! Happy to read this!
dimzon
1st March 2006, 14:06
0.2.3.2101 1 March 2006
Commit by dimzon:
- Warn user if an instance of MeGUI is already running
http://img465.imageshack.us/img465/3015/untitled5wi.png
Sharktooth
1st March 2006, 14:29
Does -> Do.
dimzon
1st March 2006, 14:33
Does -> Do
fixed
ChronoCross
1st March 2006, 17:38
so many new builds so little time hehe. I'll try the cvs again in a few hours for the latest.
Sharktooth
1st March 2006, 19:01
http://www.webalice.it/f.corriga/megui/MeGUI-src.CVS-0.2.3.2101.7z
Richard Berg
1st March 2006, 19:25
Warn user if an instance of MeGUI is already running
Make sure this only checks if multiple copies of the same .exe are running. That's problematic because they will overwrite each other's profile, job, etc. XML files.
However, running separate .exe's should definitely be allowed. As long as they're kept in separate dirs, there will be no interference between them. Lots of reasons why you might want to do this:
- debugging
- trying new unstable versions without having to abort the long jobs your stable copy is running
- encoding on dualcpu/dualcore machines (we rejected the proposal to handle this within MeGUI, remember?)
dimzon
1st March 2006, 19:28
Make sure this only checks if multiple copies of the same .exe are running.
Anyway you have a choice to run or not to run ;)
Richard Berg
1st March 2006, 19:41
Yes, but why make it unnecessarily annoying? It takes less than a line of extra code. Instead of comparing process name, compare Process.MainModule.FileName.
berrinam
2nd March 2006, 11:22
0.2.3.2102 2 March 2006
Commit by berrinam:
- Fixed exception when checking Turbo on a 1stpass profile in x264 config
- Fixed macroblock options selection when checking Turbo as above
Sharktooth
2nd March 2006, 11:49
sources http://www.webalice.it/f.corriga/megui/MeGUI-src.CVS-0.2.3.2102.7z
bob0r
2nd March 2006, 11:52
so many new builds so little time hehe. I'll try the cvs again in a few hours for the latest.
Why don't you automate the process?
Compile a new build each minute/hour/day? :)
Ah wait you can't!!!! Arg you cant have bloody csc.exe quit as far as i know.... anyone who does know for mingw???
My sctipt:
#!/bin/sh
## Change paths
megui_dir=/home/user/MeGUI-src.CVS/
pack_dir=/home/user/pack/
net_dir=C:\\/WINDOWS\\/Microsoft.NET\\/Framework\\/v2.0.50727\\/
if [ ! -d "$megui_dir" ]; then
while true; do
cd; cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/megui co -P MeGUI-src.CVS;
if [ -d "$megui_dir" ]; then
break
fi
sleep 10
done
fi
cd $megui_dir;
#sed -e 's/csc \/res/'$net_dir'csc \/res/' compile.bat > compile_m.bat;
start //low //b //w compile full-svn;
## Manually enter: exit
## Blame csc.exe, not me :)
mv megui-svn.exe $pack_dir;
mv AvisynthWrapper.dll $pack_dir;
mv MessageBoxExLib.dll $pack_dir;
mv Data/ContextHelp.xml $pack_dir/Data/;
cd $megui_dir/neroraw/;
start //low //b //w compile
## Manually enter: exit
## Blame csc.exe, not me :)
mv neroraw.exe $pack_dir;
berrinam
2nd March 2006, 12:02
Ah wait you can't!!!! Arg you cant have bloody csc.exe quit as far as i know.... anyone who does know for mingw???
My sctipt:
...
cd $megui_dir/neroraw/;
start //low //b //w compile
## Manually enter: exit
## Blame csc.exe, not me :)
mv neroraw.exe $pack_dir;It doesn't exit so that when running it from windows you can see any errors when compiling. The compile.bat script simply has a PAUSE command in it. If you want to avoid that, use 'compile full' or 'compile full-svn' as your commandline.
bob0r
2nd March 2006, 13:02
Nah, the problem is that csc.exe opens a new cmd.exe (There is no csc.exe after compilation, cmd.exe is what remains open), which only can be closed when you type exit (as far as i know):
user@PC ~
$ megui.sh
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
AviSynthWindow.cs(1539,10): warning CS1030: #warning: 'This is just quickfix, please check it!'
d2vReader.cs(45,10): warning CS1030: #warning: 'Why load the video here? This means that we can't apply force film unless the video unless it is playable in AviSynth'
Form1.cs(4357,10): warning CS1030: #warning: 'calc.setDefaults must get special tweaks direcly from IVideoSettingsProvider'
Form1.cs(4364,10): warning CS1030: #warning: 'calc.getSelectedCodec must return IVideoSettingsProvider'
G:\msys\1.0\home\user\MeGUI-src.CVS>exit
exit
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.
G:\msys\1.0\home\user\MeGUI-src.CVS\neroraw>exit
exit
user@PC ~
$
leowai
2nd March 2006, 17:43
@bob0r, I've good news. I managed to make automatic compilation with MinGW under windows. This method doesn't prompt you to input "exit" but you will see ugly & messy screen messages. Here we go. Basically, we need following two files to run:
The MinGW running script "MeGUI_cvs.h" (which modified from the one you provided):
#!/bin/sh
## Change paths
megui_dir=/home/User/MeGUI-src.CVS/
pack_dir=/home/User/pack/
net_dir=C:\\/WINDOWS\\/Microsoft.NET\\/Framework\\/v2.0.50727\\/
if [ ! -d "$megui_dir" ]; then
while true; do
cd; cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/megui co -P MeGUI-src.CVS;
if [ -d "$megui_dir" ]; then
break
fi
sleep 10
done
fi
cd $megui_dir;
#sed -e 's/csc \/res/'$net_dir'csc \/res/' compile.bat > compile_m.bat;
echo.
echo.
echo. -== Compiling MeGUI ==-
cmd < ./../Compile_MeGUI.bat
echo.
echo.
# Move & copy files for packing
mv megui.exe $pack_dir;
mv megui-svn.exe $pack_dir;
cp AvisynthWrapper.dll $pack_dir;
cp MessageBoxExLib.dll $pack_dir;
cp Data/ContextHelp.xml $pack_dir/Data/;
mv neroraw.exe $pack_dir;
# Exit MeGUI.src.CVS folder
cd ..
The second is "Compile_MeGUI.bat" which every command lines in this file will be executed by "cmd.exe". Good thing is it will exit at the end of running. ;)
start /b /w setenv.bat
start /b /w compile full
start /b /w compile full-svn
echo
*Note: You need "echo" or even a blank line in "Compile_MeGUI.bat" in order for "start /b /w compile full-svn" to be executed. Strange ah? :confused: :sly:
Put those two files under user's home directory in MinGW. Run the "MeGUI_cvs.h" script, it should return to MinGW command prompt at the end of the compilation.
It works fine here and hope it works on your side too. Good luck.
nexus
2nd March 2006, 23:56
0.2.3.2102 2 March 2006
Commit by berrinam:
- Fixed exception when checking Turbo on a 1stpass profile in x264 configI still get this exception with build 0.2.3.2102. :-(
dimzon
3rd March 2006, 00:09
I still get this exception with build 0.2.3.2102. :-(
wrong thread!
:readrule:
bob0r
3rd March 2006, 00:52
@leowai
AWESOME! IT WORKS!!
I can now auto update megui into the x264 package :D
megui.sh:
#!/bin/sh
## Change paths
megui_dir=/home/user/MeGUI-src.CVS/
pack_dir=/home/user/pack/
if [ ! -d "$megui_dir" ]; then
while true; do
cd; cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/megui co -P MeGUI-src.CVS;
if [ -d "$megui_dir" ]; then
break
fi
sleep 10
done
fi
cd $megui_dir;
cmd < ./../meguicompile.bat
mv megui-svn.exe $pack_dir;
cp AvisynthWrapper.dll $pack_dir;
cp MessageBoxExLib.dll $pack_dir;
cp Data/ContextHelp.xml $pack_dir/Data/;
cd $megui_dir/neroraw;
cmd < ./../../meguinerorawcompile.bat
mv neroraw.exe $pack_dir;
meguicompile.bat:
start /b /w compile full-svn
echo
meguinerorawcompile.bat:
start /b /w compile
echo
Many thanks!!
ChronoCross
3rd March 2006, 01:30
I;m having some issues. it doesn't seem to execute the cvs command at all. it just goes straight into compiling.
Edit: it works just fine if the folder doesn't exist. however from that point on it doesn't update using "cvs update" nor does it run in a loop for automatic updating. any ideas?
bob0r
3rd March 2006, 02:17
Just add "cvs up" after cd $megui_dir;
cd $megui_dir;
cvs up;
Or what i do:
On the end of my script:
cd;
rm -r MeGUI-src.CVS;
With gpac i had some bad experience using cvs up instead of a clean checkout, so i use clean checkout everytime now.
Also cvs up can't be looped, so you never know if it truely did update, with a clean checkout you are always sure.
Well it can be looped, if you make an IF FI statement with some required text, but i haven't looked into that.
x264 svn never gave me any problems, only the occasional script testing makes me delete my x264 folder, to "test it all"
Edit:
For looping use:
megui_looping.sh:
#!/bin/sh
## loop in seconds (3600 seconds = 1 hour)
while true; do megui.sh; sleep 3600;done
I guess in your case 86400 seconds (24 hours) can be good.
I believe its possible to check revision or versions numbers with CVS, but also i haven't looked into this yet.
With SVN this is much easier:
## get last line from output `svn up`
check=`svn up | tail -1`
## check if there is a new update, At = no new update, Updated = new update, At = YES
if [ `echo $check | awk '{print $1}'` = "At" ]; then
## get revision number
rev_u=`echo $check | cut -c13-15 | tr -d .`
## check if revision number matches with contents of rev.txt
if [ "$rev_u" = `head -1 rev.txt` ]; then
## matched! echo no new updates
leowai
3rd March 2006, 06:40
@leowai
AWESOME! IT WORKS!!
I can now auto update megui into the x264 package :D
Many thanks!!
Good to hear that & You're welcome. :)
With gpac i had some bad experience using cvs up instead of a clean checkout, so i use clean checkout everytime now. Erm... Now I know who slow down the cvs checkout network. Just kidding. :D
I think it would be ok for clean checkout on everyday basic while cvs up for more regular updates in hours. Thinking of eveyone having a clean checkout on cvs projects at the same time...:eek:
With SVN this is much easier:
Thanks for sharing that. Going to try this out. :devil:
Sharktooth
3rd March 2006, 14:36
CVS update
0.2.3.2103 3 March 2006
Commit by Sharx1976:
- Fixed wording on "Queue" buttons in main Form
- Fixed a bug in OneClickWindow.cs output file textbox state adjustment
Mutant_Fruit
3rd March 2006, 15:32
I'm still working away at the AutoUpdate dialog and i have a few more questions.
Someone suggested before that a better way of displaying the available updates should be used. I'm thinking a treeview would be good in this case because there are several files under each "heading" type thing. The question i have is, what headings should i use. I'm thinking of something like this (at the moment).
UpdateableFiles
| \
| MeGUI Files - x264, mencoder, dgindex etc
| (the ones with paths in megui's settings)
| \
| AviSynthFiles
| \
| Audio
| \
| Video
| \
| Misc files.
What do ye think of that? Anyone want to suggest better ways of laying out the files in the "UpgradeWindow" layout?
Doom9
3rd March 2006, 16:45
I've been thinking about changing the settings dialog myself, and to group programs by functionality. For instance, have a section AVI, where you have to add avc2avi and avimuxgui as these are required for avi output.
similarly, the mp4 box would include mp4box
something along these lines
berrinam
3rd March 2006, 23:12
0.2.3.2104 4 March 2006
Commit by berrinam:
- Fixed loading values when crf/qp is in the currentVideoSettings (it was always set to 26)
- Fixed trellis dependencies in x264 encoder dialog
berrinam
4th March 2006, 21:54
0.2.3.2105 5 March 2006
Commit by berrinam:
- Fixed bug with OneClick processing which caused a fatal KeyNotFoundException when the stream info file was missing
Sharktooth
5th March 2006, 10:42
New x264 option:
--direct auto -> https://trac.videolan.org/x264/changeset/457
also default mode for --direct is now spatial. -> https://trac.videolan.org/x264/changeset/456
Sharktooth
5th March 2006, 12:02
CVS Update:
0.2.3.2106 5 March 2006
Commit by Sharx1976:
- Added Auto option to x264 B-Frames direct mode. Spatial is now the default mode.
NOTE: CVS gone nuts and i couldnt commit (it timed out several times)... i'll try to commit the changes later.
sources are here: http://www.webalice.it/f.corriga/megui/MeGUI-src.CVS-0.2.3.2106.7z
EDIT: Committed (finally).
soresu
5th March 2006, 12:42
I am wondering if it is possible to post a changelog for MeGUI on the x264.nl site now that MeGUI compilation has been automated?
Sharktooth
5th March 2006, 13:02
why?
changelog is here: http://cvs.sourceforge.net/viewcvs.py/megui/MeGUI-src.CVS/Changelog.txt?view=markup
berrinam
5th March 2006, 13:06
Good link, Sharktooth. I've added a link to that on http://megui.sourceforge.net/
Sharktooth
5th March 2006, 13:19
the crappy SF CVS has still problems. i can't commit the changes.
... damn it we should move to SVN :P
Doom9
5th March 2006, 13:48
... damn it we should move to SVN :PAt this point, I believe it would be a dangerous move since the changes from my end are considerable.. better wait for the next truly stable release that includes my new job generation.
Sharktooth
5th March 2006, 13:52
you're right.
ChronoCross
5th March 2006, 21:31
Compiled Sharktooths additions.
*kicks sourceforge CVS*
Sharktooth
5th March 2006, 23:49
SF CVS hates me... i cant still commit the changes...
dimzon
5th March 2006, 23:55
there are corecodec.org with same features as sf
maybe migrate on it?
Sharktooth
5th March 2006, 23:59
well, i think it's only a temporaneous problem. lets wait and see.
EDIT: Finally committed...
berrinam
6th March 2006, 06:57
0.2.3.2107 6 March 2006
Commit by berrinam:
- Fixed crash when saving AviSynth script during source type detection
- Cleaned up GUI management of source detection in AviSynth Script Creator
- Fixed OneClickConfig bug with 'delete' button not working
Sharktooth
6th March 2006, 11:16
CVS Update:
- Added gpl.txt (license).
Sharktooth
6th March 2006, 11:36
I updated also the file releases on SF with the new MeGUI 0.2.3.2107 (0.2.3.2033 was quite old).
Doom9
6th March 2006, 13:04
the darned dynamic muxpath selection is taking forever. Now I'm at the point where the autoencodewindow shows all available containers based on the selected audio and video output types, but right now it takes the first path instead of the best path, and it adds avi twice so that's not really it.. why oh why did I have to touch what was working.
Sharktooth
6th March 2006, 13:24
LOL :)
think at me fixing x264 tri-state 6-7 times... always the same bugs:)
squid_80
6th March 2006, 16:35
(slightly off-topic post warning)
*kicks sourceforge CVS*So you're the reason sourceforge is giving me the "I've fallen and can't get up!" error. :)
Doom9
6th March 2006, 16:35
think at me fixing x264 tri-state 6-7 times... always the same bugsI think we need to assign one person in charge of a codec configuration dialog, and let him do everything that concerns that dialog.. that way, we have no conflicting ideas on how people think things should work, and one person has the overview of what has been done and needs to be done.
Sharktooth
6th March 2006, 16:41
we should have a "milestone" view of the project.
i mean, a place where to put all the ideas for the next major version (0.3 for example) and then every devs choose what to do.
when all ideas are implemented and all bugs are squashed, release MeGUI 0.3 and start that again for MeGUI 0.4.
dimzon
6th March 2006, 16:50
we should have a "milestone" view of the project.
i mean, a place where to put all the ideas for the next major version (0.3 for example) and then every devs choose what to do.
when all ideas are implemented and all bugs are squashed, release MeGUI 0.3 and start that again for MeGUI 0.4.
Yes, we need roadmap!!!
Sharktooth
6th March 2006, 18:40
i had an irc discussion with verm today.
i'll report it here:
<verm_> you around?
<verm_> got a question
<verm_> anyway i'll just say what i have to you can read when you're around.
<verm_> is megui looking for hosting?, i can offer perm hosting, svn+trac+ftp+www (perm as in litrally, forever, no bandwidth limits)
<verm_> shell access as well
<Sharktooth> well we're hosted on SF right now
<verm_> these days that's the same as having no hosting at all...
<Sharktooth> but you know how much slow it is
<verm_> yeah, and trac will help a lot with development
<verm_> i'm sure you know trac
<Sharktooth> yep
<verm_> anyway it's a very fast machine, hosted at http://non-gnu.uvt.nl/
<Sharktooth> i'll ask doom9, or if you want you can drop a post in this forum thread: http://forum.doom9.org/showthread.php?t=95863
<verm_> hehe better if you ask directly i'm not much of a forum person, IRC or mailing lists for me :)
<verm_> but it's stable and fast hosting
<Sharktooth> ok
<Sharktooth> i'll ask
<Sharktooth> is if for free? :D
<verm_> oh of course
<verm_> free forever
<Sharktooth> ok:)
<verm_> no bandwidth limits either
<verm_> oh and we can host domains too, megui.org
<verm_> if its owned by a developer
Doom9
6th March 2006, 20:11
speaking of roadmaps, I recall posting one already.. just without any timestamps but feature wise I have my plans set for the next two stable builds.
As far as hosting goes, it does sound interesting. But we'd have to convert CVS to SVN somehow, and I don't think that part should be done prior to the next really stable build. I finally have a reliable answer from the muxprovider as to what output it can provide provided the input types, so hopefully tomorrow I can rewrite the mux job generation so that the autoencode works again, but then I have another layer of generalization to be done (video and audio output types are not generic enough.. it needs to be video codec + audio codec = what container or the one clicker will never work.
Sharktooth
6th March 2006, 20:39
with shell access cvs2svn can be used to "convert" it.
Convert a cvs repository to a subversion repository
Converts a CVS repository (including its branches and tags) to a
Subversion repository. It is designed for one-time conversions, not for
repeated synchronizations between CVS and Subversion.
However verm is importing the MeGUI CVS to his SVN to see if he can keep the revision changes.
We'll need a domain though.
Richard Berg
6th March 2006, 20:56
FWIW, I'm adding TeamPlain (http://www.devbiz.com/teamplain/webaccess/) to one of my Team Foundation Servers, which should give TFS the web interface an OSS project like MeGUI needs.
I agree we should wait before making any more major changes.
Sharktooth
6th March 2006, 21:13
do you know trac?
http://www.edgewall.com/trac/
we'll have it on that host...
Sharktooth
6th March 2006, 21:59
@devs: However a temporaneous SVN is up. All the revision changes and logs have been kept.
PM me if you wanna see it and i'll give you the URL.
berrinam
7th March 2006, 06:39
I have a small update for Source Detection, to provide extra data. Do I still commit this to SF CVS?
ChronoCross
7th March 2006, 06:59
As far as I know the svn thingy sharktooth is talking about was only a test.
berrinam
7th March 2006, 07:07
Ok, here we go:
0.2.3.2108 7 March 2006
Commit by berrinam:
- Source Detection gives extra data (useful for debugging)
Sharktooth
7th March 2006, 12:08
I've received no PMs and no answers yet.
The transition to SVN is easy.
If you have changes to commit just clean the sources from CVS folders, checkout the SVN and copy the cleaned sources over it... then commit.
Kostarum Rex Persia
7th March 2006, 16:21
What about uncompressed AVI sources? Why uncompressed AVI must convert to YV12 color space in AVS scripts?
shon3i
7th March 2006, 16:52
What about uncompressed AVI sources? Why uncompressed AVI must convert to YV12 color space in AVS scripts?
YV12 colorspace is faster than RGB and it's lossy format.
Sharktooth
7th March 2006, 16:53
also because x264 wants YV12 as input or will not encode (remember the Invalid input format (DIB) error message?).
Kostarum Rex Persia
7th March 2006, 16:56
also because x264 wants YV12 as input or will not encode (remember the Invalid input format (DIB) error message?).
Can you, please, explain that with much more detail? What about YUV2 input?
Sharktooth
7th March 2006, 17:04
no. it's not a MeGUI issue.
the encoders require YV12 to work so MeGUI converts everything to YV12.
Kostarum Rex Persia
7th March 2006, 17:53
Ok, but you still own me explanation? Why x264.exe insists on YV12 inputs?
dimzon
7th March 2006, 18:17
what about such "logo"
http://img437.imageshack.us/img437/6491/mg324uc.png
http://img137.imageshack.us/img137/5025/mg506fm.png
http://img137.imageshack.us/img137/7938/mg728ad.png
buzzqw
7th March 2006, 18:21
too much google like ;)
BHH
Richard Berg
7th March 2006, 18:33
Ok, but you still own me explanation? Why x264.exe insists on YV12 inputs?
He doesn't owe you anything. x264.exe already supports Avisynth, which allows you do to just about anything you want - why does it matter whether the conversion to YV12 happens within avisynth.dll or x264.exe? Conversion code is hard to get fast & 100% correct - why do you want the x264 devs to reinvent the wheel?
Doom9
7th March 2006, 20:55
we already have some submitted logos.. I guess I'm the only one who still remembers.
dimzon
8th March 2006, 00:50
@Doom9 and other Developers
Some words about exception handling http://www.artima.com/intv/handcuffs.html
Bill Venners: So you think the more common case is that callers don't explicitly handle exceptions in deference to a general catch clause further up the call stack?
Anders Hejlsberg: It is funny how people think that the important thing about exceptions is handling them. That is not the important thing about exceptions. In a well-written application there's a ratio of ten to one, in my opinion, of try finally to try catch. Or in C#, using statements, which are like try finally.
Bill Venners: What's in the finally?
Anders Hejlsberg: In the finally, you protect yourself against the exceptions, but you don't actually handle them. Error handling you put somewhere else. Surely in any kind of event-driven application like any kind of modern UI, you typically put an exception handler around your main message pump, and you just handle exceptions as they fall out that way. But you make sure you protect yourself all the way out by deallocating any resources you've grabbed, and so forth. You clean up after yourself, so you're always in a consistent state. You don't want a program where in 100 different places you handle exceptions and pop up error dialogs. What if you want to change the way you put up that dialog box? That's just terrible. The exception handling should be centralized, and you should just protect yourself as the exceptions propagate out to the handler.
Richard Berg
8th March 2006, 05:06
I guess I'm the only one who still remembers.
I didn't say anything about the previous logos because I thought they were hideous.
Who needs VS2005 Pro? I got an extra copy (not for resale).
Doom9
8th March 2006, 09:18
The exception handling should be centralized, and you should just protect yourself as the exceptions propagate out to the handler.So, I'll translate that: you have one huge method that handles every exception. In order to figure out where the exception is from, you need to either catch them locally and throw out a custom exception, or you will be unable to inform the user in a useful matter about what has gone wrong. And that, quite frankly, is insane. Cleaning up locally, yes, all the time, but throwing custom exceptions all over the place? I don't think so. Say you have a db connection and your sql SP causes an exception and you've used a using statement.. so the db connection is properly cleaned up despite the exception.. but what do you do with the exception? Say you need your method to still do something after cleaning up, you can't just break out the generic exception handler. In my case, I have methods that do combined SQL and Webservice calls.. first there's a webservice call, if it succeeds, there are two sql SPs that need to be called, if they fail, I need to call another webservice (well, same service, different method.. to clean up everything again), and if hte SQL statements succed, yet a few more webservice methods. The only way you can handle that with exceptions, is that you catch the sqlexception locally, throw a custom exception that is detailed enough so the generic exception handler knows it needs to call the cleanup method on the webservice. So you need to dive down the object hierarchy again, proably reinit classes because they are not known in the launching class, just to finish the cleanup. That's just ineffective beyond measure.
dimzon
8th March 2006, 10:47
I didn't say anything about the previous logos because I thought they were hideous.
Who needs VS2005 Pro? I got an extra copy (not for resale).
Hmm... I can get distributive itself from my work. So I need only a legal serial...
In this case I can use VC++ from VS2005 at home...
btw I'm not too much care about licensing problem bcz my homework (meGUI/BeHappy/AviSynth plugins) development is 100% non-profit so I even can steal serial from my work too... (Maybe it's even legal - my company is Microsoft Platinum Partner and has corporate licence on WinXP/VS/Office)
dimzon
8th March 2006, 10:57
@Doom9
void someMethod()
{
try
{
//...
}
catch(SomeSpecificException ex)
{
throw new ApplicationException("User friendly description", ex)
}
}
Doom9
8th March 2006, 13:28
@dimzon: yes, and then your generic exception handler has to have a 100 position switch.. really darned pretty, plus you separate the logic from where it belongs.. why should a GUI class be aware of what can go wrong in some very specific processing class, and more importantly, why should the GUI class provide means to get back to that other class and do something in response to the user response after he was presented some message? In the end, with that approach you end up placing logic that blongs into a separate class into the main gui class.. and potentially add code fragments of a 100 different classes to your main gui class. Doesn't that go against everything OO stands for? It's like having one person in my company that is aware of sales tasks, finance tasks, engineering tasks, development tasks, installation tasks, building maintenance tasks, etc.
dimzon
8th March 2006, 13:38
@dimzon: yes, and then your generic exception handler has to have a 100 position switch..
Actually no. It's just
try
{
//...
}
catch(ApplicationException ae)
{
// Normal error
MessageBox.Show(ae.Message);
}
catch(Exception ue)
{
// Unexpected error
MessageBox.Show(ue.ToString());
}
Doom9
8th March 2006, 15:08
no, not at all. You don't just need to inform the user that something has gone wrong, you also often need to do something after the exception has ocurred. Not only freeing up used resources, but gracefully exiting.. like in my example from work where I need to go back and send some cleanup commands to the webservice (I'm adding project to project server.. if I create a project via webservice, and the sql commands fail, it's not enough to inform the user about an errror.. I need a rollback and since the webservice can't do that, I need to tell it to delete the project again.. and that deletion command most certainly doesn't belong in the GUI class but right there with all the other webservice calls and sql commands (naturally, sql commands are sent and processed in a different class than the one that sends webservice calls).
dimzon
8th March 2006, 16:11
no, not at all. You don't just need to inform the user that something has gone wrong, you also often need to do something after the exception has ocurred.
Yes, off couse sometimes it's requed.
like in my example from work where I need to go back and send some cleanup commands to the webservice (I'm adding project to project server.. if I create a project via webservice, and the sql commands fail, it's not enough to inform the user about an errror.. I need a rollback and since the webservice can't do that, I need to tell it to delete the project again.. and that deletion command most certainly doesn't belong in the GUI class but right there with all the other webservice calls and sql commands (naturally, sql commands are sent and processed in a different class than the one that sends webservice calls).
Yes, I know such techique. AviSyhthAudioEncoder use same for output file cleanup. There are special term for it : "Compensating transaction" - some actions to emulate transactions in non-transactional enviroment like filesystem or stateless webService
In such case I prefer such pattern
try
{
//...
}
catch(Exception e)
{
PerformSomeCompensation();
throw; // rethrow same error
}
Or
try
{
//...
}
catch(SomeExpectedException e)
{
PerformSomeCompensation();
throw new ApplicationException("User friendly mesage", e); // rethrow new error
}
In this case I perform some compensation logic so my state still valid BUT most error handling (like user notification) still placed in centralized error handler...
Doom9
8th March 2006, 16:40
you don't know exactly which state you're in when the exception is thrown... that's why I catch my sql exception right there, and report an error back to the caller, which in turn can either continue doing its work, or perform the rollback in case an error is signalled. And after that, an appropriate error message is presented (or rather, logged since this is a non user supervised process).
Regardless of all the teach you on msdn and the certifications, there's also a part about throwing errors being the opposite of resource friendly, so with each catch and rethrow you effectively increase the ineffectiveness of your software.. and there ain't nothing taking that away no matter how you turn it. that's why I prefer the catch, process and do whatever is applicable approach rather than the catch, process and rethrow (and then on top of the additional context switch having to have even more code to handle the rethrown exception) approch.
dimzon
8th March 2006, 16:52
Regardless of all the teach you on msdn and the certifications, there's also a part about throwing errors being the opposite of resource friendly, so with each catch and rethrow you effectively increase the ineffectiveness of your software.. and there ain't nothing taking that away no matter how you turn it. that's why I prefer the catch, process and do whatever is applicable approach rather than the catch, process and rethrow (and then on top of the additional context switch having to have even more code to handle the rethrown exception) approch.
Keep in mind - error-meaning Exception is something wich must not occur in 99.9999999% and if exception means error you doesn't worry about performance
Raithmir
8th March 2006, 22:34
What's the current opinion on migrating to SVN?... It'd be nice if I didn't have to have both SVN and CVS installed :D
ChronoCross
9th March 2006, 00:17
What's the current opinion on migrating to SVN?... It'd be nice if I didn't have to have both SVN and CVS installed :D
one only will suffice. it's hard to keep both of them up to date. I like svn but that's already known. but currently it is only hosted on cvs.
Sharktooth
9th March 2006, 00:27
a SVN migration is painless though...
max-holz
12th March 2006, 11:11
I have tested sourceforge svn with another project; it's not fast as x264's svn but it's not bad, certainly better that cvs.
Sharktooth
13th March 2006, 13:56
new binaries up on SF (2108).
dimzon
13th March 2006, 22:25
Can ANYBODY tell me why "Company Name" in MeGUI is shown as www.doom9.net
Sharktooth
13th March 2006, 22:50
what's wrong with it?
dimzon
14th March 2006, 00:01
what's wrong with it?
i belive it must be
www.doom9.org
not
www.doom9.net
Edit: Oh sorry, never know www.doom9.net is valid too (always use www.doom9.org )
dimzon
15th March 2006, 13:29
@Doom9
Any news about Your refactoring? Please, keep us informed!
Doom9
15th March 2006, 19:23
if I'm not posting that means nothing is happening. I have more than a full plate at work, trouble with the IRS and my ISP so I don't feel like even looking at code when I get home from work.
Sharktooth
16th March 2006, 12:22
CVS Update:
0.2.3.2109 16 March 2006
Commit by Sharx1976:
- Added a file type of all supported audio formats to the audio open dialog and defaulted to that (patch by SysKin).
Sharktooth
16th March 2006, 12:46
CVS Update:
0.2.3.2110 16 March 2006
Commit by Sharkx1976
- Fixed a bug in ChapterCreator.cs. If you want to add a chapter in the middle of an existing list the programm lost all chapter after the new one(+1). (patch by IMOON)
ChronoCross
16th March 2006, 19:48
I won't be bale to make another build until the end of the weekend as I'm fighting off a nasty bit of Food poisoning I got from the school cafeteria.
berrinam
16th March 2006, 20:34
0.2.3.2111 16 March 2006
Commit by berrinam:
- Altered Source Detector to use IsCombedTIVTC instead of IsCombed. TIVTC.dll is now required for Source Detection
- Fixed bug with checking lossless mode in x264 Encoder Configuration -- it would disable encoding mode, but not re-enable it
- Removed useless LoadPlugin(<dgdecode>) line at the beginning of generated AviSynth scripts. dgdecode.dll is required in the AviSynth plugins anyway
berrinam
16th March 2006, 21:41
0.2.3.2112 16 March 2006
Commit by berrinam:
- Fixed up AviSynth script generation from the bug I added in 0.2.3.2111
- Removed the remaining few #if FULL bits in the code. These were causing SAR calculation to be forgotten.
berrinam
17th March 2006, 08:42
0.2.3.2113 17 March 2006
Commit by berrinam:
- Fixed error when opening a first pass mode in AutoEncode
Sharktooth
19th March 2006, 14:33
x264 rev 474 supports a new option: --thread-input
it separates the --thread-input from --threads and gives a nice speedup on dual core/dual processor configurations.
Sharktooth
19th March 2006, 14:59
CVS Update:
0.2.3.2114 19 March 2006
Commit by Sharkx1976:
- Added support for --thread-input x264 option in CommandLineGenerator.cs
Note: it gets automatically added for --threads > 1.
bratao
19th March 2006, 23:52
I´m witout my work machine, but should someone look at aviMuxer ?
With auto encode, it work fine, but if i go to Menu, Muxer-> Avi,
Add a video and audio, set to Vbr and ok..
It allocate the all Video and Hang for hour , after that killed the program..
This is the nomal becavior ?
Doom9
20th March 2006, 09:47
mencoder is a shitty avi muxer I'm afraid.. messes up half the time, especially when your input is AC3. In the future, avi muxing will be done differently.
bratao
20th March 2006, 13:53
I dont think that is a mencoder error but a Megui.
Im setuping a debbuger machine to help with more info.
But like a already say, the merge feature of 1-click always work great, but the manual merge, kill the pc
Sharktooth
21st March 2006, 02:44
--subme 7 is now in SVN.
MeGUI-svn CC can be removed.
leowai
21st March 2006, 03:43
--subme 7 is now in SVN.
MeGUI-svn CC can be removed.
I've different point of view. I think MeGUI-svn should stick with SVN of x264. So, I would suggest (temperary) remove 'MeGUI' version rather than 'MeGUI-svn' version. Because now 'MeGUI' is only for x264 with experimental patches and 'MeGUI-svn' is named for x264 WITHOUT experimental patches.
Or in future releases, 'MeGUI' will only for SVN build of x264, 'MeGUI-Exp' (or other names) for x264 with experimental patches?
Kostarum Rex Persia
21st March 2006, 04:03
No, MeGUI-svn should be removed now.
ChronoCross
21st March 2006, 05:18
even the current full megui doesn't have settings for AQ. it is full svn right now. there is no feature in full that isn't in the current svn. svn conditional compiling should be removed as they are now equal.
foxyshadis
21st March 2006, 05:19
I think profiles based on patches should be relegated to custom command line, unless they extend existing options, like subme 7 did. The upside is it's obvious that it's experimental and requires no extra dev support, the downside is megui won't have the logic to dynamically add/remove it.
leowai
21st March 2006, 07:16
there is no feature in full that isn't in the current svn. svn conditional compiling should be removed as they are now equal.
Ya. I know about this. I just wondering how are you going to name future release of MeGUI. For me, I'm thinking of 'MeGUI-svn' as major build since most ppl use svn build of x264. 'MeGUI-full' is an add-on build for x264 with experimental patches. :confused:
In future release, how about making 'MeGUI' as use for SVN build of x264 while 'MeGUI-Full' is for x264 with experimental patches?
Sorry here if what I state above seems to be confusing. :confused:
berrinam
21st March 2006, 07:25
I'm all for managing it through custom command lines. The whole point about patches is that they are UNSTABLE, and since we do eventually want MeGUI to be stable, this is really the only way we can resolve the two.
Also, with almost 2000 posts, perhaps it's a good idea to close this thread and start afresh?
ChronoCross
21st March 2006, 08:26
Honestly I think if megui is going to be competitive and actually have public releases it should not have more than one way of compiling.
A full version is all we should have. it's not that hard to use. if we want to control svn features we could simply make a checkbox in the x264 dialog to block out all none svn options. IT'll make megui more stable in the end cause you won't have 2000 conditional versions floating around. next thing you know we'll need to have a conditional compilation for avisynth 3.0 ro some other thing that megui supports simply because we have become accustomed to catering tot he wants of a single svn. if we made a conditional version for each program based on it's cvs or svn we will have waaay too many compiling options.
Sharktooth
21st March 2006, 12:37
well, since there is no difference in options (now) "svn" CC could be safely removed.
in the meantime i'm working on a method to automatically distinguish custom builds from svn builds without the need of CC.
Kostarum Rex Persia
21st March 2006, 14:55
well, since there is no difference in options (now) "svn" CC could be safely removed.
in the meantime i'm working on a method to automatically distinguish custom builds from svn builds without the need of CC.
Vety good idea, Sharktooth.:goodpost:
Romario
21st March 2006, 17:18
No, MeGUI-svn should be removed now.
Yes, you are right, KRP.
berrinam
21st March 2006, 20:05
Look, will you two (KRP and Romario) stop polluting the MeGUI dev thread? You're not actually contributing anything to the discussion. If you raised some points about the argument, then that would be interesting, but as it is, you are just spamming. Once again, you are breaking rule 11:
11) Don't post just to increase your number of posts. If you have nothing to say on a certain matter then don't post.
smok3
21st March 2006, 20:51
x264 rev 474 supports a new option: --thread-input
it separates the --thread-input from --threads and gives a nice speedup on dual core/dual processor configurations.
is there '--threads auto' or similar?
---
and a quick test between old ce-quicktime and new one:
old:
x264 [info]: PSNR Mean Y:35.120 U:41.762 V:40.610 Avg:36.328 Global:35.707 kb/s: 504.58
new:
x264 [info]: PSNR Mean Y:35.418 U:41.797 V:40.624 Avg:36.590 Global:35.983 kb/s: 505.31
(could that be significant?) - i can actually see a difference on few frames, but i didnt really check if they are of the same type, anyway it seems that this new preset is a bit harsh when dealing with such low bitrates on this specific sample - only judging from this few frames.
Sharktooth
21st March 2006, 21:31
no "--threads auto" in x264, but megui can do it (check the settings).
also .2/.3db in PSNR usually means better quality...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.