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

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

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 Encoder GUIs
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th July 2005, 13:48   #161  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
Quote:
The main problem I have with the GUI is the main form -- if you get rid of the audio group box, you have a lot of blank space.
Does it hurt a lot? The main form mainly has its size from the queue.. I'm not sure it's such a good thing to just reduce it's size (you're going to cut off a lot of stuff.. if you look at one of the codec configuration dialogues.. the commandline textbox is initially not visible.. it's outside of visibility but still there.. if you check the checkbox, I change the form size so it becomes visible).
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 6th July 2005, 13:55   #162  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Quote:
Originally Posted by Doom9
Does it hurt a lot? The main form mainly has its size from the queue.. I'm not sure it's such a good thing to just reduce it's size (you're going to cut off a lot of stuff.. if you look at one of the codec configuration dialogues.. the commandline textbox is initially not visible.. it's outside of visibility but still there.. if you check the checkbox, I change the form size so it becomes visible).
Ok, just wondering. I'll leave it alone, then.
berrinam is offline   Reply With Quote
Old 6th July 2005, 21:26   #163  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
the new sources are up.. but this is more of a transitional release as certain things are still outstanding (see release note of the latest build).
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 6th July 2005, 22:52   #164  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
The code clean-up is good

What happened to AR auto-detection from the info file?

What about writing to the log?

EDIT: fixed in next post.

Last edited by berrinam; 7th July 2005 at 00:27.
berrinam is offline   Reply With Quote
Old 6th July 2005, 23:56   #165  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
AR autodetection from the info file can be implemented as follows:
change VideoUtil.openVideoSource(...) to this:
Code:
		public bool openVideoSource(string fileName, ComboBox track1, ComboBox track2, out ArrayList trackIDs, out AspectRatio ar)
		{
			trackIDs = new ArrayList();
			string infoFile = VideoUtil.getInfoFileName(fileName);
			bool putDummyTracks = true; // indicates whether audio tracks have been found or not
			ar = AspectRatio.CUSTOM;
			if (!infoFile.Equals(""))
			{
				AudioTrackInfo[] atis;
				getSourceInfo(infoFile, out atis, out ar);
				if (atis.Length > 0)
				{
					putDummyTracks = false;
				}
				int index = 0;
				foreach (AudioTrackInfo ati in atis)
				{
					trackIDs.Add(ati.trackID);
					track1.Items.Add(ati.language + " " + ati.type + " " + ati.nbChannels);
					track2.Items.Add(ati.language + " " + ati.type + " " + ati.nbChannels);
					if (ati.language.Equals(mainForm.Settings.DefaultLanguage1) && track1.SelectedIndex == -1)
						track1.SelectedIndex = index;
					if (ati.language.Equals(mainForm.Settings.DefaultLanguage2) && track2.SelectedIndex == -1)
						track2.SelectedIndex = index;
					index++;
				}	
			}
			else
				MessageBox.Show("Could not find DVD Decrypter generated info file " + infoFile, "Missing File", MessageBoxButtons.OK);
			if (putDummyTracks)
			{
				track1.Items.AddRange(new string[] {"Track 1", "Track 2", "Track 3", "Track 4", "Track 5", "Track 6", "Track 7", "Track 8"});
				track2.Items.AddRange(new string[] {"Track 1", "Track 2", "Track 3", "Track 4", "Track 5", "Track 6", "Track 7", "Track 8"});
			}
			return putDummyTracks;
		}
There are three differences from before: it has another out parameter, ar is assigned AspectRatio.CUSTOM at the beginning, and the declaration of ar is removed. Secondly, because of the change in function prototype, we change VobinputWindow.openVideo(string) to
Code:
		private void openVideo(string fileName)
		{
			input.Text = openIFODialog.FileName;
			track1.Items.Clear();
			track2.Items.Clear();
			AspectRatio ar;
			demuxAllTracks.Checked = vUtil.openVideoSource(openIFODialog.FileName, track1, track2, out audioTrackIDs, out ar);
		}
