View Full Version : MeGUI development
Pages :
1
[
2]
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Emp3r0r
22nd July 2005, 12:20
I updated GUI so it is resizable... mainly for the Queue tab.
Also, I've found the problem sillKotscha described about video input for mpg; it also affects the click once screen as they both call openVideoSource in the VideoUtil.cs which has the following code:486 string infoFile = VideoUtil.getInfoFileName(fileName);
487 bool putDummyTracks = true;
488 ar = AspectRatio.CUSTOM;
489 if (!infoFile.Equals(""))where infoFile always equals empty string since mpg, ts, m2v, etc normally don't have a "Stream Information" file.
TheBashar
22nd July 2005, 12:37
Yes.. ugly workaround that you don't need anymore.
You might not, but I do. At least until x264 zones change. But then, you already read my plight with that in a different thread.
The infamous "stupid user" error
Yup, that's me! I live in the blissful world where usually a Ctrl-Z can get me out of my messes. Alas, sometimes you just don't get a second chance.
well then, I think I'm just going to add an above normal priority and be done with it. It's not like normal settings make any sense.. if you have cpu cycle consuming crapware running on a pc that isn't to be used during encoding, the difference in encoding time won't be noticeable. If it is.. your setup is to be blamed.
Were you addressing my comments? If so, I have NO idea what you are talking about! ;) I simply mean that sometimes I like to do something else so I crank the priority down to "Low". Then when I'm done, I like to put it back. Unfortunately, you have a dropdown box where the "Normal" entry partially obscures the "Abort" button. Miss clicking on the "Normal" drop-down item by a few pixels and you can accidentally get the Abort button.
I think there was a misunderstanding because I don't know how a super-duper high priority choice would help. Even on a poor setup like mine running cpu consuming crapware.....
Cheers!
Doom9
22nd July 2005, 12:44
umm.. it looks like you've been working with an old version.
And I already knew where to look for the info file thing... I simply never bothered to make the code conditional on the input ;)
@berrinam: how's the work on the main form coming along? I haven't done anything since the last release so far.
berrinam
23rd July 2005, 01:34
Ok, I have completed and tested both the conditional compiling and matroska output. The project is too large (by only 9KB) to attach here, so I posted it on rapidshare.de (http://rapidshare.de/files/3274780/2.1.4_conditional___matroska.zip.html). The three compiled versions (full, x264, snow) I have attached here.
Notes:
-The way I have managed the conditional compiling is just to have three instances of the initializecomponent method within the megui class and the calculator class.
-Matroska muxing is done through mkvmerge.exe. It takes avi, mp4 and mkv input (no raw input) and it supports ac3, aac, mp3 audio formats.
-Both the oneclickwindow class and the autoencodewindow class are aware of mkv muxing.
-The oneclickwindow class now has the option "don't encode audio" which keeps the original audio tracks and muxes them directly into the output mkv (only allowed for mkv output, and it assumes that mkvmerge will accept any audio input set in the oneclickwindow).
-A mkvMuxWindow class has been added which is almost identical to the Muxwindow used for mp4. This should only be used for muxing files created by megui (and associated apps like dgindex, etc), because of the problem with audio muxing (it assumes that the audio track is 0, same for video).
-Languages for mkv muxing are identical to mp4 muxing as they both follow the same iso standard.
Doom9
23rd July 2005, 08:32
great.. I'll give it a test drive, add the other patches and fixes that are due and try to have a new release this week-end. Oh, and I will have to look into matroska overhead, you didn't list that as one of the things done and I'd like to have a precise calculator.
berrinam
23rd July 2005, 08:41
I searched a little for matroska overhead before writing it, and the only real consensus I found was that it was hard to estimate because of EBML lacing schemes.
Doom9
23rd July 2005, 11:14
then what kind of overhead do you use for ac3 and mp3 in mkv? using the avi values would obviously not be correct (way too high), and an approximation will be fine. You cannot exactly determine the mp4 overhead either (I forgot why but bond told me once and it's somewhere in this very forum), but the approximation I used (courtesy of ateme) seems to work out.
berrinam
23rd July 2005, 11:23
Well, I can't remember exactly what I do with mp3 and ac3, but I have a feeling I use the same overhead values as for aac. I know it's dodgy, but I don't have anything else to work with. I did find a page explaining how matroska overhead works (from avimux gui) here (http://www-user.tu-chemnitz.de/~noe/Video-Zeug/AVIMux%20GUI/en_estimate_overhead.html#overhead_mkv). Unfortunately, I do not know how up-to-date this is, in particular, it does not refer to avc muxing. I found that this thread (http://forum.doom9.org/showthread.php?t=63628) has several methods for estimating mkv overhead.
Doom9
23rd July 2005, 13:47
well.. aac audio has no overhead ;) Or rather, if you have a video-in-mp4 and add an audio-in-mp4, you won't incurr any additional overhead. So basically MeGUI calculates video overhead only in mp4 mode.
The Link
23rd July 2005, 15:23
-Matroska muxing is done through mkvmerge.exe. It takes avi, mp4 and mkv input (no raw input) and it supports ac3, aac, mp3 audio formats.
Is adding of vorbis audio also considered in the future? IMHO this would especially make sense for mkv output (besides aac which is a bit behind tuned vorbis versions at some bitrates afaik).
Doom9
23rd July 2005, 17:02
who knows.. maybe one day.
I am more and more thinking this is the wrong direction though.. all those options make MeGUI more and more inaccessible and harder to use. But there's so much groundwork to be done for a Recode clone that does only x264 and xvid that I'm ages away of even determining the feasibility.
sillKotscha
23rd July 2005, 19:13
is it possible to add a 'mono' encoding option to the mp3 section... I've "DVB-T streamed" Tarantula (great b-movie :) ) and they broadcastet it with mono sound. Via Wavelab I've made a pseudo stereo-file (mono-mix) and encoded it sepreatly. But it would be nice to have mono support in MeGUI as well. I know, your aim was a kind of full DVD-backup solution and up2date DVDs got very rarly mono sound but...
thanks, Sill
Doom9
25th July 2005, 08:54
that doesn't even fall under 90/10.
I'm currently working on the mkv bitrate calculation.. it's based on a lot of more or less educated guesses, but one thing I can say right now: using the mp4 calculations will be rather inaccurate.. mkv has higher overhead. And the calculations get more and more complex with each container. I love the simplicity of MP4 when it comes to that.
sillKotscha
25th July 2005, 10:05
that doesn't even fall under 90/10.
= 9 :)
but I'm lost here... what do you mean, your "todo-list"?
mkv bitrate calculus is horror, I guess. Overhead calculations by GKnot are often false when files get muxed by mkvmergeGUI -> undersized files.
Try your best!! :)
Doom9
25th July 2005, 10:22
90/10 = features that 90% of the user will use versus those that 10% will use. In software, you normally are happy with 80 / 20, and mono is such a special case, I'm sure not even 10% of what's backed up with MeGUI would be mono sound.
My matroska audio overhead (except vorbis which seems to be rather random) will be accurate, but when it comes to video, you need to know the number of i, p and b-frames and since you cannot know that before encoding, calculations will never be accurate.
Doom9
25th July 2005, 23:05
@berrinam: I've been looking over your patch and I have a couple of questions
1) why is MP4 and MKV interchanged in the dropdown on the main window?
2) why is there no call to calc.generateMKVCommandline anywhere in jobutil?
3) where is the mkv muxjob created from the autoencodewindow? (that may depend on number two.. the proper commandline definitely isn't there)
4) what is the workflow to get an mkv with audio/subs? I cannot find any output type override in the video job generation. does that mean that only x264.exe mkv output + muxing audio/subs with mkvmerge is supported. What happens if mencoder is used and / or another codec?
also, please increase the version number, and pm me links to sources and binaries.. I want to check out everything before it is made available to the general public.
berrinam
25th July 2005, 23:45
1) MP4 and MKV are interchanged because mp4 is sometimes removed and added to the list (for snow), and I didn't want that stuffing up the order. As mkv should be compatible with every codec, I moved it further up.
2) I forgot to add it when I ported the mkvmerge code from 2.1.3 to 2.1.4 :( I have put the change at the end of this post (it is only two extra lines).
3) Autoencodewindow sets the muxtype variable and then sends that to videoutil in the generateJobSeries function. VideoUtil in turn calls jobutil, hence the problem.
4) I'm not sure what you mean by an output type override ... I just mimicked the way mp4 and avi jobs are handled. For mencoder encoding, it will be saved as avi, then muxed into mkv (copying the style of mp4 muxing, through raw files). This is probably sub-optimal, so I will change it in a moment to go through raw->mp4->mkv.
JobUtil change: in generateMuxJob(...), add if (type == MUXTYPE.MKV)
job.Commandline = gen.generateMkvmergeCommandline(mainForm.Settings.MkvmergePath, job.Settings,
job.Input, job.Output);
just before the return statement.
berrinam
26th July 2005, 00:00
Opps, it's still missing a section. I have justed posted the updated mp4muxer class, which also handles mkv muxing (and avi muxing).
Doom9
26th July 2005, 06:42
so I will change it in a moment to go through raw->mp4->mkv.That's just what I don't want.. two subsequent muxjobs.
berrinam
26th July 2005, 07:12
I understand the problems with matroska, however I don't like being limited to AAC audio when I have x264 video. This is why I implemented the matroska muxing. Maybe it should be limited to x264cli, though, and the other codecs only muxed through avi, with a big warning saying that this isn't using mkv native storage.
However, what IS wrong with having two subsequent mux jobs? We have multiple jobs for multiple video passes; it's similar conceptually. And I don't see (except for the extra job generation code it requires) how it can become an implementation problem. Have I missed something?
Doom9
26th July 2005, 08:50
it adds another layer that was never foreseen, and many places where changes have to be made. I've continued to work on the matroska code this morning and there's a bunch of things still left out, which just shows how hard it is to add support for something that the framework wasn't meant for. I'm at a point where I know that if Vorbis audio is to be supported, besides the trouble of not really being able to calculate the bitrate properly (even for the other codecs it's not going to be terribly accurate because there's no way of knowing the frame type distribution before encoding), I will have to rewrite the whole audio part yet again - the software is really meant for just AAC, and the MP3 addition is an ugly hack that now starts to interfere (e.g... you cannot configure two mp3 jobs even if you have matroska output, and I have a lingering suspicion I'll find more in the videoutil or jobutil class).
I'm not sure how mkvmerge handles other codecs in AVI, I presume it can store them natively so that won't be a problem.
berrinam
26th July 2005, 09:27
I'm not sure how mkvmerge handles other codecs in AVI, I presume it can store them natively so that won't be a problem.
I think mosu cleared that up just after your post:
AVI is quite ok for MPEG-4 part 2 (aka DivX etc). For AVC it has to be MP4 though.
And since that is the case, it seems that two muxing steps are not needed, except for mencoder-x264 output, so I guess that that should be disallowed.
Doom9
26th July 2005, 13:26
so I guess that that should be disallowed.Yup. I'll disable that on my way back home tonight. I think I'm pretty close on finishing the calculator now, just have to check, recheck and reckeck again all the numbers. And then I guess I have to add a lot of stats on overhead somehow because the calculations are more "putting your finger in the wind" rather than accurate.
berrinam
26th July 2005, 22:53
@Doom9: a few things that still need to be changed:
-DGIndex needs to be made minimized when it runs. I turned this off so that I didn't have to index the entire film. This is done by uncommenting line 617 of VideoUtil class (VideoUtil.createDGIndexProject()
-The mp4 (and mkv) muxing class is sending WAY too many updates to the log. Fix this by removing log.Append("MKVMerge update: ");
log.Append(frameNumber);
log.Append("\r\n");
from MP4Muxer.getMkvPercent (~line 494-6)
-OneClickWindow shows a popup (I used it for debugging) which it shouldn't. This is in line 1074 of OneClickWindow (the second last line of OneClickWindow.setUpJobs())
Doom9
26th July 2005, 23:06
more comments:
x264_only only includes mp4 output (videoOutputOpenButton_Click), it should also offer raw and mkv
theres a lot of conditional code in the calculator that I'm not too sure of. Basically the oly thing that can be disabled is anything that involves NeroAACSettings in snow mode, and anything that involves mp3settings in x264 mode.
the muxer also seems to "run away" at some point. I've just been debugging, and got a 0% message, but never got any higher values.
A bunch of shortcuts in the menu also seem to have mysteriously disappeared. And you can't have the same shortcut for two menu items ;) And to make them work, they have to be set.. using & to underline the subsequent char won't do.. (that paragraph has been taken care off)
I also had to work on the muxer.. if you mux an mp4 audio file, it's track 1 you're interested in, not 0..
berrinam
26th July 2005, 23:16
the muxer also seems to "run away" at some point. I've just been debugging, and got a 0% message, but never got any higher values.That could well be linked to a faulty commandline. I have used it, and it has always shown the progress correctly except when it couldn't handle the input files.
A bunch of shortcuts in the menu also seem to have mysteriously disappeared. And you can't have the same shortcut for two menu items ;) And to make them work, they have to be set.. using & to underline the subsequent char won't do.. (that paragraph has been taken care off)
I also had to work on the muxer.. if you mux an mp4 audio file, it's track 1 you're interested in, not 0..
Thanks for both -- didn't know about either.
Doom9
28th July 2005, 10:11
@TheBashar: I have found an approach of deleting done jobs that works for me: a setting in the options "remove successfully completed jobs". When a job is completed successfully, and there's no subsequent job linked, it will be removed. If the job in question is part of a series of jobs, then all previous jobs will be removed as well. Since I'm aborting a series of jobs at an error, basically you should only get in the position where all jobs of a series will be deleted if they have all been successfully completed. Naturally, I'd never activate this feature as I tend to redo parts of a series quite often as part of the development process, but you can activate it if you like. How does that sound?
MeteorRain
28th July 2005, 10:34
Doom9:
on MeGUI - x264 Codec Configuration - More - Quantizer Matrices, there's a mistake in the filter sentense?
the file-open dialog opened, it filter out all .txt file while the text below says "Quantizer Matrix File (*.cfg)"
i wonder if you write
filter = "Quantizer Matrix File (*.cfg)|*.txt" :o
Doom9
28th July 2005, 10:44
filter = "Quantizer Matrix File (*.cfg)|*.txt" No, it's a little different but almost ;)
TheBashar
28th July 2005, 12:22
a setting in the options "remove successfully completed jobs". When a job is completed successfully, and there's no subsequent job linked, it will be removed. If the job in question is part of a series of jobs, then all previous jobs will be removed as well.
Thanks Doom9. That sounds like a reasonable way to handle it. Any chance the setting can be made to alter the behaviour of the "Clear" button as opposed to being an automatic removal?
Oh, and thank you for the idiot-proofing. I read about the close during encoding prevention on your frontpage. Believe it or not, I've managed to do that a couple times now, so this idiot will be very glad to have that feature!
Thanks!
Doom9
28th July 2005, 12:39
Any chance the setting can be made to alter the behaviour of the "Clear" button as opposed to being an automatic removal?No, clear is really there to start with a clean slate and get around all the question boxes you get when trying to delete a job of a series of jobs. What you want to clear button to do will no longer be necessary as you'll never be in the situation of having properly finished jobs still in the queue when using the new setting. The only ones you might still have would be part of an aborted or errored series of jobs and I strongly believe that those should be kept until such time as the entire series has been successfully completed. You may think that's not necessary but there will be a time when you will be grateful that I didn't change this behavior.
TheBashar
28th July 2005, 20:03
You may think that's not necessary but there will be a time when you will be grateful that I didn't change this behavior.
Oh, I agree with you 100% there. That's a much safer way to go. In fact, by suggesting the "remove all successful" function as a user activated button instead of an automagic thing, I was leaning towards even safer yet.
Doom9
29th July 2005, 10:33
I think there's been a misunderstanding on what the calculator should do in the minimized mode. The only difference between codec specific and full mode is the codec selection and a limited container selection. But I'm already working on changing that, that way I can get my hands dirty with the conditional clauses as well. And I'm not so sure having two initializecomponent methods is such a great idea.. I've added a button, moved around some others, and there's a new checkbox in the settings.. all that needs to be in both versions.
berrinam
29th July 2005, 10:56
And I'm not so sure having two initializecomponent methods is such a great idea.. I've added a button, moved around some others, and there's a new checkbox in the settings.. all that needs to be in both versions. As far as I can see, there is no way around this. It seems certain that conditional code cannot be put inside the InitializeComponent method, as any changes to the gui in the designer will rewrite the method, losing the conditional code.
Mind you, I seem to be stuck with this conditional compiling. It seems there is no way to elegantly manage all the code. I haven't tried the visual inheritance idea you mentioned a while ago, because I'm not sure how this fits with the GUI designer. I thought that the GUI designer only managed forms in which all the elements are defined and handled within the class. However, I may be wrong. Is there a tutorial or reference on visual inheritance you can point me to?
Doom9
29th July 2005, 13:31
The only thing I have is in a study book for the MCAD certification. But, you can have a base class with certain base functionality, inherit from that and handle events from the base class as well. Basically any form you create is an instance of a visual inheritance.. it inherits from a base form that has a certain look and functionality (like maximize/minimize, closing the form, etc). You can override the events the base form generates (override OnClosing is one example.. I'm using that to prevent the program from closing when the X button in the main form is pressed and encoding is still under way.
MeteorRain
29th July 2005, 14:32
doom9:
sometimes, when x264cli encoder terminated in an irregular situation, the meGUI will still think the file has sucessfully encoded.
those things such as memory overflow will give a done result instead of error.
meGUI should check the final filesize before set the done state. if the file is 0byte, there must occurs errors.
regards
MeteorRain
stax76
29th July 2005, 15:56
As far as I can see, there is no way around this. It seems certain that conditional code cannot be put inside the InitializeComponent method, as any changes to the gui in the designer will rewrite the method, losing the conditional code.
you should never edit the designer generated code because either your changes will be overwritten by the code serializer or you break the deserializer.
I haven't tried the visual inheritance idea you mentioned a while ago, because I'm not sure how this fits with the GUI designer.
visual inheritance commonly means that you design a base class including child controls with the designer and use the designer as well for derived classes. Maybe it's a good solution for what you want to achieve. I found it rather troublesome in VS 2003 and since then never used it again and do fine without it.
Doom9
30th July 2005, 21:08
I've added the latest sources. I've tried compiling with csc, which works but the resulting binary crashes upon startup. I think it's because of the additional icon that I'm compiling as a resource in VS. Does anybody manage to compile that icon using csc? If so please let me know.. I'd like to include batch files for commandline compiling (there's already one but it produces an executable with the problem described).
stax76
30th July 2005, 23:25
I've added the latest sources. I've tried compiling with csc, which works but the resulting binary crashes upon startup. I think it's because of the additional icon that I'm compiling as a resource in VS. Does anybody manage to compile that icon using csc? If so please let me know.. I'd like to include batch files for commandline compiling (there's already one but it produces an executable with the problem described).
when you compile in VS 2003, doesn't show the output pane the exact compiler command-line? In VS 2005 btw project files are MSBuild based which is part of the .NET redistributable meaning project files can be compiled easily with the .NET redistributable.
Doom9
31st July 2005, 03:42
when you compile in VS 2003, doesn't show the output pane the exact compiler command-line? In VS 2005 btw project files are MSBuild based which is part of the .NET redistributable meaning project files can be compiled easily with the .NET redistributable.that is new to me.. I've never seen that, and compiling files as resources is very new... but you can dl the sources and if yuo have a working batch file, please share............
Doom9
4th August 2005, 20:47
grumpf.. somehow VS managed to kill the beautiful conditional GUIs.. it doesn't show half the GUI classes at all and thinks they're just code classes. I guess I shouldn't have moved a project around in conditional mode. Now I have to go back to the 0.2.1.7 release and port all changes as not being able to use the GUI editor is simply unacceptable.
Doom9
6th August 2005, 13:39
I've restored the source. Thank god the last release was still fully functional so it was a simple metter of replacing a couple of files.
berrinam
6th August 2005, 15:16
What is the situation with the todo-list? I presume auto deinterlacing is still wanted through the avisynthwindow? Does this mean automatically using Decomb's fielddeinterlace in all NTSC sources, as mezzanine said?
Is there anything else to work on?
Doom9
7th August 2005, 00:05
Does this mean automatically using Decomb's fielddeinterlace in all NTSC sources, as mezzanine said?Is that really good enough? I'm not sure
I've updated the todo list with one item.. besides that nothing comes to mind right now.
berrinam
7th August 2005, 01:08
Three bugs I've found:
1. MeGUI always deleted completed jobs, irrelevant of whether the checkbox was ticked in the settingsform. This can be fixed by changing line 3623 (the if statement at the end of MeGUI.markJobDone(StatusUpdate) to if (job != null && job.Status == (int)Job.JobStatus.DONE && job.Next == null && settings.DeleteCompletedJobs) The check for settings.DeleteCompletedJobs was missing.
2. If x264 reported an error with the [error] output, MeGUI ignored it, and flagged it as done, even though it was a broken encode. I can produce this sort of error by doing a second pass with more input frames than the first pass. This problem can be fixed by changing this if statement: if (log.ToString().ToLower().IndexOf("Syntax:") != -1
|| log.ToString().ToLower().IndexOf("unknown") != -1)from line 391-2, in VideoEncoder.x264Encoding to if (log.ToString().ToLower().IndexOf("Syntax:") != -1
|| log.ToString().ToLower().IndexOf("unknown") != -1
|| log.ToString().ToLower().IndexOf("[error]") != -1)
3. When opening an avs file, the output name will be auto-selected even if there is a first-pass profile selected, so no output wanted. A fix can be done by adding updateIOConfig(); to MeGUI.inputOpenButton_Click at the end of the if block.
DigitalDivide
7th August 2005, 02:50
Just a quick question for a noobie. Is it possible to use meGui to encode movies to .mkv and keep my AC3 stream intact without encoding it to AAC? It's really important to me that I have my AC3 :)
Thanks in advance!
berrinam
7th August 2005, 04:10
@DigitalDivide: Yes, it is possible. You have several options for doing this:
1) The OneClickWindow has the option 'Don't encode audio' which will skip the audio encoding stage and mux the original audio straight into mkv.
2) You can set up your video to encode, select mkv filetype, then click autoencode and check 'add additional content (audio, subs, chapters)' which will let you select the audio.
3) You can encode the video yourself (possibly using bitrate calculation from the MeGUI calculator), then mux it with either mkvmerge gui or the megui mkv muxer
berrinam
7th August 2005, 04:43
@Doom9: Is video cutting still out of the question? In the HDTV forum, GaveUp has written a small AC3 Cutter which he claims has no more than 48ms sync issues. Could this be combined with AviSynth cutting for video to allow for cutting?
and.... what is audio stream->pid mapping?
Doom9
7th August 2005, 13:04
@Doom9: Is video cutting still out of the question? In the HDTV forum, GaveUp has written a small AC3 Cutter which he claims has no more than 48ms sync issues.50ms is considered by many to be the start of visible a/v asynch so that's not really good enough. And in Europe, most digital TV broadcasts use MP2 audio, not AC3, so that would have to be handled as well (and in Japan they have a lot of AAC). Imho, the most appropriate way to handle cutting is an AviSynth AC3 source that decodes all available channels to PCM, and a BeSweet that accepts AviSynth as input (I've never tried). With that, you can have frame accurate cutting and no audible asynch.
what is audio stream->pid mapping?In a transport stream, a PID identifies a stream (audio or video), just like you have substream IDs in a VOB. So, if you have your TS, you need to know which PIDs are used for your audio and video in order to select them. It gets even more interesting if you've been recording the data from an entire transponder.. then you have multiple TV channels that you need to differentiate in between.
berrinam
7th August 2005, 13:22
2. If x264 reported an error with the [error] output, MeGUI ignored it, and flagged it as done, even though it was a broken encode.My bad. Although this sometimes means a broken encode, it is also used to signal non-fatal errors. A better error detection method is then needed.
Doom9
7th August 2005, 13:58
Although this sometimes means a broken encode, it is also used to signal non-fatal errors. A better error detection method is then needed.Not anymore.. a few versions back I introduced x264.exe exitcode checking. Exitcode 0 means all ok, anything below 0 means an error.. so even if the log doesn't contain anything I deem erroneous, if the exitcode is negative, the job is still marked as having an error and the queue is stopped accordingly.
berrinam
7th August 2005, 14:02
Well, that method of checking didn't pick up on the error I described earlier about there being more frames in second pass than first pass. I suppose this just becomes an x264 issue then, not a MeGUI issue.
Doom9
7th August 2005, 14:41
does x264 report anything wrt to that error, and in stdout or stderr? I really only can check for specific messages in the output and exit codes..
Siku
7th August 2005, 22:50
@Doom9
There might be a bug in the birate calculator. I tried to calculate the bitrate using storage media: DVD-5 and the bitrate is way too low. The movie's lenght is 86 minutes and MeGUI's bitrate calculator gives me bitrate of 619 kbps. See the screenshot here (http://personal.inet.fi/koti/kettunen/megui_bitratecalc.jpg). I'm using the latest version of MeGUI (0.1.8.2a).
Regards,
Siku
Doom9
7th August 2005, 23:14
That bad feeling I had in my stomach pit turned out to be correct: I was scared when I saw the length and target size, and rightfully so: the size of a DVD-5 in bytes doesn't fit a 32 bit integer. And by default, overflows are not thrown as errors but the values are silently truncated. This affects 2 out of 3 operation modes besides the calculator so there won't be an immediate fix. Considering that you should get a bitrate around 7 mbit for your parameters, I'm hoping you're doing 1080p content.. if not, I'd rethink my target size.
And by the way, and that goes for everyone, this thread is really meant for developers, you should use the other one for anything else including error reports.
berrinam
7th August 2005, 23:32
Siku's bug confirmed here. It appears to be due to the filesize in bytes being larger than 2^32 (it should probably be held as a long, not an int).
About the x264 error message mentioned earlier, according to MeGUI's log, it is this message:x264 [error]: More input frames than in the 1st pass While this error is not fatal (it encodes all the frames that the first pass encoded, then stops), it may result in largely undersized files depending on how many more frames there are in the second pass than in the first.
EDIT: Another message it produces is Assertion failed: frame >= 0 && frame < rc->num_entries, file encoder/ratecontrol.c, line 482
berrinam
7th August 2005, 23:34
Didn't see your message until after I posted
And by the way, and that goes for everyone, this thread is really meant for developers, you should use the other one for anything else including error reports.
Does that include bugfixes?
Siku
7th August 2005, 23:45
Considering that you should get a bitrate around 7 mbit for your parameters, I'm hoping you're doing 1080p content.. if not, I'd rethink my target size.
I was just playing around with that bitrate calculator. I wasn't really about to encode the video at that file size or bitrate. Just thought to help you out and report this issue...
Cheers,
Siku
Doom9
7th August 2005, 23:57
I'll add error and failed to the keyword search for errors then. But if those report an exitcode of 0, you probably need to tell aku about this as well.
Does that include bugfixes?buxfixes mean code, don't they? and code is as development as it gets.
berrinam
9th August 2005, 00:19
More cosmetics:
When rerunning and already completed job (eg if it had an error or something), the finishing time and fps columns are not blanked out as they should be, because they no longer apply when the job is being rerun. To fix, go to MeGUI.startEncoding, and find the line item.SubItems[6].Text = DateTime.Now.ToLongTimeString();Follow this by item.SubItems[7].Text = "";
item.SubItems[8].Text = "";
When a zone is set from the VideoPlayer window, it seems natural that the old zone start and zone end values should be cleared. Do you agree? If yes, then change if (zoneEnd > zoneStart)
ZoneSet(this.zoneStart, this.zoneEnd); in VideoPlayer.setZoneButton_Click to if (zoneEnd > zoneStart)
{
ZoneSet(this.zoneStart, this.zoneEnd);
this.zoneStart = -1;
this.zoneEnd = -1;
setTitleText();
}
Doom9
13th August 2005, 00:30
I've updated the sources as well. I think all currently open issues should be taken care off (safe perhaps a feedback dialog if you press abort, although I'm not sure I want to help with that stupid user error at all).. I seem to recall some mkv thing though (language related I think) but I seem unable to locate it. Am I dreaming?
berrinam
13th August 2005, 00:42
The mkv language problem is here (http://forum.doom9.org/showthread.php?p=695162#post695162)
Doom9
13th August 2005, 00:55
oh well.. no log no support, right? I have found the problem though but if he had posted his log, the fix would've made it into the current release, not the next one.
berrinam
13th August 2005, 00:55
There seems to be a problem with first-pass-filename bugfix in 2.1.9. It doesn't appear fixed in the compiled MeGUI I downloaded, but when I compiled the sources myself, it worked. Is that bugfix missing from the compiled version?
Doom9
13th August 2005, 00:58
hmm.. the attachment has 0 views, so it's kinda hard for you to have downloaded it.. I think you got the old build that I replaced few minutes after first posting.. the build time should be 00:37
berrinam
13th August 2005, 01:03
Weird... I downloaded it again and it still showed as 0 downloads.
Anyway, the problem is fixed in the new download, so I don't know what was going on, because the last download had all of the other bugfixes listed.
leowai
17th August 2005, 15:38
by the way, does anybody feel like creating a 16x16 and 32x32 icon? a "minimize to system tray" functionality would kinda need a 16x16 icon (which is then also used in the upper left corner of the app), and the 32x32 version would be used for shortcuts on your desktop.
I did the icons [32 & 16] for MeGUI. Use it if you found this is better than other ppl's... :sly:
Keep on the nice work. :thanks:
[edit]
I found red colour of "GUI" text is more sexy. Uploaded another ferrari version. :p
MeteorRain
18th August 2005, 18:08
i just change it to satisfy myself using.
if you like these changes, apply it on your src code ;)
x264ConfigurationDialog.cs
private void x264CustomQuantizer_SelectedIndexChanged(object sender, System.EventArgs e)
{
x264QuantizerFileLoadButton.Enabled = false;
// x264QuantizerMatrixFile.Text = "";
if (x264CustomQuantizer.SelectedIndex == 2) // custom
{
x264QuantizerFileLoadButton.Enabled = true;
}
showCommandLine();
} <-- no need to clear the textbox i think. when you want to switch between matrixes, it'd be a pain.
Form1.cs - UpdateGUIStatus
if (pw != null)
{
pw.IsUserAbort = false; // ensures that the window will be closed
pw.Close();
}
this.Text = "Completed - " + su.JobName + " - MeGUI 0.2.1.9";
===========================================================================
catch (Exception e)
{
logBuilder.Append("Exception when trying to update status while a job is running. Text: " + e.Message + " stacktrace: " + e.StackTrace);
this.log.Text = logBuilder.ToString();
}
this.Text = (double)((int)(su.PercentageDoneExact * 100)) / (double)100 + " % - " + su.JobName + " - MeGUI 0.2.1.9";
this.jobProgress.Value = su.PercentageDone;
<-- add status display in the main window. and btw, you should save the 'MeGUI #ver' in a constant, and append it when needed.
and as well, i delete the 'abort' button in the progresswindow LOL just to make it safer because
i can't garantee my mouse always works correctly when i move my mouse at a fast speed. (it'll lose its position, and will go to some strange place sometime orz)
Regards!
Doom9
18th August 2005, 19:03
@leowai: thanks, but I have a real hard time reading that.. I think for icons it's better to just use graphical stuff and no text, which, even at 32x32 is almost impossible to read unless you turn the background white.
@MeteorRain: whats the point of your first change? the index changed event is only fired if the index actually changes, and it's logical to blank out the filename if you select a mode where no custom quantizer matrix will be used. displaying a file even if no custom quantizer matrix is selected misleads people into thinking they are still using a custom quantizer matrix. there's no way you can accidentally change that dropdown, so when you do this willingly, you willingly override a configured matrix.
what is green? new line? modified line? I suppose new. I don't consider that too useful either. When encoding is complete, the progress windows will have disappeared. Plus, I know why you put the percentage first.. but that goes against what people expect from the taskbar (it's icon, program name).. what's that program with the name "54.32% - Job12-3 " ? And MeGUI might move to the tray while encoding in future versions anyway.
MeteorRain
18th August 2005, 20:15
i said i just make it more satisfying for my use.
first is, when i tests custom matrix, i have to save the matrix path+filename in notepad, and keep copying and pasting when i want to switch between custom and default one. or alternatively, you can just hide the textbox, or disable it. but plz don't clean it, becuz it's useful in future encoding.
second is, when i enable the status window, there'll be 2 windows in my taskbar, cost too many space. and i can't hide the main window and only leave the status window there. so i do the opposite, show brief status on the title, and close the status window.
if one is familar with MeGUI, he'll always know what does "54.32% - Job12-3 " mean in his taskbar. i just make it behaviors like VDM.
i post these codes just becuz i (imho) think they bring convenient to ppl. use or not depends on you.
Doom9
18th August 2005, 21:00
first is, when i tests custom matrix, i have to save the matrix path+filename in notepad, and keep copying and pasting when i want to switch between custom and default one. or alternatively, you can just hide the textbox, or disable it. but plz don't clean it, becuz it's useful in future encoding.I don't get it. copy and paste what?
leowai
19th August 2005, 04:46
@leowai: thanks, but I have a real hard time reading that.. I think for icons it's better to just use graphical stuff and no text, which, even at 32x32 is almost impossible to read unless you turn the background white.
Welcome. :D
True, because of the transparent background of the texts. However, text based icon is the first (and the only) ideal come into my mind.
Graphical icons... If only if I come across some new ideal for it, I'll make another icon for MeGUI again. :)
MeteorRain
19th August 2005, 05:34
I don't get it. copy and paste what?
the matrix file path and filename.
i'm just testing the difference between flat and some custom matrix so i need to switch between them. that's why i have to keep c&ping.
winxp saves path for opendialog, and thus i have to jump from the path of video and the path of matrix to load the avs and custom matrix. that made me painful
berrinam
19th August 2005, 14:23
I have made and listed the changes required to signal the AR instead of resizing in AviSynth for it (discussed briefly in the MeGUI thread). They are quite long, listed here:
Firstly, there is a bugfix:
OneClickWindow crashed if using matroska but encoding audio. To fix, change else if (containerFormat.SelectedIndex == 2) // mp4 in OneClickWindow.projectCreationFinished to else if (containerFormat.SelectedIndex == 1 ||
containerFormat.SelectedIndex == 2) // mkv or mp4
Now the AR signalling:
To enable proper AR signalling in all cases I am aware of, it is done it two ways:
Signal via the codec if not Snow
Signal via the container if matroska
If the container is not matroska and the codec is snow, then signalling is not possible, and there is an error message.
changes:
VideoUtil.suggestResolution method is changed to
public static int suggestResolution(double readerHeight, double readerWidth, double customDAR, CropValues cropping, int horizontalResolution,
bool signalAR, out int SARX, out int SARY)
{
double sourceHorizontalResolution = readerHeight * customDAR - (double)cropping.left -(double)cropping.right;
double sourceVerticalResolution = readerHeight - (double)cropping.top - (double)cropping.bottom;
double realAspectRatio = sourceHorizontalResolution / sourceVerticalResolution; // the real aspect ratio of the video
realAspectRatio = getAspectRatio(realAspectRatio);
double resizedVerticalResolution = (double)horizontalResolution / realAspectRatio;
int scriptVerticalResolution = 0;
int temp = (int)(resizedVerticalResolution / (double)16);
int upper = (temp+1) * 16;
int lower = temp * 16;
if ((double)upper - resizedVerticalResolution > resizedVerticalResolution - (double)lower) // Which one is closer to the resolution we should have
scriptVerticalResolution = lower;
else
scriptVerticalResolution = upper;
if (signalAR)
{
int displayVerticalResolution = (int)Math.Round(resizedVerticalResolution);
sourceVerticalResolution = readerHeight - cropping.top - cropping.bottom;
temp = (int)(sourceVerticalResolution / (double)16);
upper = (temp+1) * 16;
lower = temp * 16;
if ((double)upper - resizedVerticalResolution > resizedVerticalResolution - (double)lower) // Which one is closer to the resolution we should have
scriptVerticalResolution = lower;
else
scriptVerticalResolution = upper;
SARX = horizontalResolution;
SARY = displayVerticalResolution;
return scriptVerticalResolution;
}
else
{
SARX = 1;
SARY = 1;
return scriptVerticalResolution;
}
}
OneClickWindow has a checkbox added (called signalAR). I put it next to the AR textbox, but that obviously is not important. It has a checkedChanged event as follows:
private void signalAR_CheckedChanged(object sender, System.EventArgs e)
{
if (signalAR.Checked && videoCodec.SelectedIndex == 2 && containerFormat.SelectedIndex != 1)
{
MessageBox.Show("Can't signal AR with Snow except with Matroska container", "AR signalling not possible", MessageBoxButtons.OK, MessageBoxIcon.Error);
signalAR.Checked = false;
}
}
OneClickWindow has the following new variables:
private int outputSARX;
private int outputSARY;
The suggestResolution call in OneClickWindow.openVideo needs to be changed to:
int scriptVerticalResolution = VideoUtil.suggestResolution(reader.Height, reader.Width, Double.Parse(customDAR.Text), AutoCropValues, (int)horizontalResolution.Value, signalAR.Checked, out outputSARX, out outputSARY);
The generateJobSeries call at the end of OneClickWindow.setUpJobs needs to be changed to vUtil.generateJobSeries(videoInput, videoOutput, muxedOutput, videoSettings,
aStreams, audio, subtitles, chapters, desiredSize, splitSize, containerOverhead,
type, outputSARX, outputSARY, signalAR.Checked);
VideoUtil.generateJobSeries gets three new variables passed to it, so the prototype becomes: public void generateJobSeries(string videoInput, string videoOutput, string muxedOutput, VideoCodecSettings videoSettings, AudioStream[] aStreams,
SubStream[] audio, SubStream[] subtitles, string chapters, long desiredSize, int splitSize, double containerOverhead, MUXTYPE muxtype,
int SARX, int SARY, bool signalAR)This code is added in the function just after the encoding mode (automated 2pass) is set: // Signal the AR
if (signalAR)
applyAspectRatio(SARX, SARY, videoSettings);(The function this references will be given later). The muxjob generation within this function (inside the if (doMux) block) is changed from mjob = jobUtil.generateMuxJob(vjobs[vjobs.Length - 1], audio, subtitles, chapters, muxtype,
muxedOutput);[code] to [code] mjob = jobUtil.generateMuxJob(vjobs[vjobs.Length - 1], audio, subtitles, chapters, muxtype,
SARX, SARY, muxedOutput);
VideoUtil gets another function (referenced in the above code): /// <summary>
/// applies the given fractional aspect ratio to the video settings if possible
/// </summary>
/// <param name="SARX">the x part of the AR</param>
/// <param name="SARY">the y part of the AR</param>
/// <param name="settings">the video settings to be modified</param>
/// <returns>true if succeeded, false if failed</returns>
public static void applyAspectRatio(int SARX, int SARY, VideoCodecSettings settings)
{
// Snow is ignored, because it does not support AR signalling
if (settings is lavcSettings)
{
lavcSettings temp = (lavcSettings) settings;
temp.SARX = SARX;
temp.SARY = SARY;
}
else if (settings is x264Settings)
{
x264Settings temp = (x264Settings) settings;
temp.SARX = SARX;
temp.SARY = SARY;
}
else if (settings is xvidSettings)
{
while (SARX > 255 || SARY > 255) // XviD needs SARX <= 255 and SARY <= 255
{
SARX = SARX / 2;
SARY = SARY / 2;
}
xvidSettings temp = (xvidSettings) settings;
temp.SARX = SARX;
temp.SARY = SARY;
temp.PAR = 5;
}
}
There need to be some changes made to add AR to the muxing info for matroska. MuxSettings gains two variables and two properties: private int sarX, sarY; and /// <summary>
/// SARX (only for Matroska)
/// </summary>
public int SARX
{
get {return sarX;}
set {sarX = value;}
}
/// <summary>
/// SARY (only for Matroska)
/// </summary>
public int SARY
{
get {return sarY;}
set {sarY = value;}
} and inside the constructor: sarX = -1;
sarY = -1;JobUtil.generateMuxJob gains two input variables, to get the following prototype: public MuxJob generateMuxJob(VideoJob vjob, SubStream[] audioStreams, SubStream[] subtitleStreams,
string chapterFile, MUXTYPE type, int SARX, int SARY, string output)It gains the following two lines of code: job.Settings.SARX = SARX;
job.Settings.SARY = SARY;They can basically go anywhere before the commandline is generated. The first line of CommandLineGenerator.generateMkvmergeCommandline becomes the following four lines: string retval = "\"" + mkvmergePath + "\" -o \"" + output + "\" ";
if (settings.SARX > 0 && settings.SARY > 0)
retval += "--aspect-ratio 0:" + settings.SARX + "/" + settings.SARY + " ";
retval += "-A -S \"" + input + "\" ";The call to generateJobSeries at the end of AutoEncodeWindow.queueButton_Click becomes vUtil.generateJobSeries(videoInput, videoOutput, muxedOutput.Text, this.videoSettings.clone(), aStreams, audio, subtitles, chapters, desiredSize, splitSize,
(double)containerOverhead.Value, type, -1, -1, false);AviSynthWindow.suggestResolution_CheckedChanged needs to have the call to suggestResolution replaced by the following three lines: int sarx, sary; // Not needed for AviSynthWindow resizing
int scriptVerticalResolution = VideoUtil.suggestResolution(reader.Height, reader.Width, Double.Parse(customDAR.Text),
cropping, (int)horizontalResolution.Value, false, out sarx, out sary);When attempting to compile, there should now be four (I think, maybe I miscounted) compile-time errors which are due to the changed JobUtil.generateMuxJob prototype. To fix these, add the parameters -1, -1 just before the muxed output (the last) parameter.
After all this work, there should now be working AR signalling. A lot of little changes, huh? Upon testing, this seems to work with each configuration except for:
-Snow not in Matroska (it doesn't have any way to signal AR)
-XviD not in Matroska (the mencoder XviD AR signaling seems to be broken for custom PARs)
berrinam
19th August 2005, 14:39
Just testing again with all the changes listed above, and x264 in mkv seems to be temporarily broken. I have found the problem, and will have solved it in a moment (it is to do with x264.exe's problems with signalling sar in mkv output. I plan to make mkv output go through x264.exe's mp4, and then muxed into mkv).
EDIT: Here is the fix: In OneClickWindow.setUpJobs, inside the MKV if block, change else
videoOutput += ".mkv"; to else
videoOutput += ".mp4";
Doom9
19th August 2005, 20:27
about the fix: this effectively enforces AAC audio for MKV output, does it not? The output type should depend on the profile selected (there may or may not be Vorbis support one day). Until recently, the autoencode window would not properly support all types for matroska either but I changed that so any configured mp3 and aac stream should be taken into account.
-XviD not in Matroska (the mencoder XviD AR signaling seems to be broken for custom PARs)Can't we work with the profiles XviD offers?
-Snow not in Matroska (it doesn't have any way to signal AR)I don't quite get that.. you're adding the aspect ratio when muxing, so why can't it be applied ?
And for those codecs that support signalling on stream level: wouldn't it be better to rely on that?
VideoUtil.generateJobSeries gets three new variables passed to it, so the prototype becomes:Why is that necessary if we can signal on a video stream level? you could apply the signalling to the VideoCodecSettings object prior to calling generateJobSeries, could you not?
berrinam
19th August 2005, 22:36
Can't we work with the profiles XviD offers?I suppose so. I'm not sure what the differences between PAL 16:9 and NTSC 16:9 are, though.
I don't quite get that.. you're adding the aspect ratio when muxing, so why can't it be applied ?That was a typo; I meant "snow when not in matroska"
And for those codecs that support signalling on stream level: wouldn't it be better to rely on that?I do that as well, however I found that when put into the matroska contaienr, the aspect ratio would be overridden by matroska's default (square pixels) unless it was explicitly specified. I do both just to be more sure that it works.
about the fix: this effectively enforces AAC audio for MKV output, does it not?Yes it does. I was going on the reasoning that, like MP4, if you have a choice between mp3 and aac, you would be stupid to go with mp3.
Doom9
19th August 2005, 23:20
if you have a choice between mp3 and aac, you would be stupid to go with mp3.Not everybody has nero...
the aspect ratio would be overridden by matroska's default Is there no way to change that? I'd rather not expand pars (a dying concept by the way.. HD doesn't require the anamorphic trick) all over the place.
Doom9
20th August 2005, 00:40
I've upped the latest sources.
MeteorRain
21st August 2005, 09:52
about the percentage display on the title:
>> string percentage = su.PercentageDoneExact.ToString("##.##");
the result displays ugly i think....
it gives ".1%" if it's 0.10%
and btw, add "-" between the items maybe better, like "MeGUI Version - Jobx - x.xx%" instead of "MeGUI jobxx .xx%"...
yeah, you forgot to add the version here :o
and i still suggest the title being "x.xx% - Jobx - MeGUI Ver", becuz more ppl have more interests on the progress, instead of the name of the program :rolleyes:
i use: this.Text = (double)((int)(su.PercentageDoneExact * 100)) / (double)100 + " % - " + su.JobName + " - MeGUI " + version;
regards!
Doom9
21st August 2005, 14:25
it gives ".1%" if it's 0.10%who cares? I don't.
and btw, add "-" between the itemsIt eats up more space. The way it is now, unless you have so many items in the taskbar that the items get resized, you can just see MeGUI, job name and completion percentage. I left the version number because you cannot see it and quite frankly it's more than sufficient to see it while you're not encoding. And if the items are resized, then the program name is the last thing to go so you always know which program is running.. this is way more important than how far it is along.. if you want to know that and the item is so small that the percentage is cut off, you can always hover over it with the mouse.
And by the way, a double has a considerable number of digits behind the dot.. so your code ends up in 10.23512453536425356323434 - jobX - MeGUI version.. not pretty.
Either way you can argue all you want here, I think you should be grateful that I did anything at all instead of further complaining and I will not change this, I've gone through two revisions and I like it the way it is now.
MeteorRain
21st August 2005, 17:01
OK, you go ahead ;)
but, the code written above will never cause such things like "10.23512453536425356323434". i think you missed the "(int)" in the code XD
thanks!
MeteorRain
Doom9
21st August 2005, 21:30
@berrinam: here's an idea I've been having about the whole custom AR thing: we have sarx/sary in VideoCodecSettings for every codec. 3 out of 4 codecs support stream level signalization, but there's nothing preventing us from using these flags for snow as well. That done, JobUtil.generateMuxJob could have a look at the sar settings of the VideoCodecSettings object it gets as an argument, and if a custom AR is set, set it for the mux job. That way, no new variables have to be added anywhere, and method calls can remain the same. The only place where variables would have to be added is the MuxJob, and those could be reused if the muxer ever gets AR signalling capability.
yami
22nd August 2005, 03:34
hi, i'm ready to rip dvd to x264
when i use pass=1 , its ok.
but when i change to pass=2
i got this
avis [info]: 720x480 @ 29.97 fps (124510 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
mp4 [info]: initial delay 100 (scale 2997)
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
Assertion failed: frame >= 0 && frame < rc->num_entries, file encoder/ratecontro
l.c, line 482
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
other parameter "--bitrate 1024 --stats "2pass.log" --bframes 3 --analyse p8x8,b8x8,i4x4 --qpstep 1 --progress "
is it movie's problem or x264 bug ?
thx u .
hellfred
22nd August 2005, 08:45
hi, i'm ready to rip dvd to x264
when i use pass=1 , its ok.
but when i change to pass=2
i got this
avis [info]: 720x480 @ 29.97 fps (124510 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
mp4 [info]: initial delay 100 (scale 2997)
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
Assertion failed: frame >= 0 && frame < rc->num_entries, file encoder/ratecontro
l.c, line 482
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
other parameter "--bitrate 1024 --stats "2pass.log" --bframes 3 --analyse p8x8,b8x8,i4x4 --qpstep 1 --progress "
is it movie's problem or x264 bug ?
thx u .
It means, that the source of the second passs contains more frames than frames have been analysed in first pass. Check the stats file from first pass, look for the frame count, compare it to the number of frames, and redo the first pass, untill it has sufficient frames in the stats file.
Hellfred
Doom9
29th August 2005, 13:54
I think I figured out a way to get commandline compilation working again but I need some time to test it. compilation won't be a one liner anymore but since I'll provide batch files that won't matter.
@berrinam: any comments on my AR suggestions?
P.S. I've upped the latest sources.
Sharktooth
29th August 2005, 17:15
What about setting up a SVN repository for megui source on doom9.org? Is it possible? It would be much easier (at least for me) to help or contribute.
Doom9
29th August 2005, 18:23
I wouldn't even know how.. and considering there's mainly two guys working on this, patches work out just fine and I won't have to bother checking in and out all the time (I often develop offline with no Internet access (Internet via cellphone is both too expensive and too slow), so I'd check out everything anyway and keep it checked out until the next version.
berrinam
30th August 2005, 08:22
I had done the signalling bit the way you suggested a few days ago, and it is so much easier. I had been stuck on the XviD bit for a while, and I have now written it, thanks to SeeMoreDigital's guide. I kept the XviD rounding bit separate, so that you can apply it without applying the XviD bit, because I'm not convinced it is the best way to handle XviD. However, it seems to work, and with Matroska, there don't seem to be problems with any of the codecs. Enough introduction, here are the changes:
The first four changes I mentioned before stay the same (the ones about suggestResolution and its calls, up to and including the suggestresolution call in OneClickWindow).
in OneClickWindow.setUpJobs, add videoSettings.SARX = outputSARX;
videoSettings.SARY = outputSARY; just after the call to openVideo (it's close to the end).
Add to MuxSettings private int sarX, sarY; and sarX = -1;
sarY = -1; in the constructor and the following properties: /// <summary>
/// The SARX value to be used for muxing (-1 means it isn't used)
/// </summary>
public int SARX
{
get {return sarX;}
set {sarX = value;}
}
/// <summary>
/// The SARY value to be used for muxing (-1 means it isn't used)
/// </summary>
public int SARY
{
get {return sarY;}
set {sarY = value;}
}In jobUtil.generateMuxJob, add job.Settings.SARX = vjob.Settings.SARX;
job.Settings.SARY = vjob.Settings.SARY; (obviously before the call to generateCommandline).
CommandlineGenerator.generateMkvmergeCommandline should be changed in an identical way to my previous post, ie changing the first line into the following four: string retval = "\"" + mkvmergePath + "\" -o \"" + output + "\" ";
if (settings.SARX > 0 && settings.SARY > 0)
retval += "--aspect-ratio 0:" + settings.SARX + "/" + settings.SARY + " ";
retval += "-A -S \"" + input + "\" "; AViSynthWindow has the suggestResolutionWindow call in suggestResolution_CheckedChanged replaced, in an identical way to last time: replace the old call with these three lines: int sarx, sary; // Not needed for AviSynthWindow resizing
int scriptVerticalResolution = VideoUtil.suggestResolution(reader.Height, reader.Width, Double.Parse(customDAR.Text),
cropping, (int)horizontalResolution.Value, false, out sarx, out sary);
This should work fine except for XviD. As I mentioned earlier, XviD doesn't seem to work on custom PARs, so a rounding function needs to be implemented. This can be done (I'm not sure that this is the best way, but it seems to work) by the following: Add the following method to OneClickWindow: private int roundPAR()
{
double par = (double)outputSARX * (double)height / (double)width / (double)outputSARY;
double[] pars = {1, 1.090909, 1.454545, 0.090909, 1.212121};
double minDist = 1000;
int closestIndex = 0;
for (int i = 0; i < pars.Length; i++)
{
double first = Math.Max(par, pars[i]);
double second = Math.Min(par, pars[i]);
double dist = first - second;
if (dist < minDist)
{
minDist = dist;
closestIndex = i;
}
}
return closestIndex;
}Add the following two lines to OneClickWindow.setUpJobs after those we added earlier (the ones after the call to openVideo): if (videoSettings is xvidSettings && outputSARX > 0 && outputSARY > 0)
((xvidSettings)videoSettings).PAR = roundPAR();Add the private ints width and height to OneClickWindow, and initialize them in the openVideo method after the call to suggestResolution like this: this.width = (int) horizontalResolution.Value;
this.height = scriptVerticalResolution;This takes the resolution and rounds it to one of the 4 custom ones for XviD. It may cause some aspect distortions, but everything should be fine when using matroska.
MeteorRain
30th August 2005, 11:30
Not Found
The requested URL /MeGUI-src-0.2.2.3.zip was not found on this server.
Apache/2.0.54 (Debian GNU/Linux) mod_fastcgi/2.4.2 PHP/4.3.10-16 Server at forum.doom9.org Port 80
:o:o
berrinam
30th August 2005, 12:22
Same for me -- I built my changes on 2.2.1 sources.
Doom9
30th August 2005, 12:48
it's 0.2.2.3a ;)
berrinam
1st September 2005, 13:46
@Doom9: Just wondering whether you saw my above patch using your suggestion for AR signalling.
Doom9
1st September 2005, 18:15
yup I saw it.. but I'm swamped at work so I haven't really gotten around to reviewing it. Sorry :(
berrinam
1st September 2005, 22:02
No problem... I just thought it might have been lost in the thread.
Marsu42
4th September 2005, 02:36
Your GUI is very promising, it might save much time that otherwise would be spent with click-and-wait procedures. Now, I finally decided to register @Doom9 to put up my wishlist :->. I am btw aware that this is not as helpful as contributing source code...
And while I am at it, maybe you could put a list of known bugs and upcoming features into the distribution archive to prevent redundant reports (the forum posts are already too vast).
Anyway, I'm posting a list of showstoppers that are the reason for me not using MeGUI (0.2.2.3a) yet, things that a manual encode using an oag machine and virtualdub combination is able to do:
audio (like in oag machine):
1.1. 44.1 kHz downsampling via ssrc (besweet -shibatch(--rate 44100) switch)
1.2. ac3 dynamic compression strength selection (azid -c light/normal/heavy switch)
video:
2.1. xvid custom matrices (like in xvid vfw gui)
2.2. import chapters as zones (like in chaptergrabber/kfe)
2.3 set keyframe on chapter start (like chaptergrabber/kfe, statsreader)
2.4. auto-set intro and credits as zones w/o keyframe
2.5. remove closed gop for xvid 1.1 (not really necessary since it's likely to be ignored anyway)
queue:
3.1. unique names for 2/3-pass stats files for later re-encode w/ other bitrate or curve (like in gordian knot)
3.2. unique names for besweet log files
3.3. bug: when manually encoding to mkv w/ xvid 1st pass only, a mux job is created that breaks the queue
3.4. bug: intermediate xvid avi is not deleted after 2nd pass muxing step
muxing:
4.1. import of vobsub subtitles (sub/idx) in addition to srt (like mkvmerge >=1.5.0)
4.2. option to create intermediate avi/mp4 on/in another temp partition/directory for muxing speed
tuning:
5.1. option to delete incomplete output on abort and skip creation if it already exists
5.2. possibility to re-schedule queue tasks on abort (like virtualdub)
5.3. finer grained task priority setting, esp. "lower than normal" (like virtualdub)
clarifications:
6.1. audio->config: "increase volume automatically" seems to mean normalization, might be mixed up w/ compression
6.2. settings->automated encoding: "overwrite" and "keep" seem to be mutually exclusive?
6.3. settings->automated encoding: add "max." word to "passes", since xvid only supports 2
berrinam
4th September 2005, 10:56
@Marsu42: Some useful points there, thank you, and welcome to this forum. However, I suspect (it's Doom9's decision, of course) that comments like these would be wanted on the main MeGUI thread, as opposed to here.
And while I am at it, maybe you could put a list of known bugs and upcoming features into the distribution archive to prevent redundant reports (the forum posts are already too vast).This is probably not useful/feasible/possible, because at the moment, any bugs found are fixed by the next release. What's the point of the upcoming features? If you are that eager, you could just read the last few posts of this thread, or just wait until they arrive.
Anyway, I'm posting a list of showstoppers that are the reason for me not using MeGUI (0.2.2.3a) yet, things that a manual encode using an oag machine and virtualdub combination is able to do:Of course, MeGUI will probably never be able to match the features of every individual program out there, simply because there are too many programs, and the GUI is designed to be easy to use, and not crowd the user with settings.
2.4. auto-set intro and credits as zones w/o keyframeI believe this is already being done, but hidden from the user.
3.4. bug: intermediate xvid avi is not deleted after 2nd pass muxing stepNot a bug. What happens if the user wants to keep it? Perhaps it should be up to the user what the program does, a la GK, perhaps not.
4.2. option to create intermediate avi/mp4 on/in another temp partition/directory for muxing speedIs this actually possible with mp4box, mkvmerge and/or mencoder?
5.2. possibility to re-schedule queue tasks on abort (like virtualdub)I believe this is already done in MeGUI (you can set it back to "waiting" or "postponed" by double-clicking on the job)
6.2. settings->automated encoding: "overwrite" and "keep" seem to be mutually exclusive?Not true; the first option is to overwrite the stats file, whereas the second option is about keeping the video output.
6.3. settings->automated encoding: add "max." word to "passes", since xvid only supports 2That's also ambiguous, because that could imply that the program spuriously decides not to do a third pass.
The rest of the points are good, thanks for the feedback. Of course, this being a free program, it may take a while for them to be implemented, or they may be decided against, but the feedback is welcome never-the-less.
@Doom9: I still can't find the sources.
Doom9
4th September 2005, 13:02
1.1. 44.1 kHz downsampling via ssrc (besweet -shibatch(--rate 44100) switch)over my dead body. No program of mine will ever allow you to do that. This will only change if there's a specific hardware device I'm targeting which cannot handle 48 KHz.
1.2. ac3 dynamic compression strength selection (azid -c light/normal/heavy switch)And what's next? There's a long list of features BeSweet still can offer. Hardwar players use normal DRC so it's the reasonable setting.
I guess I could stop here because you call all these showstoppers (I call them minor issues at best, MeGUI works fine for my purposes and apparently a lot of other people).
2.1. xvid custom matrices (like in xvid vfw gui)It is supported, sorta. It's not my fault that mencoder cannot handle its own syntax on the windows platform (it uses the double dot as option separator, and to specify a custom quantizer matrix path, you just need a double dot for the drive letter). However, that problem will go away once I incorporate encraw as xvid encoder.
2.2. import chapters as zones (like in chaptergrabber/kfe)I'm pretty sure you're completely oblivious to the fact that as it is now, no of the 4 supported codecs in MeGUI can start a zone with an I-frame. So what is the point? Personally, even when it's possibly, I find it a useless thing to do. Both standalone players as well as DirectShow filters can jump to any point in the video without requiring it to be a keyframe, so it's better to let the SCD do its job rather than force keyframes upon it. As chapterpoints tend to be at cut points anyway, chances are good your chapters will start with a keyframe anyway. Only encraw will offer zones that start with an I-frame, at which point the zone feature set of XviD will be revisited.
2.5. remove closed gop for xvid 1.1 (not really necessary since it's likely to be ignored anyway)You can THAT a showstopper? Jesus am I glad you're not my boss, I'd quit in an instant, and not so far in the future the company would go bankrupt - we deal with problems a million times major than this every day, and have to find our ways around them in a way. This is cosmetics, the thing every self-respecting programmer hates (takes time and doesn't change functionality at all), and if it has absolutely no effect on encoding, it really doesn't matter whatsoever.
3.1. unique names for 2/3-pass stats files for later re-encode w/ other bitrate or curve (like in gordian knot)This is already possible. You can configure the stats file for each video job, plus there's the option "overwrite stats file in 3rd pass".. uncheck it and your second and third pass logfile will have different names.
4.1. import of vobsub subtitles (sub/idx) in addition to srt (like mkvmerge >=1.5.0)If you can give me the exact mkvmerge commandline requires for a .sub/.idx set, I will add it.
4.2. option to create intermediate avi/mp4 on/in another temp partition/directory for muxing speed
This is already possible in MeGUI as it is:
In the one click encoder, you can use the working directory to place the encoded output where you want, and use the output to specify yet another drive, so it's all possible. In manual, and auto-mode, the same applies. Let's take auto-mode first:
You set the encoded output path to another place than the default you get when loading the video/audio source. That takes care of saving the encoded video/audio at another place than the source.
Then when you press auto-encode, you can place the muxed output in a different directory, so effectively you can have the input in a directory/drive different from the encoder output and that different from the muxed output.
Then the manual mode: here again we have the same input/output configuration like in the auto-mode, so that only muxing remains. For complexity reasons, and the fact that most people have one harddisk, I don't think adding a direct configuration for the muxed output is a good idea. However, you can still configure it. Just go to the queue tab, click on the mux job you want to modify, then press load. This will bring up the muxing window, and you can now change the destination of the muxed output. And with that, we've taken care of every mode MeGUI offers.
5.3. finer grained task priority setting, esp. "lower than normal" (like virtualdub)Did I say over my dead body yet? Low is basically all you need, anything else is useless. Even normal, just makes your life miserable when you want to use the PC, and if you're not using it and have other programs that eat your CPU time away, you might want to reconsider your setup and not clamor for things in encoding program to fix the shortcomings of your setup.
6.1. audio->config: "increase volume automatically" seems to mean normalization, might be mixed up w/ compressionI don't follow. That switch triggers -ota(-g max), which according to the manual does the following: example : "-g max" will apply the highest gain level that still does not distort the original signalSince not everybody understands normalization, I picked "increase volume" for the checkbox description.
6.3. settings->automated encoding: add "max." word to "passes", since xvid only supports 2cosmetics again.
@Doom9: I still can't find the sources.Wasn't it's 0.2.2.3a :) subtle enough? All you needed to do is add an a to the link and it would work. I've changed it now.
And while I am at it, maybe you could put a list of known bugs and upcoming features into the distribution archive to prevent redundant reportsPlanned features are listed and discussed in this thread (post2 and the end of the thread for the discussion), but as for known bugs, I have no time to keep such a list, plus they are usually fixed within 24h unless it's something cosmetical (by your standards it would still be a showstopper but I have other standards.. if it works, if you can work around a problem, it's no major deal and can wait a few days).
berrinam
4th September 2005, 13:44
Wasn't it's 0.2.2.3a subtle enough? All you needed to do is add an a to the link and it would work. I've changed it now.
I tried that, except you changed the - between src and 0 into a .
Thanks for the new link.
Doom9
4th September 2005, 21:05
I implemented the AR signalling.. just one thing:
else
{
SARX = 1;
SARY = 1;
return scriptVerticalResolution;
}
in suggestResolution... I think that should be 0 instead of 1 as > 0 = AR signalling is used (that's when you apply the AR in the mkvmerge commandline, and that's how I defined it in VideoCodecSettings for each codec). Now I'm off to give it a spin.
@edit: some concerns: should't this functionality only be offered for no resizing? also, have you checked if XviD's custom AR signalling does work in encraw or the VfW?
Doom9
4th September 2005, 22:44
things that a manual encode using an oag machine and virtualdub combination is able to do:Uh, Virtualdub and XviD VfW do not offer these options:
2.2. import chapters as zones (like in chaptergrabber/kfe)
2.3 set keyframe on chapter start (like chaptergrabber/kfe, statsreader)
2.4. auto-set intro and credits as zones w/o keyframe
If at all, some tool would write them to the registry and the settings would have to be erased again after encoding.. far from ideal, plus manual labor for sure.
3.1. unique names for 2/3-pass stats files for later re-encode w/ other bitrate or curve (like in gordian knot)Once again, you have to do this manually so it's no different from MeGUI (you can do it, see my posts above)
3.4. bug: intermediate xvid avi is not deleted after 2nd pass muxing stepas berrinam pointed out, this is not a bug, doing that would be a feature to be added (I put it onto the todo list), and VDub most certainly doesn't do that automatically.
3.3. bug: when manually encoding to mkv w/ xvid 1st pass only, a mux job is created that breaks the queueThat could indeed be the case and not be limited to MKV and XviD in fact, but all output that cannot be done directly but needs a mux.
5.1. option to delete incomplete output on abort and skip creation if it already existsIf VDub can do that it would be news to me.
berrinam
4th September 2005, 23:07
I implemented the AR signalling.. just one thing:
else
{
SARX = 1;
SARY = 1;
return scriptVerticalResolution;
}
in suggestResolution... I think that should be 0 instead of 1 as > 0 = AR signalling is used (that's when you apply the AR in the mkvmerge commandline, and that's how I defined it in VideoCodecSettings for each codec).Yes, you're right. However, it shouldn't result in any problems anyway, because an AR of 1:1 will just give square pixels anyway. @edit: Actually, you're completely right -- it will give the wrong AR if you leave it my way. Sorry I missed it.
@edit: some concerns: should't this functionality only be offered for no resizing?Well, resizing is required otherwise the dimensions may not be mod16 after cropping. However, if the width in the OneClickWindow is set to the width of the video, then the resizing will in effect only round the dimensions to mod16 (the resizing keeps the same ratio between hres and vres, so if the hres is kept at the maximum, so will the vres)
also, have you checked if XviD's custom AR signalling does work in encraw or the VfW?I tried with VfW and it worked.
berrinam
4th September 2005, 23:34
I was looking through the source code looking at converting DGIndex jobs into queue-able jobs, and I found this function in VobinputWindow:
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);
}It seems to me that this isn't doing what it should, because it is ignoring the string passed to it as an argument. Is this right?
Doom9
5th September 2005, 13:59
I tried with VfW and it worked.Alright, would you do the honors and file the bugreport, so we can get rid of the workaround at the earliest convenience?
Well, resizing is required otherwise the dimensions may not be mod16 after cropping. However, if the width in the OneClickWindow is set to the width of the video, then the resizing will in effect only round the dimensions to mod16 (the resizing keeps the same ratio between hres and vres, so if the hres is kept at the maximum, so will the vres)but in that case, we're still resizing, are we not, whereas the ideal situation at the original resolution would be to just crop (well, I guess it's a point to debate if the crop doesn't yield mod16 results).
It seems to me that this isn't doing what it should, because it is ignoring the string passed to it as an argument. Is this right?It does seem rather funky. I suppose due to the way it works there's no obvious problem but if a method takes the input to be opened as an argument, it should by all means use it.
berrinam
6th September 2005, 22:42
Alright, would you do the honors and file the bugreport, so we can get rid of the workaround at the earliest convenience?Yes, to mplayer, or to xvid?
but in that case, we're still resizing, are we not, whereas the ideal situation at the original resolution would be to just crop (well, I guess it's a point to debate if the crop doesn't yield mod16 results).Also, if it happens that the cropping is mod16, and the rounding changes nothing, there will be no resizing by avisynth (it ignores it if there are no changes).
I have implemented the last three of the features you listed at the beginning of the thread. Here are the implementations:
Delete intermediate files:
add option to settingsform and MeGUISettings, entitled DeleteIntermediateFiles. To MeGUI.UpdateGUIStatus, add, just before the check for chained jobs (if (job.Next != null && !su.WasAborted && cont) // try finding a chained job) the following code: if (job is MuxJob && settings.DeleteIntermediateFiles && job.Previous != null)
{
logBuilder.Append("End of mux job, delete intermediate files.");
ArrayList filesToDelete = new ArrayList();
Job current = job;
while (current.Previous != null)
{
current = (Job)jobs[current.Previous];
if (!current.Output.Equals(""))
filesToDelete.Add(current.Output);
}
foreach (object file in filesToDelete)
{
try
{
logBuilder.Append("Found intermediate output file '" + ((string)file) + "', deleting...");
File.Delete((string)file);
logBuilder.Append("Deleted successfully.\r\n");
}
catch (Exception)
{
logBuilder.Append("Deletion failed.");
}
}
}
To delete aborted job output files:
add option to settingsform and MeGUISettings, entitled DeleteAbortedOutput. To MeGUI.markJobAborted add if (settings.DeleteAbortedOutput)
{
logBuilder.Append("Job aborted, deleting output file...");
try
{
File.Delete(job.Output);
logBuilder.Append("Deletion successful.\r\n");
}
catch (Exception)
{
logBuilder.Append("Deletion failed.\r\n");
}
} immediately after item.SubItems[7].Text = job.End.ToLongTimeString();
To localise stats files, change the initialization value of logfile in the VideoCodecSettings constructor to "", so you get this line: logfile = ""; In JobUtil.generateVideoJob, as the fourth and fifth line, add if (settings.Logfile.Equals(""))
settings.Logfile = Path.ChangeExtension(job.Output, ".stats.log");To let the user delete the Logfile in the codec settings, add an 'X' button to reset it, with this as the eventhandler: this.logfile.Text = "";
this.showCommandLine();
BeSweet logfiles could be varied in a similar manner, however the question arises of when the logfile is decided. At present, it isn't part of the AudioCodecSettings, but that may be a good thing to add. Alternatively, if the naming system is good enough, it could be left as follows:
add the parameter, 'string besweetLogFile' to the two audio generate...Commandline functions. Change the four lines with besweet.log in them to the following four, in the order they arise in the code: sb.Append("\" -logfile \"" + besweetLogFile + "\" ) -azid( ");
sb.Append("\" -logfile \"" + besweetLogFile + "\" ) -lame( ");
sb.Append("\" -logfile \"" + besweetLogFile + "\" ) -azid( ");
sb.Append("\" -logfile \"" + besweetLogFile + "\" ) -bsn( -2ch ");
At the beginning of both of those functions, add the following line: string besweetLogFile = Path.ChangeExtension(output, ".besweet.log");(this is decided inside the generate...Commandline method so that no prototypes/function calls/classes have to change). This method of placing the BeSweet logfile gives no control to the user, just as the current method does. It might be better to give the user control, but it would probably make it unnecessarily complicated.
azsd
7th September 2005, 06:18
the custom maxtrix disabled in xvid config?
I saw grayed button here
Doom9
7th September 2005, 08:30
Yes, to mplayer, or to xvid?mplayer
the custom maxtrix disabled in xvid config?It may well be because while mencoder can handle it.. it can't handle it on windows (windows paths use a :, mencoder uses that to separate its options). This will be resolved though once encraw becomes ready.. I might even dump mencoder for x264 and xvid encoding in the future and just use it for avi muxing in those two cases (bond will advise me not to offer avi of course ;)) because maintaining commandline support for two applications with non matching featuresets becomes cumbersome.
berrinam
7th September 2005, 13:54
Bug report filed to mplayer.
Another bugfix for MeGUI -- the Avisynth creator window wouldn't close d2v files properly. The d2vReader.close method header needs to be changed to public override void Close() so that it overrides the VideoReader.Close. Previously, this function was never called, and MeGUI held on to the d2v file until it closed, preventing deletion of the file.
Doom9
7th September 2005, 19:02
MeGUI held on to the d2v file until it closed, preventing deletion of the file.I noted that too, and in fact the 0.24 build already contains a bugfix to that end (or is it my dev source tree? I don't recall).. when I didn't apply force film I effectively never closed the d2v after opening it after dgindex had run to get the film percentage.
When I put those three items in the todo list, I meant for me to do it, but hey, I definitely can't complain about too much work ;) Thanks
Doom9
20th September 2005, 09:28
@berrinam: sorry for taking so long, I finally integrated your code (with a few minor changes) and I don't see anything that wouldn't work. One thing I've been wondering about: for a muxjob, isn't every stream to be muxed an intermediate file in a way, and likewise logfiles? I considered going through every subtitle and audio stream in the muxjob as well, but I'm unsure what the ideal thing is.
Also, delete intermediary files conflicts with "keep 2nd pass of 3 pass", so I need to add some additional GUI handlers to the settings form to warn the user about that.. I personally consider it straightforward that it acts like that, but I'm sure even users who've asked for such features don't realize all the consequences.
berrinam
4th October 2005, 08:26
It seems that MeGUI doesn't abort properly from a paused encode. This line: this.pauseButton.Image = (Image)this.pauseImage; should be added to MeGUI.abort() or else the wrong picture will be displayed. More importantly, paused = false; should be added within the if (this.paused) // aborting directly causes problems so prevent it block in MeGUI.abort(), otherwise MeGUI will crash next time you press pause. Ok, that wasn't explained well. Here's what I mean:
1. Start an encode.
2. Press pause.
3. Press abort.
4. Press start.
5. Press pause.
This will cause it to crash, because when it was aborted, MeGUI still believed the current encode was paused.
Also, perhaps the priority dropdown in ProgressWindow should have a DropDownList DropDownStyle, so that it isn't editable? Obviously, nothing serious, but I think it looks better that way, since it makes no sense to edit the Priority names anyway.
Doom9
7th October 2005, 14:15
thanks for those fixes.. I've integrated them into the latest build
Doom9
7th October 2005, 18:14
I just posted a few more todo things that I meant to have done before I left for my holidays, but couldn't because I got sick.
Sharktooth
8th October 2005, 14:22
x264CLI has new switches.
VUI is not so important (--sar was an old option) but "mixed references" is.
Maybe it's worth adding it in the "to do" list.
berrinam
9th October 2005, 10:07
I've implemented some of the things on the todo list, as well as fixed some bugs. Rather than list all of the changes here, I've uploaded the updated source code, as well as new compiles. If it turns out that Doom9 has made other changes, I have kept a log of all the changes, so I can list them in the style I normally do.
Bugfixes:
-The OneClickWindow doesn't crash when trying to use 'Don't Encode Audio'
-DGIndex doesn't crash when aborting jobs
-MeGUI won't let you try to open the Process Window when running DGIndex, which would lead to a crash.
-root directory bug discussed with haubrija in main MeGUI thread
Cosmetics:
-MeGUI will give a message if there are jobs queued, but not waiting (eg done or postponed, etc)
-Better managing of 'Don't Encode Audio' with the container format dropdown
New features:
-load simple DGIndex jobs
-add '--mixed-refs' option for x264
@edit: removed attachments -- update in next post.
Sharktooth
9th October 2005, 20:27
new Adaptive Quantization switches.
they're not in the SVN yet but the AQ patch is included in my builds.
--aq Adaptive quantization
--aq-strength <float> Amount to adjust QP by AQ: 0.0 => no AQ,
1.1 => strong AQ [0.50]
--aq-sensitivity <float> Degree of "flatness" of the MB when AQ starts
to work:
5 => works for almost all blocks,
22 => only flat ones [15.0]
berrinam
9th October 2005, 23:30
Ok, this is the same as last time, but with x264 AQ options.
Anyone know which AVC profile AQ falls under?
@edit: Main MeGUI program removed from here, as a new version can be found here (http://forum.doom9.org/showthread.php?p=724251#post724251)
bond
11th October 2005, 14:20
doom9, i found a glitch in meguis x264 settings:
ticking p4x4 mb size should only be allowed when p8x8 is ticked too, cause p4x4 without p8x8 isnt possible
zajc
13th October 2005, 14:16
Hello!
I'm encoding TV captures in the following steps:
1st step (VirtualDubMod)
Encoding captured .avi (mjpeg) via .avs to lossless huffyuv .avi file
2nd step (MeGUI)
XVID 1st pass (huffyuv .avi)
3rd step (MeGUI)
XVID 2nd step (huffyuv .avi)
This give me 20-30% faster TOTAL encoding time.
QUESTION:
I'm wondering if we can combine the 1st and the 2nd step as described in http://forum.doom9.org/showthread.php?t=84924 and implement this into MeGUI.
Example from http://students.washington.edu/lorenm/src/avisynth/avs2yuv/
Concurrent huffyuv and 2 pass encoding (Windows): Warning: this is new and may be buggy.
avs2yuv foo.avs -hfyu huffyuv.avi -o - | mencoder - -o NUL: -ovc xvid -xvidencopts pass=1
mencoder huffyuv.avi -o pass2.avi -ovc xvid -xvidencopts pass=2:bitrate=1000
That will probably increase 2-pass XVID encoding when using slow .avs scripts for 20-40%. Maybe this method will be suitable for other codecs (x264...).
Any suggestions are welcome.
Thanks.
leowai
13th October 2005, 14:54
That will probably increase 2-pass XVID encoding when using slow .avs scripts for 20-40%. Maybe this method will be suitable for other codecs (x264...).
Any suggestions are welcome.
Thanks.
dimzon mentioned about this before:
http://forum.doom9.org/showthread.php?p=720554#post720554
But you give it a good try and let us know how faster it compared to avs method (probably same for x264 too). However, the trade off is the lossless huffyuv method might full up the hard disk space very quickly! It only suits for ppl who need to convert videos in limited time with enough of hard disk space.
I'm encoding TV captures in the following steps:
1st step (VirtualDubMod)
Encoding captured .avi (mjpeg) via .avs to lossless huffyuv .avi file
If this is the cause, why not directly record it in lossless hffyuv from your TV card? You might want to try third party program if your bundle software can't do this. Mine can. :D
zajc
13th October 2005, 15:43
If this is the cause, why not directly record it in lossless hffyuv from your TV card? You might want to try third party program if your bundle software can't do this. Mine can.
If I try to capture directly to filtered HUFFYUV with ffdshow VFW encoder builtin filters or .avs with the 3 filters
TomsMoComp(1,5,1)
crop(...)
lancsozresize(...)
usually I don't get the good result (captured .avi have symptoms like frames were dropped althought VVCR report 0 dropped frames; high CPU or dropped frames is not an issue here). That is the reason why I capture to 768x576, interlaced, MJPEG or HUFFYUV codec with very good final results.
I came to idea to encode to filtered HUFFYUV first when exerimenting to capture directly to filtered HUFFYUV when I got an excelent XVID encoding time. Unfortunatelly direct capture to filtered HUFFYUV is not an option for me and for the others (at least for some).
max-holz
13th October 2005, 16:39
I have problem with MEGUI 0.2.2.6a.
I have set the desired output size with the AutoEncode button to 2CD (1400MB) and the film lenght is 1.50; in the first pass the bitrate is set to "--bitrate -163". What's the mess? I exspect 1500-1800 for the bitrate cos the audio compression takes 128MB
This is the log:
Generating jobs. Desired size: 1433600 bytes
Setting desired size of video to 1433600 bytes
Next job job1-1 is an audio job. besweet commandline:
"C:\DVD Tools\AAC\BeSweet.exe" -core( -input "C:\Scambio\Elaborazione Video\Febbre\VTS_01_1 - 0x80 - Audio - AC3 - 6ch - 48kHz - DRC - Italiano - DELAY 16ms.AC3" -output "C:\Scambio\Elaborazione Video\Febbre\VTS_01_1 - 0x80 - Audio - AC3 - 6ch - 48kHz - DRC - Italiano - DELAY 16ms.mp4" -logfile C:\Scambio\Elaborazione Video\Febbre\VTS_01_1 - 0x80 - Audio - AC3 - 6ch - 48kHz - DRC - Italiano - DELAY 16ms.besweet.log ) -azid( -s stereo -c normal -L -3db ) -dimzon( -dllname bse_FAAC.dll -q 120 ) -ota( -d 16 -g max )
successfully set up audio encoder and callbacks for job job1-1
----------------------------------------------------------------------------------------------------------
Log for job job1-1
besweet: "C:\DVD Tools\AAC\BeSweet.exe" -core( -input "C:\Scambio\Elaborazione Video\Febbre\VTS_01_1 - 0x80 - Audio - AC3 - 6ch - 48kHz - DRC - Italiano - DELAY 16ms.AC3" -output "C:\Scambio\Elaborazione Video\Febbre\VTS_01_1 - 0x80 - Audio - AC3 - 6ch - 48kHz - DRC - Italiano - DELAY 16ms.mp4" -logfile C:\Scambio\Elaborazione Video\Febbre\VTS_01_1 - 0x80 - Audio - AC3 - 6ch - 48kHz - DRC - Italiano - DELAY 16ms.besweet.log ) -azid( -s stereo -c normal -L -3db ) -dimzon( -dllname bse_FAAC.dll -q 120 ) -ota( -d 16 -g max )
BeSweet v1.5b31 by DSPguru.
--------------------------
[00:00:00:000] Initializing...
[00:00:00:000] -- Initializing...
[01:50:42:496] |
[00:00:00:016] Adding silence..
[01:50:42:512] Finalizing...
[01:50:42:512] Conversion Completed !
Visit DSPguru's Homepage at :
http://DSPguru.doom9.net/
----------------------------------------------------------------------------------------------------------
job job1-1 has been processed. This job is linked to the next job: job1-2
this series of jobs starts with an audio job and is followed by regular twopass video jobs
The audio job is named job1-1 the first pass job1-2 and the second pass job1-3
The second pass job has a desired final output size of 1433600 bytes and video bitrate of 700 kbit/s
The size of the first audio track is 135051582 bytes
Desired video size after substracting audio size is -132172Setting the desired bitrate of the subsequent video jobs to -163 kbit/s
Next job job1-2 is a video job. encoder commandline:
"C:\Programmi\x264\x264.exe" --pass 1 --bitrate -163 --stats "C:\Scambio\Elaborazione Video\Febbre\Febbre_movie.stats" --ref 5 --mixed-refs --bframes 3 --subme 6 --weightb --analyse all --8x8dct --me umh --threads 2 --cqmfile "C:\Programmi\x264\eqm_avc_hr.cfg" --progress --no-psnr --output NUL "C:\Scambio\Elaborazione Video\Febbre\Febbre_movie.avs"
successfully set up video encoder and callbacks for job job1-2
max-holz
13th October 2005, 18:36
I have tried another time but in my opinion there is a problem:
Generating jobs. Desired size: 1433600 bytes
The second pass job has a desired final output size of 1433600 bytes and video bitrate of 1637 kbit/s
The size of the first audio track is 135051582 bytes
Desired video size after substracting audio size is -132172Setting the desired bitrate of the subsequent video jobs to -163 kbit/s
Next job job1-2 is a video job. encoder commandline:
"C:\Programmi\x264\x264.exe" --pass 1 --bitrate -163 --stats "C:\Scambio\Elaborazione Video\Febbre\Febbre_movie.stats" --ref 5 --mixed-refs --bframes 3 --subme 6 --weightb --analyse all --8x8dct --me umh --threads 2 --cqmfile "C:\Programmi\x264\eqm_avc_hr.cfg" --progress --no-psnr --output NUL "C:\Scambio\Elaborazione Video\Febbre\Febbre_movie.avs"
successfully set up video encoder and callbacks for job job1-2
max-holz
13th October 2005, 19:16
MEGUI 0.2.2.5 has no problem. I don't understand the sense of this phrase "The size of the first audio track is 135051582 bytes", infact compressed audio track has a size of 128 MB. I suppose that from 0.2.2.6 there is some bug in substracting compressed audio track size from desired movie size in the code of the autoencode button.
stephanV
13th October 2005, 19:53
128 MB =~ 135051582 bytes!!!
max-holz
13th October 2005, 20:24
128 MB =~ 135051582 bytes!!!
So why "The second pass job has a desired final output size of 1433600 bytes"?
I set 1400 MB for the final video size
Perhaps the problem is here:
0.2.2.6 10/06/2005
new: dgindex processing is now handled as a regular job. This allows queueing of multiple dgindex jobs, and thus the one click mode can process multiple movies after another, including the dgindex phase.
changed: desired size in the autoencode window has been changed to MBs instead of KBs
changed: .sub input has been replaced by .idx input for Subtitle muxing into mkv
bugfix: aborting paused jobs and restarting them no longer causes a crash
bugfix: moving jobs up/down works properly again
stephanV
13th October 2005, 21:36
Now that is a bug, bytes should be kilobytes in that case...
zajc
14th October 2005, 14:32
I'm encoding TV captures in the following steps:
1st step (VirtualDubMod)
Encoding captured .avi (mjpeg) via .avs to lossless huffyuv .avi file
2nd step (MeGUI)
XVID 1st pass (huffyuv .avi)
3rd step (MeGUI)
XVID 2nd step (huffyuv .avi)
This give me 20-30% faster TOTAL encoding time.
QUESTION:
I'm wondering if we can combine the 1st and the 2nd step as described in http://forum.doom9.org/showthread.php?t=84924 and implement this into MeGUI.
Example from http://students.washington.edu/lore...isynth/avs2yuv/
Concurrent huffyuv and 2 pass encoding (Windows): Warning: this is new and may be buggy.
avs2yuv foo.avs -hfyu huffyuv.avi -o - | mencoder - -o NUL: -ovc xvid -xvidencopts pass=1
mencoder huffyuv.avi -o pass2.avi -ovc xvid -xvidencopts pass=2:bitrate=1000
That will probably increase 2-pass XVID encoding when using slow .avs scripts for 20-40%. Maybe this method will be suitable for other codecs (x264...).
My first investigation.
Program avs2yuv.exe version 0.24 is not compatible with the new version of mencoder. We must change the line in avs2yuv.cpp
sprintf(cmd, "mencoder - -o \"%s\" -quiet -ovc lavc -lavcopts vcodec=ffvhuff:vstrict=-1:pred=2:context=1", hfyufile);
to
sprintf(cmd, "mencoder - -o \"%s\" -quiet -ovc lavc -lavcopts vcodec=ffvhuff:vstrict=-2:pred=2:context=1", hfyufile);
vstrict=-1 --> vstrict=-2
and compile the new avs2yuv.exe.
The following lines are fully working (mencoder.exe 2005-10-09 and avs2yuv.exe 0.24.01 (modified version) (http://freeweb.siol.net/zajc27/avs2yuv.rar) must be in the system path (example SETPATH=c:\mplayer\)) :)
avs2yuv foo.avs -hfyu huffyuv.avi -o - | mencoder - -o NUL: -ovc xvid -xvidencopts pass=1:<other_settings>
mencoder huffyuv.avi -o pass2.avi -ovc xvid -xvidencopts pass=2: <other_settings>
I have 3 questions. :confused:
What is the context=1 switch? Adaptive Huffman tables? I can't find anywhere what is this switch.
Is it faster to read huffyuv .avi file with or without avi-index if we read .avi with mencoder only from the beginning to the end (frame 1,2,3…x)?
Is this command line in avs2yuv.cpp mencoder foo.avs -o foo.avi -quiet -ovc lavc -lavcopts vcodec=ffvhuff:vstrict=-1:pred=2:context=1" optimized? I 'm not fully familiar with mencoder.
My next mission is to test 2-pass XVID encoding speed difference between standard .avs+mencoder encoding and avs2yuv+.avs+huffyuv+mencoder encoding when the source is 768x576, interlaced and the final result is 512x384, deinterlaced source.
TEST case
source
trimmed SouthPark cartoon
7501 frames
768x576
interlaced
MJPEG (Q=19)
.avs filters
TomsMoComp(1,15,1)
crop(8,6,752,564)
Lanczos4Resize(512,384)
MeGUI
mencoder "sp.avs" -ovc xvid -o NUL: -passlogfile "sp.stats" -xvidencopts pass=1:bitrate=1360:max_key_interval=300:packed:vhq=1:qpel:chroma_me:trellis:min_iquant=1:min_pquant=1:min_bquant=1:keyframe_boost=100:kfthreshold=1:kfreduction=20
mencoder "sp.avs" -ovc xvid -passlogfile "sp.stats" -xvidencopts pass=2:bitrate=1360:max_key_interval=300:packed:vhq=1:qpel:chroma_me:trellis:min_iquant=1:min_pquant=1:min_bquant=1:keyframe_boost=100:kfthreshold=1:kfreduction=20 -o "sp_xvid.avi" -of avi -ffourcc XVID
XviD 1st pass = 523s (14.34 fps)
XviD 2nd pass = 969s (7.74 fps)
TOTAL = 1492s
avs2yuv+huffyuv+MeGUI
avs2yuv "sp.avs" -hfyu "sp_hfyu.avi" -o - | mencoder - -ovc xvid -o NUL: -passlogfile "sp.stats" -xvidencopts pass=1:bitrate=1360:max_key_interval=300:packed:vhq=1:qpel:chroma_me:trellis:min_iquant=1:min_pquant=1:min_bquant=1:keyframe_boost=100:kfthreshold=1:kfreduction=20
mencoder "sp_hfyu.avi" -ovc xvid -passlogfile "sp.stats" -xvidencopts pass=2:bitrate=1360:max_key_interval=300:packed:vhq=1:qpel:chroma_me:trellis:min_iquant=1:min_pquant=1:min_bquant=1:keyframe_boost=100:kfthreshold=1:kfreduction=20 -o "sp_xvid.avi" -of avi -ffourcc XVID
XviD 1st pass = 660s (11.37 fps)
XviD 2nd pass = 581s (12.91 fps)
TOTAL = 1241s
Conclusion
The 2nd method is 251s (17%) faster.
This should be an alternative option in future MeGUI version.
It could improve (slow) encoding time for other codecs too.
The rest is up to you - developers :cool:
berrinam
14th October 2005, 15:23
@zajc: While this may be interesting, it is not exactly related to MeGUI, is it?
Also, as Doom9 has said here (http://forum.doom9.org/showthread.php?p=696028#post696028), And by the way, and that goes for everyone, this thread is really meant for developers, you should use the other one for anything else including error reports.
zajc
14th October 2005, 15:58
While this may be interesting, it is not exactly related to MeGUI, is it?
I hope this will be implemented into megui - someday ;)
max-holz
14th October 2005, 16:21
@zajc: While this may be interesting, it is not exactly related to MeGUI, is it?
Also, as Doom9 has said here (http://forum.doom9.org/showthread.php?p=696028#post696028),
So I must open another thread for my error report posted above about substracting bytes to kilobytes?
Sharktooth
14th October 2005, 17:03
No, you should use the OTHER MeGUI thread.
berrinam
15th October 2005, 01:02
Here is the version of MeGUI with the AutoEncode KB/MB bug fixed. It also fixes a bug with the OneClick window when using original audio. I've only attached the full version, because only it is affected.
Please note that bug reports and feature requests should be posted on the main thread (http://forum.doom9.org/showthread.php?t=96032), as always.
max-holz
15th October 2005, 08:06
Here is the version of MeGUI with the AutoEncode KB/MB bug fixed. It also fixes a bug with the OneClick window when using original audio. I've only attached the full version, because only it is affected.
Please note that bug reports and feature requests should be posted on the main thread (http://forum.doom9.org/showthread.php?t=96032), as always.
The link to fixed version doesn't function, I can't click?!?
:(
berrinam
15th October 2005, 10:00
It needs to be approved by a moderater first.
max-holz
17th October 2005, 15:34
Is it possible in the bitrate calculator form add a functionality for taking care of subtitle size in the calculation?
Doom9
17th October 2005, 19:41
well, subs are about a 100k so that's rather negligible, wouldn't you agree?
Sharktooth
17th October 2005, 20:22
subs in MP4 do not produce additional overhead as in AVI. So 100kb doesnt make a substantial difference... that means it's not worth adding that feature.
Doom9
17th October 2005, 22:38
@berrinam: did you already look into what bond mentioned? Also, I don't really need to see what code you changed but I'm wondering about this one:
-root directory bug discussed with haubrija in main MeGUI thread
berrinam
17th October 2005, 22:50
@berrinam: did you already look into what bond mentioned?No, I missed it, sorry.
Also, I don't really need to see what code you changed but I'm wondering about this one:Path.GetDirectoryName returns a trailing slash when the Path is a root directory. In all other cases it has no trailing slash. This was causing some paths to have a double slash in them, which is illegal. See this post (http://forum.doom9.org/showthread.php?p=721460#post721460).
I put a wrapper for this function which removes the trailing slash if it is there, and I replaced the calls to Path.GetDirectoryName to MeGUI.GetDirectoryName. It turns out when I found and replaced all, I missed some.
Blue_MiSfit
18th October 2005, 05:33
erm... this sounds SO n00bish... but the latest megui.zip doesn't extract properly for me. I use the latest revision of WinRAR - 3.51, and it says:
"! C:\Documents and Settings\blue_misfit\Desktop\megui.zip: Unknown method in megui.exe
! C:\Documents and Settings\blue_misfit\Desktop\megui.zip: No files to extract
"
right.... any ideas? never seen this one before. Tried clearing browser cache and redownloading - same result. Also tried (GASP!) using internet explorer.
I had to wash my hands afterwards... ;)
Doom9
18th October 2005, 08:13
@berrinam: could you please post the source code of the KB/MB fix as well? thanks
berrinam
18th October 2005, 08:38
@Doom9: Here you go (attached). (@edit: the archive is named with the wrong version, but the contents are fine)
@Blue_MiSfit: Try using 7zip http://www.7-zip.org/).
berrinam
18th October 2005, 09:01
support x264 levels (http://forum.doom9.org/showthread.php?t=96059)
this link is out of date. It has now been moved here: http://forum.doom9.org/showthread.php?t=101345. It may be worth updating the todo list so that this information doesn't become forever lost.
Doom9
18th October 2005, 10:20
I don't see the attachment, and as an admin, I get to see attachments even prior to authorization. I'll update the x264 levels link.
Sharktooth
18th October 2005, 15:28
@berrinam: could you please add "--subme 7" before posting the sources? (info here: http://students.washington.edu/lorenm/src/x264/x264_p8rd.2.txt)
Doom9
18th October 2005, 16:28
Sharktooth: version 0.2.2.7 is soon to be out when I can get my hands on the latest sources. I've already designed the "skip chained jobs on error" feature in my head, I just need to code it and I have about 3h of guaranteed coding time tomorrow so adding another selection to a dropdown shouldn't be too hard to accomplish. However, what to call this option? We already have RDO.. is this superRDO?
Sharktooth
18th October 2005, 16:55
guess that something like "RDO Level2" would be ok
berrinam
18th October 2005, 22:40
Sorry, here it is.
Doom9
19th October 2005, 22:54
I've upped the latest sources. As far as the whole intermediary files stuff goes, it may speed things up a bit, but the downside is an insane use of space, complication of the procedure, and gains are most visible for people with what I call unhealthy filtering, so it's really nothing for me, sorry.
Sharktooth
20th October 2005, 21:26
well, when the Adaptive Quantization will be submitted to the SVN the --aq switch will be removed and --aq-strenght 0 will be the default.
Sirber
20th October 2005, 21:28
so no AQ by default?
Sharktooth
20th October 2005, 21:31
it will be removed coz it is redundant. setting --aq-strenght to something other than 0 will enable AQ. However the patch is still not updated so until i get a new one it will continue to work as it was implemented in MeGUI.
Doom9
20th October 2005, 22:24
well, unless I have a timeline and can synchronize development with it, it doesn't make much sense right now to start planning. I have no big projects though, basically stuff that can be finished in one day or two.
Doom9
23rd October 2005, 23:04
I've just updated the link to the latest sources. I hope I haven't introduced too many bugs in the new release as I might not have proper internet access to upload bugfixes next week.
berrinam
24th October 2005, 09:21
An addition to MeGUI I have done recently that I find useful is the option to 'Export Jobs to Batch file'. I put this in the menu, however this is probably not the best place. It exports the currently selected jobs to a batch file. The menu-handler I used is below.
private void mnuToolsBatchExport_Click(object sender, System.EventArgs e)
{
if (this.queueListView.SelectedItems.Count > 0)
{
this.saveFileDialog.Title = "Enter name of output";
this.saveFileDialog.FileName = "";
this.saveFileDialog.Filter = "Batch files (*.bat)|*.bat";
if (this.saveFileDialog.ShowDialog() != DialogResult.OK)
return;
StreamWriter output = new StreamWriter(this.saveFileDialog.FileName);
output.WriteLine(":: MeGUI generated batchfile");
foreach (ListViewItem item in this.queueListView.SelectedItems)
{
Job job = (Job)jobs[item.Text];
if (job != null)
{
// Label our jobs
output.WriteLine(":: " + job.Name);
output.WriteLine(job.Commandline);
}
}
output.Close();
}
}Feel free to include it if you want
Doom9
24th October 2005, 10:20
hmm.. why would you run something in batchfile instead of in MeGUI, thus losing quite a bit of functionality? even if we're thinking about problematic jobs and people unfamiliar with the commandline so that they could run a commandline and get additional error messages, those people would double click on the batchfile, it would run and then close and you lost the output again.
berrinam
24th October 2005, 10:26
You're right. Anyway, it was quick to write, and I found it useful when I was trying to narrow down the problem with x264+AQ, because I could set jobs, knowing some would error out, and come back later to see which ones failed where. Probably not an overwhelmingly useful function.
hellfred
24th October 2005, 11:40
hmm.. why would you run something in batchfile instead of in MeGUI, thus losing quite a bit of functionality? even if we're thinking about problematic jobs and people unfamiliar with the commandline so that they could run a commandline and get additional error messages, those people would double click on the batchfile, it would run and then close and you lost the output again.
The closing is not a problem, when you simply put aPAUSE in the last line. Then the cmd-Window will promt and wait for the user to "press any key.." before closing.
For me, being curious and always eager to learn how things are done, it would be nice to have the possibility to see the actual command lines, but I do know that you are most probably not very keen on having yet more bugreports form people messing with the bat-file (and not stating it).
Hellfred
Yuri Khan
24th October 2005, 12:47
why would you run something in batchfile instead of in MeGUI, thus losing quite a bit of functionality?
What can you do with a job queue that you can’t do with a batch file? Can you put 26 jobs in the queue, then realize you’ve made a mistake and change one setting in all the jobs at once? Can you clone a whole queue, modify a few things, and compare results afterwards? With a batch file, I can. What’s better, I can take one job in a batch file and automatically generate all the other jobs by using the first one as template.
I suppose I could do the same by editing the jobs queue XML file manually, but providing the same functionality in the GUI is very costly.
Batch files are a natural format for job queues — not only video encoding queues, but all kinds of jobs.
Doom9
24th October 2005, 13:03
The closing is not a problem, when you simply put aI may not use batchfiles a lot.. but that one I do know ;)
it would be nice to have the possibility to see the actual command linesBut you can.. what do you think the "show commandline" checkbox in every codec configuration window is for? Try it out.. you can see commandline changes in real time as you configure the codec. Plus, before starting each job, its commandline is dumped to the log.
What can you do with a job queue that you can’t do with a batch file?How about postponing, collecting stats, update the settings graphically (not everyboy knows the 100 cli parameters x264.exe has), move up/down without copy/paste. And as far as cloning goes, yes you can.. you'll have to edit stuff in your batchfile and you have to create jobs in the right order in the GUI. And mass update: you have to edit commandlines, line by line.. few people are actually capable of doing that. Anyway, both have their advantages but MeGUI was never meant as a glorified batchfile creator.. those who work with batchfiles shouldn't need a GUI, and those that need a GUI don't really need batchfiles.
Also, to me a batchfile output is like making a statement that I don't trust my job handling. But I do trust it enough so I don't think even for debugging purposes it's necessary.
Yuri Khan
25th October 2005, 14:12
How about postponing, collecting stats
rem and move, respectively.
update the settings graphically (not everyboy knows the 100 cli parameters x264.exe has)
Well, that’s where the GUI is convenient — to build the template command line with common switches.
move up/down without copy/paste.
For me, copy/paste is at least as convenient as Move up/down buttons, and probably more so because I can copy/paste several lines at once.
And mass update: you have to edit commandlines, line by line.. few people are actually capable of doing that.
Oh no, you don’t. With batch files, you do a context search-and-replace.
Anyway, both have their advantages but MeGUI was never meant as a glorified batchfile creator.. those who work with batchfiles shouldn't need a GUI, and those that need a GUI don't really need batchfiles.
I’d say it a little differently: those who work with batch files are capable of making their own UIs tailored specifically to their own needs.
I understand that I am not in the target audience of MeGUI and have no problems with that; sorry if I said anything to offend you.
berrinam
31st October 2005, 11:29
EDIT: This doesn't work with x264-only or snow-only. I will fix it if you are interested.
EDIT2: Should be fixed for all modes now (it has new code for Form1, and there is a new attachment).
How about being able to create a default configuration for OneClick?
Two new classes attached, along with an updated MeGUISettings and SettingsForm (I doubt you've modified them -- if you have, I can just tell you the changes), and a small bit of new code for OneClickWindow and Form1 as follows:
OneClickWindow: at the end of the constructor, add // Do extra defaults config (same code as in OneClickDefaultWindow)
// strings
if (audioProfile.Items.Contains(mainForm.Settings.OneClickDefaults.AudioProfileName))
audioProfile.SelectedItem = mainForm.Settings.OneClickDefaults.AudioProfileName;
if (videoProfile.Items.Contains(mainForm.Settings.OneClickDefaults.VideoProfileName))
videoProfile.SelectedItem = mainForm.Settings.OneClickDefaults.VideoProfileName;
if (containerFormat.Items.Contains(mainForm.Settings.OneClickDefaults.ContainerFormatName))
containerFormat.SelectedItem = mainForm.Settings.OneClickDefaults.ContainerFormatName;
if (sizeSelection.Items.Contains(mainForm.Settings.OneClickDefaults.StorageMediumName))
sizeSelection.SelectedItem = mainForm.Settings.OneClickDefaults.StorageMediumName;
// bools
dontEncodeAudio.Checked = mainForm.Settings.OneClickDefaults.DontEncodeAudio;
signalAR.Checked = mainForm.Settings.OneClickDefaults.SignalAR;
splitOutput.Checked = mainForm.Settings.OneClickDefaults.Split;
// ints
if (mainForm.Settings.OneClickDefaults.SplitSize > 0)
splitSize.Text = mainForm.Settings.OneClickDefaults.SplitSize.ToString();
if (mainForm.Settings.OneClickDefaults.Filesize > 0)
fileSize.Text = mainForm.Settings.OneClickDefaults.Filesize.ToString();
horizontalResolution.Value = mainForm.Settings.OneClickDefaults.OutputResolution;
// Clean up after those settings were set
sizeSelection_SelectedIndexChanged(null, null);
containerFormat_SelectedIndexChanged(null, null);
audioProfile_SelectedIndexChanged(null, null);
VideoProfile_SelectedIndexChanged(null, null);
dontEncodeAudio_CheckedChanged(null, null);
signalAR_CheckedChanged(null, null);
splitOutput_CheckedChanged(null, null);
Form1: change mnuToolsSettings_Click to private void mnuToolsSettings_Click(object sender, System.EventArgs e)
{
#if FULL
SettingsForm sform = new SettingsForm(videoProfiles, audioProfiles, videoProfile.SelectedIndex, audioProfile.SelectedIndex);
#else
SettingsForm sform = new SettingsForm();
#endif
sform.Settings = this.settings;
if (sform.ShowDialog() == DialogResult.OK)
{
this.settings = sform.Settings;
changeVideoOutputExtention(); // this is here to prevent output extension mismatches when the x264 encoder is changed
}
}
berrinam
1st November 2005, 12:05
Just to alert you, I have fixed the problem with the above code.
Doom9
1st November 2005, 19:41
I'm hoping you've tested the actual functionality more than the -new.zip you've attached.. it lacked that adapted menu code to open the settings window, and the x264 release wouldn't build without changes either.
berrinam
1st November 2005, 20:47
@Doom9: Did you include the code in my post as well as the attached files? It woked fine for me when I did. NB: v2.2.9 seems to be missing the OneClickWindow code which I posted.
Doom9
1st November 2005, 20:51
Did you include the code in my post as well as the attached files? No, for some reason I took your first sentence as "you can just copy in the files and be done with it unless you have made changes to the oneclick and main form".
Turns out I should've bothered to actually read your whole post. Sorry about that :(
redfordxx
7th November 2005, 03:26
I am compressing x264 using MeGUI. I have queue of cca 10 encodes.
Select last job and use "move down button". The selection disappears. Once more pressing the down button and got this.See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
at System.Windows.Forms.SelectedListViewItemCollection.get_Item(Int32 index)
at MeGUI.MeGUI.MoveListViewItem(ListView& lv, Boolean moveUp)
at MeGUI.MeGUI.downButton_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.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
megui-x264
Assembly Version: 1.0.2131.35386
Win32 Version: 1.0.2131.35386
CodeBase: file:///C:/Program%20Files/x264/megui-x264.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
babduss4
Assembly Version: 0.0.0.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
fhdzw45o
Assembly Version: 0.0.0.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
yegudxpo
Assembly Version: 0.0.0.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
Accessibility
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/accessibility/1.0.5000.0__b03f5f7f11d50a3a/accessibility.dll
----------------------------------------
************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (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 machine
rather than being handled by this dialog.Up is the same.
Maybe some1 is interrested...
Sharktooth
7th November 2005, 04:33
RDO for B-Frames should be disabled when b-frames = 0.
Needs CABAC.
bond
7th November 2005, 13:15
Trellis should be disabled when --subme < 6 (no RDO).afaik you dont need subme6 when wanting to use trellis
but you do need cabac to use trellis!
Sharktooth
7th November 2005, 14:11
mooo :D
Doom9
7th November 2005, 16:36
are you trying to confuse me? now I don't know what to code anymore
Sharktooth
7th November 2005, 16:38
i edited my post with the right "conditions".
Doom9
7th November 2005, 20:35
RDO for B-Frames should be disabled when b-frames = 0.Done.
but you do need cabac to use trellis!It was like that already.
Did I miss anything else? (I got the up/down think taken care of as well).
Sharktooth
7th November 2005, 20:38
i was convinced disabling cabac didnt disable trellis...
damnit i already got a pair of googles... maybe i need better ones...
Sharktooth
9th November 2005, 18:08
fix for B-RDO behaviour in conjunction with b-frames
in x264ConfigurationDialog.cs
...
else if (this.x264NumberOfBFrames.Value == 0)
{
this.x264AdaptiveBframes.Enabled = false;
this.x264WeightedBPrediction.Enabled = false;
this.x264PyramidBframes.Enabled = false;
this.bRDO.Enabled = false;
x264BframePredictionMode.Enabled = false;
x264BframeBias.Enabled = false;
}
...
and
...
if (this.x264NumberOfBFrames.Value >= 1)
{
this.x264AdaptiveBframes.Enabled = true;
this.x264WeightedBPrediction.Enabled = true;
this.x264PyramidBframes.Enabled = false;
if (this.x264SubpelRefinement.SelectedIndex >= 5) // RDO & B-frames are enabled, enable RDO for B-frames
this.bRDO.Enabled = true;
if (!x264BframePredictionMode.Enabled)
x264BframePredictionMode.Enabled = true;
if (!x264BframeBias.Enabled)
x264BframeBias.Enabled = true;
}
...
and
...
private void x264SubpelRefinement_SelectedIndexChanged(object sender, System.EventArgs e)
{
if (this.x264SubpelRefinement.SelectedIndex >= 5 & this.x264NumberOfBFrames.Value >= 1) // RDO & B-frames are enabled, enable RDO for B-frames
this.bRDO.Enabled = true;
else
this.bRDO.Enabled = false;
this.showCommandLine();
}
...
The trellis thing is more tricky... i'll think about it tonight.
New binaries: http://forum.doom9.org/showthread.php?p=739329#post739329
Sharktooth
9th November 2005, 22:08
In CommandLineGenerator.cs:
switch (xs.EncodingMode)
{
case 0: // ABR
sb.Append("--bitrate " + xs.BitrateQuantizer + " ");
break;
case 1: // CQ
sb.Append("--qp " + xs.BitrateQuantizer + " ");
break;
case 2: // 2 pass first pass
sb.Append("--pass 1 --bitrate " + xs.BitrateQuantizer + " --stats " + "\"" + xs.Logfile + "\" ");
break;
case 3: // 2 pass second pass
case 4: // automated twopass
sb.Append("--pass 2 --bitrate " + xs.BitrateQuantizer + " --stats " + "\"" + xs.Logfile + "\" ");
break;
case 5: // 3 pass first pass
sb.Append("--pass 1 --bitrate " + xs.BitrateQuantizer + " --stats " + "\"" + xs.Logfile + "\" ");
break;
case 6: // 3 pass 2nd pass
sb.Append("--pass 3 --bitrate " + xs.BitrateQuantizer + " --stats " + "\"" + xs.Logfile + "\" ");
break;
case 7: // 3 pass 3rd pass
sb.Append("--pass 3 --bitrate " + xs.BitrateQuantizer + " --stats " + "\"" + xs.Logfile + "\" ");
break;
case 9: // constant quality
sb.Append("--crf " + xs.BitrateQuantizer + " ");
break;
} // now add the rest of the x264 encoder options
Where's "case 8" ?!? It should be Automated 3pass... guess that's why it doesnt work well...
Doom9
9th November 2005, 22:12
Where's "case 8" ?!? It should be Automated 3pass.Yup, but you never get there because when generating jobs, the first job generated will be a 3 pass first pass, the 2nd will be a 3 pass 3rd pass and the 3rd one will be a 3pass 2nd/3rd pass depending on your settings.
Sharktooth
9th November 2005, 22:16
ok... then the problem is in "turbo"... damnit i dont even know c#...
Randall
9th November 2005, 22:29
looks like case 3 does nothing as well... just a comment. and you should probably have a default case no?
I know a little bit of C#. Where is "turbo" located?
Doom9
9th November 2005, 22:35
I don't feel like coding but it's going to take me longer to tell you how megui works than for me to locate and fix whatever is broken.. it's all menial things, a few lines per problem max. don't worry about that switch, it does what it should and I don't need a default case if I know beforehand what values that are going to arrive in that switch.
Randall
9th November 2005, 22:39
sorry man I was only looking a one function there. ;) i know what you mean about explaining how some software works. sometimes it's easier to just go in there and fit it yourself. my co-worker spent like 20 minutes one time explaining a fix that i needed to make that ended up being a one-liner. d'oh!
Sharktooth
9th November 2005, 22:41
default case isnt needed coz the value is retrieved from a drop down list that already has a default value.
turbo is not an x264 option. it's a checkbox in the x264ConfigurationDialog.
When ShowCommandLine() is called it checks if Turbo is enabled or disabled...
private void checkBox_CheckedChanged(object sender, System.EventArgs e)
{
this.showCommandLine();
}
... but i must be blind coz i cant find where the showCommandLine function is...
EDIT: found it.... eheh
Doom9
9th November 2005, 22:42
the best thing you can do right now to help is try out combinations of the gazillion options there are, so that this week-end I have a list of all the cases that still need work and I can solve them all together..
@Sharktooth: you're looking in the wrong place.. it's more productive if you focus on trying to find more issues in the GUI.
Randall
9th November 2005, 22:43
use ctags http://ctags.sourceforge.net/ to dump out all of the functions, then you can jump right to it with your favorite editor. I use gvim.
Sharktooth
9th November 2005, 22:52
ok. the big problems are:
1) trellis dropdown gets enabled if you exit the dialog and re-open it coz it's default enabled on load...
a check should be added the _Load event to esabilish if CABAC is enabled or not... and consequently enable/disable trellis dropdown.
2) the disabled controls remains in the command line generation (if they're checked or different than default value).
Sharktooth
9th November 2005, 22:55
3) when rising b-frames from 0 to 1 P4x4 checkbox control gets disabled (grayed out) even with unrestricted level.
EDIT: however navigating into megui code is a pain in the ... :|
Randall
9th November 2005, 23:08
find . \( -name '*.cs' -a -print \) | ctags -L - will save your life. after that just open up any source file with gvim, highlight the function you wanna find, do a "ctrl ]" and you're there. no more headaches or grepping everywhere for code. http://cantor.ee.ucla.edu/~jsab/vim_ctags_cpp.html
Doom9
9th November 2005, 23:26
the disabled controls remains in the command line generation (if they're checked or different than default value).which ones?
Sharktooth
10th November 2005, 02:28
which ones?
every grayed out but still checked or different from default control.
example: select high profile... select custom partitions... check all MBs.. then select baseline profile... select show commandline.
8x8dct and I8x8 are still in the commandline even if baseline profile grayed them out and should have removed them...
charleski
10th November 2005, 02:41
I'm not sure what the rules are for submitting development suggestions and code - I looked through the pages on this thread and couldn't find anything so I hope it's OK to just post this.
While playing around with the profiles Sharktooth posted I got the idea that it would be nice to be able to do so in a 'safe' manner, so that you could go back to the original without having to re-extract it from an archive. Since it's clear that doom9 just loves writing GUI code I downloaded VC# 2005 Express and had a go at doing the modification myself.
I thought I'd present what I have working at the moment and ask the following questions:
1) Are you interested in this sort of stuff?
2) Is there anything I'm doing horribly wrong? - I noticed that VC#Express had to convert the project before opening it. Also, I learnt programming in Pascal (i.e. many years ago), but I think my modifications are in line with acceptable object-oriented practice.
3) Should I be doing anything else in terms of managing code versions?
I wrote a changelog which I'll append here:
10-Nov-2005
Altered the way in which MeGUI handles changes to the video configuration in the x264 dialog. The aim is to allow n00bies like me to tinker with proper profiles such as the ones released by Sharktooth without overwriting them and forgetting what settings they've changed.
There is a new option in the MeGUI Settings dialog: Safe Profile Alteration.
If this is checked, upon exiting the dialog by clicking OK after having changed any of the encoder settings APART from bitrate, SAR and zones, the program will create a new profile called "<old profile name>Tweaked" which contains the new settings. The user may subsequently revert back to the old profile at any time as it remains intact.
I excluded bitrate, SAR and zones from the protection as I thought those were elements that users might want to alter according to the particular video being encoded.
At the moment this profile protection only operates on the x264 configuration.
Modified files:
x264ConfigurationDialog.cs (the bulk of the new code)
SettingsForm.cs
SettingsForm.rsx
MeGUISettings.cs
Form1.cs
(these 4 are altered to present the new Safe Profile Alteration setting and pass it to x264ConfiurationDialog)
I have not fully tested this yet, though it seems to work on the tests I've done so far. I just wanted to see if there's interest in me carrying on with this and expanding the protection to the other codecs as well. The changes were made on the 0.2.3.1b version of MeGUI.
Link to modified code (http://homepages.nildram.co.uk/~cajking/MeGUI-src.0.2.3.1b MODIFIED.rar)
Doom9
10th November 2005, 09:12
@charleski: unfortunately there are two things that need to be sorted out before I can upgrade the project to Visual Studio 2005 (I suppose it doesn't matter if I use Pro (have to for work) or Express): One is I need to make sure I can still compile the project for .NET 1.1 (I'm sure I'll dump that requirement sooner than later), and what goes along with it is to find out if I can have the old and new visual studio installed in parallel.
Also, I see the solution to all this deactivation crap as one method that contains the whole activation/deactivation logic and which is called with each show showcommandline call, as well as when a profile is loaded (opening of the window). What is causing problems right now is mostly that the deactivation crap is in the various event handlers for the various gui events.. so when you load a profile, there's a variety of things that go on and that interfere with each other (so I also have to deactivate the firing of any events until the whole profile has been loaded). Then I also have to make sure there's corresponding logic in the commandlinegenerator.. and that's that. But having the logic in two places is always prone to error.. but it's the only way to handle triple state for GUI elements that just have two states.
charleski
10th November 2005, 13:00
OK, thought it would be alright since you advertised the Express series on the front page :).
If you look at my code you'll see that I had to stick a profileAltered flag into the event handlers as well :/. I wasn't too happy about that, but the logic needs some way of knowing if the user has modified the settings in order to work sanely. An alterantive would be just to compare the current settings to those stored in the profile on exiting the dialog though. Which, now I think of it, might be a neater solution.
Sharktooth
10th November 2005, 13:27
@charleski: unfortunately there are two things that need to be sorted out before I can upgrade the project to Visual Studio 2005 (I suppose it doesn't matter if I use Pro (have to for work) or Express): One is I need to make sure I can still compile the project for .NET 1.1 (I'm sure I'll dump that requirement sooner than later), and what goes along with it is to find out if I can have the old and new visual studio installed in parallel.
Yes, it's possible. use command line compilers from the SDKs and modify the paths to point the 1.1 framework. You can even use the 2.0 compilers with 1.1 libs. It's what i did to compile the MeGUI binaries for .NET 1.1.
For what concerns having both VS 2003 and VS 2005, it should be possible coz they install in different folders, but i dint try it coz i migrated all projects to 2005.
Sharktooth
10th November 2005, 15:06
I forgot to say Auto-3pass is buggy... expecially with turbo option (look at the command lines).
Randall
10th November 2005, 15:51
Manual 3-pass encoding without turbo should be fine though correct?
Sharktooth
10th November 2005, 15:53
it should
charleski
10th November 2005, 20:32
I've fixed a bug in my code and altered it so it no longer uses a flag in the event handlers. Instead I created a new method in x264Settings that checks whether one set of encoder settings is substantially different to another.
The link given above points to the latest version.
Tima
11th November 2005, 00:21
When encoding XviD for more than 24 hours, MeGUI's status displays running time as "actual_time mod 24_hours". Remain time is OK.
I used unpatched 0.2.3.1b, encoding XviD with latest Celtic Druid's build of Mencoder.
Sharktooth
11th November 2005, 03:11
"latest Sharktooth's build of mencoder"??!?
not really... i never uploaded any build of mplayer/mencoder made by me.
Tima
11th November 2005, 03:21
I am SORRY, they are C_D's.. [there was 5.21AM when I wrote that post.. :) Fixed]
Pomyk
11th November 2005, 23:55
I get an error when trying to queue a job: 'The file "file.avs" cannot be opened.'
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at MeGUI.JobUtil.generateVideoJob(String input, String output, VideoCodecSettings settings)
at MeGUI.JobUtil.prepareVideoJob(String movieInput, String movieOutput, VideoCodecSettings settings)
at MeGUI.MeGUI.getVideoJobs()
at MeGUI.MeGUI.addVideoJob(Boolean start)
at MeGUI.MeGUI.queueVideoButton_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.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
After a bit of debugging I noticed that 1st call to AVIFileGetStream works but a 2nd one fails. Avisynth files work in every other app (x264cli, VD, players). I have an Athlon X2 3800+.
charleski
14th November 2005, 01:00
Just to let you know for when you work out the whole .NET 2.0 thing, I added profile protection to the other codecs as well. Latest code and build is at the link given in my first post.
stax76
14th November 2005, 01:51
An alterantive would be just to compare the current settings to those stored in the profile on exiting the dialog though.
You cannot compare ref types unless you do it by hand adding comparison code for every field added and if that field is a ref type again it must implement IComparable. Value type semantics allow comparison assuming you do not embed ref types which you should never do. I rather apply hacks to ship around ref type characterics to avoid wasting my time cluttering my code with boilerplate code. If you copy/compare by hand and forget to update your copy/compare code you introduce nice little bugs.
I've looked into the code and spotted some bugs, e.g. the copy code for Zones which is a array, collection types are ref types, assigning this both references point to the same object, if it has value type items a shallaw copy can be done meaning the values are copied, it would not work for ref type items. The compare code for Zones can't work either as completely missing.
I work with very complex object graphs and clone and compare them very easiliy using reflection, it's robust and works reasonable fast, reflection performance was in 1.1 already good and was much improved in 2.0.
copies ref types:
<DebuggerHidden()> _
Public Shared Function GetCopy(ByVal o As Object) As Object
Using ms As New MemoryStream
Dim bf As New BinaryFormatter
bf.Serialize(ms, o)
ms.Position = 0
Return bf.Deserialize(ms)
End Using
End Function
'compares complex object graphs using recursion, supports collection types, excludes NonSerializabe marked fields
Public Shared Function GetCompareString(ByVal obj As Object) As String
Dim sb As New StringBuilder
ParseCompareString(obj, Nothing, sb)
Return sb.ToString
End Function
Public Shared Sub ParseCompareString(ByVal obj As Object, ByVal declaringObj As Object, ByVal sb As StringBuilder)
If TypeOf obj Is ICollection Then
For Each i As Object In CType(obj, ICollection)
If IsGoodType(i) Then
If IsToString(i) Then
sb.Append(i.ToString)
Else
ParseCompareString(i, obj, sb)
End If
End If
Next
Else
If IsGoodType(obj) Then
Dim t As Type = obj.GetType
While Not t Is Nothing
For Each i As FieldInfo In t.GetFields(BindingFlags.Public Or BindingFlags.NonPublic Or BindingFlags.Instance Or BindingFlags.DeclaredOnly)
If Not i.IsNotSerialized Then
Dim o As Object = i.GetValue(obj)
If IsGoodType(o) Then
If IsToString(o) Then
sb.Append(i.Name + "=" + o.ToString + vbCrLf)
'sb.Append(i.Name + "=" + o.ToString + " [" + t.Name + "]" + vbCrLf)
Else
If Not o Is declaringObj Then
ParseCompareString(o, obj, sb)
End If
End If
End If
End If
Next
t = t.BaseType
End While
End If
End If
End Sub
Private Shared Function IsGoodType(ByVal o As Object) As Boolean
If o Is Nothing Then
Return False
End If
If TypeOf o Is Pointer Then
Return False
End If
If Not o.GetType.IsSerializable Then
Return False
End If
Return True
End Function
Private Shared Function IsToString(ByVal o As Object) As Boolean
If Not o Is Nothing Then
If o.GetType.IsPrimitive Then
Return True
End If
If TypeOf o Is String Then
Return True
End If
If TypeOf o Is CultureInfo Then 'some fields change here
Return True
End If
End If
End Function
Also, I see the solution to all this deactivation crap as one method that contains the whole activation/deactivation logic and which is called with each show showcommandline call, as well as when a profile is loaded (opening of the window). What is causing problems right now is mostly that the deactivation crap is in the various event handlers for the various gui events.. so when you load a profile, there's a variety of things that go on and that interfere with each other (so I also have to deactivate the firing of any events until the whole profile has been loaded).
Sounds good (and like a lot fun ;), I did GUI code to death and still struggle sometimes, what I "like" most is updating the caption of ListBox items as it requires a blocking mechanism in both directions.
charleski
14th November 2005, 03:08
You cannot compare ref types unless you do it by hand adding comparison code for every field added and if that field is a ref type again it must implement IComparable.Look at the code (x264Settings.cs). Doom9's implementation already contains a method to clone collections of encoder settings, so I added in a specialised comparator as well (comparison of some of the values in the settings is not relevant for my particular needs - documented in the comments).
I wasted a good couple of hours hunting around to see if C# has some sort of method of exposing the components of a class even if they aren't known, allowing you to step through the collection, but couldn't find anything suitable. I was looking for something like:
Compare (typeDefinedElsewhere groupOfStuff1, groupOfStuff2)
foreach (element of typeDefinedElsewhere)
if not SpecialCase(element)
if groupOfStuff1.element = groupOfStuff2.element
...
etc
It may be that this sort of functionality has been developed for C# and I just missed it though.
OTOH, the codec settings are a pretty static set of data, and unlikely to change unless there's a change in the functionality of the underlying encoder. If there is, then all the methods that would require alteration are neatly in one place.
stax76
14th November 2005, 04:20
Look at the code (x264Settings.cs). Doom9's implementation already contains a method to clone collections of encoder settings
I did not see this but how could this work when the clone code of the collection items don't work?
so I added in a specialised comparator as well (comparison of some of the values in the settings is not relevant for my particular needs - documented in the comments).
Now I see the comments, why are those fields excluded, I remember some bad experience with such special threatment.
I wasted a good couple of hours hunting around to see if C# has some sort of method of exposing the components of a class even if they aren't known, allowing you to step through the collection, but couldn't find anything suitable. I was looking for something like:
Maybe you was looking for the reflection API, many use reflection and attributes all over the place including much of the .NET libs, you can see this decompiling with Reflector, I spend as much time browsing reflector as reading the SDK docs figuring out how things work or why things don't work or work different I thought they would.
Doom9
14th November 2005, 11:22
on a different subject.. the codec configuration never underwent any major change, but the featureset did so now I have to cram in options in places that aren't always logically connected so I'm wondering if anyone has an idea for improvement in that area, especially for the x264 codec.
Richard Berg
15th November 2005, 06:58
@Doom9 - if you're still thinking of building for .net 1.1 using vs2k5, here's a decent blog post: http://blogs.msdn.com/jomo_fisher/archive/2005/04/22/410903.aspx
Sharktooth
15th November 2005, 13:36
@Richard: Doom9 is using csc to compile megui. setting paths to 1.1 libs and stuff in the SDK is enaugh to make csc compile for the 1.1 NET framework.
bond
15th November 2005, 14:37
there is still a problem with the macroblocks options of x264:
when i first go to "none" and than to "custom" i can tick the p4x4 option altough the p8x8 isnt ticked
when i tick the i4x4 flag the next problem occurs as ticking the i4x4 flag automatically ticks the p8x8 too, altough afaik p8x8 is not a requirement for i4x4
than i have another thing: i think the naming of the codecs is somehow misleading, you offer ASP, AVC, XviD and Snow, altough XviD is ASP too of course
wouldnt it be better to label the codecs
- ASP (libav)
- ASP (xvid)
- AVC (x264)
- Snow
that way newbies get a feeling for what they are actually using (both codec and format-wise)
berrinam
16th November 2005, 08:41
A bug with OneClick mode when using codecs other than x264 will cause it not to generate the jobs, and also halt the queue.
This can be fixed by changing if (settings != null) // verify that the video corresponds to the chosen avc level, if not, change the resolution until it does fit in JobUtil.openVideo to if (settings != null && settings is x264Settings) // verify that the video corresponds to the chosen avc level, if not, change the resolution until it does fit The problem was that, on the next line, the settings were being cast into x264 settings without first checking that they were x264, causing a cast type error. It seems not many people use OneClick, as I am the only one who reports these errors.
Doom9
16th November 2005, 09:46
It seems not many people use OneClick, as I am the only one who reports these errors.Either that or everybody uses x264 only.. I suspect both are rather true, and we're probably facing an interface problem because the one click mode isn't what people get to see right away. Programs that were developed after MeGUI have it much easier as all the problems have already been ironed out...
Sharktooth
17th November 2005, 17:41
Another patch:
case 2: // high profile, enable everything
if (!x264CabacEnabled.Enabled)
x264CabacEnabled.Enabled = true;
if (!x264NumberOfBFrames.Enabled)
x264NumberOfBFrames.Enabled = true;
if (x264NumberOfBFrames.Value > 0)
{
if (!x264AdaptiveBframes.Enabled)
x264AdaptiveBframes.Enabled = true;
if (!x264PyramidBframes.Enabled)
x264PyramidBframes.Enabled = true;
}
if (!x264I8x8mv.Enabled)
x264I8x8mv.Enabled = true;
if (!adaptiveDCT.Enabled)
adaptiveDCT.Enabled = true;
if (!x264BframeBias.Enabled)
x264BframeBias.Enabled = true;
if (!x264BframePredictionMode.Enabled)
x264BframePredictionMode.Enabled = true;
if (!quantizerMatrixGroupbox.Enabled)
quantizerMatrixGroupbox.Enabled = false;
if (!x264LosslessMode.Enabled)
x264LosslessMode.Enabled = true;
if (x264LosslessMode.Checked)
{
x264BitrateQuantizer.Enabled = false;
x264EncodingMode.SelectedIndex = 1;
x264EncodingMode.Enabled = false;
}
else if (!x264BitrateQuantizer.Enabled)
x264BitrateQuantizer.Enabled = true;
if (!trellis.Enabled)
trellis.Enabled = true;
quantizerMatrixGroupbox.Enabled = true;
break;
the red lines are missing in the source and cause the b-pyramid option to be grayed out if you load a x264 High-Profile megui video profile and click "Config".
Sharktooth
17th November 2005, 18:22
another bug: b.pyramid gets disabled even if you rise or lower the b.frames value...
gonna fix it later along with the trellis always enabled when you open the config dialog. I will also add the oneclick fix by berrinam in the binaries.
EDIT: i'm gonna verify if the b.pyramid should be enabled only with 2 or more b.frames... in that case the above patch is not good and the main profile should be fixed too... and it seems so...
Doom9
17th November 2005, 19:56
I'm gonna rewrite the whole darned tri-state stuff as soon as I refind my motivation.. with so much going on at work I just need to relax in the evening. Fixing here and there isn't going to do any good here, a complete new start is needed.. for each showcommandline run a "peoplebuggingmeintoaddingfeaturesineverlikedinthefirstplaceanknewtheyregoingtogetmeintotrouble" and have a matching function in the commandlinegenerator that instead of en/disabling forces what imho the gui should do as well.. force options on and off and set them to what they should be set to.
Sharktooth
17th November 2005, 19:59
well...i can still publish temporary fixes until you find the motivation :)
however i was thinking to redo the whole thing from scratch... in the meanwhile i'll fix the here and there glitches (so ppl stop bugging my ass:D they made me start learning C#...)
Doom9
17th November 2005, 21:11
well.. I can give you a few pointers. when it comes to tri-state and GUI, everything is in the event handlers for each GUI element.. so just load it in the GUI designer and double click on it. The only extra method is adjustMBOptions which maps profiles to MB selection options. The reason for most of the problems upon loading is that events are fired as the GUI is being filled, so each line in CodecSettings property triggers some GUI action.. and they mess with each other.
The other part is in the commandlinegenerator, where I correct the tri-state mess (booleans have two values so checked but disabled turns into true in x264settings and I have to correct for that with additional logic). This rewrite could make things easier as there would basically be two methods that do the same thing, one for GUI options, the other for x264settings..
Revgen
17th November 2005, 21:50
I'm gonna rewrite the whole darned tri-state stuff as soon as I refind my motivation.. with so much going on at work I just need to relax in the evening. Fixing here and there isn't going to do any good here, a complete new start is needed.. for each showcommandline run a "peoplebuggingmeintoaddingfeaturesineverlikedinthefirstplaceanknewtheyregoingtogetmeintotrouble" and have a matching function in the commandlinegenerator that instead of en/disabling forces what imho the gui should do as well.. force options on and off and set them to what they should be set to.
I can see now why Len0x quit working on AutoGK. :(
Sharktooth
17th November 2005, 23:28
I should have fixed the x264 config Enabled/Disabled things... i did it in a hurry so i hope it works. Next step: fixing Auto 3-passes with turbo.
Downloads moved here: http://forum.doom9.org/showthread.php?p=739371#post739371
EDIT: i still insist on setting up a SVN server... :P
Tima
17th November 2005, 23:49
MeGUI crashes when I open any *.d2v project in 'AviSynth Script Creator'.
I use DGMPGDec 1.4.6 beta 1. All paths in MeGUI appear to be correct.
Sharktooth
17th November 2005, 23:52
i suppose that's not due to my patches...
Sharktooth
18th November 2005, 00:10
there is still a problem with the macroblocks options of x264:
when i first go to "none" and than to "custom" i can tick the p4x4 option altough the p8x8 isnt ticked
when i tick the i4x4 flag the next problem occurs as ticking the i4x4 flag automatically ticks the p8x8 too, altough afaik p8x8 is not a requirement for i4x4
I missed this one. It's on my way...
charleski
18th November 2005, 00:12
I'd like to help, but I'm using the VS Express freebies with .NET 2, how much of an issue is that? I agree with Sharktooth, an SVN would make things a lot easier - no point working on something that someone else is fixing.
Sharktooth
18th November 2005, 00:13
I'm also using VS2005... just convert the project and tell VS to make backups.
Tima
18th November 2005, 00:17
i suppose that's not due to my patches...
I have this problem also with older unpatched versions.. ;)
charleski
18th November 2005, 00:23
Tima, can you upload one of the .d2v files you're having problems with?
Sharktooth
18th November 2005, 00:46
Ok... this time i think i fixed'em all...
Moved here: http://forum.doom9.org/showthread.php?p=739928#post739928
Tima
18th November 2005, 01:06
Tima, can you upload one of the .d2v files you're having problems with?
The problem happens with ANY d2v project I open..
Example: http://for_spam.gorodok.net/misc/project.d2v
charleski
18th November 2005, 01:28
Can you include a short mpeg segment (ideally an .m2v file) to go with the d2v file so I can see what's happening? You can find a number of tools to manipulate and cut vobs on the downloads page.
Tima
18th November 2005, 01:48
Ehm.. the unhandled exception is 'Unable to load DLL (dgdecode.dll)'
Do I still have to upload vobs? ;)
Sharktooth
18th November 2005, 01:53
no... :D
charleski
18th November 2005, 03:06
What Sharktooth was trying to say (:)) is that it sounds like the problem is quite simple. Try copying the DGdecode.dll from your DGMPDEC folder to the one MeGUi is in.
Sharktooth
18th November 2005, 03:20
Levels are yet another pain in the a$$...
Im not going to fix them right now...
charleski
18th November 2005, 03:43
Ok, I can have a go at tackling levels, though it needs a design decision.
The way I would handle it is to make any level setting override all other alterations, so if you have a level set it would confine any other tweaking of the profile to stay within the set level (perhaps giving a warning if you wanted to go outside it). A cursory scan of the code shows that doom9 has already done fair amount of stuff on levels, though - this might need to be changed.
Tima
18th November 2005, 10:37
What Sharktooth was trying to say (:)) is that it sounds like the problem is quite simple. Try copying the DGdecode.dll from your DGMPDEC folder to the one MeGUi is in.
Thanks, it's indeed a good workaround. :)
Doom9
18th November 2005, 10:52
A cursory scan of the code shows that doom9 has already done fair amount of stuff on levels, though - this might need to be changed.I did everything.. it just bit when you loaded a profile.. as other things did. So all that needs to be done is copy the code from level_Selectionchanged (or whatever it's called in code) into the new big method that takes care of all activation/deactivation. Levels must override everything else.. otherwise people will end up with a stream that won't play in future standalones and blame us even though their settings are to be blamed. I also forced a resolution override into the one clicker when we have a level set.
Thanks, it's indeed a good workaround.It's not a workaround, it's how it has to be. The DLL has to be somewhere where the system will find it.. so that's the program path, the system32 path and presumably every other path that is in your system's PATH.
Tima
18th November 2005, 15:33
The DLL has to be somewhere where the system will find it..
It would be way more convenient, if I could specify the path to dgdecode.dll in 'Settings' (the same way I specify the path to dgindex.exe ;)). Could you implement this feature?
Sharktooth
19th November 2005, 15:46
New code patch including B-RDO for SVN builds
Moved here: http://forum.doom9.org/showthread.php?p=740761#post740761
charleski
20th November 2005, 02:07
Ok, I've done a rewrite of the code to control AVC Levels.
All the relevant logic now sits in AVCLevels.cs and each decision is centralised to aid management.
Switching to a new profile is barred if the new profile violates the level that's selected. The selected level is enforced at each call to showCommandLine(). [edit: All the other level code in the event handlers has been removed.] The enforcement code will attempt to make the current codec settings conform to the level specified. If it is unable to do so it will force the level to Unrestrained and the calling Form (x264ConfigurationDialog) will pop up a warning dialog.
*Please* can people do some beta-testing on this. The core logic seems to work fine, but it needs to be tested with input files of differing size, bitrate, etc. Right now my brain hurts :).
There's a debug build of the altered MeGUI in the bin/Debug folder, though it may need .NET 2.0 installed. There's a backup of the orginal project files in the archive - VS 2005 only seemed to convert the main .csproj file.
I've included Sharktooth's patches in this version, though some form of code management would be nice, if anyone wants to set up a repository :).
I haven't included my SafeProfileAlteration modification: no-one's made any comment on it, though I find it quite useful for when i'm playing around with settings. I'll probably fold it in in a day or two.
The levels patch (full source code + debug build) is here (http://homepages.nildram.co.uk/~cajking/MeGUI-src.0.2.3.1b-Levels.rar)
Sharktooth
20th November 2005, 15:16
Could you provide only the modified files please? It seems you did something that screwed the .NET 1.1 compilation.
do not play with forms and controls with VS2005 (just edit the code) or it will screw 1.1 compatibility.
charleski
20th November 2005, 18:40
I didn't touch the forms or controls at all, not sure what difficulty you're having. The only conversion points according to UpgradeLog.xml are</Event><Event ErrorLevel="0" Project="MeGUI" Source="MeGUI.csproj" Description="Project converted successfully">
</Event><Event ErrorLevel="3" Project="MeGUI" Source="MeGUI.csproj" Description="Converted">
</Event><Event ErrorLevel="0" Project="" Source="MeGUI.sln" Description="Solution converted successfully">
</Event><Event ErrorLevel="3" Project="" Source="MeGUI.sln" Description="Converted">
</Event><Event ErrorLevel="0" Project="MeGUI" Source="MeGUI.csproj" Description="Scan complete: Upgrade not required for project files.">
Anyway, here are the files I changed : MeGUI-src.0.2.3.1b-LvlsModFiles0.2.rar (http://homepages.nildram.co.uk/~cajking/MeGUI-src.0.2.3.1b-LvlsModFiles0.2.rar )
I've been looking into using csc directly and just pointing it to old .NET 1.1 libraries, but it took a while to track down the docs on MSDN (got sidetracked into stuff on MSBuild and the SDM). What switches do you alter for a 1.1 build, just point /reference and /lib to the right places? I noticed a blog entry saying they plan to support builds direct to 1.1 for VS2005 by Jan/Feb.
Sharktooth
21st November 2005, 16:16
Im talking about this:
Form1.cs(2417,34): error CS1501: No overload for method
'x264ConfigurationDialog' takes '3' arguments
x264ConfigurationDialog.cs(210,10): (Location of symbol related to previous
error)
You played with forms and now csc isnt able to compile megui... (however i cant understand why it reports that error).
However get the original sources and reapply your changes without touching forms and controls, then redirect all the stuff (path of libs, includes etc...) to the 1.1 SDK respective folders and use csc.exe (the 2.0 version) or the compile.bat as usual.
Doom9
21st November 2005, 16:42
why not just use csc.exe from the 1.1 runtime/sdk installation to compile?
Sharktooth
21st November 2005, 16:43
coz csc 2.0 is newer, faster and less buggy than 1.1 and can compile 1.1 as well.
Doom9
21st November 2005, 16:49
well, it takes what, 2 seconds to compile megui? and I have yet to have any problems with it. And it's tried and tested whereas the 2.0 release is still rather new.
Sharktooth
21st November 2005, 17:00
well MS suggests to use the csc 2.0 to compile even 1.1 stuff. however "crosscompiling" from .NET to .NET was already used with 1.1 -> 1.0.
turning back on the compile error, i cant still understand why it complains about "overloading" when everything seems to be ok.
charleski
21st November 2005, 17:22
Im talking about this: Form1.cs(2417,34): error CS1501: No overload for method
'x264ConfigurationDialog' takes '3' arguments
x264ConfigurationDialog.cs(210,10): (Location of symbol related to previous
error)
Ok, that looks like you have some of the files mixed up. Both Form1.cs and x264ConfigurationDialog.cs are changed. x264ConfigurationDialog needs to know the frame size if it's specified so that it can pass that to the AVC level checker when attempting to load a new profile.
You played with forms and now csc isnt able to compile megui... (however i cant understand why it reports that error).Well obviously I changed the code, but I didn't touch the form design. What are you talking about with "forms and controls", the Windows Form Designer generated code? That's completely untouched.
redirect all the stuff (path of libs, includes etc...) to the 1.1 SDK respective folders and use csc.exe (the 2.0 version) or the compile.bat as usual.Hmm, ok, slightly cryptic, but it sounds like I should change vsvars32.bat in the SDK to make a set of environment variables that point to the 1.1 SDK. I'll give that a go.
Sharktooth
21st November 2005, 17:27
Ok, that looks like you have some of the files mixed up. Both Form1.cs and x264ConfigurationDialog.cs are changed. x264ConfigurationDialog needs to know the frame size if it's specified so that it can pass that to the AVC level checker when attempting to load a new profile.
No, they both have 4 arguments. vs2005 compiles it with no problems.
i looked into the .NET docs and: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cscomp/html/vcerrCompilerErrorSC1501.asp
Well obviously I changed the code, but I didn't touch the form design. What are you talking about with "forms and controls", the Windows Form Designer generated code? That's completely untouched.
Yes, sorry i thought it didn't compile coz of the form.cs changes (i didnt even look at the error)...
Hmm, ok, slightly cryptic, but it sounds like I should change vsvars32.bat in the SDK to make a set of environment variables that point to the 1.1 SDK. I'll give that a go.
Yes, that worked for me.
Sharktooth
21st November 2005, 17:30
oh... i found the problem.... you didnt update the x264_only section for conditional compiling...
patch:
--- megui_lvl/Form1.cs Sun Nov 20 16:45:29 2005
+++ meguisrc/Form1.cs Mon Nov 21 17:36:02 2005
@@ -2414,8 +2414,16 @@
break;
}
#elif X264_ONLY
- x264ConfigurationDialog xcd = new x264ConfigurationDialog(this.videoProfiles, this.path,
- videoProfile.Text);
+ int hres, vres, nFrames;
+ double framerate;
+ if (this.videoInput.Text == "")
+ { // no input video specified
+ hres = vres = 0;
+ }
+ else
+ this.jobUtil.getAllInputProperties(out nFrames, out framerate, out hres, out vres, this.videoInput.Text);
+ x264ConfigurationDialog xcd = new x264ConfigurationDialog(this.videoProfiles, this.path,
+ videoProfile.Text, this.jobUtil.bytesPerFrame(hres, vres));
xcd.Input = this.videoInput.Text;
xcd.Output = this.videoOutput.Text;
if (settings.X264Encoder == 1)
@@ -2461,7 +2469,7 @@
videoProfile.SelectedIndex = index;
}
#endif
- if (player != null)
+ if (player != null)
player.Show();
updateIOConfig();
}indentation is screwed... :devil:
new full code patch with updated changelog: moved here -> http://forum.doom9.org/showthread.php?p=741004#post741004
NOTE: Snow conditional compiling was broken by the levels patch.
charleski
21st November 2005, 18:27
oh... i found the problem.... you didnt update the x264_only section for conditional compiling...
Ah, yes. All my patches were done for the full compile. I'll have to check that I haven't missed anything hidden in an x264_ONLY conditional, though I think it's all covered.
I got it to compile using 1.1 libraries, but since you've already posted a build i won't post another one. I'll write up some instructions for doing the compile in case others need it.
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.