We also change OneClickWindow. We change the openButton_Click function to
Code:
		private void openButton_Click(object sender, System.EventArgs e)
		{
			if (!processing)
			{
				openFileDialog.Filter = "VOB Files (*.vob)|*.vob|MPEG-1/2 Program Streams (*.mpg)|*.mpg|Transport Streams (*.ts)|*.ts";
				if (openFileDialog.ShowDialog() == DialogResult.OK)
				{
					input.Text = openFileDialog.FileName;
					track1.Items.Clear();
					track2.Items.Clear();
					AspectRatio ar;
					vUtil.openVideoSource(openFileDialog.FileName, track1, track2, out audioTrackIDs, out ar);
					string chapterFile = VideoUtil.getChapterFile(openFileDialog.FileName);
					if (File.Exists(chapterFile))
					{
						this.chapterFile.Text = chapterFile;
					}
					workingDirectory.Text = Path.GetDirectoryName(openFileDialog.FileName);
					workingName.Text = Path.GetFileNameWithoutExtension(openFileDialog.FileName);
					this.chooseOutputName();
					this.setAspectRatio(ar);
				}
			}
		}
and we add a new helper method as follows:
Code:
		private void setAspectRatio(AspectRatio ratio)
		{
			switch (ratio)
			{
				case AspectRatio.A16x9:
					aspectRatio.SelectedIndex = 0;
					aspectRatio_SelectedIndexChanged(null, null);
					break;
				case AspectRatio.A4x3:
					aspectRatio.SelectedIndex = 1;
					aspectRatio_SelectedIndexChanged(null, null);
					break;
				case AspectRatio.A1x1:
					aspectRatio.SelectedIndex = 2;
					aspectRatio_SelectedIndexChanged(null, null);
					break;
				default:
					aspectRatio.SelectedIndex = 4;
					aspectRatio_SelectedIndexChanged(null, null);
					break;
					
			}
		}
This enables AR auto-detection from the info file (if not possible, it will default to Autodetect later).

Secondly, no log was being written by OneClickWindow because it was not being added to the mainForm log. To fix this, in OneClickWindow.setUpJobs(), add the following line at the end:
Code:
			mainForm.addToLog(logBuilder.ToString());
Finally, I realized when testing it that it didn't autostart the job queue unless Autostart job queue was set in settings (I guess that makes sense ). It's good, but not if you don't realize it (ie, you set it to run overnight, and then the next morning you wake up and it hasn't started ) Anyway, is it worth showing a popup that says, "warning: this job won't autostart" or something like that?

As in other situations, not autostarting the job queue seems to clash with the oneclick workflow, although I can understand that one may want to configure multiple jobs before starting.

And another thing: I presume you limited oneclickwindow to two audio tracks to be consistent with the vobinputwindow, but the way it was before was interesting, because it was the only way in the gui to have more than two audio tracks, if anyone wants that. It also prevented having two of the same audio track (a waste of space and encoding time). There is also a problem in that oncne you have selected an audio track, you cannot deselect it (the audiotrack comboboxes need to have a 'Empty' item -- I will implement that in the next post.

Last edited by berrinam; 7th July 2005 at 00:01.
berrinam is offline   Reply With Quote
Old 7th July 2005, 00:23   #166  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Quote:
Originally Posted by berrinam
I will implement that in the next post.
Just as promised, here is a solution: in both the OneClickWindow and VobinputWindow constructors, add
Code:
 			track1.Items.Clear();
			track2.Items.Clear();
			track1.Items.Add("<No file loaded>");
			track2.Items.Add("<No file loaded>");
			track1.SelectedIndex = 0;
			track2.SelectedIndex = 0;
(simpler than that would be to load them into the designer and set the collection in the list to <No file loaded>, and set the selectedindex to 0). After you have done either of the above, go to VideoUtil.openVideoSource(...). Just before the
Code:
foreach (AudioTrackInfo ati in atis)
block, add
Code:
				track1.Items.Add("<Empty>");
				track2.Items.Add("<Empty>");
				track1.SelectedIndex = 0;
				track2.SelectedIndex = 0;
				int index = 1;
Change these if statements:
Code:
					if (ati.language.Equals(mainForm.Settings.DefaultLanguage1) && track1.SelectedIndex == -1)
. Turn the selectedindex in the code to 0, to get:
Code:
					if (ati.language.Equals(mainForm.Settings.DefaultLanguage1) && track1.SelectedIndex == 0)
. Finally, in runDGIndexProject, change
Code:
			this.track1 = track1;
			this.track2 = track2;
into
Code:
			this.track1 = track1 - 1;
			this.track2 = track2 - 1;
to account for the addition of the <empty> item at the beginning.
berrinam is offline   Reply With Quote
Old 7th July 2005, 08:42   #167  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
Quote:
And another thing: I presume you limited oneclickwindow to two audio tracks to be consistent with the vobinputwindow, but the way it was before was interesting, because it was the only way in the gui to have more than two audio tracks, if anyone wants that. It also prevented having two of the same audio track (a waste of space and encoding time).
Well.. I do not foresee more than 2 audio tracks in all the calculations and processing code and I have no intention of ever relaxing that constraint. Furthermore, it is actually not possible to select the same audio track twice.. you can select it.. but number two is silently discarded

I'm afraid I must've eliminated some of the logging code during the rewrite such as the ar thing.. there's a method that already returns the ar but it is never propagated back to the form.. it does make sense getting it from the ifo though because the vobs sometimes have incorrect ar flags. On the other hand, if there's no info file or no ar detected, it should default to auto-detection.. in my tests I ended up with a 16:9 setting for a 4:3 source and naturally the resulting file was improperly resized.

Quote:
Anyway, is it worth showing a popup that says, "warning: this job won't autostart" or something like that
I'll add a warning.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 7th July 2005, 09:28   #168  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Quote:
Originally Posted by Doom9
I'm afraid I must've eliminated some of the logging code during the rewrite such as the ar thing.. there's a method that already returns the ar but it is never propagated back to the form.. it does make sense getting it from the ifo though because the vobs sometimes have incorrect ar flags. On the other hand, if there's no info file or no ar detected, it should default to auto-detection.. in my tests I ended up with a 16:9 setting for a 4:3 source and naturally the resulting file was improperly resized.
In the version I posted above (and I thought the same about the old version), the ar would default to autodetect later if it couldn't determine it. I'm surprised that your file didn't work, maybe it's a problem with the info file, because my tests worked fine.
berrinam is offline   Reply With Quote
Old 7th July 2005, 13:53   #169  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
I've made a preliminary MeGUI lite version for x264 and snow (separately). To compile for x264, add the define symbol (in the project options) X264_ONLY. Similarly, for snow, add SNOW_ONLY. Note that as of yet, they cannot be used concurrently. Attached are precompiled versions, and source code.

(Almost) Any comments are welcome.
berrinam is offline   Reply With Quote
Old 7th July 2005, 21:34   #170  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
Quote:
Just as promised, here is a solution: in both the OneClickWindow and VobinputWindow constructors, add
I believe you missed a crucial piece. I don't think I've ever advertised that, but I have added code to the vobinput window and ported to the oneclick window that permits megui to properly identify the audio tracks after demuxing in case of non continuous track IDs. If you add another track, that's naturally going to break that mechanism.

So I went the lazy route and just added buttons to set the selected index back to -1. Feel free to implement a more proper solution later one when I've stopped changing everything (over the week-end.. I have a few lavc options left to test and some audio code to reconsider and proper avi support in the oneclick window).

By the way, you said that csc creates much smaller executables. What commandline did you use to compile megui?
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 7th July 2005, 21:56   #171  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
about the lite versions: default priority, autostart queue, shutdown after encoding, overwrite stats file and keep second pass output should still be available.

The filetype dropdown is missing in the x264 gui and you can get rid of the codec label right away.

The reset button can be moved into the groupbox.

The same also goes for the Snow GUI.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 7th July 2005, 23:25   #172  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Quote:
Originally Posted by Doom9
By the way, you said that csc creates much smaller executables. What commandline did you use to compile megui?
Code:
csc /target:winexe /out:megui.exe /win32icon:app.ico /unsafe+ /recurse:*.cs
I think the files compiled this way are much smaller because it does not include the resource files. The /optimize+ tag can be added, but it only knocks about 6KB off.

I'll do all of those things you mentioned about the lite versions.
berrinam is offline   Reply With Quote
Old 8th July 2005, 07:21   #173  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
thanks for the compilation tips.

Here's an idea I've been toying around with for a couple of days, let me know what you think:

switch out the source detection function (from jobutil I think) to medialib (http://forum.doom9.org/showthread.php?t=96516). It would have the following pros and cons:

pro: sources that could be encoded but cannot opened because of a missing YV12 VfW codec could still be encoded. mencoder and x264.exe certainly don't use VfW (I'm not sure what they use to open the video). Naturally, video preview would still be using AviFile (the only other alternative is DirectShow which appears to be quite a bit more problematic (the "go to frame X" call is not honored by at least 50% of the DS filters out there, and that's just the beginning of the problems)
pro: AC3 audio encoding would have a working progress bar even during the first pass as the exact lenght of the audio file could be detected in advance. The same goes for all the other input types of course.


con: megui would no longer be self-containing. Without the medialib you would be unable to encode
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 8th July 2005, 08:09   #174  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Quote:
Originally Posted by Doom9
thanks for the compilation tips.
No problem. I only discovered them because the computer I use most of the time doesn't have VS.NET installed.

Quote:
Here's an idea I've been toying around with for a couple of days, let me know what you think:
Well, it looks like it could be quite useful. It sounds like a good idea.

Quote:
con: megui would no longer be self-containing. Without the medialib you would be unable to encode
'no longer'? Hasn't MeGUI required external programs from the start? Anyway, I don't think that would be a serious problem. It shouldn't need to be distributed every release, so I don't see any real problems. With a bit of work, MeGUI could probably even be made to check for the presence of MediaInfoLib, and fall back on the current code if it wasn't there.

So basically, I think it would be a good idea.
berrinam is offline   Reply With Quote
Old 9th July 2005, 02:29   #175  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
Quote:
Hasn't MeGUI required external programs from the start?
Oh absolutely, but this is yet one more dependency and one that is not a must to have.

I'll see what I can do with that lib.

I've also upped the latest sources.. I don't have immediate plans to change form1 so I guess now would be a good time to make the official commit of the conditional compile options once you're done with the changes.

I'll add a separate bitrate calculator that should also be accessible in both reduced modes. You can add the menu option and a dummy event handler for this already and I'll integrate the new class into that.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 9th July 2005, 03:07   #176  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Quote:
Originally Posted by Doom9
I've also upped the latest sources.. I don't have immediate plans to change form1 so I guess now would be a good time to make the official commit of the conditional compile options once you're done with the changes.

I'll add a separate bitrate calculator that should also be accessible in both reduced modes. You can add the menu option and a dummy event handler for this already and I'll integrate the new class into that.
Ok, I've done most of the code, and I will send it soon. Unless you have changed anything significant on form1, I should be able to use what I have done already. What I was doing was just fixing up the positioning of some of the buttons.

The code for the GUI elements is becoming rather messy, but I'm hoping that it won't be a problem because most of form1 will be staying the same.
berrinam is offline   Reply With Quote
Old 9th July 2005, 03:35   #177  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
I've had a look at the updates you posted -- it shouldn't be too hard to work them into version 2.1.0a, so I don't have to rewrite the code.
berrinam is offline   Reply With Quote
Old 9th July 2005, 03:50   #178  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
Video output filename wasn't being autoset -- a variable had it, but it wasn't put into the textbox. Will be fixed in the compile options release I will give.
berrinam is offline   Reply With Quote
Old 9th July 2005, 08:17   #179  |  Link
berrinam
Registered User
 
berrinam's Avatar
 
Join Date: Apr 2005
Posts: 1,740
I have completed and attached the lite versions. All of the code *should* be up-to-date with 2.1.1, but I may have left something out by using an obsolete file somewhere. Everything seems to be working, so this should probably be used as the codebase for any further additions (it is a real hassle if not, because almost every file needs to have something done to it). Like before, I have attached sources, and compiled versions. In the source version, I have only attached *.cs files; I haven't changed anything else, or added/removed files.

These sources also fix the bug mentioned above.
berrinam is offline   Reply With Quote
Old 9th July 2005, 11:33   #180  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
thank you.. I'll make sure to use this for any further work I do.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Reply

Tags
development, megui, not a help thread


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

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

Forum Jump


All times are GMT +1. The time now is 20:31.


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