View Full Version : MeGUI development


Pages : [1] 2 3 4 5

Doom9
11th June 2005, 14:28
This thread is dedicated to the development of MeGUI. If you don't "speak" C# this is the wrong thread to post in. For generic MeGUI problems refer to the main MeGUI thread (http://forum.doom9.org/showthread.php?t=96032)

You can get the source code from Sourceforge (http://sourceforge.net/projects/megui)

And here is the current TODO list (http://forum.doom9.org/showthread.php?t=105162)

celtic_druid
12th June 2005, 04:51
C# didn't seem all that hard last time I had a go at it.

I think next mencoder compile I will just disable pthreads or at least now that I know it is autodetected under mingw I will pack the dll. I couldn't get it to encode with threads > 1 for libavc though. With ffmpeg it works fine.

berrinam
12th June 2005, 07:28
I don't know if anyone noticed, but MeGUI seems to only have 4 of the 5 macroblock motion estimation modes for x264 (the i4x4 checkbox is missing, and the p4x4 checkbox actually enables i4x4, so p4x4 can't be enabled). I don't know what is going on with this, but I wrote a patch based on the sources Doom9 posted recently. I know that Doom9 is planning to rewrite a lot of the code, so I noted all the changes I made so that I (or someone else) can make them again on the new version. It is included in the sourcecode. Anyone interested?

I've attached the compiled version and the sources.

Doom9
12th June 2005, 13:37
@berrinam: actually, I don't find an i4x4 option in the mencoder documentation. but it's there in x264 so I'll use it. I also noted that you tied the options together the way they should be so I'll definitely use it.

Just a guess without checkingNope, definitely not.. the Belgian locale uses the same decimal separator as the German one.. and you're not getting 25000 fps video, are you?

akupenguin
12th June 2005, 18:21
actually, I don't find an i4x4 option in the mencoder documentation. I added it to mencoder at the same time as I added i8x8.

Doom9
12th June 2005, 19:20
since I'm apparently struck by blindness.. what's the option and default value?

akupenguin
12th June 2005, 20:59
the option is 'i4x4' or 'noi4x4', and the default is 'i4x4'.

xtknight
13th June 2005, 02:38
alright here goes:
speed up d2v preview when cropping. Basically I overwrite a bunch of pixels with white when cropping. I do that looping over pixels over the frame. There's a much more efficient way working with images.. it's to freeze the bitmap into memory, then consider it a byte array with each pixel being followed by each other. Since we're dealing with 24 bit images, you have sets of 3 bytes that make up one color.. first comes B, then G, then R. So, instead of the 4 loops, there could be one, and pixels could be set to a color by changing bytes in the byte array. Then when done, unlock the image again.

This could also be used for auto-crop.

And all of that is staying in the managed domain, without even having to resort to pointers. I'll attach a sample (that uses unsafe code.. but it gets you the basics) here.

Once the GUI is done, it could be extended to support multiple zones (taken from the preview window.. with a start and end button).

Then there's AVI support in auto mode. mencoder can be used to mux (vbr)mp3 and ac3 into an AVI (this would obviously require besweet configuration for mp3 output).

Then of course there's lots of lavc and xvid options that are unsupported.. but I guess somebody should ask for a specific option first.

Then of course there's the matter of the progress bar for mp4 muxing (you'll find some starter points in the mp4muxer class.. I never quite finished it.. and with x264.exe support, mp4box might act a bit different if your video input is also an mp4).

And while we're with mp4box.. now that it supports language tags of course that's something (support starts with the d2v creator.. rather than to have a checked listbox I guess having two dropdowns listing all languages would be good.. and if there's no info file, a selection like track1/2/etc could be used).

D2V Creator: tracks selected for demux should be filled in as audio source in the main GUI.

One click mode: select .ifo/vob, pick audio track, audio and video profile and hit go.. a lot of code to enable this is already there but it needs to be tied together.

Last but not least, if bond can confirm that libavformat's mp4 muxing is okay for ASP, perhaps we could offer direct mp4 output for xvid/lavc using mencoder.

And yet another one: the x264cli encoder should get the video bitrate (encoder tells you at the end), and from that derive the mp4 overhead and save it to the mp4stats file (and since direct mp4 output is now possible, I guess the mp4stats in the mp4 muxer will have to be adapted to take mp4 video input into account).

Though I'm very unfamiliar with DVDs I could probably help you do that. The only thing I'm unfamiliar with/don't know a thing about is the d2v resizing thing...not sure what that is...if you explain it more I could catch on fairly easy...

You just want me to modify that posted source or is there a later version at this time? I have decent knowledge of .NET languages and a little C++. My understanding is you just want this in .NET though right? I'd be very excited to be able to help.

You mentioned you were doing a GUI redo...should I wait?

- xtknight

Doom9
13th June 2005, 08:23
about the d2v: have a look at the avisynth creator form.. check out what happens if you change the crop values. Basically it does this: start at the first line, iterate over every pixel and set its color to white, go to the next line, set color to white, etc. until you've reached the number of pixels to be cropped away from the top.

The same is done at the right, left, and bottom. Doing it that way, I'm effectively marking certain pixels twice (and since assigning a color to a pixel is slow, this is a major waste of time)

A better way would be to consider the image to be an array of bytes (pixel1x1-blue, pixel1x1-green, pixel1x1-red, pixel1x2-blue, pixel1x2-green, pixel1x2-red, pixel1x3-blue, etc). If you look up the class definition of Bitmap, you'll see that you can lock and unlock the image in memory, and from the IntPtr you get, you can treat it as an array of byte and do this whole operation much more effectively (white = [255, 255, 255]). If that's not enough info, check the source and the example I posted on page 40.

You can safely start with the AviSynth window.. that one's good for now. Progress bar for mp4 muxing is also something you could work on, it doesn't depend on the GUI changes that are currently in the works. The bitrate calculation for AVI muxing could also be done, as well as the AVI muxer itself (just don't integrate it into the main form yet.. that's the one that is being totally revamped). So basically, anything that doesn't touch the main form is okay to be started right now.

oh, and by the way, C# isn't a must.. if you write your own class and are more familiar with say C++, it's alright with me. I know C++, but C# seems like a more straightforward language to me.

Is it just me, or is the version you posted v0.1914?Nope, I forgot to update the exe. And I'm having a major mess in my head with the version numbers myself.. and the fact that the forum refused to let me attach the latest version didn't really help reducing my confusion.

berrinam
13th June 2005, 09:39
For anyone who didn't notice, v0.193 is now available at http://forum.doom9.org/MeGUI-0.193.zip

@Doom9, I'm also happy to help with MeGUI. Will you post sources for subsequent versions, or should I just use the old sources?

Doom9
13th June 2005, 09:58
@berrinam: I will post the sources. Above I have listed the work that can start right now using the latest published sources. Since I've taken it upon myself to rearrange the GUI, it would currently not make a lot of sense to release sources that contain half-finished features that I'm going to finish in the next few days (I hope to get quite far today after work). But as you can see from the latest version, a lot has already been done. Once I'm all done, it will become much easier to make changes as the code is more separated into specific modules. I've already reduced the size of the main class from more than 400KB to 180KB and there's more to come. I also want to move out a lot of the logic to other classes, thus enabling more people to work on the program concurrently without stepping on each other's toes.

xtknight
13th June 2005, 23:07
Doom9:

OK I'm not sure about the AVI muxer...I got real close but I still can't get the damned thing to work.

Does MP4Box show progress? Is there some verbose option? I didn't see any progress bar when I was muxing a video but maybe I'm just blind.

So this d2v crop is for the preview window?

For the grayscale code:
I'm not sure if this would qualify as safe or unsafe, but I got it off of MSDN:

...
// Get the address of the first line.
IntPtr ptr = bmpData.Scan0;
...
// Copy the RGB values into the array.
System.Runtime.InteropServices.Marshal.Copy(ptr, rgbValues, 0, bytes);
...
// Copy the RGB values back to the bitmap
System.Runtime.InteropServices.Marshal.Copy(rgbValues, 0, ptr, bytes);

That code is unsafe, correct, even though there are no * pointers, per se? Unfortunately, I think this is one weakness of safe code...it's just not fast enough. The ideal thing to do would be to use assembler, with optimizations up to SSE3, which I don't know but I imagine there's some grayscale code out there. (Though even without the optimizations it would still be a lot faster.) You'd do this by calling a COM DLL coded with inline assembly in C++. Just wondering...what's the advantage of using safe code over unsafe? The 'safe' code gets turned into assembly later, anyway...I mean as long as you have sufficient error-catching there's no need to rely on managed code IMO. You said you didn't mind if it was coded in C++, but essentially that's the same as the unsafe C# code you have there...so...unless there's a faster safe way of doing it you're stuck there...or if that code I posted above is infact "safened" by .NET...

Evidently I haven't dealt with this stuff too much...so that's why I was skeptical of whether I could do this or not. Guess I'll go do the other stuff. And just out of curiosity what is the grayscale function used for?

berrinam
14th June 2005, 02:56
I'm just as confused as xtknight. I don't see how you can optimize the code as much as you say without making it unsafe. Anyway, I have rewritten the crop function with pointers (I presume this makes it unsafe) to see if this is what you mean. I'm using argb because it makes it easier just to read in an integer. I've also written some similar code (but longer) for the autocrop function, but I'm not including that here.


private void cropImage(ref Bitmap b)
{
BitmapData image = b.LockBits(new Rectangle(0, 0, b.width, b.height), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb)
int* pointer = image.Scan0.ToPointer();
int* pixel;
int stride = image.Stride;
int white = Color.white.ToArgb()
int lineGap = stride - (4*b.width);
int centerJump = b.width - left - right;

pixel = pointer;
for (int j = 0; j < top; j++) {
for (int i = 0; i < b.Width; i++) {
*pixel = white;
pixel++;
}
pixel += lineGap;
}

for (int j = top; j < b.Height - bottom; j++)
{
for (int i = 0; i < left; i++) {
*pixel = white;
pixel++;
}
pixel += centerJump;
for (int i = 0; i < right; i++) {
*pixel = white;
pixel++;
}
pixel += lineGap;
}
for (int j = b.Height-bottom; j < b.Height; j++)
{
for (int i = 0; i < b.Width; i++)
{
*pixel = white;
pixel++;
}
pixel += lineGap;
}
b.UnlockBits(image);
}

stax76
14th June 2005, 07:00
you don't have to manipulate images unless you are having fun with it :D. My code is fast and can crop and scale. See it in the latest DVX version in action. For my crop dialog I want to borrow a idea of Recode but for now I'm working on Stax DVB but I'll try to give you some competion with my DVX successor later ;)


using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.IO;
using System.Drawing.Imaging;
using System.Windows.Forms;
using System.Reflection;
using System.Diagnostics;

namespace VFW
{
public class AVIFile
{
public int Left, Top, Right, Bottom;

IntPtr AviFile;
IntPtr FrameObject;
IntPtr AviStream;
AVISTREAMINFO StreamInfo;
Control Control;

int FrameCountValue;

public int FrameCount
{
get { return FrameCountValue; }
}

public float FrameRate
{
get { return StreamInfo.dwRate / (float)StreamInfo.dwScale; }
}

public Size FrameSize
{
get { return new Size((int)StreamInfo.rcFrame.right, (int)StreamInfo.rcFrame.bottom); }
}

public void Open(string fileName, Control c)
{
Open(fileName);

Control = c;
}

string GetFourCC(int value)
{
byte[] bytes = BitConverter.GetBytes(value);
char[] chars = new char[4];

for (int i = 0; i < bytes.Length; i++)
chars[i] = Convert.ToChar(bytes[i]);

return new String(chars);
}

public void Open(string fileName)
{
try
{
AVIFileInit();

int OF_SHARE_DENY_WRITE = 32;

int result = AVIFileOpen(ref AviFile, fileName,
OF_SHARE_DENY_WRITE, 0);

if (result != 0)
throw new Exception("AVIFileOpen failed");

result = AVIFileGetStream(AviFile, out AviStream,
1935960438 /*FourCC for vids*/, 0);

if (result != 0)
throw new Exception("AVIFileGetStream failed");

FrameCountValue = AVIStreamLength(AviStream.ToInt32());

StreamInfo = new AVISTREAMINFO();

result = AVIStreamInfo(AviStream.ToInt32(), ref StreamInfo,
Marshal.SizeOf(StreamInfo));

if (result != 0)
throw new Exception("AVIStreamInfo failed");

if (GetFourCC(Convert.ToInt32(StreamInfo.fccHandler)) == "YV12")
FrameObject = AVIStreamGetFrameOpen(AviStream, 1);
else
FrameObject = AVIStreamGetFrameOpen(AviStream, 0);

if (FrameObject == IntPtr.Zero)
throw new Exception("AVIStreamGetFrameOpen failed");
}
catch (Exception ex)
{
MessageBox.Show("An error occurred. Maybe no YV12 decoder available, installing XviD, DivX or ffdshow might help.\r\n\r\n" +
ex.ToString(), Application.ProductName,
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

int PositionValue;

public int Position
{
get { return PositionValue; }
set
{
if (value < 0)
PositionValue = 0;
else if (value > FrameCount - 1)
PositionValue = FrameCount - 1;
else
PositionValue = value;
}
}

public void Close()
{
if (FrameObject != IntPtr.Zero)
{
AVIStreamGetFrameClose(FrameObject);
FrameObject = IntPtr.Zero;
}

if (AviStream != IntPtr.Zero)
{
AVIStreamRelease(AviStream);
AviStream = IntPtr.Zero;
}

if (AviFile != IntPtr.Zero)
{
AVIFileRelease(AviFile);
AviFile = IntPtr.Zero;
}

AVIFileExit();
}

public void Draw()
{
if (Control != null && Control.Visible)
{
Graphics g = Control.CreateGraphics();
Draw(g);
g.Dispose();
}
}

int DrawCount = 0;

public void Draw(Graphics g)
{
try
{
if (Control != null && Control.Visible && FrameObject != IntPtr.Zero)
{
Debug.WriteLine(++DrawCount);

Image img = GetBMPFromDib(new IntPtr(
AVIStreamGetFrame(FrameObject, Position)));

if (Left == 0 && Top == 0 && Right == 0 && Bottom == 0)
{
g.DrawImage(img, Control.ClientRectangle);
}
else
{
float factorX = (float)Control.Width / img.Width;
float factorY = (float)Control.Height / img.Height;

float left = Left * factorX;
float right = Right * factorX;
float top = Top * factorY;
float bottom = Bottom * factorY;

RectangleF rectDest = new RectangleF();

rectDest.X = left;
rectDest.Y = top;
rectDest.Width = Control.Width - left - right;
rectDest.Height = Control.Height - top - bottom;

Rectangle rectSrc = new Rectangle();

rectSrc.X = Left;
rectSrc.Y = Top;
rectSrc.Width = img.Width - Left - Right;
rectSrc.Height = img.Height - Top - Bottom;

g.DrawImage(img, rectDest, rectSrc, GraphicsUnit.Pixel);

SolidBrush sb = new SolidBrush(Color.White);

g.FillRectangle(sb, 0, 0, left, Control.Height);
g.FillRectangle(sb, 0, 0, Control.Width, top);
g.FillRectangle(sb, Control.Width - right, 0, right, Control.Height);
g.FillRectangle(sb, 0, Control.Height - bottom, Control.Width, bottom);

sb.Dispose();
}
}
}
catch (Exception ex)
{
MessageBox.Show("An error occurred. Maybe no YV12 decoder available, installing XviD, DivX or ffdshow might help.\r\n\r\n" +
ex.ToString(), Application.ProductName,
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

public Bitmap GetBitmap()
{
return GetBMPFromDib(new IntPtr(
AVIStreamGetFrame(FrameObject, Position)));
}

public Bitmap GetBMPFromDib(IntPtr pDIB) {
IntPtr pPix = new IntPtr(pDIB.ToInt32() + Marshal.SizeOf(typeof(BITMAPINFOHEADER)));

MethodInfo mi = typeof(Bitmap).GetMethod("FromGDIplus",
BindingFlags.Static | BindingFlags.NonPublic);

IntPtr pBmp = IntPtr.Zero;
int status = GdipCreateBitmapFromGdiDib(pDIB, pPix, ref pBmp);

return (Bitmap)mi.Invoke(null, new object[] {pBmp});
}

[DllImport("gdi32.dll", ExactSpelling=true)]
static extern bool DeleteObject( IntPtr obj );

[DllImport("gdiplus.dll", ExactSpelling=true)]
static extern int GdipCreateBitmapFromGdiDib( IntPtr bminfo, IntPtr pixdat, ref IntPtr image );

[DllImport("gdiplus.dll", ExactSpelling=true)]
static extern int GdipCreateHBITMAPFromBitmap( IntPtr image, out IntPtr hbitmap, int bkg );

[DllImport("gdiplus.dll", ExactSpelling=true)]
static extern int GdipDisposeImage( IntPtr image );

[DllImport("avifil32.dll")]
static extern void AVIFileInit();

[DllImport("avifil32.dll", PreserveSig=true)]
static extern int AVIFileOpen(
ref IntPtr ppfile,
String szFile,
int uMode,
int pclsidHandler);

[DllImport("avifil32.dll")]
static extern int AVIFileGetStream(
IntPtr pfile,
out IntPtr ppavi,
int fccType,
int lParam);

[DllImport("avifil32.dll", PreserveSig=true)]
static extern int AVIStreamStart(int pavi);

[DllImport("avifil32.dll", PreserveSig=true)]
static extern int AVIStreamLength(int pavi);

[DllImport("avifil32.dll")]
static extern int AVIStreamInfo(
int pAVIStream,
ref AVISTREAMINFO psi,
int lSize);

[DllImport("avifil32.dll")]
static extern IntPtr AVIStreamGetFrameOpen(
IntPtr pAVIStream,
int lpbiWanted);

[DllImport("avifil32.dll")]
static extern int AVIStreamGetFrame(IntPtr pGetFrameObj, int lPos);

[DllImport("avifil32.dll")]
static extern int AVIFileCreateStream(
int pfile,
out IntPtr ppavi,
ref AVISTREAMINFO ptr_streaminfo);

[DllImport("avifil32.dll")]
static extern int AVIStreamGetFrameClose(
IntPtr pGetFrameObj);

[DllImport("avifil32.dll")]
static extern int AVIStreamRelease(IntPtr aviStream);

[DllImport("avifil32.dll")]
static extern int AVIFileRelease(IntPtr pfile);

[DllImport("avifil32.dll")]
static extern void AVIFileExit();

[StructLayout(LayoutKind.Sequential, Pack=1)]
struct RECT {
public UInt32 left;
public UInt32 top;
public UInt32 right;
public UInt32 bottom;
}

[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi, Pack=1)]
struct BITMAPFILEHEADER {
[MarshalAs( UnmanagedType.ByValArray, SizeConst=2)]
public Char[] Type;
public Int32 Size;
public Int16 reserved1;
public Int16 reserved2;
public Int32 OffBits;
}

[StructLayout(LayoutKind.Sequential, Pack=1)]
struct BITMAPINFOHEADER {
public UInt32 biSize;
public Int32 biWidth;
public Int32 biHeight;
public Int16 biPlanes;
public Int16 biBitCount;
public UInt32 biCompression;
public UInt32 biSizeImage;
public Int32 biXPelsPerMeter;
public Int32 biYPelsPerMeter;
public UInt32 biClrUsed;
public UInt32 biClrImportant;
}

[StructLayout(LayoutKind.Sequential, Pack=1)]
struct AVISTREAMINFO {
public UInt32 fccType;
public UInt32 fccHandler;
public UInt32 dwFlags;
public UInt32 dwCaps;
public UInt16 wPriority;
public UInt16 wLanguage;
public UInt32 dwScale;
public UInt32 dwRate;
public UInt32 dwStart;
public UInt32 dwLength;
public UInt32 dwInitialFrames;
public UInt32 dwSuggestedBufferSize;
public UInt32 dwQuality;
public UInt32 dwSampleSize;
public RECT rcFrame;
public UInt32 dwEditCount;
public UInt32 dwFormatChangeCount;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=64)]
public UInt16[] szName;
}
}
}

berrinam
14th June 2005, 08:35
@stax: I understand what you mean. What about autocropping? Have you got any code that does that quickly?

Doom9
14th June 2005, 08:36
about safe/unsafe: I guess when you start using IntPtr it's essentually unsafe.. but basically I was concerned with having to use the unsafe flag for compilation and mark sections as unsafe. IntPtr, from my perspective, is basically a safe pointer and you don't have to worry about cleaning up the memory (that's my main gripe with unmanaged languages.. memory management.. ).

and I can do two passes with x264.exe just fine (that's one of the few things I actually tested in this build.. keep in mind it's alpha code)

berrinam
14th June 2005, 08:44
So where does that leave the whole situation with cropping, then? And how important is speeding up of cropping?

Doom9
14th June 2005, 10:19
So where does that leave the whole situation with cropping, then?I can't execute the code now, but it's pretty much what I was trying to describe. So if it works as it should we're good in that department. The autocrop you mentioned you had written in that style will also come in handy. As far as importance is concerned.. nobody has complained so far, and I think the performance bottleneck should be eliminated with your code and you can move to the next item on my list :)

Does MP4Box show progress? Yes it does. If you look at the mp4muxer class you see I'm already reading it.. I'm just not sending any statusupdates. My problem was that at some point during import. mp4box seems to run off, no longer waiting for me to read from stdout. So to reliably figure out when the next stream is being imported, you'll probably have to compare percentage values.

And as far as avi muxing is concerned, just use mencoder.. it can just mux a single stream, but supports cbr/vbr mp3 and AC3. I think that'll do just fine for now.

Does MeGUI really use the wrong parameter "i8x8mv" which really should be "i8x8"?Yes it does.. sorry about that. So before encoding, close MeGUI, open the xml files in question and edit the commandline, save them, restart MeGUI and start the jobs in the queue.

stax76
14th June 2005, 14:15
What about autocropping? Have you got any code that does that quickly?


I'm always tying to get with simple solutions therefore I'm parsing the output file of the auto crop AviSynth filter, I was always very satisfied with this method, needless to say it was a easy to implement it. If you like to you can write this in managed code but there is already managed code for this simply because C++ code can be compiled to IL. It's called managed extensions and the greatly improved successor is called C++/CLR. It's absolutely great for almost all interop tasks, more productive, more flexible and a lot easier as you only have to incude header files and it performs as well faster as normal interop, I use C++/CLR extensively in Stax DVB and for other projects. Besides that you have of course always a couple of other interop options like COM interop and P/Invoke.

Doom9
14th June 2005, 16:39
well.. I looked at DVX before doing my autocrop.. and ended up looking at GKnot for a "do it on your own solution". But if berrinam rewrote my autocrop based on the methods used in the preview cropping, it's going to be a lot faster than the current method (that still iterates over the image and does getPixel).

xtknight
14th June 2005, 19:20
sorry ignore this...my f**k up...

I can't get it to work in general...the log didn't show all the info so I replicated the same command in the command line.

Command line:

C:\Documents and Settings\unknown>"C:\tools\megui\mencoder.exe" "c:\mydocbackup\May 18-Channel 67 (7 19 pm) 001--mpeg2dec.avs" -ovc lavc -lavcopts vbitrate=80
-o "C:\Documents and Settings\unknown\Desktop\test.m4v" -of rawvideo
MEncoder dev-CVS-050524-19:49-3.4.2 (C) 2000-2005 MPlayer Team
CPU: Advanced Micro Devices (Family: 8, Stepping: 0)
Detected cache-line size is 64 bytes
CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE SSE2

85 audio & 199 video codecs
File not found: 'frameno.avi'
Failed to open frameno.avi
success: format: 0 data: 0x0 - 0x89
============ Sorry, this file format is not recognized/supported =============
=== If this file is an AVI, ASF or MPEG stream, please contact the author! ===
Cannot open demuxer.

Exiting...

AviSynth script:

MPEG2Source("C:\Documents and Settings\unknown\My Documents\May 18-Channel 67 (7 19 pm) 001.mpg")

This is understandable...it's an AviSynth script (it exists)...but why does your program import an AviSynth script when mencoder doesn't support it? Maybe it's just me? I've used mencoder with mpg files just fine. Never used vob/ifo files, etc...never recoded a DVD. I don't have any DVDs...I'm just trying to recode a TV show that was recorded in high bit-rate MPEG-2. Also any idea why mencoder doesn't recognize SSE/SSE2 in my Athlon64? Do I have to specify it manually some how? I'm asking all this now because I need to have a way to run MP4Box successfully from your program and fix the progress thing...

Doom9
14th June 2005, 19:35
If I can load the AviSynth script (e.g. you get a working preview window), then I have to assume it can be read. But, do you get that? You should see the video in the preview.. the thing is.. AviSynth displays a short video with the error if there's an internal error that isn't fatal. MPEG2Source expects a DGIndex project file though..

I'm afraid that's how it work.. if the AviSynth scrip can be opened with the AviFile API it is up to the user to decide if what he sees in the preview makes sense, and if it doesn't, fix it.

Create a dgindex project from your mpg file and load that via mpeg2source and everything should be okay.
Also any idea why mencoder doesn't recognize SSE/SSE2 in my Athlon64?That's normal.. it never has and never will. You'll find me asking the same thing in this very forum (not the same thread though I think).

xtknight
14th June 2005, 19:52
If I can load the AviSynth script (e.g. you get a working preview window), then I have to assume it can be read. But, do you get that? You should see the video in the preview.. the thing is.. AviSynth displays a short video with the error if there's an internal error that isn't fatal. MPEG2Source expects a DGIndex project file though..

I'm afraid that's how it work.. if the AviSynth scrip can be opened with the AviFile API it is up to the user to decide if what he sees in the preview makes sense, and if it doesn't, fix it.

Create a dgindex project from your mpg file and load that via mpeg2source and everything should be okay.
That's normal.. it never has and never will. You'll find me asking the same thing in this very forum (not the same thread though I think).

Well I fixed one careless mistake...turns out that MPEG2 file in the avs file didn't exist since I reinstalled Windows and moved the documents dir...so I changed that...

Yeah it wasn't showing in the preview. So now I use DirectShowSource and it works just fine.

Now the audio and video encode fine but I can't get MP4Box to run from the queue...nothing is logged in regard to MP4Box.

A command line like this worked for me:

C:\tools\megui>mp4box -add "C:\Documents and Settings\unknown\Desktop\may31rawaudio.mp4" -add "C:\Documents and Settings\unknown\Desktop\may31raw.m4v" -new "C:\Documents and Settings\unknown\Desktop\may31.mp4"

IsoMedia import - track ID 1 - Audio (SR 48000 - 2 channels) - SBR AAC
IsoMedia import - track ID 2 - media type odsm sub-type MPEG
IsoMedia import - track ID 3 - media type sdsm sub-type MPEG
MPEG-4 Video import - 720 x 480 @ 25.0000 FPS
Indicated Profile: Simple Profile @ Level 3
Import results: 500 VOPs (14 Is - 486 Ps)
Converting to ISMA Audio-Video MP4 file...
Saving may31.mp4: 0.500 secs Interleaving

Then after all that I can't play the file but I guess that's a separate issue. :confused: Also, should the FPS stay at 29.97 for NTSC video? Do I need to add fps=29.97 at the end of my DirectShowSource command?

Alright now the audio plays with mplayerc and video plays with Moonlight player...

Doom9
14th June 2005, 20:04
[quote]Do I need to add fps=29.97 at the end of my DirectShowSource command? I strongly suggest that.. it may work without but it's safer to specify it. And you also need to add -fps 29.97 before the -new in your mp4box commandline.. else you end up with 25fps video as you may have noticed.

As for playback, there are plenty of good tips in this and the container forum. Basically get the latest ffdshow and haali spliter (or ffdshow + install Nero).

As far as running mp4box goes.. you have the source ;) And if you're trying the alpha.. it might just be one of the million things that I broke since the latest stable release. I have the new version started for the first time now.. it's going to be a long while until everything works as it's supposed to.

xtknight
14th June 2005, 20:13
New windows installation so that's why I didn't have those codecs so thanks...I got it working now...plays fine and everything. It also muxes fine with the -fps 29.97.

IsoMedia import - track ID 1 - Audio (SR 48000 - 2 channels) - SBR AAC
IsoMedia import - track ID 2 - media type odsm sub-type MPEG
IsoMedia import - track ID 3 - media type sdsm sub-type MPEG
MPEG-4 Video import - 720 x 480 @ 29.9700 FPS

Last question-why is there 2 MPEG video tracks? I'm only giving it one raw input video file (just like your program would). Is one of them not video but extra information (like MPEG-21 or something)?

The thing is, I'm using your latest stable release (I believe), and MP4Box doesn't run with either that release (0.1914) or that latest dev release. I guess it's debugging time for me.

Doom9
14th June 2005, 20:20
well.. if you run mp4box -info (or something like that that works) on your audio .mp4 you'll see where those additional tracks come from. I don't particularly care why they are there.. but they are. If you care.. you'll find the answer somewhere in this forum.

xtknight
14th June 2005, 21:48
This has stumped me. Here is every line printed from stdout to the VS console (... as a placeholder):

MPEG-4 Video import - 720 x 480 @ 29.9700 FPS
Indicated Profile: Simple Profile @ Level 1
Importing: | | (01/100)
Importing: | | (02/100)
..........................................
Importing: |================== | (9The thread '<No Name>' (0xbbc) has exited with code 0 (0x0).
2/100)
Importing: |================== | (93/100)
Importing: |================== | (94/100)
..........................................
Importing: |=================== | (99/100)

Import results: 500 VOPs (24 Is - 476 Ps)
Converting to ISMA Audio-Video MP4 file...
Saving test6.mp4: 0.500 secs Interleaving
Writing: | | (01/100)
Writing: | | (02/100)
Writing: | | (03/100)
Writing: | | (04/100)
Writing: |= | (05/100)
Writing: |= | (06/100)
Writing: |= | (07/100)
Writing: |= | (08/100)
Writing: |= | (09/100)
Writing: |== | (10/100)
Writing: |== | (11/100)
Writing: |== | (12/100)
Writing: |== The thread '<No Name>' (0xbf8) has exited with code 0 (0x0).
| (13/100)

I noticed threads exiting between the progress indicators. And at the last one, a thread exited and the progress indicator stopped indefinitely. The interesting thing is the stderr reader thread is never aborted manually yet it ends abruptly for some reason. Maybe because of an exception...but why would there be an exception reading stderr when there's clearly output?

Doom9
14th June 2005, 22:14
@berrinam: could you post the autocrop code as well?

@xtknight: I think by now I've catched pretty much all the stdout/read error messages.. if you look at Encoder.cs you'll see I use a lot of try/catch.. so the only time such a thread would exit is if the process has ended.. you can easily verify that by placing breakpoints.

xtknight
15th June 2005, 00:23
@berrinam: could you post the autocrop code as well?

@xtknight: I think by now I've catched pretty much all the stdout/read error messages.. if you look at Encoder.cs you'll see I use a lot of try/catch.. so the only time such a thread would exit is if the process has ended.. you can easily verify that by placing breakpoints.

And that's exactly why I'm confused...there are no exceptions...

Unfortunately stuff like this happens in real time so breakpoints just don't work very well. The breakpoints won't stop the muxer so I can't see where its erroring...

So what I've decided to do is make a separate program to demonstrate the functionality, for two reasons:

1. MeGUI overwhelms me and it's hard to debug in such a big environment, especially having not wrote the program in the first place.

2. It's isolated and I can spend more time coding and less time browsing for my media files in the GUI itself to test it...

I hope you don't mind.

Update: Well what I think happening is the process exiting before the program has a chance to get the stdout...but I have no idea how to fix that. With the stdout redirect in DOS (>) I can get all of the messages from MP4Box, but in C# it just isn't getting the messages. If there's no other way to get the full stdout in C#, you could just open the file stdout-redirected to by DOS, and constantly read that in. Not that best way to do it though...well I hope I saved you some time anyway. If you want me to read progress using the DOS-outputed stdout, let me know. I wish there was a way to delay the process from exiting so it could get all the stdout. That would be ideal. Like I said there are no exceptions being thrown.

Doom9
15th June 2005, 07:25
Update: Well what I think happening is the process exiting before the program has a chance to get the stdout...uh, did you combine the output of multiple processes? there is a way to read everything from stdout.. process.ReadToEnd (or something similar.. I'm not in the IDE right now)

As I said previously, mp4box "running away" was what made me stop working on this.. but as it only runs away while writing the final output file.. it might not be terribly nice to have a progress bar that doesn't run linearly, but basically you could still use it for the importing.. I was thinking of having some indicator in the status update telling people "importing video", "importing audio1", "importing audio2", "importing subtitle1", .. "writing output", "splitting output", and each starts at 0%. The "running away" only seems to be happening in the last step.. so you can work around this by just not bothering with the progress in the last step, but rather use ideas from previous versiont that used mp4box, and simply have a thread that reads the output filesize and calculates the completion percentage from what you think the size should be and what it is.. it's not terribly accurate but it'll do just fine.

I never said it was straightforward.. why do you think I put it on hold? I even asked in the mp4box forum why mp4box acts the way it does : http://sourceforge.net/forum/forum.php?thread_id=1272493&forum_id=287547. No reply in almost 2 months.. clearly 3rd party programs using mp4box are no priority for the developers.

If you want me to read progress using the DOS-outputed stdout, let me know.Isn't that supposed to fail? If you have a file open in write mode, other processes cannot access it, can they?

P.S. You are now at the point where I was when I decided I wanted to do less boring things and hoping that the mp4box devs would do something about this behavior.. the challenge is going from this point to a working solution ;)

P.S.2 ) Perhaps I ought to file this behavior as a bug? After all except for the writing stage stdout is blocking.

berrinam
15th June 2005, 11:52
@berrinam: could you post the autocrop code as well?

Sorry about that, here are both pieces of code (now working :p )

Cropping function (changed):
private unsafe void cropImage(ref Bitmap b)
{
BitmapData image = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
byte* pointer = (byte*)image.Scan0.ToPointer();
byte* pixel;
int stride = image.Stride;
byte white = (byte) Color.White.R;

pixel = pointer;
int width = b.Width;
int height = b.Height;
int width3 = 3 * width;
int left3 = 3 * left;
int right3 = 3 * right;

int lineGap = stride - width3;
int centerJump = width3 - left3 - right3;
for (int j = 0; j < top; j++)
{
for (int i = 0; i < width3; i++) {
*pixel = white;
pixel++;
}
pixel += lineGap;
}
int heightb = height - bottom;
for (int j = top; j < heightb; j++)
{
for (int i = 0; i < left3; i++) {
*pixel = white;
pixel++;
}
pixel += centerJump;
for (int i = 0; i < right3; i++) {
*pixel = white;
pixel++;
}
pixel += lineGap;
}
for (int j = b.Height-bottom; j < height; j++)
{
for (int i = 0; i < width3; i++)
{
*pixel = white;
pixel++;
}
pixel += lineGap;
}
b.UnlockBits(image);
}


Autocropping function (including a changed isBadPixel(int) function):
private bool isBadPixel(int pixel)
{
int comp = 12632256;
int res = pixel & comp;
return (res != 0);
}
/// <summary>
/// iterates through the lines and columns of the bitmap and checks whether the brightness of each pixel is under a certain threshold (isBadPixel)
/// if enough 'bad pixels' are found, this line is assumed to be an image line. Cropping is done up to the first such line.
/// </summary>
/// <param name="b">the bitmap to be analyzed</param>
/// <returns>struct containing the number of lines to be cropped away from the left, top, right and bottom</returns>
private unsafe CropValues getAutoCropValues(Bitmap b)
{
// When locking the pixels into memory, they are currently being converted from 24bpp to 32bpp. This incurs a small (5%) speed penalty,
// but means that pixel management is easier, because each pixel is a 4-byte int.
BitmapData image = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
int* pointer = (int*) image.Scan0.ToPointer();
int* lineBegin, pixel;
int stride = image.Stride / 4;
CropValues retval = new CropValues();
bool lineFound = false;
int badPixelThreshold = 50;
int widthBadPixelThreshold = b.Width / badPixelThreshold;
int heightBadPixelThreshold = b.Height / badPixelThreshold;
int nbBadPixels = 0;

lineBegin = pointer;
for (int i = 0; i < b.Width; i++)
{
pixel = lineBegin;
for (int j = 0; j < b.Height; j++)
{
//if (b.GetPixel(i, j) != prevColor)
//if (isBadPixel(b.GetPixel(i, j)))
if (isBadPixel(*pixel))
nbBadPixels++;
if (nbBadPixels > heightBadPixelThreshold)
{
retval.left = i - 1;
if (retval.left < 0)
retval.left = 0;
if (retval.left % 2 != 0)
retval.left++;
lineFound = true;
break;
}
pixel += stride;
}
nbBadPixels = 0;
if (lineFound)
break;
lineBegin += 1; // 4-byte Argb
}
nbBadPixels = 0;
lineFound = false;
lineBegin = pointer;
for (int i = 0; i < b.Height; i++)
{
pixel = lineBegin;
for (int j = 0; j < b.Width; j++)
{
//if (b.GetPixel(j, i) != prevColor)
//if (isBadPixel(b.GetPixel(j, i)))
if (isBadPixel(*pixel))
nbBadPixels++;
if (nbBadPixels > widthBadPixelThreshold)
{
retval.top = i - 1;
if (retval.top < 0)
retval.top = 0;
if (retval.top % 2 != 0)
retval.top++;
lineFound = true;
break;
}
pixel += 1; // 4-byte Argb
}
nbBadPixels = 0;
if (lineFound)
break;
lineBegin += stride;
}
nbBadPixels = 0;
lineFound = false;
lineBegin = pointer + b.Width - 1;
for (int i = b.Width - 1; i >= 0 ; i--)
{
pixel = lineBegin;
for (int j = 0; j < b.Height; j++)
{
//if (b.GetPixel(i, j) != prevColor)
//if (isBadPixel(b.GetPixel(i, j)))
if (isBadPixel(*pixel))
nbBadPixels++;
if (nbBadPixels > heightBadPixelThreshold)
{
retval.right = b.Width - i;
if (retval.right < 0)
retval.right = 0;
if (retval.right % 2 != 0)
retval.right++;
lineFound = true;
break;
}
pixel += stride;
}
nbBadPixels = 0;
if (lineFound)
break;
lineBegin -= 1; // Backwards across 4-byte Argb
}
nbBadPixels = 0;
lineFound = false;
lineBegin = pointer + stride * (b.Height-1);
for (int i = b.Height - 1; i >= 0 ; i--)
{
pixel = lineBegin;
for (int j = 0; j < b.Width; j++)
{
//if (b.GetPixel(j, i) != prevColor)
//if (isBadPixel(b.GetPixel(j, i)))
if (isBadPixel(*pixel))
nbBadPixels++;
if (nbBadPixels > widthBadPixelThreshold)
{
retval.bottom = b.Height - i;
if (retval.bottom < 0)
retval.bottom = 0;
if (retval.bottom % 2 != 0)
retval.bottom++;
lineFound = true;
break;
}
pixel += 1;// 4-byte Argb
}
nbBadPixels = 0;
if (lineFound)
break;
lineBegin -= stride;
}
return retval;

}


The unsafe autocropping is about 4-8 times faster than before. Unsafe compiling must be allowed, though (Project->MeGUI properties->Build->Allow unsafe code blocks).

Doom9
15th June 2005, 18:26
here are both pieces of codeThanks. I'll integrate them shortly.

I had another idea about the mp4box "running away" problem. We know that this only happens in the last phase (correct me if I'm wrong), so you could rely on stdout for status updates until that last phase, then no longer send out status updates from the thread that reads stdout, but have another thread that reads the filesize and compares it to what you're supposed to get. And if the last step is splitting, since you know how mp4box names the split files, you can compare the size of the split file(s) with the size of the muxed mp4 and send statusupdates based on that).

xtknight
15th June 2005, 21:24
OK Doom9 I sent you a PM with the sample stdout interpreter/progress bar. It can update the status with either importing or writing (the only two I see when I mux video/audio). Enjoy. :D The path for muxing is hard-coded so when you integrate it you'll have to replace that obviously. For testing just specify the correct path for MP4Box and the MP4Box command line in the process.arguments. I don't know what was wrong with the StreamReader code you had but this class I got from CodeProject (http://www.codeproject.com/csharp/LaunchProcess.asp) seemed to do the trick, and it was easy as child's play from there.

On the left of my program's dialog it shows the actual stdout and on the right the interpreted form of it. Above both of those textboxes lies a label and a progress bar which also represent the status.

I also used the getLineType function among others from your program, and they include slight modifications.

Note: that CodeProject article says ReadToEnd() won't work because the status update in the GUI has to be synchronous and realtime with the external process's stdout. My testing seemed to confirm this.

Doom9
15th June 2005, 21:42
Note: that CodeProject article says ReadToEnd() won't work because the status update in the GUI has to be synchronous and realtime with the external process's stdout.correct.. you can use ReadToEnd to get everything until the process exits.. but that method only returns when the process has exited.

Anyway, thanks and I'll look at it once I have the next release ready (hopefully tomorrow.. I have audio and video encoding done.. now working on getting the auto mode to work properly again). and I want to move around profile creation as well.

Doom9
18th June 2005, 18:19
Just letting you know that I've added the sources of the latest published version to the first post.

xtknight
18th June 2005, 19:25
I got ahold of assembler gray-scale code. I'll see if I can get C# to execute it. I have VB.NET code to execute inline assembly so it shouldn't be too hard. ;) It should be fast enough to do gray-sacle in realtime.

Doom9
18th June 2005, 19:35
Uh.. grayscale why? Because of the sample I posted? I'm never using grayscale conversion and your code seems just fine. Better look at one of the other features that are still missing.

xtknight
18th June 2005, 20:19
Uh.. grayscale why? Because of the sample I posted? I'm never using grayscale conversion and your code seems just fine. Better look at one of the other features that are still missing.

oh...ok...I just happened to stumble across grayscale ASM code by mistake. This code generally just multiplies each R,G,B pixel by a factor. So technically it could be used for whatever you were intending ("marking" pixels?) I never knew what you were trying to do but if the code you have is fast enough already I guess there's no need.

Doom9
18th June 2005, 21:37
mixing managed code with Assembly? that must be real ugly.

Anyway, I finally integrated your code and it really speeds things up. And as you can see I'm already working on some other stuff but I still could use some help with other items.

xtknight
19th June 2005, 00:41
mixing managed code with Assembly? that must be real ugly.

Properly written assembler isn't any worse than unmanaged C++. It's not exactly a 'fashion statement', though. :P

Anyway, I finally integrated your code and it really speeds things up. And as you can see I'm already working on some other stuff but I still could use some help with other items.

Give credit to berrinam, he wrote that code, not me. :)

berrinam
19th June 2005, 02:47
D2V Creator: tracks selected for demux should be filled in as audio source in the main GUI and from there to the muxing window in auto mode (so that the language is pre-selected)
Any idea as to how to find the filename of the demuxed audio? It seems that all of the filename can be worked out from the Stream Information except for the bitrate of the audio. Should I just look for standard bitrates (448kbps, 384kbps, etc) or is there some way to get DGIndex to print the filenames to stdout?

Doom9
19th June 2005, 02:55
It calls the files as follows:

projectname <audio format> <track> <channel_format> <bitrate>bps DELAY <delay>ms.extension

basically track is important (T01, T02, T03). So, I'd do a directory lookup (Directory.something) to get files that contain the track identifier and project name.. I think that should get you enough info to find the actual file.

xtknight
19th June 2005, 04:32
I don't completely understand what you want with the languages thing. I've never worked with DVDs before but I do have a full list of every DVD language if you want it. From what I could tell from your to-do list you already have a language selection (because you said instead of checkboxes)? What is the language used for? .ifo files? What do I do once I know what language the user has chosen?

Did you get around to thoroughly testing the MP4Box progress bar? I just don't know what to do with the subtitles you sent me...I'm real inexperienced with DVDs. I understand what vob,ifo files are I just don't know what's in the ifo files and where/how subtitles are stored. I read the doom9 dvd newbie guide on it but it didn't really explain the subtitles for me.

And yet another one: the x264cli encoder should get the video bitrate (encoder tells you at the end), and from that derive the mp4 overhead and save it to the mp4stats file (and since direct mp4 output is now possible, I guess the mp4stats in the mp4 muxer will have to be adapted to take mp4 video input into account).

So, currently, x264.exe does not get the bitrate when it's called from your app? Just a quick question: what's CLI mean?

Hey, BTW I love the new interface on the latest MeGUI!

berrinam
19th June 2005, 08:27
Can more than 2 audio tracks be put into mp4? Is there a reason that MeGUI limits it to two?

I'm asking because I want to know what should happen when the user chooses more than two audio tracks -- which ones get put into the inputs?

Also, about zones in the new interface: it doesn't seem very practical. Where do you get the frame numbers from for the zones? I would presume from the avspreview window. But this is inaccessible while the zones window is open. Also, setting credit start doesn't appear to be adding a zone at the end.

Doom9
19th June 2005, 11:05
I don't completely understand what you want with the languages thing. I've never worked with DVDs before but I do have a full list of every DVD language if you want it. From what I could tell from your to-do list you already have a language selection (because you said instead of checkboxes)? What is the language used for? .ifo files? What do I do once I know what language the user has chosen?Alright.. if you go to the settings, you'll find two empty language dropdowns. I will fill them in the next release. Based on that info, in the d2v creator, once you've parsed the info file, you can auto check the tracks that match the prfered language from the settings.
Then once you have created the dgindex project and close the window, the two audio tracks (if they match the languages from the preferences take those two, if there's only one match, take that and the first "other".. if there's no match take the first two, or if it's only one you only take one) and plug them into the audioFiles array in the main GUI.

Did you get around to thoroughly testing the MP4Box progress bar? I just don't know what to do with the subtitles you sent me...I'm real inexperienced with DVDs. I understand what vob,ifo files are I just don't know what's in the ifo files and where/how subtitles are stored. I read the doom9 dvd newbie guide on it but it didn't really explain the subtitles for me.Here's how to mux 2 audio tracks and 3 subs and chapters into an mp4:

mp4box -add video.264 -add audio1.mp4;lang=eng -add audio2.mp4;lang=ger -add subtitle1.srt;lang=eng -add subtitle2.srt;lang=ger -add subtitle3.srt;lang=fre -chap chapters.txt -spf 23.976 -new output.mp4

And no, I haven't gotten around to testing it.

Can more than 2 audio tracks be put into mp4? Is there a reason that MeGUI limits it to two?There is no limit. However, there is a limit in a practical sense.. most people watch movies in one lanugage. If it's a foreign language move they may at times want an additional track but 3 or more tracks are simply not practical.. most people don't speak as many languages. This also corresponds with how most other programs handle things and a poll on the AutoGK site on the subject. While I've now basically rewritten the audio selection code to be as flexible as the subtitle code (thus it wouldn't be a big issue to add a track, I'm just not sure about the bitrate updates), I will not do that.

But this is inaccessible while the zones window is open. Wait and you'll see.. I'm already working on it and I'm sure people will like the way it is done. Naturally it won't be the regular preview window but one you have to open from the codec configuration window.

Also, setting credit start doesn't appear to be adding a zone at the end.It does.. just not at the point you'd think. Because I don't want to put a zone into each codec configuration I only add it at the very end when you're queueing the job. There is a basic conflict between zones and credits though.. do you show it when you enter the configuration dialog? what to do if the configuration dialog is never entered, what to do if the codec is changed (remove it in the previous codec, or leave it). So I was thinking about the following: credits (and intro in the future) will not be shown in the configuration and once a job is created, if the credits zone intersects with an existing one, the credits zone has been configured manually and thus won't do anything.. if the credits zone would be the last one it would be added. There are of course a few alternatives.. I'm not a 100% sure which would be the best one. There's also the question about profiles and zones.. right now they are saved because they're part of the settings.. but does that make sense or should zones be removed if something is saved as a profile?

Doom9
19th June 2005, 13:35
I've added a few design studies for some of the features on the todo list.

Doom9
19th June 2005, 23:07
So, currently, x264.exe does not get the bitrate when it's called from your app? Just a quick question: what's CLI mean?
cli = commandline interface, and of course I send the bitrate to x264.exe. But at the end of encoding, x264.exe shows the following line (amongst others):

encoded 43 frames, 22.02 fps, 1095.94 kb/s

from that you can get the actual video bitrate (without container overhead) and put into the log (you can also get the container overhead from this of course... ). mencoder writes something similar. It's really no big deal, just a little commandline parsing.

If you're working on the d2v creator, make sure you use the latest sources.. the language selections in the settings can finally be made.

berrinam
19th June 2005, 23:10
If you're working on the d2v creator, make sure you use the latest sources.. the language selections in the settings can finally be made.

Will do.

Doom9
19th June 2005, 23:18
and there's another one if you're already working on that class.. run dgindex minimized.. the solution can be either found in the development forum or the avi.net thread.. I'm a participant in both discussions. Or perhaps it's in the old megui thread. Either way the solution is aready around, and it's a real easy fix

LigH
20th June 2005, 08:30
In case someone did not yet notice: Microsofts default Windows filters (after a fresh install) don't convert YV12 in general, planar video formats are rather unusual. But DivX 5 or XviD - once installed - take this job, and I even got some ATI codecs some long time ago.

ffdshow's raw video conversion is just another way to go. Who knows how many more filters or codecs can be used as "helpers"...

Doom9
20th June 2005, 09:15
@Ligh: though that doesn't seem to be the problem here as he can play the file in a media player. But if you can, then we know the filters are available.. it's just that AVIFile works differently.. I really wished I could reproduce this somehow because right now I'm rather clueless... I know which call fails but I have no idea why.. I guess I need to read into the AVIFile API after all - unfortunately it's the one class I didn't write by myself and except for a small change to expose the video framerate I have never touched it.

But first... x264 custom matrices.

LigH
20th June 2005, 09:27
Before you get crazy about it - first we should try to find out if the reason is the 'CPAE'* bug.

The second idea: If you are often testing many different setups, a virtual PC might be the perfect solution; install, backup the harddisk file, check out... Some even support temporary disk operations which are discarded when the emulator closes, if I remember right. BOCHS is a free solution, but maybe a bit slow, I'm afraid?

__

* CPAE: "Codec Packs Are Evil"

Doom9
20th June 2005, 10:31
what is 'CPAE'*?

ahh.. saw it in your signature. Obviously I don't have time for 20 different setups so basically we need to compare configurations of cases where it fails to find out some common ground.

And before I forget, custom matrices are actually already supported since I have added a field to the x264 configuration where you can plug in additional commandline parameters.. just plug in a valid matrix configuration there and you're all set. And those settings are even saved in profiles :)

LigH
20th June 2005, 10:59
Signature? - No, just a "footnote"! ;) (Just made something similar to the "ID-10T error".)

stax76
20th June 2005, 12:08
AVIStreamGetFrameOpen failed

I'm struggling with such problems for years, when I was using DShow instead of avifile it was even worse. Recent months I didn't get any bug reports at all so I guess most issues are solved. Try open with AVSEdit!

http://www.planetdvb.net/AVSEdit_1.1.1.3.exe

there is a reg key where you can define which yv12 decoder to use, it's described in the AVSEdit topic

Doom9
20th June 2005, 12:24
@stax: what did you change in the avi opening routines in between the last release where this problem was reported and the last release?

GetFrameOpen certainly seems to point to a decoder problem. And I'm wondering why the problem does not ocurr in VDub.. could it be that it's using homebrewn routines rather than standard VfW ones, at least for certain tasks?

I did some more reading and found this: http://www.gamedev.net/reference/programming/features/avifile/page4.asp Makes me think the conversion to 24bit could be the culprit. http://www.shrinkwrapvb.com/avihelp/avihlp_3.htmseems to confirm that converting to 24 bit can be problematic.

stax76
20th June 2005, 13:12
there were a couple of different things that could cause trouble, color space, yv12 decoder, color depth and iirc even screen resolution. The functions taking care of it are:


string GetFourCC(int value)
{
byte[] bytes = BitConverter.GetBytes(value);
char[] chars = new char[4];

for (int i = 0; i < bytes.Length; i++)
chars[i] = Convert.ToChar(bytes[i]);

return new String(chars);
}

public void Open(string fileName)
{
try
{
AVIFileInit();

int OF_SHARE_DENY_WRITE = 32;

int result = AVIFileOpen(ref AviFile, fileName,
OF_SHARE_DENY_WRITE, 0);

if (result != 0)
throw new Exception("AVIFileOpen failed");

result = AVIFileGetStream(AviFile, out AviStream,
1935960438 /*FourCC for vids*/, 0);

if (result != 0)
throw new Exception("AVIFileGetStream failed");

FrameCountValue = AVIStreamLength(AviStream.ToInt32());

StreamInfo = new AVISTREAMINFO();

result = AVIStreamInfo(AviStream.ToInt32(), ref StreamInfo,
Marshal.SizeOf(StreamInfo));

if (result != 0)
throw new Exception("AVIStreamInfo failed");

if (GetFourCC(Convert.ToInt32(StreamInfo.fccHandler)) == "YV12")
FrameObject = AVIStreamGetFrameOpen(AviStream, 1);
else
FrameObject = AVIStreamGetFrameOpen(AviStream, 0);

if (FrameObject == IntPtr.Zero)
throw new Exception("AVIStreamGetFrameOpen failed");
}
catch (Exception ex)
{
MessageBox.Show("An error occurred. Maybe no YV12 decoder available, installing XviD, DivX or ffdshow might help.\r\n\r\n" +
ex.ToString(), Application.ProductName,
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}



GetFrameOpen certainly seems to point to a decoder problem. And I'm wondering why the problem does not ocurr in VDub.. could it be that it's using homebrewn routines rather than standard VfW ones, at least for certain tasks?

I did some more reading and found this: http://www.gamedev.net/reference/pr...ifile/page4.asp Makes me think the conversion to 24bit could be the culprit. http://www.shrinkwrapvb.com/avihelp/avihlp_3.htmseems to confirm that converting to 24 bit can be problematic.


I don't know but you could ask Avery Lee

Doom9
20th June 2005, 14:12
thanks :)

Doom9
20th June 2005, 19:54
@xtknight: I managed to kill your muxer with my test scenarios :) And I scrapped everything but the idea of starting two threads besides the main processing thread.. but that seems to work as desired, even though mp4box still "runs away".. but at least I get the stdout, and when I'm not debugging I expect the GUI to stay on top of the mp4box process. Now it's time to turn that status window back alive.

xtknight
21st June 2005, 01:39
and there's another one if you're already working on that class.. run dgindex minimized.. the solution can be either found in the development forum or the avi.net thread.. I'm a participant in both discussions. Or perhaps it's in the old megui thread. Either way the solution is aready around, and it's a real easy fix

yup...see my reply in that thread:

http://forum.doom9.org/showthread.php?t=94578

@xtknight: I managed to kill your muxer with my test scenarios :) And I scrapped everything but the idea of starting two threads besides the main processing thread.. but that seems to work as desired, even though mp4box still "runs away".. but at least I get the stdout, and when I'm not debugging I expect the GUI to stay on top of the mp4box process. Now it's time to turn that status window back alive.

OK...uh...what was the command line you gave to kill it? I realize I need to account for the different types of status mp4muxer spits out but the problem is I don't know what those would be, so I need to try the command line here and find out.

---------------------

By the way, about that AVIStreamGetFrameOpen open problem..umm..I got that error with MeGUI when I was opening a file with a broken version of AVISynth. Could that be the problem?

To catch the errors you must open a new thread because the AVIFile API will crash your main program thread without returning anything IIRC.

berrinam
21st June 2005, 09:51
I have a few updates prepared here:

Firstly, a bugfix for crashes in the Avisynth Window (see this thread (http://forum.doom9.org/showthread.php?t=96185)). This is done by adding

suggestResolution.Enabled = false;
autoCropButton.Enabled = false;
previewButton.Enabled = false;
to AviSynthWindow.AviSynthWindow (constructor)
and adding

suggestResolution.Enabled = true;
autoCropButton.Enabled = true;
previewButton.Enabled = true;

before player.Show() in AviSynthWindow.openVideo(string)

Next is a bugfix for autocropping. Autocropping previously undercropped on the left and on the top if the amount to be cropped was odd, i.e. it rounded down instead of up, leaving one line of black bars. This is now changed to overcrop by one line in this situation. To apply, go to AviSynthWindow.getAutoCropValues(Bitmap). Change

retval.left = i - 1;
(in the first loop) to

retval.left = i;
and change

retval.top = i - 1;
(in the second loop) to

retval.top = i;
.

Finally, audio files will now be copied from VobinputWindow to mainForm by the following:
turn VobinputWindow.projectCreationFinished(bool) into
this.processing = false;
if (loadOnSave.Checked && !error)
{
string[] files = Directory.GetFiles(Path.GetDirectoryName(projectName.Text) + @"\",
Path.GetFileNameWithoutExtension(projectName.Text)+"*");
int counter = 0;
foreach (int index in audioTracks.CheckedIndices)
{
if (counter >= 2)
{
// More than two tracks is not supported
break;
}
else
{
string trackNumber = "T" + ((counter+1).ToString()).PadLeft(2, '0');
string filename = "";
foreach (string file in files)
{
if (file.IndexOf(trackNumber) != -1) // It is the right track
{
filename = file;
}
}
if (filename.Length != 0)
{
mainForm.setAudioTrack(counter, filename,
Path.GetDirectoryName(projectName.Text) + @"\" +
Path.GetFileNameWithoutExtension(filename) + ".mp4");
}
}
counter++;
}
AviSynthWindow asw = new AviSynthWindow(projectName.Text);
asw.OpenScript += new OpenScriptCallback(mainForm.asw_OpenScript);
asw.Show();
this.Close();
}
and in the MeGUI class, add the following function (I treat it as a helper function, but your choice, of course):
public void setAudioTrack(int trackNumber, string input, string output)
{
// Change view to other track
if (trackNumber == 1)
{
audioTrack1.Checked = true;
audioTrack2.Checked = false;
}
else
{
audioTrack1.Checked = false;
audioTrack2.Checked = true;
}
audioTrack_CheckedChanged(null, null);

this.audioStreams[trackNumber].path = input;
this.audioStreams[trackNumber].output = output;

if (audioStreams[trackNumber].isInputMP4Muxable())
audioStreams[trackNumber].settings = null;
else if (audioStreams[trackNumber].isOutputMP4Muxable())
audioStreams[trackNumber].settings = this.currentAACSettings;
else
audioStreams[trackNumber].settings = null;

audioOutput.Enabled = true;
}

Enjoy!

EDIT: If there is a better way to communicate changes, please tell me. These long posts seem quite cumbersome.

EDIT2: Changed first bugfix per MeteorRain's request.

berrinam
21st June 2005, 10:26
Maybe the Ok and Cancel buttons should be put on each tab for the video config settings?

MeteorRain
21st June 2005, 11:18
Maybe the Ok and Cancel buttons should be put on each tab for the video config settings?
a better idea is to catch the 2 buttons out of the tab control ^ ^

Doom9
21st June 2005, 12:23
Maybe the Ok and Cancel buttons should be put on each tab for the video config settings?I was considering that too... just strikes me as bad having multiple buttons for the same purpose. I've never had any formal training on what is good or bad GUI design so I guess I'll just add them. Normally I'd try to have a bottom area with just the buttons, independent of the tabs, but that would mean an even bigger window.

Though those things are part of what I put as a todo point... reorganize dialogs.. perhaps the way I've ordered the options could be improved, and then I think it would be nice to have a dropdown for the profile.. like simple profile, main profile and high profile. high profile would enable 8x8i and 8x8dct, allow quant 0 and allow custom matrices (currently working on that). For the difference between simple and main profile I'd have to look at bond's sticky but I'm sure something could be worked out for this as well.

Doom9
21st June 2005, 21:22
@xtknight: certain split and raw video input scenarios. I have them ironed out though but not doing everything very properly right now.. in raw video input, certainly .264, the percentage can reset.. you take this as a grounds to increase the track number.. that is wrong.. I did it the way I had planned using my existing code.. it takes care of that but you still have the resetting percentage.. it's no big deal to fix that though.. I have it mapped out just need to code it.

MeteorRain
22nd June 2005, 03:29
@doom9
could you have a modify at the encoding status window to make it similar to the status window of the VDM that can minimize to the startmenubar instead of at the bottomleft of the screen like the style in windows 3.2 now?

azsd
23rd June 2005, 09:44
this may called Taskbar as usually.

in ProgressWindow.cs form,set the "Window Style -> ShowInTaskBar" to True.

and by the way modify the form font to Tahoma or It will changed to different fonts in runtime in different os because unchanged(defaut) fonts havn't store in form.

or you can uncheck "TopMost" field
now It goes yuanman shimashita like VDM status dialog.

mmm,but is there MeGUI 1.9.9.9 src availble for download at somewhere?

Doom9
23rd June 2005, 11:04
but is there MeGUI 1.9.9.9 src availble for download at somewhere?I wish, I had those, too ;) But if you're refering to 0.1.9.9 then no and they won't because I've already started working on the next revision so the code has been changed.

I started making dialogs not appear in the status window because I ended up having a lot of entries there... main gui, dialog 1, preview window from that dialog and a quantizer matrix editor at the same time.. that seemed a bit excessive.

Doom9
23rd June 2005, 21:31
the latest sources are out now.

If anybody has an idea about category1 (mentioned here: http://forum.doom9.org/showpost.php?p=677298&postcount=114 - inability to redirect stderr from commandline and .net) don't hesitate..

berrinam
24th June 2005, 09:30
I have added a few design study screenshots for these features. In case you want to start implementing one, please give me a heads-up, because the design will require some changes.

I'm planning to work on the OneClick Encode. Is there some way for me to get your design files for it?

Doom9
24th June 2005, 09:57
There are none. I only got that screenshot from North101. There's no need for the container dropdown right now and certainly not the PSP thing (you need a special non specs compliant MP4 muxer for the PSP anyway.. and it's seriously limited in terms of what resolutions and framerates it can support, too).

I'd appreciate it though if you could give the whole x264.exe status bar issue a look cos I'm stumped.

xtknight
24th June 2005, 17:10
There are none. I only got that screenshot from North101. There's no need for the container dropdown right now and certainly not the PSP thing (you need a special non specs compliant MP4 muxer for the PSP anyway.. and it's seriously limited in terms of what resolutions and framerates it can support, too).

I'd appreciate it though if you could give the whole x264.exe status bar issue a look cos I'm stumped.

If you model an x264 progress bar off that program I made which uses the CodeProject stdout reader class, does it work? I think it uses different functions than the stdout reader in MeGUI. For me, that CodeProject class read every single thing in stdout with no issues. What is x264clireader?

Doom9
24th June 2005, 17:20
What is x264clireader?A simple stdout stderr reader for x264.exe based on the muxer you sent me.. it uses exactly the same mechanisms to read stdout/stderr (as does the updated mp4 muxer.. which works fine for all parties involved).

This isn't so much about not reading things incorrectly.. this is about figuring out why for some people (a small minority) it doesn't work whereas the large majority has no problems at all with x264.exe. I suppose you'll start guessing soon enough, too because it'll work just fine on your machine. It's hard to fix issues you cannot reproduce and where you cannot go to the affected machine and start the debugger, isn't it?

berrinam
26th June 2005, 01:12
Another bug and bugfix:

In any codec configuration dialog, if you delete the last profile and then select a different one, it will crash. The following line needs to be added to the deleteVideoProfileButton_Click function, at the end of the if block:

this.oldVideoProfileIndex = -1;

Doom9
26th June 2005, 22:39
Another bug and bugfix:It also applies to the audio dialogues ;)

Doom9
27th June 2005, 19:14
btw, in case you haven't noticed, as admin my edits are now shown but I'm constantly updating the 3rd post in this thread as development progresses. The todo list is getting shorter.

I just finished AVI bitrate calculation.. once mencoder is up to the level, the AVI feature should be a walk in the park. Same goes for the still open mp4box issue, where I also have to adapt the stream info part a bit. But it almost seems to me the major bits are done.. except for the one click mode.

berrinam
27th June 2005, 22:10
But it almost seems to me the major bits are done.. except for the one click mode.
Well, good news: I have a preliminary version of the One Click encoder attached. If all the options have been configured (languages and codec profiles), then all you need to do is select the input file, and it will fill in the rest. I built it on v2.0.0 sources, so I'll just list the changes I made. Here goes:

I made a new form and class called OneClickWindow, which I have attached.
I added a menubutton to it from the main form. It has this event handler:
OneClickWindow oneClick = new OneClickWindow(this, videoProfiles, audioProfiles, videoProfile.SelectedIndex, audioProfile.SelectedIndex);
oneClick.ShowDialog();

I also added the following properties to MeGUI:
public JobUtil JobUtil
{
get {return this.jobUtil;}
}
public NeroAACSettings CurrentAACSettings
{
get {return this.currentAACSettings;}
set {this.currentAACSettings = value;}
}
public xvidSettings CurrentXvidSettings
{
get {return this.currentXvidSettings;}
set {this.currentXvidSettings = value;}
}
public x264Settings CurrentX264Settings
{
get {return this.currentX264Settings;}
set {this.currentX264Settings = value;}
}
public lavcSettings CurrentLavcSettings
{
get {return this.currentLavcSettings;}
set {this.currentLavcSettings = value;}
}
public snowSettings CurrentSnowSettings
{
get {return this.currentSnowSettings;}
set {this.currentSnowSettings = value;}
}

public string StartPath
{
get {return path;}
}
. And that is all for the One Click Window.
But I also have a bug and bugfix I found in the development: The AutoEncodeWindow was showing the wrong filesizes for the various DVD options. The fix is here:
sizeSelection_SelectedIndexChanged needs to be replaced by
if (sizeSelection.SelectedIndex == 0) // 1/4 CD
this.muxedSize.Text = "179200";
if (sizeSelection.SelectedIndex == 1) // 1/2 CD
this.muxedSize.Text = "358400";
if (sizeSelection.SelectedIndex == 2) // 1 CD
this.muxedSize.Text = "716800";
if (sizeSelection.SelectedIndex == 3) // 2 CDs
this.muxedSize.Text = "1433600";
if (sizeSelection.SelectedIndex == 4) // 3 CDs
this.muxedSize.Text = "2150400";
if (sizeSelection.SelectedIndex == 5) // 1/3 DVD
this.muxedSize.Text = "1501184";
if (sizeSelection.SelectedIndex == 6) // 1/4 DVD
this.muxedSize.Text = "1126400";
if (sizeSelection.SelectedIndex == 7) // 1/5 DVD
this.muxedSize.Text = "901120";
if (sizeSelection.SelectedIndex == 8) // 1 DVD
this.muxedSize.Text = "4586496";


EDIT: Newer AutoEncodeWindow code

berrinam
27th June 2005, 22:37
There are some problems/limitations with what I have done so far with the one click window. They are as follows:
-it is not possible to select the working directory (the button is disabled). The reason is that I haven't found a folderdialog class.
-I'm not sure what the situation is with MP4 overhead, so I've just copied the code from the AutoEncodeWindow
-custom filesizes are not enabled. I know how to do this, but at the moment I am too busy to implement it. EDIT: done
-nothing happens if you change the project name. As above, this is simply a matter of catching the valuechanged event, but I haven't done it yet. EDIT: done
-the code in general needs to be cleaned up. EDIT: done

Also, would it be worth turning DGIndex jobs into jobs that can be queued?

stax76
27th June 2005, 22:49
-it is not possible to select the working directory (the button is disabled). The reason is that I haven't found a folderdialog class.

enter folder in the search of Visual Studio and restrict the search on .NET Framework. If you look for stuff in .NET, you can also search with Google, Google Groups and at CodeProject. For Google Groups you can use this link:

http://groups.google.de/groups?ie=UTF-8&oe=UTF-8&as_ugroup=*dotnet*&lr=&hl=de

it searches only dotnet groups, I've used this a lot and still have to from time to time

berrinam
28th June 2005, 07:03
@stax: Thanks, I'll look into it.

Anyway, I've fixed up everything else that I can, which includes a basic code cleanup of the OneClickWindow class, and I have uploaded a new version to replace the old one.

Doom9
28th June 2005, 12:48
Also, would it be worth turning DGIndex jobs into jobs that can be queued?I'm not sure.. it would take quite a bit of work..and if you're looking at the one click window just writing a bunch of jobs, a lot of other things would be affected as well (for instance the loading of demuxed audio files from the DGIndex project creator)

Plus I imagine that there's some custom logic somewhere in between DGIndex and the rest of the jobs but I haven't looked at your attachement yet.

superdump
29th June 2005, 05:08
I don't know if this has been mentioned before so disregard it if it has but I've noted a couple of things.

Sometimes when switching between the config panel for x264 and the main window and then back again, the settings are remembered in precisely the same manner as they were set. It doesn't really matter, but when you select none from the list of analysis options, click ok, then click the config button, it switches to custom but with all options deselected. Similarly for 'all'. Looking again at the commandline I see that when none is selected there is no --analysis or -A switch specified, so default behaviour will be assumed by the command line encoder. This isn't the same as -A none.

The other thing is, would it be possible to move the rate/qp settings to the main window, or make the user defined profiles not remember the bitrate such that the profile can be selected and then the bitrate set for each encode? I'm not sure what the best method of attacking this would be. I'll have a think and see if I can give a more useful suggestion than above. :)

Very nice GUI by the way, good work, it's appreciated. :)

berrinam
29th June 2005, 07:42
The other thing is, would it be possible to move the rate/qp settings to the main window, or make the user defined profiles not remember the bitrate such that the profile can be selected and then the bitrate set for each encode?


For automatic encoding, the bitrate is set automatically. I suppose the reasoning behind keeping the bitrate as part of the profile in all other situations is that the profile is a quality-based profile, as in, you would want the same quality for all things you do with the same profile... now that I say it I realise that I'm not actually explaining anything ... ah well.

berrinam
29th June 2005, 07:44
@Doom9, I was just wondering whether you wanted to include my OneClickWindow code into the project sometime?

Doom9
29th June 2005, 08:08
@berrinam: let's just say I was incapacitated for the entire day yesterday so I didn't look at one single line of code.. obviously it's going to be integrated. Not sure which release but I hope to have major changes (I'm going to move the pre-encoded audio selection away from the main window so that'll cause some changes in other parts) done by the end of the week-end.

berrinam
29th June 2005, 08:12
Ok, sorry to nag.

superdump
29th June 2005, 17:00
For automatic encoding, the bitrate is set automatically. I suppose the reasoning behind keeping the bitrate as part of the profile in all other situations is that the profile is a quality-based profile, as in, you would want the same quality for all things you do with the same profile... now that I say it I realise that I'm not actually explaining anything ... ah well.
Bah. I didn't see the autoencode option. I'll to play with it and discover its behaviour though. It might be good to be able to specify one of your userdefined profiles within it for each of the video passes and for the audio. I see that you can select profiles in the main window but you can only select one video profile, what if you wish to use different settings for the first pass? :)

Doom9
29th June 2005, 18:59
what if you wish to use different settings for the first pass? Well.. if you can convince me why this is necessary and why the turbo flag isn't enough..

Though, I have one thing planned not yet listed in the todo list: update an existing job in the queue.. you can load their settings, but you cannot save them back again. Once you can, you can apply another profile to the first pass if you please.. I kinda doubt that most people would want to do that though.. basically you want your options to match as good as possible with the exception of those that can be safely reduced.. and those are the ones for the turbo flag.

I just got a new PC (dual core :) so I might not write any code today either but I'll resume the work tomorrow and look at the mb options you mentioned.. I'm pretty sure I don't even have to reproduce them.. I seem to recall to have put in certain defaults.. iirc I apply all mb options but force the dropdown to custom.. I can add logic that makes it go to all or none depending on what is checked and what is unchecked.. and the --analyse options.. your'e correct, I didn't take care of that.. it never was an issue using mencoder and that's where I based the commandline generation code on.

superdump
29th June 2005, 19:25
Well.. if you can convince me why this is necessary and why the turbo flag isn't enough..

Well, I suppose it makes it more versatile so you don't have to add or remove stuff from the turbo flag but if turbo is implemented as mentioned in the x264 dev thread then I have no reason to convince you really. :)

I assume that when using the automatic 2 pass mode with turbo enabled it only uses the reduced settings in the first pass and uses the settings specified in the gui for the second pass, right?

Though, I have one thing planned not yet listed in the todo list: update an existing job in the queue.. you can load their settings, but you cannot save them back again. Once you can, you can apply another profile to the first pass if you please.. I kinda doubt that most people would want to do that though.. basically you want your options to match as good as possible with the exception of those that can be safely reduced.. and those are the ones for the turbo flag.

Not necessarily for altering the codec settings for my purpose but generally I think this is a worthwhile feature, in case mistakes are made etc.

I just got a new PC (dual core :) so I might not write any code today either but I'll resume the work tomorrow and look at the mb options you mentioned.. I'm pretty sure I don't even have to reproduce them.. I seem to recall to have put in certain defaults.. iirc I apply all mb options but force the dropdown to custom.. I can add logic that makes it go to all or none depending on what is checked and what is unchecked.. and the --analyse options.. your'e correct, I didn't take care of that.. it never was an issue using mencoder and that's where I based the commandline generation code on.

Niiice. AMD or P4? I'm sure that will aid with the next codec comparison. :D I did note that the options worked correctly for mencoder, it's just the 'none' switch that needs adding when using the cli. :)

Cheers.

berrinam
2nd July 2005, 00:10
Is a plain old x264 gui still wanted? Any comments on what should be included?

Doom9
2nd July 2005, 00:26
I assume that when using the automatic 2 pass mode with turbo enabled it only uses the reduced settings in the first pass and uses the settings specified in the gui for the second pass, right?Absolutely. It will be like that in the upcoming automated 3 pass mode as well (my way of killing a perfectly good week-end)

The analyse switches are fixed in the upcoming 0.2.0.5.. I just need to finish the AVI part.

The first encoding results from my shiny new CPU can be found here: http://forum.doom9.org/showthread.php?t=94226

Is a plain old x264 gui still wanted?Still on the todo list, yes. I see two ways of handling that: 1) smart compiling.. use compilation flags to "throw out" all the stuff not needed. 2) add a flag to the settings file that upon loading disables everythinb but x264 encoding (basically hide the audio groupbox, codec label and selection and blank out the AVI output mode). You also have to blank out everything but the settings in the tools menu, and that menu has to be simplified to just offer the x264 path, and all the options in the other groupbox (except for the x264 encoder of course). If you start now, please be careful to touch as little as possible as a lot of classes will come back changed in 0.2.0.5

berrinam
2nd July 2005, 00:55
How long till 0.2.0.5 release? Should I just wait?

About MeGUIlite, do I leave in
matrix editor?
chapters?
zones?
muxing?
raw and mp4 output?

Doom9
2nd July 2005, 00:58
no, the lite is just really an x264.exe GUI... I guess. But that includes both raw and mp4 output (which is what x264.exe can do). I hope to have the new version out within 24h.

Yama4050242
2nd July 2005, 04:32
a litter request, can you kindly use Mandarin and Cantonese in the mux tool audio track name instead of chinese, although there are quite a lot of dialects in china,but for dvd backup, i think these 2 are the main ones.
the inconvenience of just a chinese there is if i got a clip with both Mandarin and Cantonese,i can just use Chinese for 1 audio track, but no proper name for the other

btw, i am chinese, poor english:P

Yama4050242
2nd July 2005, 04:36
or make the audio track name not only selectable, but can define by user would be great

leowai
2nd July 2005, 04:42
a litter request, can you kindly use Mandarin and Cantonese in the mux tool audio track name instead of chinese, although there are quite a lot of dialects in china,but for dvd backup, i think these 2 are the main ones.
the inconvenience of just a chinese there is if i got a clip with both Mandarin and Cantonese,i can just use Chinese for 1 audio track, but no proper name for the other

btw, i am chinese, poor english:P
If this is the case, why don't make the language selector editable? You can input whatever name you wish to have in both audio and subtitles section.

Doom9
2nd July 2005, 10:25
If this is the case, why don't make the language selector editable? You can input whatever name you wish to have in both audio and subtitles section.Sorry to be blunt but apparently you do not know how mp4box works. Here's a hint: it takes a 3 letter ISO code, and for some reason it doesn't support them all. So what happens under the hood is that you can work with humanly readable strings, and at the end I resolve them to an ISO string. That only works if I know the values of both in advance. Even if you could enter both, there's no guarantee that it would work because mp4box also knows only a limited selection of languages. I'll go over that list again and make sure I've included every language mp4box supports, but I cannot go beyond that.. it makes no sense to explicitly give users a way to mess up.

Yama4050242
2nd July 2005, 10:57
Sorry to be blunt but apparently you do not know how mp4box works. Here's a hint: it takes a 3 letter ISO code, and for some reason it doesn't support them all. So what happens under the hood is that you can work with humanly readable strings, and at the end I resolve them to an ISO string. That only works if I know the values of both in advance. Even if you could enter both, there's no guarantee that it would work because mp4box also knows only a limited selection of languages. I'll go over that list again and make sure I've included every language mp4box supports, but I cannot go beyond that.. it makes no sense to explicitly give users a way to mess up.
thx for your explanation, i think i know what you said, and again thx for your great work on this GUI

Doom9
2nd July 2005, 21:20
alright, I have attached the latest version. @berrinam: could you please check how this works with the one click form? And also note that there'll be a new setting soon setting how many passes will be done in auto (and one click) mode.. it'll be called NbAutomatedPasses, of type int. JobUtil.prepareVideoJob will return a third job in automated mode (all in the proper order of course, like it's done for automated twopass right now).

Doom9
2nd July 2005, 21:31
public string StartPath
{
get {return path;}
}
Is not required because the main Form already has a property for that: MeGUIPath

In addition, it has a property to get the settings for the currently configured video codec: public VideoCodecSettings VidCodecSettingsso you should use that
I'll add the same to get the current audio settings. Since I'm making heavy use of inheritance we should work with the generic types whenever possible and get the actual type using the "is" operator.

I have already added the new property.. here's the prototype
public AudioCodecSettings AudCodecSettings

And I hope you don't mind that when I integrate it, I'm going to rewrite parts of the code.. I saw you integrated autocrop and dgindex project creation code, which is not ideal. I'll move those a/multiple separate classes so that the code will only have to be maintained once. Or you can create those classes, as you like.

Doom9
2nd July 2005, 21:40
and one more thing: I'll start integration once I'm done with the automated 3 pass and the current code has been tested a bit.. autoclick caters to an audience that often doesn't get the complexity of the process so I'd like all the underlying code to be tested. While I think I'm doing a reasonable amount of testing before every release, there's been a lot of changes in between the last two versions.

berrinam
3rd July 2005, 01:14
public string StartPath
{
get {return path;}
}
Is not required because the main Form already has a property for that: MeGUIPath

Ok, fixed.


In addition, it has a property to get the settings for the currently configured video codec: public VideoCodecSettings VidCodecSettingsso you should use that.
I'll add the same to get the current audio settings. Since I'm making heavy use of inheritance we should work with the generic types whenever possible and get the actual type using the "is" operator.

I understand, but I need to get the individual codec settings for when I change codec (videoConfigButton_Click). As in, when the LAVC is configured, it gets main form's CurrentLavcSettings. If it were just to call VidCodecSettings, then what would happens if the VidCodecSettings were x264CodecSettings, as opposed to LavcCodecSettings? I'm sure there is a better way to do it, but how?

And I hope you don't mind that when I integrate it, I'm going to rewrite parts of the code.. I saw you integrated autocrop and dgindex project creation code, which is not ideal. I'll move those a/multiple separate classes so that the code will only have to be maintained once. Or you can create those classes, as you like.
Yes, I was planning to do that, I just never got around to it. I presume you want some sort of VideoUtil class that manages autocropping and resizing?

.. autoclick caters to an audience that often doesn't get the complexity of the process so I'd like all the underlying code to be tested.
The way I see OneClick is as a set-and-forget method for anyone, so long as no AviSynth filters are wanted. For the people who aren't experienced, the default settings (through profiles) should be good, but it should also be appropriate for advanced users on sources that need no filtering.

I am at a loss with what to do about chapters and subtitles, because they seem to break up the automated process (is there any automation in chapter or subtitle extraction?). At the moment, neither are implemented (the chapters file is there, but it has no effect). Should I exclude them?

Doom9
3rd July 2005, 01:21
about Chinese vs Cantonese vs Mandarin: Here's the list of what mp4box supports: http://cvs.sourceforge.net/viewcvs.py/gpac/gpac/doc/ISO%20639-2%20codes.txt?rev=1.1&view=markup

sadly, neither Cantonese nor Mandarin are on the list

If you look at the ISO standard, those just don't exist: http://www.w3.org/WAI/ER/IG/ert/iso639.htm

berrinam
3rd July 2005, 01:28
Also, with so much inheritance, would it be a good idea to inherit all of the configuration dialogs from a videocodecconfigurationdialog class, which has input, output, encoderpath, creditsstartframe, and so on? Then, the VideoCodecSettings class could have a getConfigDialog method.

Doom9
3rd July 2005, 01:31
I understand, but I need to get the individual codec settings for when I change codec (videoConfigButton_Click). As in, when the LAVC is configured, it gets main form's CurrentLavcSettings. If it were just to call VidCodecSettings, then what would happens if the VidCodecSettings were x264CodecSettings, as opposed to LavcCodecSettings? I'm sure there is a better way to do it, but how?hmm.. I guess it depends on how you want to configure it.. I haven't seen the GUI yet, but assuming it looks like North101's design there's no config button.. perhaps there ought to be one? But then again we'd also have to offer profiles.. what do you think about adding those two? It would certainly be easier not to do it but I'm not sure what is more beneficial for the user.

If the one click window is a dialog and we're not going to add config and profiles, then I'd prefer to give the form a reference to all currently configured VideoCodecSettings and AudioCodecSettings objects at construction time.

I am at a loss with what to do about chapters and subtitles, because they seem to break up the automated process (is there any automation in chapter or subtitle extraction?). At the moment, neither are implemented (the chapters file is there, but it has no effect). Should I exclude them?Well, chapters can be done if you're using DVD Decrypter (it can write a chapter file while ripping). Subs are indeed something else.. they need to be done manually before using MeGUI.

So leave chapter and try to auto-load the chapters file based on the name of the video input (rip something with DVD Dec and chapter extraction enabled to see how it names chapter files.. I don't know that either).

I guess we can drop subs for now and add them if somebody asks for them or if mp4box supports vobsub muxing one day (I have an RFE open but haven't gotten around to uploading some sample files)

Yes, I was planning to do that, I just never got around to it. I presume you want some sort of VideoUtil class that manages autocropping and resizing?Exactly.

Doom9
3rd July 2005, 01:38
Also, with so much inheritance, would it be a good idea to inherit all of the configuration dialogs from a videocodecconfigurationdialog class, which has input, output, encoderpath, creditsstartframe, and so on? Then, the VideoCodecSettings class could have a getConfigDialog method.I've thought about that when I moved the configuration to separate dialogs.. conceptually it makes sense, but since we have different sizes, number of tabs, and most settings do not match I think it would become complex rather quickly (each constructor or load event handler would have to resize the GUI move GUI elements around.. I've already made a first attempt but somehow the visual inheritance didn't work out the way I wanted it.. but if you want to give it a shot go ahead).

berrinam
3rd July 2005, 01:40
hmm.. I guess it depends on how you want to configure it.. I haven't seen the GUI yet, but assuming it looks like North101's design there's no config button.. perhaps there ought to be one? But then again we'd also have to offer profiles.. what do you think about adding those two? It would certainly be easier not to do it but I'm not sure what is more beneficial for the user.At the moment, my design has profiles and configuration. The code is mostly copied from version .0.1.9.8 of the main form. I take the philosophy that profiles mean that the inexperienced user can use pre-configured profiles, and the advanced user can choose whatever settings he or she chooses.

If the one click window is a dialog and we're not going to add config and profiles, then I'd prefer to give the form a reference to all currently configured VideoCodecSettings and AudioCodecSettings objects at construction time. I do that. Another option that comes to mind just now is this: configure the profiles in the main form, and then just select which one you want in the oneclickwindow. What do you think?

Well, chapters can be done if you're using DVD Decrypter (it can write a chapter file while ripping). Subs are indeed something else.. they need to be done manually before using MeGUI.

So leave chapter and try to auto-load the chapters file based on the name of the video input (rip something with DVD Dec and chapter extraction enabled to see how it names chapter files.. I don't know that either). Will do.

berrinam
3rd July 2005, 01:42
I've thought about that when I moved the configuration to separate dialogs.. conceptually it makes sense, but since we have different sizes, number of tabs, and most settings do not match I think it would become complex rather quickly (each constructor or load event handler would have to resize the GUI move GUI elements around.. I've already made a first attempt but somehow the visual inheritance didn't work out the way I wanted it.. but if you want to give it a shot go ahead).
I will try that. Anyway, what I was thinking was just to overload the getConfigDialog method.

Doom9
3rd July 2005, 01:46
Anyway, what I was thinking was just to overload the getConfigDialog method.I don't quite get that. With so many dialogs, the GUI setup should be done in the InitializeComponent method (the one VS generates on its own and that contains everything you do in the GUI designer). Sure you can do a whole GUI manually (I once wrote a Java mail program like that.. it was a real pain in the ass), but I'd be very uncomfortable not being able to edit the GUI quickly in the designer.. there are always things that need changing.

configure the profiles in the main form, and then just select which one you want in the oneclickwindow. What do you think?That's how I meant "having profiles". And of course you need to filter them by codec (see the configuration dialogs for code.. it's already done there).

berrinam
3rd July 2005, 01:53
I don't quite get that. With so many dialogs, the GUI setup should be done in the InitializeComponent method (the one VS generates on its own and that contains everything you do in the GUI designer). Sure you can do a whole GUI manually (I once wrote a Java mail program like that.. it was a real pain in the ass), but I'd be very uncomfortable not being able to edit the GUI quickly in the designer.. there are always things that need changing.
I just meant have, as part of the x264Settings class, a createConfigDialoog method which creates an instance of x264ConfigDialog and wirets all the settings ... I'm not sure if this is any better, though. Anyway, I know what I mean, I think I understand you, so it should be fine -- I'll write the code.

That's how I meant "having profiles". And of course you need to filter them by codec (see the configuration dialogs for code.. it's already done there).
Sounds good.

Doom9
3rd July 2005, 01:58
I've uploaded the latest sources. Darned new PC crashing again just killed my VS installation.. VS tells me it's not properly installed for the current user. Now I have to extract the 19k files again and reinstall.. damn.

I'm not sure it's such a good idea to create a form from a data container class.. the way it's done now, send a container class to the gui and get one back seems more straightforward.

berrinam
3rd July 2005, 02:01
I'm not sure it's such a good idea to create a form from a data container class.. the way it's done now, send a container class to the gui and get one back seems more straightforward.
I agree that sounds better, but where does it do this?

Doom9
3rd July 2005, 02:07
I agree that sounds better, but where does it do this?load form1.cs in the designer, double click on the config button and see what it does.. after creating the forum, I use a property of the form to set the current settings. When I get a OK result back, I use the same property to get the updated settings back, and overwrite the currentXYZSettings in the main form.

berrinam
3rd July 2005, 02:11
Aah right... data container, not GUI container. I'll do it as you say.

berrinam
3rd July 2005, 02:14
Oo, one more thing -- choice for mp4/avi or just stick to mp4? I favor having a choice for everything, but defaulting to mp4

Doom9
3rd July 2005, 02:19
well.. I guess since I spent all this time implementing it.. keep both.. but avi is limited to one track and currently ac3 input doesn't work (mencoder's problem not mine) I'd definitely default to mp4

berrinam
3rd July 2005, 14:08
Ok, I have updated oneclickwindow for 0.2.0.6. It does not (yet) have avi output, chapter support or auto3pass, but the rest seems to be there, and it seems to work. Built on top of version 2.0.6, I have attached changes here (http://rapidshare.de/files/2770660/2.0.6_.zip.html)

EDIT: I haven't used rapidshare.de before, and I'm not sure if it worked. As a backup I have also attached the same file.

PS. I will catch up on the missing features tomorrow

Doom9
3rd July 2005, 14:14
I see you've attached a new AviSynth window.. what has changed except for moving out the stuff into the videoutil class? (I'm about to release 0207 with full job updates but if that's the only change I can already incorporate that new code so when you make the update tomorrow you can base your code on 0207 directly)

also.. I'd need to have the launching code for the main form separately.. I'm still working on the main form right now (job updates obviously are in there).

berrinam
3rd July 2005, 14:21
I see you've attached a new AviSynth window.. what has changed except for moving out the stuff into the videoutil class? (I'm about to release 0207 with full job updates but if that's the only change I can already incorporate that new code so when you make the update tomorrow you can base your code on 0207 directly)

also.. I'd need to have the launching code for the main form separately.. I'm still working on the main form right now (job updates obviously are in there).
Ok, it seems you want a full changelog, as earlier. Here goes:
Avisynth window: delete all methods in autocrop region and replace with
private void autoCropButton_Click(object sender, System.EventArgs e)
{
CropValues final = VideoUtil.autocrop(reader);
bool error = (final.left == -1);
if (!error)
{
cropLeft.Value = final.left;
cropTop.Value = final.top;
cropRight.Value = final.right;
cropBottom.Value = final.bottom;
if (!crop.Checked)
crop.Checked = true;
}
else
MessageBox.Show("I'm afraid I was unable to find 3 frames that have matching crop values");
}

Main Form: Add OneClickEncodeWindow menu item with this event handler:
private void mnuToolsOneClick_Click(object sender, System.EventArgs e)
{
OneClickWindow oneClick = new OneClickWindow(this, videoProfiles, audioProfiles, videoProfile.SelectedIndex, audioProfile.SelectedIndex);
oneClick.ShowDialog();
}

Main Form: add this properties
public JobUtil JobUtil
{
get {return this.jobUtil;}
}

And the other files are new, and the project file just includes them

berrinam
3rd July 2005, 14:26
Missed something. Avisynthwindow: delete getAspectRatio method. Change
suggestResolution_CheckedChanged(blah, blah) to
private void suggestResolution_CheckedChanged(object sender, System.EventArgs e)
{
if (suggestResolution.Checked)
{
verticalResolution.Value = (decimal)VideoUtil.suggestResolution(reader.Height, Double.Parse(customDAR.Text)
}
}

EDIT: fixed code in this post

Doom9
3rd July 2005, 14:48
Main Form: add this propertiesIf you need that, why not just put it into the constructor?

@edit: I've uploaded the latest sources.

Doom9
3rd July 2005, 15:16
private void suggestResolution_CheckedChanged(object sender, System.EventArgs e)
{
if (suggestResolution.Checked)
{
verticalResolution.Value = (decimal)VideoUtil.suggestResolution(reader.Height, Double.Parse(customDAR.Text)
}
}is not valid code.. suggestResolution takes 4 arguments. and there's no getAspectRatio method either in the code I got from the post above.

azsd
3rd July 2005, 18:24
auto 3 pass has a flash speed (completed in 0.001 seconds with -1 fps) in 0.2.0.6 all step,
in 0.2.0.8 the first step has same error,the second step running correct.
in 0.2.0.8 the manuelly 3pass working fine.

here attached the log file of 0.2.0.6 and 0.2.0.8

Doom9
3rd July 2005, 19:18
indeed there is something wrong.. the log points out that there's no input configured. Fortunately this happens here as well so I can begin fixing right away. For the future: please describe everything you did until the error starting from the point where you launch MeGUI. I know that's a lot of info.. but that ensures that I'll be able to reproduce things right away, or point out problems that might have something to do with your source.

@update: found and fixed the bug.. I'm not running an automated 3 pass to make sure everything works. I accidentally blanked out the input for the first pass.. that turned into an empty stats file which causes problems for subsequent passes.

Doom9
3rd July 2005, 19:41
bugfix is out in the user thread. I've uploaded the fixed class to the source package as well.

berrinam
3rd July 2005, 21:57
private void suggestResolution_CheckedChanged(object sender, System.EventArgs e)
{
if (suggestResolution.Checked)
{
verticalResolution.Value = (decimal)VideoUtil.suggestResolution(reader.Height, Double.Parse(customDAR.Text)
}
}is not valid code.. suggestResolution takes 4 arguments. and there's no getAspectRatio method either in the code I got from the post above.
Sorry about that ... I was looking at the wrong version of code. You should use this code:
private void suggestResolution_CheckedChanged(object sender, System.EventArgs e)
{
if (suggestResolution.Checked)
{
CropValues cropping = new CropValues();
cropping.left = (int)cropLeft.Value;
cropping.right = (int)cropRight.Value;
cropping.top = (int)cropTop.Value;
cropping.bottom = (int)cropBottom.Value;

int scriptVerticalResolution = VideoUtil.suggestResolution(reader.Height, Double.Parse(customDAR.Text), cropping, (int)horizontalResolution.Value);
verticalResolution.Value = (decimal)scriptVerticalResolution;
}
}

And the JobUtil can also be put in the constructor. EDIT: when passing objects, are they passed as references, or are they cloned?

Doom9
3rd July 2005, 22:13
You should use this codeit's already in there ;)

when passing objects, are they passed as references, or are they cloned?passed as reference. Objects are reference type.. hence the VideoCodecSettings.clone method, and me cloning it before encoding in order not to change the original (currentXYZSettings in the main form). There are value types... integers, doubles, structs, decimal, bool... (all those I recall using in MeGUI).. value types are cloned, so to speak.

berrinam
3rd July 2005, 22:16
it's already in there ;)Ok, sorry about the stuff-up -- I have too many versions on my computer. Anyway, it is already to add the one click encoder, yes?

Doom9
3rd July 2005, 22:30
I'm waiting on you to finish the window.. you said something about working on it again tomorrow to add the AVI mode.

berrinam
3rd July 2005, 22:40
yep, sure.

berrinam
4th July 2005, 01:55
Ok, I finally have everything (hopefully) implemented in OneClick. I compiled it, just to make it easier for you:p. It's weird ... when I compile with csc.exe (the commandline compiler which is part of the 1.1 framework), the output filesizes are about half that of VS.NET. Anyway, the only changes I remember making since v0208 are the addition of the OneClickWindow and the event handler in MeGUI for it, which is as follows:
private void mnuToolsOneClick_Click(object sender, System.EventArgs e)
{
OneClickWindow oneClick = new OneClickWindow(this, videoProfiles, audioProfiles, videoProfile.SelectedIndex, audioProfile.SelectedIndex, this.jobUtil);
oneClick.ShowDialog();
}

berrinam
4th July 2005, 07:45
Ok, the new version is . As above, it has oneclickwindow.cs. It also adds the Run DGIndex projects as minimized as an option, because when I was testing, I liked to be able to see what was happening. If you don't want that, then just ignore the settings files, and edit oneclickwindow, deleting line 1159. The eventhandler is the same as above. Built on 2.0.8 sources.

Doom9
4th July 2005, 08:09
considering the size, could you please just attach the files here.. I'd like to keep track of new versions and attached but not authorized attachments are only available to moderators.

I haven't looked at the sources yet but I do have a few conceptual questions looking at the window: what happened with the codec selection? It's grayed out here.

What's the numeric up down for in the audio box? I suppose that's container overhead seeing that it starts at 4.3.. but audio has no container overhead (at least not for aac in mp4.. nero aac considers the container overhead as part of the bitrate - for mp3 we have a fixed overhead depending on the type).

As far as the output goes.. perhaps you've noted that I changed the d2v creator to accept other types as well.. I think the one click encoder should reflect those changes so that it can also be used for other input types that dgindex supports. Hopefully, with the media library (see container forum) we'll be able to extract stream info for those other streams.. else just offer the default track1-8 as audio selection.

The dropdown in extra setup.. is that the video profile (I have no profiles at work)? And what's the project name good for?

berrinam
4th July 2005, 08:16
considering the size, could you please just attach the files here.. I'd like to keep track of new versions and attached but not authorized attachments are only available to moderators.No problem

what happened with the codec selection? It's grayed out here.I figured that it shouldn't be editable by the user, because no configuration is possible, therefore it just reflects the codec being used by the profile.

What's the numeric up down for in the audio box? I suppose that's container overhead seeing that it starts at 4.3.. but audio has no container overhead (at least not for aac in mp4.. nero aac considers the container overhead as part of the bitrate - for mp3 we have a fixed overhead depending on the type).Yes, it's container overhead for mp4, just in the wrong place. I'm think I should get rid of it completely.

As far as the output goes.. perhaps you've noted that I changed the d2v creator to accept other types as well.. I think the one click encoder should reflect those changes so that it can also be used for other input types that dgindex supports. Hopefully, with the media library (see container forum) we'll be able to extract stream info for those other streams.. else just offer the default track1-8 as audio selection.I'm afraid I have no idea what you are talking about. EDIT: I see. I never noticed that before. I'll look into that, too.

The dropdown in extra setup.. is that the video profile (I have no profiles at work)? And what's the project name good for?Yes, it is video profile. The project name determines:
-the dgindex project name
-the filename of the intermediate video files (projectname_Movie.mp4, a la GK)
-the output filename


The same files that are on rapidshare are attached here

Doom9
4th July 2005, 08:30
I figured that it shouldn't be editable by the user, because no configuration is possible, therefore it just reflects the codec being used by the profile.Hmm.. so the user must have a profile? Might not be the ideal solution because people don't realize they can use profiles (or they work so well that nobody ever mentions that feature). You could of course create 4 default profiles based on the current videocodecsettings and list those. I'm not sure what the most user friendly course is here.

I'm think I should get rid of it completely.I agree.. the default values seem to work out just fine.. but you need to make sure they re set internally in accordance to how many b-frames are configured.

berrinam
4th July 2005, 08:37
Hmm.. so the user must have a profile? Might not be the ideal solution because people don't realize they can use profiles (or they work so well that nobody ever mentions that feature). You could of course create 4 default profiles based on the current videocodecsettings and list those. I'm not sure what the most user friendly course is here.Well, I could add the config dialog again, which would be more user-friendly, I suppose. But I think for inexperienced user, (who this is partly aimed for) having default profiles like in Recode would be the best.

I agree.. the default values seem to work out just fine.. but you need to make sure they re set internally in accordance to how many b-frames are configured.Yes.

berrinam
4th July 2005, 08:40
About accepting extra input formats: I'm sure you agree it would only be appropriate for oneclick if the track names were listed. Will projectX do this?

Doom9
4th July 2005, 08:49
Well, I could add the config dialog again, which would be more user-friendly, I suppose. But I think for inexperienced user, (who this is partly aimed for) having default profiles like in Recode would be the best.Well, then we need to settle on what profiles we offer. The ones configured should definitely be available, and then some defaults.

I'm sure you agree it would only be appropriate for oneclick if the track names were listed. Will projectX do this?Well, unless you have an info file you never have the names, only track IDs.. you need to figure out the language on your own for TS, mpg and even VOB streams without an info file. I guess TS streams are going to be a bitch to handle.. I wonder if dgindex can somehow tell us what tracks are effectively available.

The mediainfo lib (http://forum.doom9.org/showthread.php?t=96516) seems to be useful for mpg but I don't see TS as a supported format.

berrinam
4th July 2005, 09:24
Well, then we need to settle on what profiles we offer. The ones configured should definitely be available, and then some defaults.The ones configured are already available. I would say that defaults could be added just by distributing the xml profiles with the executable. Anyway, I haven't had enough experience with any of the codecs to be able to recommend settings.

Well, unless you have an info file you never have the names, only track IDs.. you need to figure out the language on your own for TS, mpg and even VOB streams without an info file.I still think this destroys the oneclick workflow.

Doom9
4th July 2005, 09:47
I still think this destroys the oneclick workflow.Not necessarily.. you just have to do the "figuring out what audio streams are available" for those types of input as well.. you are reading the info file for vob input after all, so it would be done at the same point for other types of input. Then once input is selected, available audio tracks will be shown.

berrinam
4th July 2005, 10:11
Not necessarily.. you just have to do the "figuring out what audio streams are available" for those types of input as well.. you are reading the info file for vob input after all, so it would be done at the same point for other types of input. Then once input is selected, available audio tracks will be shown.
Ok, I will implement it, but the question is how much about the audio can be worked out from the track ID in mpg, ts and vob containers?

berrinam
4th July 2005, 11:05
Updates to OneClickWindow are attached (a new version of the file). I have replaced the overhead counter by internal calculations. I have changed mp4 muxing so that it will write the language automatically, if possible.

Doom9
4th July 2005, 11:48
Ok, I will implement it, but the question is how much about the audio can be worked out from the track ID in mpg, ts and vob containers?With vob, track IDs already tell you about the audio type.. the rest is just about "how many streams are there and which track IDs can be demuxed and used".

berrinam
4th July 2005, 13:20
OneClickWindow now supports multiple input formats (see file attached). This code is built on the code from this thread (http://forum.doom9.org/showthread.php?p=682058#post682058) by me. It doesn't detect the audio streams for mpg or ts -- that's too much work for today. Instead, it just uses Track1-8.

Hope this version is finally ready for public release:p

Doom9
4th July 2005, 13:38
that's too much work for today.hehe... well, we can do that another day.. the code will come in handy for both auto-mode and one click mode one day though. I'll give it a whirl tonight, too bad my dual core box is back at the shop (memory faults leading to crashes). Are you still going to look at x264.exe-only mode after this?

berrinam
4th July 2005, 13:44
Are you still going to look at x264.exe-only mode after this?
I plan to, although I am more interested in MKV muxing... how much work is it to incorporate another muxer?

berrinam
4th July 2005, 13:51
too bad my dual core box is back at the shop (memory faults leading to crashes).

My trusty P3 has never let me down :D

but when it comes to playing AVC ... hmmm ...

Doom9
4th July 2005, 14:37
I plan to, although I am more interested in MKV muxing... how much work is it to incorporate another muxer?Well.. guess it depends on how it works.. are you familiar with mkvmerge or mkvtoolnix or whatever the best cli muxer for the task is? There are a few important things that need to be figured out before the first line of code can be written:
overhead per frame for the various video and audio codecs and in function of codec settings. I'm not sure how it works for Matroska but as you by now certainly know, MP4 video overhead depends on the number of b-frames (and other things bit it appears that we don't have problems with the rule of thumb approach).

then obviously we need a cli program to do the work.. and there the important questions are: does it have a stdout/stderr progress report? if not, how does muxing work (like video first, then audio... the way mp4box does it.. it imports one stream after another, then writes the resulting file in a separate operation.. all with a progress bar going from 0 to 100 for each step), and how can we derive progress from that? does the muxer support multiple file inputs at once or do we need a separate operation for each stream (mp4creator required that.. fortunately mp4box does it all in one which greatly simplified things).

Those are the main things. Then of course the whole audio thing will have to be rewritten once again :( I'm afraid I have yet to find the flexible mechanism that works for everything.. with video we are at a good point since adding the automated 3rd pass was relatively easy.. adding mp3 audio was quite a bit more complex.

Then there's the question: do we add Vorbis audio output as an additional option or not?

Doom9
4th July 2005, 19:44
alright, there's a bunch of issues that still need work in the one click window but I'll take care of them. It seems you based the code on old revisions of the autoencode window.. so I need to bring the code in synch as well as the GUI.. and then there's so much overlap that I really need to refactor things.. else it's going to be a real pain in the back for bugfixing.

I've had a look at mkvmerge (just the manpage).. feature wise it seems okay (raw stream import is missing though which restricts the x264 encoder to x264.exe.. for all the other codecs it appears we have to use mencoder's avi output).. still comes down on how processing is done.

Doom9
4th July 2005, 20:19
btw I noted that dgtable can be used to get a list of PIDs from a TS stream.

I think we ought to finish the mp4 featureset first before looking at other formats (so x264.exe mode, and lavc/xvid configuration). I'm going to look at the latter tomorrow along with the one click encoder. I'll probably end up rewriting some stuff and I'll try to make things more flexible so that other output formats and other audio codecs could be added without so much hassle.

berrinam
6th July 2005, 06:48
I don't know if you have already done this, but I have rewritten the job generation sections of AutoEncodeWindow and OneClickWindow so that the common bit is part of the JobUtil class. They are as follows:
JobUtil method:
public Job prepareAndSetAutoEncodeJob(string videoIn, string tempVideo, string muxedOutput,
string chapters, bool isXviD, VideoCodecSettings videoSettings,
SubStream[] subtitles, MUXTYPE type, double overhead, int desiredSize,
AudioStream[] aStreams, SubStream[] audio, int splitSize)
{
BitrateCalculator calc = new BitrateCalculator();
int freeJobNumber = mainForm.getFreeJobNumber();
bool encodedAudioPresent = true;
StringBuilder logBuilder = new StringBuilder();
VideoJob[] vjobs = prepareVideoJob(videoIn, tempVideo, videoSettings);
ArrayList jobs = new ArrayList();
if (vjobs.Length > 0) // else the user aborted and we cannot proceed
{
bool doMux = true;
MuxJob mjob = null;
if (type == MUXTYPE.MP4) //figure out if we really need a muxjob
{
if (videoSettings is x264Settings && mainForm.Settings.X264Encoder == 1 &&
Path.GetExtension(tempVideo.ToLower()).Equals(".mp4") && audio.Length == 0
&& subtitles.Length == 0 && chapters.Equals("") && !(splitSize>0))
doMux = false;
}
if (type == MUXTYPE.AVI)
{
if (audio.Length == 0)
doMux = false;
}
if (doMux)
{
mjob = generateMuxJob(vjobs[vjobs.Length - 1], audio, subtitles, chapters, type,
muxedOutput);
mjob.Overhead = overhead;
if (splitSize > 0) // else there is no splitting
mjob.Settings.SplitSize = splitSize;
}
logBuilder.Append("Desired size of this automated encoding series: " + desiredSize + " bytes\r\n");
foreach (AudioStream astream in aStreams) // generate audio encoding jobs
{
AudioJob jo = generateAudioJob(astream);
jobs.Add(jo);
}
foreach (SubStream stream in audio)
{
if (File.Exists(stream.path)) // it's already available -> directly muxable input
{
FileInfo fi = new FileInfo(stream.path);
desiredSize -= (int)fi.Length;
logBuilder.Append("Encoded audio file is present: " + stream.path + " has a size of " + fi.Length + " bytes. \r\n " +
"adjusting desired size. New desired size = " + desiredSize + " bytes\r\n");
}
}
foreach (VideoJob job in vjobs)
{
jobs.Add(job);
}
if (mjob != null)
jobs.Add(mjob);
string prevName = "";
int number = 1;
int firstpassNumber = 0, secondPassnumber = 1, thirdPassnumber = 2;
bool threepass = false;
if (vjobs.Length == 3)
threepass = true;
foreach (object o in jobs)
{
Job job = (Job)o;
job.Name = "job" + freeJobNumber + "-" + number;
if (job is VideoJob)
{
VideoJob vjob = (VideoJob)job;
if (!threepass)
{
if (vjob.Settings.EncodingMode == 2) // that's the first pass
firstpassNumber = number - 1;
if (vjob.Settings.EncodingMode == 3)
secondPassnumber = number - 1;
}
else
{
if (vjob.Settings.EncodingMode == 5) // first pass
firstpassNumber = number - 1;
if (vjob.Settings.EncodingMode == 6) // that's the second pass in three pass mode
secondPassnumber = number - 1;
if (vjob.Settings.EncodingMode == 3) // third pass if we're not overwriting the stats file
thirdPassnumber = number - 1;
if (vjob.Settings.EncodingMode == 7) // that's the third pass
thirdPassnumber = number - 1;

}
}
if (!prevName.Equals(""))
job.Previous = prevName;
if (jobs.Count > number)
{
int n = number + 1;
job.Next = "job" + freeJobNumber + "-" + n;
}
number++;
prevName = job.Name;
}
int bitrate = 0;
((VideoJob)jobs[firstpassNumber]).DesiredSize = desiredSize;
((VideoJob)jobs[secondPassnumber]).DesiredSize = desiredSize;
if (threepass)
((VideoJob)jobs[thirdPassnumber]).DesiredSize = desiredSize;
if (encodedAudioPresent) // no audio encoding, we can calculate the video bitrate directly
{
logBuilder.Append("No audio encoding. Calculating desired video bitrate directly.\r\n");
if (type == MUXTYPE.MP4)
{
bitrate = calc.calculateVideoBitrate(0, desiredSize, vjobs[0].NumberOfFrames,
overhead, vjobs[0].Framerate, isXviD);
}
if (type == MUXTYPE.AVI)
{
bitrate = calc.calculateAVIVideoBitrate(0, desiredSize, vjobs[0].NumberOfFrames,
vjobs[0].Framerate, isXviD, AUDIOTYPE.CBRMP3);
}
logBuilder.Append("Setting video bitrate for the video jobs to " + bitrate + " kbit/s\r\n");
updateVideoBitrate((VideoJob)jobs[firstpassNumber], bitrate);
updateVideoBitrate((VideoJob)jobs[secondPassnumber], bitrate);
if (threepass)
updateVideoBitrate((VideoJob)jobs[thirdPassnumber], bitrate);
}
foreach (object o in jobs)
{
this.mainForm.addJobToQueue((Job)o);
}
mainForm.addToLog(logBuilder.ToString());
return ((Job)jobs[0]);
}
return null;
}

AutoEncode (queueButton_Click) method has been replaced by:
private void queueButton_Click(object sender, System.EventArgs e)
{
if (!this.muxedOutput.Text.Equals(""))
{
SubStream[] audio;
AudioStream[] aStreams;
separateEncodableAndMuxableAudioStreams(out aStreams, out audio);
SubStream[] subtitles = new SubStream[0];
string chapters = "";
bool isXviD = false; // xvid is a special case
if (this.videoSettings is xvidSettings)
isXviD = true;
if (this.videoSettings.EncodingMode != 4 && videoSettings.EncodingMode != 8) // neither automated 2 pass nor automated 3 pass, get mode from settings
{
if (mainForm.Settings.NbPasses == 2 || isXviD)
videoSettings.EncodingMode = 4;
else
videoSettings.EncodingMode = 8;
}
MUXTYPE type = MUXTYPE.MP4;
AUDIOTYPE aType;
if (aviOutput.Checked)
type = MUXTYPE.AVI;
if (addSubsNChapters.Checked)
{
if (mp4Output.Checked)
{
MuxWindow mw = new MuxWindow(this.mainForm);
mw.setMinimizedMode(mainForm.VideoIO[1], jobUtil.getFramerate(mainForm.VideoIO[0]), audio,
muxedOutput.Text, this.getSplitSize());
if (mw.ShowDialog() == DialogResult.OK)
mw.getAdditionalStreams(out audio, out subtitles, out chapters);
}
else if (aviOutput.Checked)
{
aviMuxWindow amw = new aviMuxWindow(this.mainForm);
amw.setMinimizedMode(mainForm.VideoIO[1], audio, muxedOutput.Text, this.getSplitSize());
if (amw.ShowDialog() == DialogResult.OK)
amw.getAdditionalStreams(out audio, out aType);
}
}
int desiredSize = 716800 * 1024;
try
{
desiredSize = Int32.Parse(this.muxedSize.Text) * 1024;
}
catch (Exception f)
{
MessageBox.Show("I'm not sure how you want me to reach a target size of <empty>.\r\nWhere I'm from that number doesn't exist.\r\n" +
"I'm going to assume you meant 1 700 MB CD", "Target size undefined", MessageBoxButtons.OK);
Console.Write(f.Message);
}
logBuilder.Append("Desired size of this automated encoding series: " + desiredSize + " bytes\r\n");
Job finalJob = jobUtil.prepareAndSetAutoEncodeJob(mainForm.VideoIO[0], mainForm.VideoIO[1], this.muxedOutput.Text,
chapters, isXviD, videoSettings, subtitles, type, (double)this.containerOverhead.Value,
desiredSize, aStreams, audio, getSplitSize());
mainForm.addToLog(logBuilder.ToString());
if (finalJob == null)
{
MessageBox.Show("An error occurred in creating the job");
}
else
{
if (mainForm.Settings.AutoStartQueue)
mainForm.startEncoding(finalJob);
}
}
OneClickWindow.setUpJobs() has been replaced by:
private void setUpJobs()
{
//Get all the values from the GUI
//Mux type
MUXTYPE type = MUXTYPE.MP4;
if (containerFormat.SelectedIndex == 0) //AVI
type = MUXTYPE.AVI;
//Chapters
string chapters = chapterFile.Text;

//Open the video
string avsName = openVideo(workingDirectory.Text + @"\" + workingName.Text + ".d2v");
AudioStream[] aStreams = this.audioStreams;
SubStream[] audio = new SubStream[aStreams.Length];
int j = 0;
//Configure audio muxing inputs
foreach (AudioStream stream in aStreams)
{
if (stream.isInputMP4Muxable())
audio[j].path = stream.path;
if (stream.isOutputMP4Muxable())
audio[j].path = stream.output;
audio[j].language = "";
logBuilder.Append("Language of track " + (j + 1) + " is " + (string) audioLanguages[j]);
logBuilder.Append(". The ISO code that this corresponds to is ");
string lang = (string) LanguageSelectionContainer.getLanguages()[(string) audioLanguages[j]];
if (lang != null)
{
audio[j].language = lang;
logBuilder.Append(lang + ".\r\n");
}
else
{
logBuilder.Append("unknown.\r\n");
}
j++;
}
//Create empty subtitles for muxing (subtitles not supported by oneclickwindow)
SubStream[] subtitles = new SubStream[0];

VideoCodecSettings videoSettings = getCurrentVideoCodecSettings().clone();
//Check if XviD
bool isXviD = false; // xvid is a special case
if (videoSettings is xvidSettings)
isXviD = true;

if (mainForm.Settings.NbPasses == 3 && !isXviD)
videoSettings.EncodingMode = 8; //Auto3pass
else
videoSettings.EncodingMode = 4; //Auto2pass
//container (mp4) overhead
double containerOverhead = 4.3;
if (videoSettings.NbBframes > 0)
containerOverhead = 10.4;

//target filesize
int desiredSize = 716800 * 1024;
try
{
desiredSize = Int32.Parse(this.muxedSize.Text) * 1024;
}
catch (Exception f)
{
logBuilder.Append("I'm not sure how you want me to reach a target size of <empty>.\r\nWhere I'm from that number doesn't exist.\r\n" +
"I'm going to assume you meant 1 700 MB CD");
Console.Write(f.Message);
}
logBuilder.Append("Desired size of this automated encoding series: " + desiredSize + " bytes\r\n");

//Split Size
int splitSize = -1; //No splitting.

Job finalJob = jobUtil.prepareAndSetAutoEncodeJob(avsName, workingDirectory.Text +@"\" +
workingName.Text + "_Movie.mp4", this.output.Text, chapters, isXviD,
videoSettings, subtitles,
type, containerOverhead, desiredSize, aStreams, audio, splitSize);
if (finalJob == null)
{
MessageBox.Show("Error creating series of jobs");
}
else
{
mainForm.addToLog(logBuilder.ToString());
this.Hide();
mainForm.startEncoding(finalJob);
}
}

berrinam
6th July 2005, 06:52
Then there's the question: do we add Vorbis audio output as an additional option or not?
I think it would be good, *eventually*. The reason I am keen for mkv is that it can contain AVC and AC3 (for S/PDIF out). But considering that Vorbis is one of the best (according to rjamorim) audio codecs, it would be a good idea for the not-too-distant future.

Doom9
6th July 2005, 07:48
I have refactored everything except for the job generation yet so I'll gladly look at your code. Turns out it is quite a bit more work than I expected.. but your oneclickwindow class got quite a bit smaller.

I also added output splitting, enabled manual selection of the working directory, and full AVI support is still missing (audio is always handled as AAC which obviously won't work for AVI).

berrinam
6th July 2005, 11:18
I have refactored everything except for the job generation yet so I'll gladly look at your code. Turns out it is quite a bit more work than I expected.. but your oneclickwindow class got quite a bit smaller.I didn't think that there was that much code that was in common with other classes :confused: . Sorry about that.

Doom9
6th July 2005, 12:31
Sorry about that.No need to be sorry.. I realize it's already been very difficult for you since I kept changing the release code, and since I wanted both codebases in synch the only good solution was to move everything out to a common place. Job generation between the main GUI and the autoencode window is already very similar but nothing against the similarities of autoencodewindow and oneclickwindow. Once those changes are done, we'll effectively have one codebase to work with. I might make another release without the one click window exposed to make sure I didn't break anything and if it works out, unlock the oneclickwindow.

berrinam
6th July 2005, 12:43
Sounds good.

In the meantime, I have had a little look at making the GUI x264-only (through preprocessor directives). I decided to extend this idea and have a sort of custom logic for compiling which allows for expansion of the GUI by individual codecs/features at compile-time (this means I defined each of x264, lavc, xvid, snow, avswindow, etc, and surrounded the relevant code for each of these elements with #if and #endif statements). I grouped all of Form1.cs like this. This was a fair bit of work, and the gui looks a bit wonky at times (eg when there is only audio encoding and no video encoding, the space where the video configuration should be is just empty, and vice versa). I would have continued (I presume that the other classes would be easier to do, as most likely, one can wrap the entire class in one set of #if and #endif statements), but I don't know how to make the preprocessor symbols to carry across files.

Anyway, I could continue like this, which is a very elegant method from a coding point of view, because the features can be chosen easily at compile-time, but the GUI looks wonky, as I said. What do you think about this all?

Doom9
6th July 2005, 12:55
I had exactly that in mind. We do not need to consider certain scenarios though.. e.g. audio encoding without video will never be an option.. MeGUI is limited to a few useful options when it comes to audio encoding, but there's already an excellent BeSweet frontend out there that should be used if you want the full power of BeSweet: BeLight.

But limiting codecs is definitely a good idea. Perhaps limiting the output to MP4 would, too, but that will require changes all over the place so let's talk about that again when the refactoring is done (I won't give a deadline.. it takes a long as it takes.. I'll go even further than what you posted above.. I guess you'll be shocked when you see the new VideoUtil class).

Is it possible to have conditional code that moves around GUI components after initializecomponent? or the load method do certain things in function of the directives? that way we could dynamically resize and move around stuff to make certain screens less empty (the settings dialog is certainly one such case where this would make a lot of sense). I'm doing layout dynamically for the preview window (there are 4 different windows possible, depending on how you call the constructor I change not only the size but activate or deactivate buttons.. some of them are ever overlayed over each other but since they're never active at the same time it's no problem).

I guess we should mostly look at the following options: x264.exe only, snow only (restrict output to avi). mencoder only doesn't seem to make much sense (lack of mp4 output), and there are many other scenarios that don't really make a lot of sense

berrinam
6th July 2005, 13:30
I had exactly that in mind. We do not need to consider certain scenarios though.. e.g. audio encoding without video will never be an option.. MeGUI is limited to a few useful options when it comes to audio encoding, but there's already an excellent BeSweet frontend out there that should be used if you want the full power of BeSweet: BeLight.Ok. That makes it a fair bit simpler

I guess we should mostly look at the following options: x264.exe only, snow only (restrict output to avi).
That makes it a lot simpler.

Is it possible to have conditional code that moves around GUI components after initializecomponent?I'm sure it is, although that doesn't allow for easy editing of the GUI. At the moment, the initializeComponent method is full of precompiler conditions -- I don't see any reason why I couldn't do it there. The main problem I have with the GUI is the main form -- if you get rid of the audio group box, you have a lot of blank space. I'm sure I could downsize the window, but what then happens to the queue tab? Does the bottom get cut off, or should I add conditional code for that, too?

berrinam
6th July 2005, 13:35
but I don't know how to make the preprocessor symbols to carry across files.

Any idea about this? It may not be relevant any more, but it would still be useful to know: if I #define something in one file, it isn't defined in another file. This means the custom preprocessor logic I have in the main form file is not being used anywhere else. Basically, can I globally #define preprocessor symbols except through the commandline tag '/define'?

Doom9
6th July 2005, 13:46
Any idea about this?I'm sorry, no. I've never gotten beyond define TRACE.

Doom9
6th July 2005, 13:48
The main problem I have with the GUI is the main form -- if you get rid of the audio group box, you have a lot of blank space.Does it hurt a lot? The main form mainly has its size from the queue.. I'm not sure it's such a good thing to just reduce it's size (you're going to cut off a lot of stuff.. if you look at one of the codec configuration dialogues.. the commandline textbox is initially not visible.. it's outside of visibility but still there.. if you check the checkbox, I change the form size so it becomes visible).

berrinam
6th July 2005, 13:55
Does it hurt a lot? The main form mainly has its size from the queue.. I'm not sure it's such a good thing to just reduce it's size (you're going to cut off a lot of stuff.. if you look at one of the codec configuration dialogues.. the commandline textbox is initially not visible.. it's outside of visibility but still there.. if you check the checkbox, I change the form size so it becomes visible).
Ok, just wondering. I'll leave it alone, then.

Doom9
6th July 2005, 21:26
the new sources are up.. but this is more of a transitional release as certain things are still outstanding (see release note of the latest build).

berrinam
6th July 2005, 22:52
The code clean-up is good :D

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

What about writing to the log?

EDIT: fixed in next post.

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

}
}
This enables AR auto-detection from the info file (if not possible, it will default to Autodetect later).

Secondly, no log was being written by OneClickWindow because it was not being added to the mainForm log. To fix this, in OneClickWindow.setUpJobs(), add the following line at the end: mainForm.addToLog(logBuilder.ToString());


Finally, I realized when testing it that it didn't autostart the job queue unless Autostart job queue was set in settings (I guess that makes sense :D ). It's good, but not if you don't realize it (ie, you set it to run overnight, and then the next morning you wake up and it hasn't started :confused: ) Anyway, is it worth showing a popup that says, "warning: this job won't autostart" or something like that?

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

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

berrinam
7th July 2005, 00:23
I will implement that in the next post.Just as promised, here is a solution: in both the OneClickWindow and VobinputWindow constructors, add track1.Items.Clear();
track2.Items.Clear();
track1.Items.Add("<No file loaded>");
track2.Items.Add("<No file loaded>");
track1.SelectedIndex = 0;
track2.SelectedIndex = 0; (simpler than that would be to load them into the designer and set the collection in the list to <No file loaded>, and set the selectedindex to 0). After you have done either of the above, go to VideoUtil.openVideoSource(...). Just before the foreach (AudioTrackInfo ati in atis) block, add track1.Items.Add("<Empty>");
track2.Items.Add("<Empty>");
track1.SelectedIndex = 0;
track2.SelectedIndex = 0;
int index = 1;
Change these if statements: if (ati.language.Equals(mainForm.Settings.DefaultLanguage1) && track1.SelectedIndex == -1)
. Turn the selectedindex in the code to 0, to get: if (ati.language.Equals(mainForm.Settings.DefaultLanguage1) && track1.SelectedIndex == 0)
. Finally, in runDGIndexProject, change this.track1 = track1;
this.track2 = track2;
into this.track1 = track1 - 1;
this.track2 = track2 - 1;
to account for the addition of the <empty> item at the beginning.

Doom9
7th July 2005, 08:42
And another thing: I presume you limited oneclickwindow to two audio tracks to be consistent with the vobinputwindow, but the way it was before was interesting, because it was the only way in the gui to have more than two audio tracks, if anyone wants that. It also prevented having two of the same audio track (a waste of space and encoding time).Well.. I do not foresee more than 2 audio tracks in all the calculations and processing code and I have no intention of ever relaxing that constraint. Furthermore, it is actually not possible to select the same audio track twice.. you can select it.. but number two is silently discarded ;)

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

Anyway, is it worth showing a popup that says, "warning: this job won't autostart" or something like thatI'll add a warning.

berrinam
7th July 2005, 09:28
I'm afraid I must've eliminated some of the logging code during the rewrite such as the ar thing.. there's a method that already returns the ar but it is never propagated back to the form.. it does make sense getting it from the ifo though because the vobs sometimes have incorrect ar flags. On the other hand, if there's no info file or no ar detected, it should default to auto-detection.. in my tests I ended up with a 16:9 setting for a 4:3 source and naturally the resulting file was improperly resized.
In the version I posted above (and I thought the same about the old version), the ar would default to autodetect later if it couldn't determine it. I'm surprised that your file didn't work, maybe it's a problem with the info file, because my tests worked fine.

berrinam
7th July 2005, 13:53
I've made a preliminary MeGUI lite version for x264 and snow (separately). To compile for x264, add the define symbol (in the project options) X264_ONLY. Similarly, for snow, add SNOW_ONLY. Note that as of yet, they cannot be used concurrently. Attached are precompiled versions, and source code.

(Almost) Any comments are welcome.

Doom9
7th July 2005, 21:34
Just as promised, here is a solution: in both the OneClickWindow and VobinputWindow constructors, addI believe you missed a crucial piece. I don't think I've ever advertised that, but I have added code to the vobinput window and ported to the oneclick window that permits megui to properly identify the audio tracks after demuxing in case of non continuous track IDs. If you add another track, that's naturally going to break that mechanism.

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

By the way, you said that csc creates much smaller executables. What commandline did you use to compile megui?

Doom9
7th July 2005, 21:56
about the lite versions: default priority, autostart queue, shutdown after encoding, overwrite stats file and keep second pass output should still be available.

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

The reset button can be moved into the groupbox.

The same also goes for the Snow GUI.

berrinam
7th July 2005, 23:25
By the way, you said that csc creates much smaller executables. What commandline did you use to compile megui?
csc /target:winexe /out:megui.exe /win32icon:app.ico /unsafe+ /recurse:*.csI think the files compiled this way are much smaller because it does not include the resource files. The /optimize+ tag can be added, but it only knocks about 6KB off.

I'll do all of those things you mentioned about the lite versions.

Doom9
8th July 2005, 07:21
thanks for the compilation tips.

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

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

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


con: megui would no longer be self-containing. Without the medialib you would be unable to encode

berrinam
8th July 2005, 08:09
thanks for the compilation tips. No problem. I only discovered them because the computer I use most of the time doesn't have VS.NET installed.

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

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

So basically, I think it would be a good idea.

Doom9
9th July 2005, 02:29
Hasn't MeGUI required external programs from the start? Oh absolutely, but this is yet one more dependency and one that is not a must to have.

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

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

I'll add a separate bitrate calculator that should also be accessible in both reduced modes. You can add the menu option and a dummy event handler for this already and I'll integrate the new class into that.

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

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

The code for the GUI elements is becoming rather messy, but I'm hoping that it won't be a problem because most of form1 will be staying the same.

berrinam
9th July 2005, 03:35
I've had a look at the updates you posted -- it shouldn't be too hard to work them into version 2.1.0a, so I don't have to rewrite the code.

berrinam
9th July 2005, 03:50
Video output filename wasn't being autoset -- a variable had it, but it wasn't put into the textbox. Will be fixed in the compile options release I will give.

berrinam
9th July 2005, 08:17
I have completed and attached the lite versions. All of the code *should* be up-to-date with 2.1.1, but I may have left something out by using an obsolete file somewhere. Everything seems to be working, so this should probably be used as the codebase for any further additions (it is a real hassle if not, because almost every file needs to have something done to it). Like before, I have attached sources, and compiled versions. In the source version, I have only attached *.cs files; I haven't changed anything else, or added/removed files.

These sources also fix the bug mentioned above.

Doom9
9th July 2005, 11:33
thank you.. I'll make sure to use this for any further work I do.

Doom9
9th July 2005, 14:36
I just ran your new x264-only version. Very nice work indeed :) The only thing missing is mainform title adjustment to reflect which app you're running, but I guess I can take care of that myself.

berrinam
9th July 2005, 14:39
I just ran your new x264-only version. Very nice work indeed :)Thanks
The only thing missing is mainform title adjustment to reflect which app you're running, but I guess I can take care of that myself.
Thanks again.

Doom9
9th July 2005, 22:30
hmm.. I'm trying to continue development on the code you sent me. I don't quite get why you picked a preprocessor symbol for what should be the default mode (the full mode).. since it is the default mode I wouldn't thought I'd get a full version if I don't specify anything and that I'd have to specify a flag to get a limited version. The way it is now, if you forget to add the FULL flag and make a default compilation, you get a useless application.

I also miss the bitrate calculator in the full mode. In fact, I don't find it anywhere in the source code.

why did you put the entire code from the MeGUI constructor into a try/catch? Exception in job/profile loading are already catched.

when I try compiling with X264_ONLY or SNOW_ONLY defined I get more than 200 compilation errors.. something is definitely not right here. Are you sure you packed the code you used to compile these executables?

berrinam
9th July 2005, 23:45
hmm.. I'm trying to continue development on the code you sent me. I don't quite get why you picked a preprocessor symbol for what should be the default mode (the full mode).. since it is the default mode I wouldn't thought I'd get a full version if I don't specify anything and that I'd have to specify a flag to get a limited version. The way it is now, if you forget to add the FULL flag and make a default compilation, you get a useless application.Actually, the full tag just means that it is ONLY in the full version. I couldn't figure out any way to exclude code except by wrapping it in conditional tags. If you can think of a better way, please do. So basically, code that is included in both full and lite has no conditions around it, code for only the full version has #if FULL around it, code for only x264 has #if X264_ONLY, and code for only snow has #if SNOW_ONLY around it. Yes, it does mean that you have to be aware when you are writing it whether it gets included in the lite versions.

I also miss the bitrate calculator in the full mode. In fact, I don't find it anywhere in the source code.Do you mean the menu item for the bitrate calculator? I thought that you meant that was only wanted for the lite versions -- perhaps I misunderstood you. However, I'm surprised that you couldn't find it. In my version of the code (that I sent you), it is on lines 165 and 168 (inside #if X264_ONLY and #SNOW_ONLY tags).

why did you put the entire code from the MeGUI constructor into a try/catch? Exception in job/profile loading are already catched.That was just for debugging; it kept crashing and I couldn't find out why.

when I try compiling with X264_ONLY or SNOW_ONLY defined I get more than 200 compilation errors.. something is definitely not right here. Are you sure you packed the code you used to compile these executables?
That is weird, because I just tested and it worked fine. May I ask, how are you compiling? The only method of compiling that I have tested is through the commandline. There may also be issues if VS.NET rearranges code, stuffing up the conditional code; I don't think it does, but I'm not sure. Also, where are you defining the preprocessor symbol? If in VS.NET, are you defining it in the project options (I think that is where you should). Otherwise, define it as a parameter, if you use the commandline. I'll have a look at VS.NET later today, to see if there is something it does to stuff up the code.

Doom9
9th July 2005, 23:55
May I ask, how are you compiling?VS.NET. I have DEBUG, TRACE and FULL/X264_ONLY/SNOW_ONLY defined for the debug output, and TRACE& one of the others for the release build.

About the calculator menu: I find the definition, an empty event handler, but not the place where it is added to the menu and where you link the event to the event handler.

And there were some horrible errors going on with the video profiles.. I have no clue where you got that line from but in the definition of what classes are contained in a VideoCodecSettings class, it listed thing that will most definitely never be in there, and none of the settings subclasses were mentioned. And there was some other stuff.. definitely not the most painful integration ever.. but that's exactly the reason why I want to make the releases.. I have a few things I always play through with each release to catch real showstoppers. Not that it prevented me from breaking the xvid dialogue completely in the last release, but at least everything else still worked.

berrinam
10th July 2005, 00:24
The bitratecalc creation is in lines 267, 271, 964 (where it is added to the tools menu) and 993.

I have no clue where you got that line from but in the definition of what classes are contained in a VideoCodecSettings class,oops, didn't notice that. It should be #if FULL
[XmlInclude(typeof(VideoJob)), XmlInclude(typeof(AudioJob)), XmlInclude(typeof(MuxJob)), XmlInclude (typeof(SubStream))]
#elif X264_ONLY || SNOW_ONLY
[XmlInclude(typeof(VideoJob))]
#endif
As I said earlier, the code is quite messy as a result, but it mostly does the job. I'll have a look into compiling it with VS.NET later today.

Twisted Ladder
10th July 2005, 01:17
I have some suggestions:

Could 1-pass support please be added to One Click Encoder? If I make a CBR or CQ profile why I am forced to do 2-pass at a certain file size?

Also, if there was an option in the One Click Encoder to make the resolution fit within a desired width and height (e.g. "max width" and "max height" options) instead of only defining the width, that would be great.

:thanks: in advance

berrinam
10th July 2005, 01:20
The problem with one-pass is that the rate-control is not as accurate as two-pass. It could be implemented, but there may be problems with hitting the target filesize.

Can you explain what you mean about the resolution?

Twisted Ladder
10th July 2005, 01:23
But I'm not aiming for any target file size. Mostly I would like to encode my videos with XviD @ quantizer 4.

For the resolution: I want to encode my videos for a device with a 480*320 screen. So I would like to be able to define the max width as 480 and the max height as 320. So for example, if the aspect ratio was 4:3 it would use 432*320. If the aspect ratio was 16:9 it would use 480*272.

Doom9
10th July 2005, 02:01
well.. all the automated modes are all about hitting a certain target size, the code is written for that. The code simply cannot handle another mode without significant changes, plus the entire forms would have to be redesigned to accomodate this.. someplace you'd need an option to tell the program that it can scrap all the logic with bitrate recalculation, and that would have to be propagated throughout ever facet of MeGUI. It's not only about creating jobs, it's about encoding them. Right now, an audio job followed by a vide one (with the two linked together) means "update the bitrate".

And as far as forcing the vertical resolution goes.. no again. Keeping black borders is not a smart thing to do, and stretching the video to fit a certain resolution because of a playback device? I don't think so. If you have a widescreen movie, you'll always have black bars on your PDA but it's much better to let your player add those than to have them encoded.

Twisted Ladder
10th July 2005, 02:22
No, I don't mean adding black borders to the encode, nor distorting the aspect ratio. Look at the smart resize filter for VirtualDub. It has an option to fit to width & height. It will make it the largest resolution that it can while maintaining aspect ratio and not going over specified width or height. Again see my example. For 480*320, if the aspect ratio was 4:3 it would encode for 432*320, if the aspect ratio was 480*272, it would encode to 480*272. No black bars, maintain aspect ratio, don't let it exceed specified resolution.

Also, I didn't realize 1-pass would be so hard to add. I can currently do it manually by creating the d2v, creating the AviSynth script, adding the video job, adding the audio job, wait 'til it's done encoding and mux the results. I'm no expert but it doesn't seem that different from the current One Click Encoding, just have the option to follow the profile and not ask for a target file size.

Doom9
10th July 2005, 02:36
It feels to me like one of those things that goes way beyond the 80/20 rule.. lot of work for little use for most people. I believe it is reasonable to assume that more that way more than 80% will use MeGUI's output on PCs, and probably standalones one day. Neither does require what you're asking for.

Also, I didn't realize 1-pass would be so hard to add. I can currently do it manually by creating the d2v, creating the AviSynth script, adding the video job, adding the audio job, wait 'til it's done encoding and mux the results. I'm no expert but it doesn't seem that different from the current One Click Encoding, just have the option to follow the profile and not ask for a target file size.Well, human minds are very flexible. Code is not. It's a simple as that. Hinting that a certain feature would be easy, unless you actually know how the program in question works and having a clear idea of how to implement what you're asking for, is a little pretentious and not exactly how you want to motivate any programmer (it's like somebody telling you that the work you do all day could easily be done in half an hour, in other words you're slow an ineffective (and should thus be fired)).

Twisted Ladder
10th July 2005, 02:40
If I knew the feature was so hard to implement I wouldn't have asked. Thanks anyway, guess I'll stick with DGIndex + VirtualDubMod.

azsd
10th July 2005, 03:23
MeGUI v0.2.1.1
When select and Configuated ASP/snow encoding argments,click OK,the Codec combobox changed to "AVC" automaticly.
while try to use xvid codec,megui occured an "index out of array bound" error on "Config" button clicked.

berrinam
10th July 2005, 04:13
@Doom9: I have no idea what errors you got when trying to compile it (except for that one in the videocodecsettings class), as I have just tested it in VS.NET I have got an entire project, which I will send to you. When I tried to compile, there were two errors where FULL was not being defined -- I think you spoke of that earlier. Anyway, each of the three compile modes work, and FULL should never need to be defined in the project options, as each class that needs it will define it if X264_ONLY or SNOW_ONLY are not defined. Attached is the project.

Doom9
10th July 2005, 11:46
while try to use xvid codec,megui occured an "index out of array bound" error on "Config" button clicked.Please don't report issues if not having read the changelog of the latest release.. this is an issue that the latest release fixes.

Doom9
10th July 2005, 11:53
@berrinam: well.. you need to really test it, not just compile it. I compiled the source you attached without defining anything, put the exe into a location where I have profiles, jobs and settings defined, and I get a whole bunch of errors thrown about being unable to read jobs. Then I define full and voila.

So that definitely is broken. It seems I can compile in minimized mode.. could you please port whatever you changed to the source version from the first post here.. you used the old sources which has a lot of little things wrong with it and I really want to debug everything again to find all the places that need fixing (it's not compilation issues.. it only happens in certain usecases).

There are more issues with what you attached.. my visual studio doesn't detect the resx files for half the GUI classes so they don't show up in the GUI editor (just so that when you edit my project you be on the lookout for that and make sure everything is in order before you upload the fixes)

Doom9
10th July 2005, 12:05
I did some debugging and I know why it doesn't work if you don't define full. In the VideoCodecSettings class, you do not define FULL, so unless it's defined in the project options, you have no xmlinclude and thus anything that contains a subclass of VideoCodec settings cannot be saved to XML and not read from XML.

And that is by far not the only place where that problem ocurrs.. the VideoEncoder is another prime example. Yesterday when I compiled the first time I couldn't even encode until I figured out where I had to put global defines.

azsd
10th July 2005, 12:41
sorry doom9,
I get that xvid conf error yesterday's mid night and when I wake up from bed today morning,
I posted the report first but haven't noticed 0.2.1.2 released or is it have not been release when I post.

and after deleted the profile folder,the codec selection combobox working fine now.

berrinam
10th July 2005, 12:57
@berrinam: well.. you need to really test it, not just compile it. I compiled the source you attached without defining anything, put the exe into a location where I have profiles, jobs and settings defined, and I get a whole bunch of errors thrown about being unable to read jobs. Then I define full and voila.
I'm really sorry that I stuffed all of this up. I'll give it a day or two break, and then try again in VS.NET with the latest sources. Maybe this time I won't break too much.

Twisted Ladder
10th July 2005, 21:53
Ok, well I've got some more requests (that are hopefully easier to add):

Could downsampling be added to the audio config menu?

Could you add some extra "Storage Mediums" to the drop-down list in One Click Encoder? Specifically, a 512 card (which has a capacity of 483MB, and since you can't just overburn maybe 480000KB to be on the safe side) and a 1GB card (capacity of 973MB, so 970000KB).

Doom9
11th July 2005, 07:14
why on earth would you want to downsample? You're entering territory I do not want to go into.. downsampling is a bad idea. From a coding point of view it wouldn't be hard to implement though.

And obviously I could add a million different output sizes.. but that's what custom is for. Why those sizes? Are you thinking PSP? If so forgettabaoutit, it's not gonna happen. See this posts for details why: http://forum.doom9.org/showthread.php?p=681590#post681590

Twisted Ladder
11th July 2005, 07:40
More like Zodiac, using TCPMP

http://tcpmp.corecodec.org/about (also, x264 works but is far too slow compared to hardware XviD playback)

Also I was just suggesting downsampling because it helps at lower bitrates, e.g. a 24khz audio file at 64kbps might sound better than 48khz at 64kbps. I mean, this is "the most comprehensive GUI", right?

Doom9
11th July 2005, 08:15
e.g. a 24khz audio file at 64kbps might sound better than 48khz at 64kbps.Might? Perhaps if you can provide the mathematical evidence that this in indeed so I might consider it. But I'm afraid a might be isn't good enough. And then there's the 80/20 thing again.

Twisted Ladder
11th July 2005, 15:47
It's the same way how 300kbps 15fps would look better than 30fps, because although there would be less frames, as a direct result the remaining frames would be less compressed. Same applies to audio, although 24khz wouldn't be as "smooth", it would be less compressed.

*shrug* All the cool kids are making CD backups I guess :( But even still I imagine some non-audiophiles would be willing to use 64kbps 24khz audio in order to fit a little more video quality on 1-CD backups.

Doom9
11th July 2005, 16:22
It's the same way how 300kbps 15fps would look better than 30fps, because although there would be less frames, as a direct result the remaining frames would be less compressed.Now I'm fully sold. I get about as excited about non IVTC frame decimation as an atom at 0 degrees Kelvin.

Twisted Ladder
11th July 2005, 18:18
You're a tough one to convince, aren't you? Well fine don't take my word for it:

http://s37.yousendit.com/d.aspx?id=3FKFVK0VMEQ3M2JV6XG2E0ZQJ8
http://s37.yousendit.com/d.aspx?id=3VWPZYC3Z1CU63J8JLP1HEXYMW

As you can hear, at this bitrate 24khz clearly sounds much cleaner and less compressed.

Doom9
11th July 2005, 19:10
umm.. 64kbit any no HE AAC? That's just the bitrate HE was made for.

Twisted Ladder
11th July 2005, 19:14
Whenever I use HE AAC it comes out sounding really wispy. Although I suppose that's a problem on my end.

Doom9
11th July 2005, 19:27
sounds like your player doesn't handle the HE part properly.. I'm currently listening to a HE 64kbit stereo soundtrack.. while even a non audiophile like me can hear the difference, it does sound quite okay (but it's not up to my standards).

Doom9
11th July 2005, 19:41
The bitratecalc creation is in lines 267, 271, 964 (where it is added to the tools menu) and 993.I have the creation, but 964 is the initialize component in the 0.2.1.2 sources and 993 is something entirely unrelated. Either way, I'll re-add it. Please wait for my next release before looking at the whole minimized mode thing again.

berrinam
11th July 2005, 23:40
Please wait for my next release before looking at the whole minimized mode thing again.
Does this mean 2.1.3 or a future one?

Doom9
12th July 2005, 05:41
the one after that... with a working bitrate calculator

azsd
12th July 2005, 08:08
if (fileType.SelectedIndex == 1 || (fileType.SelectedIndex == 2 && settings.X264Encoder == 0))
this.saveFileDialog.Filter = "MPEG-4 AVC RAW Files|*.264";
else
this.saveFileDialog.Filter = "MP4 Files|*.mp4";

missing the mkv filter for fileTypeselectindex 3.

and,Is it "--pass 3" or "--pass 2" means the 2nd pass of x264 3pass encoding?
MeGUI use the "--pass 3" arg for 2nd pass in logfiles.

Doom9
12th July 2005, 08:26
uhh.. where's that bit of code from? there's 1.24 MB of code in total ;)

and,Is it "--pass 3" or "--pass 2" means the 2nd pass of x264 3pass encoding?Both.. the only difference is that 2 doesn't update the stats file anymore whereas 3 does. You can chose which one is used for automated 3pass in the settings (it's the "Overwrite stats in 3rd pass" setting). And I recall putting that in the release notes (my posts at the time I make a new release)..

@edit: never mind, it's the output filename selection. I never bothered with the output selection since it's done automatically.. and while the filter isn't correct, the filename you'll end up with is correct so there's no reason for a quick fix.

berrinam
12th July 2005, 09:02
I've been looking at Matroska muxing a bit in my idle time. The thing I'm wondering is this: what is the purpose of creating a specific mkv muxing section of the gui? There is already a very good gui for muxing which is part of mkvtoolnix. Would it be better just to have matroska muxing for autoencode/oneclick jobs, and not really visible to the user except in the filetype combo box?

Doom9
12th July 2005, 09:29
well, you always have to deal with pre-existing streams, so you kinda need a stripped down muxing GUI. Naturally it would be very much feature limited and basically look like the mp4 muxer, but you have to assign language codes, and additional input somewhere.

berrinam
12th July 2005, 09:36
The thing about language codes is that you need to specify the the input stream number for the language code (ie if you want an audio track to be labeled as english, then you need to do something like --language 0:eng, where 0 is the track number of the INPUT file). So, either you assume that you are dealing with raw or one-stream files, and the track number is always 0, or else you have to do some file parsing, look through the tracks, and ask the user which track he/she wants to use as input.

berrinam
12th July 2005, 09:40
A note about what I said above: assuming that the files you have all have only one stream may be a faulty conclusion; bsn/nero mp4 output has an AAC track and an Object descriptor track and a BIFS track.

Doom9
12th July 2005, 09:43
I know that.. but that doesn't seem to have any noticeable effect on the outcome. The muxer works the way I expect it to (leaving the still open bugs in mp4box aside), and the overhead calculations seem to work (I'm actually surprised on how little problems there are with overhead.. the reason I started with mp4 was to get statistics but nobody reports them back, and nobody complains about oversize - or if they do, it's not due to improper calculations).

@edit:
The thing about language codes is that you need to specify the the input stream number for the language codeumm.. are you refering to matroska now? It works just fine for mp4 even with the additional tracks (because the aac is always the first track in Nero's output). Naturally if people start using whatnot MP4s then they might run into trouble.. but that's really their problem.. I expect a Nero generated AAC in MP4. I guess faac would work as well but I've never tried it. But if somebody tries to be smart and loads an mp4 containing video and audio, or audio and something else.. that is really a user error you cannot catch with reasonable effort.

berrinam
12th July 2005, 09:53
I'm actually surprised on how little problems there are with overhead.. the reason I started with mp4 was to get statistics but nobody reports them back, and nobody complains about oversize - or if they do, it's not due to improper calculationsWell, let's do the calculations: One byte per frame extra has this effect on output size:
1byte*25fps*60secs/min*120min/movie = 180,000 bytes = 180KB filesize difference per 2hour movie for each byte of overhead. In bitrate terms, this is

1byte*25fps = 25bytes per second = 200 bits per second, or 0.2kbps difference. What sort of rate-control can reach that accuracy?

umm.. are you refering to matroska now? It works just fine for mp4 even with the additional tracks (because the aac is always the first track in Nero's output). Naturally if people start using whatnot MP4s then they might run into trouble.. but that's really their problem.. I expect a Nero generated AAC in MP4. I guess faac would work as well but I've never tried it. But if somebody tries to be smart and loads an mp4 containing video and audio, or audio and something else.. that is really a user error you cannot catch with reasonable effort.
Yes I was. Anyway, that answers my questions. This doesn't enlist me as mkvmerge/megui interface writer now, does it? I'm happy to do it, but I want to wait a few days to get my computer sorted.

Doom9
12th July 2005, 10:46
well.. I'm personally not too keen on all the things that matroska support involves..

Doom9
13th July 2005, 21:06
alright, the calculator is finally done. Considering the event firing, it's quite a torture class.. something to make you like cli programs.

A few notes: the bitrate calculator is available in all modes.
The output opening dialogue in 264-only mode should not be limited to mp4, but offer raw and mkv output as well (currently it's limited to mp4).
In the limited modes, naturally there shouldn't be any codec selection in the bitrate calculator. Additionally, no AVI in x264-mode, and no MP4 in Snow mode (along with no b-frames).
The method that loads the configuration into the calculator, and data extraction afterwards also needs to be made conditional as it could reference to non existing classes.

I have already added the default definitions in classes that lacked the definition of full.. in theory it should work okay now without having to define full.. but please give it a really good testing.

Also, if you have time, the autoencodewindow also would have a bitrate mode for the calculation.. but come to think of it I doubt it makes sense to activate it as in the end you're still left with bitrate recalculation.. but enabling would permit you to set the desired size for the desired bitrate.. the calculation code is there and the calculator can be taken as a complex template for this.

Sharktooth
13th July 2005, 21:24
http://www.webalice.it/f.corriga/misc/megui_quirk.png

Listbox is too short for entries.

Doom9
13th July 2005, 21:28
I know.. but I care a lot more about things working than cosmetics so I tend to forget to fix those things.

mezzanine
14th July 2005, 08:49
Is it a good idea to add vstrip.dll to automatically get the chapter times and ifo structure (oneclick) ?

Doom9
14th July 2005, 12:28
well.. it does have its advantages and disadvantages. The advantage is that more rippers are supported, and the distinct disadvantage is that we'd be relying on a probably less reliable tool, that we have another explicit dependency (DVD Decrypter is implicit.. it works with anything else but in absence of the info file the languages aren't autoset and the chapter file not autoloaded).

mho, DVD Decrypter is clearly THE choice here because it generates those infos and the chapter file during ripping. And there's no solution for non VOB sources anyway

berrinam
15th July 2005, 07:40
Not having access to VS.NET at the moment, I've been working on the code only through notepad. I noticed that for the last release, you kept everything as before (in terms of the conditional compiling) except for the InitializeComponent method of Form1. Is this because it won't display properly in the editor, or some other reason?

You may have noticed the different ways I edited the GUI components. Namely, in the SettingsForm, I had the GUI twice, once for full, and once for X264_ONLY || SNOW_ONLY, whereas in Form1, I had it only once, and I just wrapped the individual components in their tags. As I said earlier, I don't currently have access to an IDE, so I don't know what allows for easy editing of the GUI. Some feedback about how the GUI elements should be done would be nice.

I also don't know what effect the resx files have (they aren't needed for compiling with csc.exe). I have a feeling they are needed for the IDE in the GUI designer, which may have been why you weren't able to edit the GUI in the last version I uploaded.

Once I have those things sorted out, I can probably reasonably quickly produce a new release. The new bitratecalculator window is going to be the most work.

Also, I have integrated mkvmerge into MeGUI on my computer (so mkv muxing works on my computer). For all formats except x264, I go through AVI container then into mkv. Is there a better way to do this for the ASP codecs?

Doom9
15th July 2005, 08:41
doesn't mkvmerge support raw asp input? If it does, I think that's the way to handle it as it's consistent with MP4 muxing. As for x264, since you need MP4 or use the direct MKV output of x264.exe I'd go for the latter.. especially since AVCinAVI input is not officially supported in mkvmerge and we don't need to open a support office for mkvmerge. And as for snow I have no idea how that should/could be handled.

You are correct about the resx files.. they contain the information required for the GUI designer.. without them I'm screwed and I'm definitely not about to place/edit/add GUI elements manually. I don't really have any experience in this are, but when I defined X264_ONLY, form1 seemed to be missing certain GUI elements and upon recompiling with FULL defined they were once again shown.. so hopefully (to be verified) that means you can have the resx for the full GUI and the GUI designer will only shown the components used in the mode you have last compiled for.

The only change I made in Form1 was to move the BitrateCalculator menu item out of the conditional block since it needs to be available everywhere. I did make changes in some other classes.. I think videocodecsettings and videoencoder (and perhaps another one).. you forgot to define full there, so why it would compile in full mode, it would be useless as no video encoding could be done.

berrinam
15th July 2005, 08:52
I currently support mux x264 through mp4 or mkv, I can't remember which. Mkvmerge GUI doesn't appear to support raw ASP input, so mkvmerge probably doesn't either.

Yeah, I noticed the changes you made to the videosomething classes, but I was talking in particular about changes made to the initialize component method in form1. I think the GUI designer must frequently rewrite the code, eliminating mine. As this doesn't seem to be the case in the SettingsForm, I think I will just resort to copying the initializecomponent method and writing it twice. This will need some testing to see how VS.NET handles it. Do you think you could look at how I've handled the SettingsForm to see whether that sort of thing would work?

Doom9
15th July 2005, 09:21
I was afraid that VS would rewrite the InitializeComponent method.. it seems to like doing that (but it doesn't always happen.. for instance you can force the order of tabs by changing the point they are added to the tabcontrol, and those changes aren't overwritten).

If you have a second InitializeComponent and call it depending on what symbol is defined, that would certainly work.. but that wouldn't show up in the GUI designer obviously. I don't know how the settings class behaves int he GUI as I cannot compile with all the errors. Looking at them, you didn't #if out all the elements not needed in the stripped down modes.. a couple of audio options still seem to be there.

There is a way you can have two designs of a form: enable localization, and design the GUI differently for different languages. Then you end up having one dll for each version, and depending on which language is set for the current thread, one or the other is loaded. But if that's such a great solution.. it would probably mislead people into believing that multiple languages are supported which isn't the case (and I don't want to support multiple languages, certainly not in an app with that amount of GUI elements).

Doom9
15th July 2005, 09:36
here's another idea I've had:

You basically created another settings window.. using visual inheritance we might be able to have a base settings form, and extend this for the full mode. That way everything is accessible in the GUI. And likewise for the main form. I'm not sure it would work just like that for the main form because there's parts of methods that you have to comment out, but that basically just means that the code has to be moved out someplace.. so instead of having processing logic in the GUI class, have it someplace else and just send not only parameters but also the reference to the GUI elements needed to the processing class, similar to certain methods in the videoUtil, that not only get parameters but also a few GUI elements to do the processing.

Doom9
15th July 2005, 09:52
hmm.. another tidbit of info I've found (studying for the MCAD certification does have its benefits): You can use the [Conditional("symbolname")] to include or not include a whole method in the output, but that only works if the return type is void.

berrinam
15th July 2005, 10:19
here's another idea I've had:

You basically created another settings window.. using visual inheritance we might be able to have a base settings form, and extend this for the full mode. That way everything is accessible in the GUI. And likewise for the main form. I'm not sure it would work just like that for the main form because there's parts of methods that you have to comment out, but that basically just means that the code has to be moved out someplace.. so instead of having processing logic in the GUI class, have it someplace else and just send not only parameters but also the reference to the GUI elements needed to the processing class, similar to certain methods in the videoUtil, that not only get parameters but also a few GUI elements to do the processing.
I like this idea the best. I was sort of thinking that that would be nice for a while, because it would make the code so much more manageable...

Anyway, how would the visual inheritance work? Wouldn't it be easier to just have two different GUIs? I thought that you can edit whichever one you want by writing #define X264_ONLY or whatever at the beginning of the class you are editing. However, I may be wrong.

If the visual inheritance is too hard to manage, I may end up just writing the InitializeComponent method twice -- if it isn't editable in the designer, then we will just have to cope.

Doom9
15th July 2005, 10:39
visual inheritance (just as non visual one) spares you from having the same code twice, which is obviously the best approach management wise. I'm not sure VS.NET would even allow the same class with two resx files (so that they are both editable in the designer). So if the resx won't work out, you need to give classes a different name, and then you need to know which one to launch..

It's not really hard to manage, it just takes some work getting there, but it would only be one more major rewrite of the many I've had to do in the past.

mezzanine
15th July 2005, 14:38
Where can i find a list of things to be done ?

berrinam
15th July 2005, 14:49
I don't have a list, but porting of the auto-deinterlace code seems like a nice idea.

mezzanine
15th July 2005, 15:53
Ok :)

Doom9
15th July 2005, 16:11
I'm afraid I stopped the todo list. I will resume and assign tasks to people currently working on them.

Doom9
16th July 2005, 12:31
I've been thinking about having dgindex jobs for the one click mode. Right now, even though you need not encode, and dgindex is a drop in the ocean compared to what's coming after it.. you are forced to run dgindex manually if you want to process multiple movies after another. I'm already scared of all the stuff I'd have to pack into such a job though (all the configured settings from the one click window... eww).

Doom9
18th July 2005, 07:48
I've added some points to the todo list.

@berrinam: how's the conditional compiling coming along? I'd like to make some experiments wrt to pausing encoding, but I need to update the main form to do that.

berrinam
18th July 2005, 08:43
@Doom9: I've been experimenting with the conditional compiling, and it works quite well if the variable declaration for the gui, and the initializecomponent method are both completely wrapped it #if... statements. This means that each of the different modes can be edited in VS.NET just by changing the /define code in the project options. However, it makes absolutely no use of visual inheritance (I couldn't figure out how to do it while keeping it editable in VS.NET). If you want, I can have a version with that ready in a few hours.

At the moment, I have a version of MeGUI that doesn't have conditional compiling, but it does have mkvmerge functionality for the main GUI and OneClickWindow (NOT autoencodewindow). For overhead, it assumes the same overhead as mp4. From my limited testing, it seems to have *slightly* smaller overheads, but not by much. The entire project for that is here (http://rapidshare.de/files/3145218/2.1.4_matroska.zip.html).

Oh, and feel free to make changes to the main form if you want to stick to the method of conditional compiling that I spoke about in this post, because I will have to redo the main form anyway.

Doom9
18th July 2005, 11:56
I take it the matroska version is fully vs.net compatible with all the GUI elements available for editing?

berrinam
18th July 2005, 12:41
Yes. On checking, I discovered that mkvMuxWindow2.cs may have to be renamed to mkvMuxWindow.cs.

CiNcH
21st July 2005, 23:45
@ Doom9,

could you please have a look at the ME Algo and ME Range switches?

x264 Help says:

--me <string> Integer pixel motion estimation method ["hex"]

strings:
dia: diamond search, radius 1 (fast)
hex: hexagonal search, radius 2
umh: uneven multi-hexagon search
esa: exhaustive search (slow)

--merange <integer> Maximum motion vector search range [16]


What MeGUI seems to do:

Diamond: --me --merange 16
Hexagon: --merange 16 (no --me at all)
Multi hex: --me umh --merange 16
Exhaustive: --me esa --merange 16


Only the last 2 seem to be correct. As far as I know merange is only respected in Multi hex and Exhaustive modes, so it should probably be greyed out in the other two modes.

leowai
22nd July 2005, 03:07
I think this has already been reported here:
http://forum.doom9.org/showthread.php?p=688652#post688652


Hexagon: --merange 16 (no --me at all)

This means Hexagon is used by default if nothing specified

TheBashar
22nd July 2005, 03:57
Thanks for MeGUI, Doom9. It is very handy. I have just a couple of user interface suggestions that would help out addle-brained people like myself.


In the encoding "status" window, rearrange such that the "priority" choices do not drop down over top of the Abort button.
Request confirmation when the close window button (X) is clicked if an encode is currently processing.
If a new avisynth script is selected on the input tab, automatically generate a new video output name corresponding to the new avs name.
Allow MeGUI window to be sized so I can read all the Queue info without horizontal scrolling.
On the Queue tab, I believe "Clear" functions as a Delete All. A cleared finished entries would be handier for me.


Just my $0.02. Thanks Again!

Doom9
22nd July 2005, 07:52
In the encoding "status" window, rearrange such that the "priority" choices do not drop down over top of the Abort button.What good would that do? You cannot at the same time abort and select a priority after all.
Request confirmation when the close window button (X) is clicked if an encode is currently processing.hmm.. I don't like that.. you should know where you click and it doesn't stop encoding after all. Of course it's the easier to be implemented solution to the "user doesn't think before clicking the X button" problem since there's no way to reopen the progress window (which from a coding point of view isn't so trivial.. that is unless I would catch the closing event and make it just hide the form.. but that does have its severe catches as well).
If a new avisynth script is selected on the input tab, automatically generate a new video output name corresponding to the new avs name.That I can do
Allow MeGUI window to be sized so I can read all the Queue info without horizontal scrolling.There's one big problem with that: GUI elements have a fixed position. If you blow up the GUI, it will look ugly as hell.. really disgusting. Imagine the input tab blown up with elements remaining at the same place. And even for the queue isn't not as trivial as chaning the form from fixed size.. the only way (I know of) for automatic resizing is anchor GUI elements somewhere. I could anchor the listview left and right so that it would be stretched, but the horizontal size would remain the same. Or put everything in an anchored panel, but that would mean everything is stretched and you'd have huge buttons and huge spaces in between GUI elements. Or I'd have to override certain events and resize and reposition the GUI myself when you resize. So you see how this "little" request opens a whole can of worms and may require a considerable time investment for something which really isn't that important.
On the Queue tab, I believe "Clear" functions as a Delete All. A cleared finished entries would be handier for me.That is correct.. clear always does that.. it doesn't say clear yzx jobs after all, does it? I like to be able to clear everything (it was a feature request that could easily be accomodated). Yours isn't quite so simple: you have to take care of chained jobs.. what to do if one is finished and one is not. What to do with aborted and errored jobs.. in the end you'd need a dropdown that contains all job types and all combinations thereof just so that everybody will be happy.

TheBashar
22nd July 2005, 08:19
What good would that do? You cannot at the same time abort and select a priority after all.

Say you've set the priority to LOW. You go to change it back to Normal. Normal is over but not totally covering abort. Click a little off target and you've just clikced abort.


hmm.. I don't like that.. you should know where you click and it doesn't stop encoding after all.

I did say I was a little addle-brained right? Anyway, it sure did stop my encode. 2.5 hrs down the drain. It wasn' the status window, but the main MeGUI window that received the spurious X click.


That is correct.. clear always does that.. it doesn't say clear yzx jobs after all, does it?

:p


you have to take care of chained jobs.. what to do if one is finished and one is not.

Will the 2nd pass work if the 1st pass is "done" and cleared? If yes, delete it. If not, keep it.

What to do with aborted and errored jobs.. in the end you'd need a dropdown that contains all job types and all combinations thereof just so that everybody will be happy.

Umm... :p I was thinking a nice "clear all the crap that doesn't matter anymore" button would be handy. Aborted, Errored, Processing... these tend to indicate I might still need to do something with them, so I'd leave them. Done, however seems like a nice "you don't need me anymomre" state.

Ya know, whatever floats your boat though. If you're not keen on any of these ideas, let me just say thanks again for all the work you've put in already!

PS: Do you know how avs2x264 handles zones.... Hehe.. just kidding. I wont even bother making that suggestion.

Doom9
22nd July 2005, 09:30
Do you know how avs2x264 handles zonesYes.. ugly workaround that you don't need anymore. I'm not ever going to encode a zone separately anymore.

Will the 2nd pass work if the 1st pass is "done" and cleared? If yes, delete it. If not, keep it.It will work. However, if for whatever reason you have to redo it, if it's gone it's gone and you will have to recreate the whole series of jobs. I make frequent use of the ability to redo one or multiple jobs from a series of jobs. And since I find that useful and use it, I'm not even considering removing it. I've even had bugreports from people who started delting parts of a series of jobs and then they couldn't encode properly anymore. And imho it would make more sense to have a boolean setting that would lead to the removal of every successfully concluded job. But that's one of the settings where the user really needs to know what he's doing plus if there's an error somewhere in the process it can lead to you having to redo everything. A scenario I could imagine is an abort during the second pass, and the user accidentally starting the next series of jobs that just happens to use the same logfile... now you need to recreate all the passes of your first series of jobs. Sounds like fun, eh?

but the main MeGUI window that received the spurious X click.The infamous "stupid user" error (please don't take it personal.. it's the action that is stupid, not the user.. and it happens to everyone once upon a time.. what you learn from it is what really counts. You cannot argue to mistakenly click it though since the maximize button is non functional and the minimize button is far away. This is a really good example of why many programmers hate GUIs.. it's a lot of work, mostly preventing the user from doing something stupid, and it's boring to do that. cli programs are much nicer in that respect.. it works you you RTFM, and so the programmer can focus on the interesting heavy duty stuff.

Say you've set the priority to LOW. You go to change it back to Normal. Normal is over but not totally covering abort. 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.

Emp3r0r
22nd July 2005, 11: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, 11: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, 11: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, 00: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, 07: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, 07: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, 10: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, 10: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, 12: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, 14: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, 16: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, 18: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, 07: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, 09: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, 09: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, 22: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, 22: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
25th July 2005, 23: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, 05: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, 06: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, 07: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, 08: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, 12: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, 21: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, 22: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, 22: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, 09: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, 09: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, 09:44
filter = "Quantizer Matrix File (*.cfg)|*.txt" No, it's a little different but almost ;)

TheBashar
28th July 2005, 11: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, 11: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, 19: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, 09: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, 09: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, 12: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, 13: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, 14: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, 20: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, 22: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, 02: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, 19: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, 12: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, 14: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
6th August 2005, 23: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, 00: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, 01: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, 03: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, 03: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, 12: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, 12: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, 12: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, 13: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, 13: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, 21: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, 22: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, 22: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, 22: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, 22: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, 22: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
8th August 2005, 23: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
12th August 2005, 23: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
12th August 2005, 23:42
The mkv language problem is here (http://forum.doom9.org/showthread.php?p=695162#post695162)

Doom9
12th August 2005, 23: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
12th August 2005, 23: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
12th August 2005, 23: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, 00: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, 14: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, 17: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, 18: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, 19: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, 20: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, 03: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, 04: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, 13: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, 13: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, 19: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, 21: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, 22: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
19th August 2005, 23:40
I've upped the latest sources.

MeteorRain
21st August 2005, 08: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, 13: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, 16: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, 20: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, 02: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, 07: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, 12: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, 16: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, 17: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, 07: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, 10: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, 11:22
Same for me -- I built my changes on 2.2.1 sources.

Doom9
30th August 2005, 11:48
it's 0.2.2.3a ;)

berrinam
1st September 2005, 12:46
@Doom9: Just wondering whether you saw my above patch using your suggestion for AR signalling.

Doom9
1st September 2005, 17: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, 21:02
No problem... I just thought it might have been lost in the thread.

Marsu42
4th September 2005, 01: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, 09: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, 12: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, 12: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, 20: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, 21: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, 22: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, 22: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, 12: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, 21: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, 05:18
the custom maxtrix disabled in xvid config?
I saw grayed button here

Doom9
7th September 2005, 07: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, 12: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, 18: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, 08: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, 07: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, 13:15
thanks for those fixes.. I've integrated them into the latest build

Doom9
7th October 2005, 17: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, 13: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, 09: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, 19: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, 22: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, 13: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, 13: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, 13: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, 14: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, 15: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, 17: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, 18: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, 18:53
128 MB =~ 135051582 bytes!!!

max-holz
13th October 2005, 19: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, 20:36
Now that is a bug, bytes should be kilobytes in that case...

zajc
14th October 2005, 13: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, 14: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, 14: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, 15: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, 16:03
No, you should use the OTHER MeGUI thread.

berrinam
15th October 2005, 00: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, 07: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, 09:00
It needs to be approved by a moderater first.

max-holz
17th October 2005, 14: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, 18:41
well, subs are about a 100k so that's rather negligible, wouldn't you agree?

Sharktooth
17th October 2005, 19: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, 21: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, 21: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, 04: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, 07:13
@berrinam: could you please post the source code of the KB/MB fix as well? thanks

berrinam
18th October 2005, 07: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, 08: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, 09: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, 14: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, 15: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, 15:55
guess that something like "RDO Level2" would be ok

berrinam
18th October 2005, 21:40
Sorry, here it is.

Doom9
19th October 2005, 21: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, 20: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, 20:28
so no AQ by default?

Sharktooth
20th October 2005, 20: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, 21: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, 22: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, 08: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, 09: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, 09: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, 10: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, 11: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, 12: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, 13: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.

Doom9
21st November 2005, 18:34
what commandline do you use when using the csc 2.0 compiler to compile binaries against the 1.1 runtime?

charleski
21st November 2005, 19:09
I wrote up the method I used to compile using .NET 2.0 csc and .NET 1.1 libs and includes here (http://homepages.nildram.co.uk/~cajking/CompilingFor1.1.zip).
Both my machines have been upgraded to shiny new .NET 2.0, so I can't test this to be sure it works though. The binary I created is here (http://homepages.nildram.co.uk/~cajking/meguiLevelPatch_NET1.1libs.exe). Could you test that and make sure it works?

Sharktooth
21st November 2005, 19:55
what commandline do you use when using the csc 2.0 compiler to compile binaries against the 1.1 runtime?
i use your .bat.

Sharktooth
21st November 2005, 19:57
Reported on IRC:
(18:25:29) X_plode: http://putfile.com/pic.php?pic=11/32411242663.png&s=x12
18:29
(18:31:27) X_plode: http://s47.yousendit.com/d.aspx?id=3VPEUXA3MJFMR21HIHIJ5VDZDT
18:34
(18:37:28) X_plode: the error comes when i try to open the config after loading the avs file...opening the config before opening the avs there is no error

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentException: '0' is not a valid value for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'.
at System.Windows.Forms.NumericUpDown.set_Value(Decimal value)
at MeGUI.x264ConfigurationDialog.set_CodecSettings(x264Settings value)
at MeGUI.x264ConfigurationDialog.EnforceLevel(x264Settings inputSettings)
at MeGUI.x264ConfigurationDialog.showCommandLine()
at MeGUI.x264ConfigurationDialog.avcLevel_SelectedIndexChanged(Object sender, EventArgs e)
at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
at MeGUI.x264ConfigurationDialog.set_CodecSettings(x264Settings value)
at MeGUI.MeGUI.videoConfigButton_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.573
CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
megui-x264
Assembly Version: 1.0.2151.32470
Win32 Version: 1.0.2151.32470
CodeBase: file:///C:/x264/megui-x264.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
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.573
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.573
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.573
CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.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.

Doom9
21st November 2005, 20:00
i use your .bat.But you have to modify it, won't you? After all in my box the bat creates 1.1 binaries.

charleski
21st November 2005, 21:15
@Sharktooth: Ok, I'll take a look at that. I also noticed on scanning the code again that the levels validation misses the width and height restrictions, so I'm putting that in and altering the function call a bit (I think I was trying to be too clever at one point).
@doom9: You need to change a few environment variables. I modified the vsvars32 batch file so it should set them correctly for you, see my post above. The actual compile.bat stays the same.

Sharktooth
21st November 2005, 21:50
yeah. i kept your .bat unmodified and once you set the vars in the right way everything works as it should.

EDIT: i'll ask bobor if he can setup an SVN server for MeGUI... working with diffs is much easier.

charleski
21st November 2005, 23:42
Ok, I fixed a silly error and made a few other changes to the logic - all detailed in the changelog. I also added in the dimension restrictions.
Full project dump is here (http://homepages.nildram.co.uk/~cajking/MeGUI-src.0.2.3.1b-Levels0.3.rar)
Modified files are here (http://homepages.nildram.co.uk/~cajking/MeGUI-src.0.2.3.1b-LevelModFiles0.3.rar)
Version compiled for .Net 1.1 is here (http://homepages.nildram.co.uk/~cajking/meguiLevelPatch0.3_NET1.1libs.exe).


EDIT: i'll ask bobor if he can setup an SVN server for MeGUI... working with diffs is much easier.That would be nice.

falcon2000eg
22nd November 2005, 01:59
Version compiled for .Net 1.1 is here (http://homepages.nildram.co.uk/~cajking/meguiLevelPatch0.3_NET1.1libs.exe).



i downloaded it and it ask me to install .net 2

falcon2000eg
22nd November 2005, 02:12
The new build of sharktooth crashed when I press config button after loadindg the movie not before that.
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentException: '0' is not a valid value for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'.
at System.Windows.Forms.NumericUpDown.set_Value(Decimal value)
at MeGUI.x264ConfigurationDialog.set_CodecSettings(x264Settings value)
at MeGUI.x264ConfigurationDialog.EnforceLevel(x264Settings inputSettings)
at MeGUI.x264ConfigurationDialog.showCommandLine()
at MeGUI.x264ConfigurationDialog.avcLevel_SelectedIndexChanged(Object sender, EventArgs e)
at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
at MeGUI.x264ConfigurationDialog.set_CodecSettings(x264Settings value)
at MeGUI.MeGUI.videoConfigButton_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:///d:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
megui-x264
Assembly Version: 1.0.2151.32470
Win32 Version: 1.0.2151.32470
CodeBase: file:///D:/Program%20Files/x264/megui-x264.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:///d:/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:///d:/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:///d:/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:///d:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.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.

charleski
22nd November 2005, 02:20
i downloaded it and it ask me to install .net 2
Gah, I probably missed something in the environment, i'll take another look.
The new build of sharktooth crashed when I press config button after loadindg the movie not before that.Yes, this bug should be fixed now.

[Edit: Ok, I altered some of the environment variables that were probably pointing to the wrong place and re-complied. Can you try downloading the program again and running it? The link remains the same (http://homepages.nildram.co.uk/~cajking/meguiLevelPatch0.3_NET1.1libs.exe)

Sharktooth
22nd November 2005, 03:54
x264_only conditional compiling is still broken... please add the fix i posted above (and check if there are other broken things due to conditional compiling)

Form1.cs(2420,43): error CS0103: The name 'hres' does not exist in the class or
namespace 'MeGUI.MeGUI'
Form1.cs(2420,49): error CS0103: The name 'vres' does not exist in the class or
namespace 'MeGUI.MeGUI'

Files moved here: http://forum.doom9.org/showthread.php?p=741271#post741271

falcon2000eg
22nd November 2005, 03:58
same problem charleski

Sharktooth
22nd November 2005, 04:01
my bins should work (they're in my previous post).

falcon2000eg
22nd November 2005, 04:08
Thanks, it worked i will try it now with your new build rev.368c

i will wait there changes in the SVN

waw :cool: 0 time wait

Sharktooth
22nd November 2005, 04:16
372 is up, it already includes the patched MeGUI-x264.

Doom9
22nd November 2005, 10:55
hmm... I never gave you guys the "c" code.. it contains some improvements in the job-moving functions. I guess now I have to hack that into the latest sources instead.

charleski
22nd November 2005, 15:04
x264_only conditional compiling is still broken... please add the fix i posted above (and check if there are other broken things due to conditional compiling)Grr, I'm an idiot, sorry, I only copied half the relevant lines instead of the full set. I've been through all the modified files, and that's the only spot where there's a call to the new functions outside an #ifdef FULL... block.

same problem charleskiSeems like I'll have to build a VM and try to work out what I'm doing wrong with the libraries, sorry.

Doom9
22nd November 2005, 17:31
Here's the fix for the up/down crash. Replace the code inside upButton_Click with the following:

if (queueListView.SelectedItems.Count > 0)
{
MoveListViewItem(ref this.queueListView, true);
updateJobPositions();
}

likewise, replace the code inside downButton_Click with the following:

if (queueListView.SelectedItems.Count > 0)
{
MoveListViewItem(ref this.queueListView, false);
updateJobPositions();
}

This doesn't take care of the weird activity when you select multiple jobs and press up/down, but at least there are no crashes anymore.

Chainmax
22nd November 2005, 18:58
Sharktooth, is automated 3-pass with turbo fixed in this latest release?

Sharktooth
22nd November 2005, 19:15
not yet and btw it's auto 3 pass that's b0rked even without turbo.

Sharktooth
22nd November 2005, 19:48
The following files include the doom9 patch ( http://forum.doom9.org/showthread.php?p=741234#post741234 )
moved here: http://forum.doom9.org/showthread.php?p=742099#post742099

Chainmax
22nd November 2005, 21:18
not yet and btw it's auto 3 pass that's b0rked even without turbo.

I see. Any idea what is causing the flaw?

charleski
22nd November 2005, 21:21
I can take a look into automated 3-pass, though I only use 2-pass and after searching the forum I see that no-one's specified exactly what problem they're having. It seems to be a flaw in the command-line generation, though.

Chainmax
22nd November 2005, 23:12
Sharktooth made a post somewhere explaining the problem. I used to use 2-pass as well, but seeing how fast first pass is a lot faster than a regular pass and doesn't result in a noticeable quality drop, it's like getting 2.9-pass quality at 2.1-pass encoding time, so to speak. That's why I switched to that mode.

charleski
23rd November 2005, 00:21
Yeah, the commandline shown in the interface isn't right when in 3-pass mode, but I generated some jobs and looked at the XML - it seems fine to me, so the actual commandlines passed to x264 appear correct.

foxyshadis
23rd November 2005, 02:08
Sharktooth made a post somewhere explaining the problem. I used to use 2-pass as well, but seeing how fast first pass is a lot faster than a regular pass and doesn't result in a noticeable quality drop, it's like getting 2.9-pass quality at 2.1-pass encoding time, so to speak. That's why I switched to that mode.
Vaguely related: Fast first pass doesn't seem to disable some of the newer options. (I have no idea which could be appropriately disabled.) A recent encode with b-rdo, trellis, adaptive quant, and b-adaptive, seemed to have almost exactly the same framerate (from a pre-filtered lossless video) between passes.

It might be worth going back now that so many new options are available and testing again for minimum lossage.

charleski
23rd November 2005, 02:20
That's interesting. can you recreate the job that caused this behaviour and post the XML? (If you close MeGUI before executing the jobs they'll be saved in the jobs folder)
Certainly I've always found 1st-pass turbo to run about 4 times faster than the 2nd pass.

foxyshadis
23rd November 2005, 05:47
I keep all old jobs around (no particular reason) so I just pulled the xml. The settings all show up there, but that depends on if b-rdo is even activated for subme 1 and whether trillis is activating.

<?xml version="1.0"?>
<Job xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="VideoJob">
<Input>C:\video\work\mark3.avs</Input>
<Output />
<Name>job33</Name>
<Priority>0</Priority>
<Status>5</Status>
<Position>32</Position>
<Start>2005-11-21T10:36:29.7118750-08:00</Start>
<End>2005-11-21T10:49:19.3056250-08:00</End>
<FPS>9.98636964703489</FPS>
<Commandline>"x264.exe" --pass 1 --bitrate 700 --stats "C:\video\work\x264.log" --aq-strength 0.7 --bframes 3 --b-pyramid --filter 1,1 --subme 1 --b-rdo --weightb --trellis 1 --analyse none --me dia --merange 20 --progress --no-psnr --output NUL "C:\video\work\mark3.avs" </Commandline>
<Settings xsi:type="x264Settings">
<EncodingMode>2</EncodingMode>
<BitrateQuantizer>700</BitrateQuantizer>
<KeyframeInterval>250</KeyframeInterval>
<NbBframes>3</NbBframes>
<MinQuantizer>10</MinQuantizer>
<MaxQuantizer>51</MaxQuantizer>
<SARX>0</SARX>
<SARY>0</SARY>
<Turbo>true</Turbo>
<V4MV>false</V4MV>
<QPel>false</QPel>
<Trellis>false</Trellis>
<CreditsQuantizer>40</CreditsQuantizer>
<FourCCs>
<string>VSSH</string>
<string>x264</string>
<string>avc1</string>
</FourCCs>
<Logfile>C:\video\work\x264.log</Logfile>
<CustomEncoderOptions />
<FourCC>1</FourCC>
<Zones />
<AQStrength>0.7</AQStrength>
<AQSensitivity>15.0</AQSensitivity>
<MixedRefs>false</MixedRefs>
<X264Trellis>1</X264Trellis>
<NbRefFrames>1</NbRefFrames>
<AlphaDeblock>1</AlphaDeblock>
<BetaDeblock>1</BetaDeblock>
<SubPelRefinement>0</SubPelRefinement>
<MaxQuantDelta>4</MaxQuantDelta>
<TempQuantBlur>0</TempQuantBlur>
<BframePredictionMode>2</BframePredictionMode>
<VBVBufferSize>-1</VBVBufferSize>
<VBVMaxBitrate>-1</VBVMaxBitrate>
<METype>0</METype>
<MERange>20</MERange>
<NbThreads>1</NbThreads>
<MinGOPSize>25</MinGOPSize>
<Profile>2</Profile>
<Level>15</Level>
<IPFactor>1.4</IPFactor>
<PBFactor>1.3</PBFactor>
<ChromaQPOffset>0</ChromaQPOffset>
<VBVInitialBuffer>0.9</VBVInitialBuffer>
<BitrateVariance>1.0</BitrateVariance>
<QuantCompression>0.6</QuantCompression>
<TempComplexityBlur>20</TempComplexityBlur>
<TempQuanBlurCC>0.5</TempQuanBlurCC>
<SCDSensitivity>40</SCDSensitivity>
<BframeBias>0</BframeBias>
<Deblock>true</Deblock>
<Cabac>true</Cabac>
<WeightedBPrediction>true</WeightedBPrediction>
<AdaptiveBFrames>true</AdaptiveBFrames>
<BFramePyramid>true</BFramePyramid>
<BRDO>true</BRDO>
<ChromaME>true</ChromaME>
<P8x8mv>false</P8x8mv>
<B8x8mv>false</B8x8mv>
<I4x4mv>false</I4x4mv>
<I8x8mv>false</I8x8mv>
<P4x4mv>false</P4x4mv>
<AdaptiveDCT>false</AdaptiveDCT>
<Lossless>false</Lossless>
<QuantizerMatrix>C:\Program Files\music-video\x264\eqm_avc_hr.cfg</QuantizerMatrix>
<QuantizerMatrixType>0</QuantizerMatrixType>
</Settings>
<OutputType>0</OutputType>
<DesiredSize>0</DesiredSize>
<NumberOfFrames>7670</NumberOfFrames>
<Framerate>23.976043137696813</Framerate>
</Job>

Sharktooth
23rd November 2005, 13:28
for what concerns turbo mode the (in theory) b-rdo can be "disabled" as well as mixed-refs (not sure about trellis).

charleski
23rd November 2005, 19:32
I'm still struggling to get MeGUI compiled for .NET 1.1. Could you take a look at this environment Sharktooth and see what I'm doing wrong?
Here are the environment variables in the command shell I use to compile:
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\******\Application Data
CLASSPATH=C:\Program Files\Java\jre1.5.0_05\lib\ext\QTJava.zip
CLIENTNAME=Console
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=******
ComSpec=C:\WINDOWS\system32\cmd.exe
DevEnvDir=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
FP_NO_HOST_CHECK=NO
FrameworkDir=C:\WINDOWS\Microsoft.NET\Framework
FrameworkSDKDir=C:\Program Files\Microsoft Visual Studio 8\SDK\v1.1
FrameworkVersion=v1.1.4322
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\******
INCLUDE=C:\Program Files\Microsoft Visual Studio 8\SDK\v1.1\INCLUDE;
LIB=C:\Program Files\Microsoft Visual Studio 8\SDK\v1.1\LIB;
LIBPATH=C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322
LOGONSERVER=\\*******
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
Path=C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\BIN;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322;C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages;C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\Common Files\Adobe\AGL;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\AviApps\YAMB;C:\Program Files\AviApps\x264;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Visual Studio 2005 SDK\2005.10\VisualStudioIntegration\Tools\Bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 15 Model 2 Stepping 9, GenuineIntel
PROCESSOR_LEVEL=15
PROCESSOR_REVISION=0209
ProgramFiles=C:\Program Files
PROMPT=$P$G
QTJAVA=C:\Program Files\Java\jre1.5.0_05\lib\ext\QTJava.zip
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\******\LOCALS~1\Temp
TMP=C:\DOCUME~1\******\LOCALS~1\Temp
USERDOMAIN=******
USERNAME=******
USERPROFILE=C:\Documents and Settings\******
VCINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8\VC
VS80COMNTOOLS=C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\
VSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8
windir=C:\WINDOWS

Or just post the environment variables you use so i can compare them.
Thanks.

acidsex
23rd November 2005, 21:51
Any chance that the Avisynth creator to support more than just DGIndex files? My reasoning is I have some DV-avi files I would like to encode using MeGUI and sometimes I have a rather large batch of them and it is very tedious having to create an avs by typing. Even if we could get a generic "Direct Show Source" template would save me a great deal of time. Would this be difficult to implement Doom9?

charleski
23rd November 2005, 22:40
Yeah, I was thinking of adding in more functionality for the avs creator along with a couple of other enhancements I've written. Give me a couple of days.

Kostarum Rex Persia
23rd November 2005, 23:24
Question for MeGUI developers: is it possible(in next builds) to introduce AVI and MPEG2 input in MeGUI? (curently,only AVS input)
I don't have knowledge,nor time to learn Avisynth scripting,so I be very delighted if you,guys,make MeGUI more friendship for use.

charleski
23rd November 2005, 23:58
Well the best way to do that is to modify the avs creator as acidsex described so that it can accept avis and modify the DGindexer so that it will accept mpeg2s. It would be a mistake to remove avisynth from the input stream.

Kostarum Rex Persia
24th November 2005, 00:03
Great,but when I may expect new revision of MeGUI with MPEG2 and AVI input.Until new year,or perhaps sooner?

Sirber
24th November 2005, 00:10
Invest the asking time to some coding ;) Shouldn't be hard adding that to MeGUI...

Kostarum Rex Persia
24th November 2005, 00:19
Ok,but from where to start.Can you advice me,Sirber.

Sirber
24th November 2005, 00:33
1) http://msdn.microsoft.com/vstudio/express/visualcsharp/
2) http://www.rarlab.com/rar/wrar351.exe
3) http://forum.doom9.org/MeGUI-src.0.2.3.1b.rar
3) Extract the sources
4) Open the sources with C#
5) Find the input manager class and add your stuff
6) Post your modifications

charleski
24th November 2005, 00:41
I'm writing the code right now actually :p, but I have a few other bits i want to add as well, so give it a day or two.

[edit] BTW, I'm blind, MeGUI can already import MPeg2 files in the d2v creator and automatically pass them to the avisynth module.

Doom9
24th November 2005, 09:17
BTW, I'm blind, MeGUI can already import MPeg2 files in the d2v creator and automatically pass them to the avisynth module.No you're not blind, that's the way it works. It would be nice if people actually tried first before asking for anything.. makes them look rather sillyif they don't.

It would be a mistake to remove avisynth from the input stream.Absolutely, especially since x264.exe only supports AviSynth and raw .yuv input.

I see a few issues with AVI input though: the first one is audio. There are only so many audio types BeSweet can handle with the vobinput plugin, and then you have those with multiple audio tracks (not sure BeSweet supports that at all and even if it did, it would mean a lot of overhead in somehow figuring out what tracks there are and the user has no help in selecting the right one), then there's the issue of missing filters (directshow versus vfw... avisource versus directshowsource, movies may play just fine but are uneditable because of a lack of VfW filters). Those are just a few issues that come along when you consider AVI. And the main problem may not even the technical side but the user side as people will throw the crap they download from P2P networks at MeGUI.. at least with DVDs you have some kind of regularity in the input.

Sharktooth
24th November 2005, 15:09
I'm still struggling to get MeGUI compiled for .NET 1.1. Could you take a look at this environment Sharktooth and see what I'm doing wrong?
Here are the environment variables in the command shell I use to compile:
...
Or just post the environment variables you use so i can compare them.
Thanks.
I use the SDK compiler (csc.exe). here's my sdkvars.bat:
Set Path=C:\Program Files\Microsoft.NET\SDK\v1.1\Bin\;C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\;C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\;C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\;%PATH%
Set LIB=C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib\;"C:\Program Files\Microsoft.NET\SDK\v1.1\Lib\";%LIB%
Set INCLUDE=C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\;"C:\Program Files\Microsoft.NET\SDK\v1.1\include\";%INCLUDE%
Set NetSamplePath=C:\PROGRA~1\MICROS~1.NET\SDK\v1.1\

Sharktooth
24th November 2005, 16:08
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
Case 8 is missing (that's the 3 pass auto!). the code for 3 pass auto is missing from both full and x264_only.

Doom9
24th November 2005, 17:12
I guess I need to have a look personally.. you're still looking in the wrong place. case 8 and case 4 are virtual cases.. they never happen because in job generation, when a job has either of these states, it'll be changed to 2 / 5 respectively, and another (or two) jobs are created having values 3 and whatever your settings say it should in case of a three pass (note that in 3 pass it can be 1-3-2 or 1-3-3, where the former means the stats are not being overwritten by the third pass).
So, this switch never gets a 4 or an 8, but when I initially wrote it, I didn't quote know that yet but figured case 3 and 4 would be the same, hence 3 falls through to 4. If you got rid of case 4 and put the code from case 4 to case 3, the software would work just the same).

Also, the latest patch still has problems. activate b-rdo, set nb of b-frames back to 0, press OK, press config again and b-rdo is on again..

Doom9
24th November 2005, 17:24
hmm.. I don't see the problem. Created an automated 3 pass, here are the 3 commandlines:

<Commandline>"x264.exe" --pass 1 --bitrate 700 --stats "D:\DVDs\DVDVolume\VIDEO_TS\re-trailer.stats" --bframes 2 --no-b-adapt --subme 1 --b-rdo --analyse none --me dia --threads 2 --progress --no-psnr --output NUL "D:\DVDs\DVDVolume\VIDEO_TS\re-trailer.avs" </Commandline>
<Commandline>"x264.exe" --pass 3 --bitrate 700 --stats "D:\DVDs\DVDVolume\VIDEO_TS\re-trailer.stats" --bframes 2 --no-b-adapt --subme 6 --b-rdo --analyse p8x8,b8x8,i4x4 --threads 2 --progress --no-psnr --output "D:\DVDs\DVDVolume\VIDEO_TS\re-trailer.mp4" "D:\DVDs\DVDVolume\VIDEO_TS\re-trailer.avs" </Commandline>
<Commandline>"x264.exe" --pass 3 --bitrate 700 --stats "D:\DVDs\DVDVolume\VIDEO_TS\re-trailer.stats" --bframes 2 --no-b-adapt --subme 6 --b-rdo --analyse p8x8,b8x8,i4x4 --threads 2 --progress --no-psnr --output "D:\DVDs\DVDVolume\VIDEO_TS\re-trailer.mp4" "D:\DVDs\DVDVolume\VIDEO_TS\re-trailer.avs" </Commandline>

build: 0.2.3.1b-CK_LevelsPatch_0.3

bottom line: trust the commandline in the jobs, not the preview because you cannot preview an automated 3 pass intelligently without a serious rewrite.

Sirber
24th November 2005, 17:26
The last 2 uses "-- pass 3".

Should be:

--pass 1
--pass 3
--pass 2

:confused:

Doom9
24th November 2005, 17:29
aargh.. another one not getting it.. there's an option in the settings "overwrite stats file in 3rd pass".. if it's checked, it's 1-3-3, if not, 1-3-2.. but I already posted that in this very page..

Sharktooth
24th November 2005, 17:30
bug no.1 : When clicking "show commandline" checkbox in the config dialog the wrong commandline is displayed (1st pass) and if you select "turbo" it will display the turbo speedups.

Sharktooth
24th November 2005, 17:31
bug no.2: Im still looking HOW to reproduce the commandline b0rking...
ill restore the 3rd pass in my megui video profiles hoping someone will catch that bug again.

Doom9
24th November 2005, 17:43
if you absolutely must see the 3rd pass commandline in preview when selecting automated 3 pass (keep in mind this is a virtual mode.. there cannot be a Job object having encodingMode == 8 (automated 3 pass), or == 4 (automated 2 pass). And unless somebody is messing around in jobUtil, this has worked properly for ages. The whole tri-state thing never touched jobUtil, only the GUI class and CommandlineGenerator, and in the latter it's only generateVideoCommandline that has been touched.

alright and here's the change to be made to

if (xs.EncodingMode != 2 && xs.EncodingMode != 4 && xs.EncodingMode != 5 && xs.EncodingMode != 8) and replace it with

if (!(xs.EncodingMode == 2 || xs.EncodingMode == 5))

and then add the darned case 8 in the switch:

case 7: // 3 pass 3rd pass
case 8: // automated threepass, show third pass options
sb.Append("--pass 3 --bitrate " + xs.BitrateQuantizer + " --stats " + "\"" + xs.Logfile + "\" ");
break;

you should have the preview you so crave.. it changes absolutely nothing in job generation though.. this is purely cosmetical since encodingmode = 8 doesn't exist when it comes to jobs. But I have a feeling this is where people go wrong.. commandline preview isn't WYSIWYG.. it's WYSINQWYG.. where NQ = not quite.

to further speed up turbo, you can also add the following to

if (xs.Turbo)

in generateX264CLICommandline()

add
xs.MixedRefs = false;
xs.BRDO = false;

Sharktooth
24th November 2005, 18:57
latest bugfixes:
Added b-rdo to the turbo mode options exclusions.
Fixed the FULL compilation x264 turbo mode options (they were different from x264_only conditional compilation options).
the files are here:
http://files.x264.nl/Sharktooth/?dir=./megui

todo:
- make lossless disable AQ options.
- check the whole commandline preview system.

Doom9
24th November 2005, 19:05
any reason why you didn't include the changes I posted above?

Sharktooth
24th November 2005, 19:11
Yes, i'll check the whole command line preview in the next patch (i will include your changes in that one).

charleski
24th November 2005, 19:25
Just to let you know: I'm working on a variety of additions to the UI, some to incorporate things people have asked for in the forums, most to do stuff that I want :). I want to get them in place and test them before posting the code, though, so it'll probably be the weekend before I put it up.

Sharktooth
24th November 2005, 19:32
remember to merge all the changes i posted... :)

foxyshadis
24th November 2005, 19:44
With recent versions I'm getting an unhandled exception when clicking on the job config option in x264 version, after loading an avs file. I haven't had a chance to test full version yet. Setting the profile level to anything other than unrestricted works fine.

stack dump is:

************** Exception Text **************
System.ArgumentException: '0' is not a valid value for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'.
at System.Windows.Forms.NumericUpDown.set_Value(Decimal value)
at MeGUI.x264ConfigurationDialog.set_CodecSettings(x264Settings value)
at MeGUI.x264ConfigurationDialog.EnforceLevel(x264Settings inputSettings)
at MeGUI.x264ConfigurationDialog.showCommandLine()
at MeGUI.x264ConfigurationDialog.avcLevel_SelectedIndexChanged(Object sender, EventArgs e)
at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
at MeGUI.x264ConfigurationDialog.set_CodecSettings(x264Settings value)
at MeGUI.MeGUI.videoConfigButton_Click(Object sender, EventArgs e)

max-holz
24th November 2005, 19:48
Hi Sharktooth, the link to x264 Full package 375A seems to be broken.

Sharktooth
24th November 2005, 19:49
It should have been fixed yet.
Download the new x264-Full package or get the bins 7 posts above...

Sharktooth
24th November 2005, 19:50
Hi Sharktooth, the link to x264 Full package 375A seems to be broken.
fixed

Doom9
24th November 2005, 20:06
With recent versions I'm getting an unhandled exception when clicking on the job config option in x264 version, after loading an avs file. I haven't had a chance to test full version yet. Setting the profile level to anything other than unrestricted works fine.I can't verify that.. it must be settings related so you need to share a lot more info. Plus, this is a topic for the user thread ;)

leowai
25th November 2005, 06:03
bottom line: trust the commandline in the jobs, not the preview because you cannot preview an automated 3 pass intelligently without a serious rewrite.
Yes, commandline in the jobs will be the final conversion parameters passed to the encoder client. If preview panel doesn't work as expected (to be same as the commandline in the jobs), what would it be useful anymore? Agree?

Furthermore, jobs only generated after MeGUI is closed. This is not so convenient for examining commandlines generated by MeGUI, especially when new switch is added. You need to close to exam and reopen to edit.

So I have some suggestion to the preview panel.

Choice 1: I also know that preview 3 passes will be a pain to the GUI where it might requires a large preview window at bottom of it. Why don't make it with slide bar? So that user can copy and paste it to a notepad to preview all the 3 passes if they are too long to preview at once in the preview panel.

Choice 2: In case of serious rewrite of the preview panel, I would suggest the 3 passes preview panel with following format.
For the case of Doom9's automated 3 pass with turbo: http://forum.doom9.org/showthread.php?p=742053#post742053.
====================================================
[Turbo mode - 1st Pass]
"x264.exe" --pass 1 --bitrate 700 --stats "D:\DVDs\DVDVolume\VIDEO_TS\re-trailer.stats" --bframes 2 --no-b-adapt --subme 1 --b-rdo --analyse none --me dia --threads 2 --progress --no-psnr --output NUL "D:\DVDs\DVDVolume\VIDEO_TS\re-trailer.avs"

[Diff & Add Switch in 2nd Pass & 3rd Pass]
(--pass 3,--pass 3) --subme 6 --analyse p8x8,b8x8,i4x4 --output "D:\DVDs\DVDVolume\VIDEO_TS\re-trailer.mp4"
====================================================
Will there any additional switches will be used in 2nd & 3rd pass than the turbo 1st pass? If, yes then we probably can use colour to differentiate the "different" and "additional" switch in the second section.

I think it's easier to compare between passes this way. However, this might introduce another issue on generating this preview. Will that be difficult? How should the commandline comparison works in current the future release? Probably the most important thing is who is willing to do this?

Question: Is "--me dia" a default option? Because "--me dia" presents in turbo mode only and not in 2nd and 3rd pass.

charleski
26th November 2005, 06:42
Ok, here's a bundle of UI changes, mostly aimed at making the avisynth script creator operate the way I want it to - I've still been using GordianKnot to generate avisynth scripts, and I suppose that lots of people out there are very familiar with GK, so it's a good base to work from. Also includes several other elements detailed in the changelog. I'll start looking at importing AVIs next, but wanted to finish this lot up first.
0.10 26 Nov 2005
For some reason adding the path to dgdecode.dll in the PATH env var wasn't working for the imports done in d2vReader.cs. After wasting far too much time trying various things I just did it a specific LoadLibrary() call. Intialisation of the d2vReader now reads in the settings.xml file and finds the path to DGIndex from there.
Also added a call to this.saveSettings() when the Settings form closes.

0.9 26 Nov 2005
Added in the commandline generation patches to fix preview of automated 3-pass posted by doom9 (24Nov) and Sharktooth (25Nov).

0.8 25 Nov 2005
The 'SAR' calculated by the avisynth creator is now transferred directly to the configuration for x264, xvid and lavc encoders.
Audio language tag now defaults to English in the muxer.
Added a choice for minimal noise filtering to the avisynth creator: Undot().
Added a checkbox to the avisynth creator window to allow the choice of using dgdecode's integral deblocker.
Avisynth creator: Checking the 'Retain anamorphic resolution' box now causes 'Suggest resolution' to be
set to true automatically. 'On save close and load' is now checked by default as it was bugging me :).
Fixed a couple of bugs in avisynth script generation so that the new options get written correctly.

0.7 24 Nov 2005
The path to DGIndex is now added to the PATH environment variable so that it's not necessary to put dgdecode.dll in MeGUI's application dir.
Additions to the main settings dialog:
You can now specify the directory in which your avisynth plugins are stored. When loading a dll in the avisynthCreator Edit tab you'll automatically be sent to that directory.
There are 2 new text fields in the settings dialog for video and audio extensions. These will be automatically added to the output name created when loading a video or audio file for encoding. This is optional and defaults to null.

0.6 24 Nov 2005
Added the ability to load MPEG2 files directly in the AVisynth script creator. The vobinput dialog will be called with appropriate settings installed. After the queued dgindexer job is run the avisynth window will re-open with the d2v file loaded.

0.5 24 Nov 2005
Altered the avi script creator to allow encoding of anamorphic input streams without losing vertical resolution.
A new checkbox is present in the svisynth window: "Retain anamorphic resolution and set SAR in encoder". If this is checked the resolution controls operate as in GordianKnot when GK is set to an input PAR of 1:1. On saving the script a dialog will warn that SAR needs to be set in the encoder and gives the appropriate values. These values are also written in a comment at the end of the .avs that is saved.
Added Telecide(order=1) option for PAL deinterlacing.

0.4 23 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.

0.3 21 Nov 2005
Added a check for frame dimensions.
Moved a few utility calculations from JobUtils.cs to AVCLevels.cs and altered the parameters to validateAVCLevel() in order to support the above.
Altered the return values from the look-up functions in AVCLevels.cs so that Unrestrained is treated the same as level 5.1 for many checks - should alter this later.
Fixed a mistake in EnforceLevels()that could cause the number of reference frames to be set to 0.
Implemented a static flag in x264ConfigurationDialog.cs to reduce some of the event-handler recursion. Not sure
if this is necessary or even really desirable.
files changed:
Form1.cs
JobUtil.cs
x264ConfigurationDialog.cs
AVCLevels.cs

0.2 20 Nov 2005
Small fix to the enabling code for P4x4mv so it won't conflict with Macroblock Options.

Levels Patch 0.1 20 Nov 2005
All the relevant levels 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().
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.


I tried compiling a 1.1 binary, but still have something screwed up, so those with .NET 1.1 will have to wait for ST to do it.
Full source is here (http://homepages.nildram.co.uk/~cajking/MeGUI-src.0.2.3.1b-CK0.10.rar)
Modified files only are here (http://homepages.nildram.co.uk/~cajking/MeGUI-src.0.2.3.1b-CK0.10ChngdFls.rar).

Kostarum Rex Persia
26th November 2005, 10:32
Wow,great news,charleski.About MPEG2 input,can you also include that?

Doom9
26th November 2005, 12:02
Question: Is "--me dia" a default option? Is the fastest me type.. hence it's in turbo. the default is --me hex.. hence you never ever see that in a commandline (in other words, when there's no --me flag, then it's the same as manually typing --me, and since I don't want to clutter up the commandline, no x264.exe defaults are written to the commandline).

Furthermore, jobs only generated after MeGUI is closed. This is not so convenient for examining commandlines generated by MeGUI, especially when new switch is added. You need to close to exam and reopen to edit.That's not true. Since automated X pass is a virtual mode that no x264 encoder is aware of, it means you can get a commandline preview by selecting the proper existing mode. So for instance if you want to know what you get in an automated 2 pass, configure it as you want, then change the encoding mode to 2 pass first pass, and then to 2 pass second pass. Those two commandlines are exactly what you get when in automated 2 pass.. there cannot be any difference, no matter what you think.. if you don't believe that, please verify it, the source code is available. The same applies to automated 3pass, but there you need to take the settings into account. There are 2 3pass settings: 1 is "Overwrite stats file in third pass", the other one is "Keep 2nd pass output in 3rd pass", but of which I think are rather self-explanatory, but please ask if there's something that you think is still unclear.
If the first option is set (it's by default) and the second isn't (it's by default), you can see your commandline by configuring automated 3pass, then select 3pass 1st pass, 3pass 2nd pass and 3pass 3rd pass after another respectively and it exactly matches what is in the job. Once again, this always holds because it's written that way.

Hence, I really see no reason to complicate matters and return multiple commandlines for virtual modes. It's not like it's possible that what I described above doesn't work in some case, it always works because automated encoding only means that once the jobs are created, the settings that you see in the commandline preview for automated encoding matches the last pass (once Sharktooth includes the fixes above), and the first pass is derived from that by setting the encoding mode to 1st pass, then creating the job.. so you see, no matter what, even with solar flares, aliens and other unexplainable things, the commandline you get will always be equal to if you encode your automated X pass, then change to mode to the pass whose commandline you're interested in.. job generation does just that.

Of course, you may not see input/output and stats file name unless you already configured them, but nobody can guess what those values will be until you configure them and no amount of code can ever change that..

About MPEG2 input,can you also include that?May I suggest for the last time that you read up again, next time there'll be strikes right away.

charleski
26th November 2005, 13:47
Fixed a minor bug in one of the input filters
Modified files (http://homepages.nildram.co.uk/~cajking/MeGUI-src.0.2.3.1b-CK0.11ChngdFls.rar)

[Edit]Note that because of the way in which handling of dgdecode has changed, you now have to make sure that dgdecode.dll does not reside in the same directory as MeGUI.

Sharktooth
26th November 2005, 14:09
x264 conditional compiling:
SettingsForm.cs(79,58): warning CS0169: The private field
'MeGUI.SettingsForm.openFolderDialog' is never used
SettingsForm.cs(91,26): warning CS0649: Field
'MeGUI.SettingsForm.safeProfileAlteration' is never assigned to, and
will always have its default value null
SettingsForm.cs(92,26): warning CS0169: The private field
'MeGUI.SettingsForm.outputExtensions' is never used
SettingsForm.cs(93,25): warning CS0169: The private field
'MeGUI.SettingsForm.videoExtension' is never used
SettingsForm.cs(94,23): warning CS0169: The private field
'MeGUI.SettingsForm.audioExtLabel' is never used
SettingsForm.cs(95,23): warning CS0169: The private field
'MeGUI.SettingsForm.videoExtLabel' is never used
SettingsForm.cs(96,25): warning CS0169: The private field
'MeGUI.SettingsForm.audioExtension' is never used
SettingsForm.cs(97,23): warning CS0169: The private field
'MeGUI.SettingsForm.avisynthPluginsLabel' is never used
SettingsForm.cs(98,24): warning CS0169: The private field
'MeGUI.SettingsForm.selectAvisynthPluginsDir' is never used
SettingsForm.cs(99,25): warning CS0169: The private field
'MeGUI.SettingsForm.avisynthPluginsDir' is never used


full compiling:
d2vReader.cs(100,21): warning CS0168: The variable 'e' is declared but never used

When clicking Tools->Settings an unhandled exception occurs:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at MeGUI.SettingsForm.set_Settings(MeGUISettings value)
at MeGUI.MeGUI.mnuToolsSettings_Click(Object sender, EventArgs e)
at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.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.2156.25410
Win32 Version: 1.0.2156.25410
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
----------------------------------------
18st2fzg
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
----------------------------------------
suuztiet
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
----------------------------------------

************** 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.

Bins and merged 0.10-0.11 sources are here: http://files.x264.nl/Sharktooth/?dir=./megui

charleski
26th November 2005, 14:15
Yes, I'll go through and tidy up those warnings later, they shouldn't stop compilation.
Compiling doom9's original code in VSExpress 2005 gives you 26 warnings, hehe, mostly related to conditional compilation and exception handling.

Doom9
26th November 2005, 14:16
I guess we should establish a rule that patches need to compile without any warnings in all 4 modes in .NET 1.1.

@charleski: It is a .NET 1.1 project.. I've compiled my latest (unreleased build, the 0.2.3.1c) using .NET 2.0 and found that all the warnings were related to things that had been changed between 1.1 and 2.0.. and adapting to 2.0 would mean it would no longer work in 1.1, thus the deprecated warnings in 2.0 are okay.

Sharktooth
26th November 2005, 14:19
i edited my post above... an unhandled exception occurs when clicking Tools->Configuration (tested in x264 mode).

Also the "Tweaked profiles handling" is not present in x264 conditional compiling... maybe some other conditional compiling related problems too.
I can't fix those things coz i'm a bit busy for the next few days.

charleski
26th November 2005, 17:08
Ok, I patched the files so that warnings no longer appear when compiling any of the five different versions. Altered the forms code so that safe profile alteration should now work in all versions.

Version 0.12
Modified Files (http://homepages.nildram.co.uk/~cajking/MeGUI-src.0.2.3.1b-CK0.12ChngdFls.rar)
.NET 1.1 binaries (http://homepages.nildram.co.uk/~cajking/MeGUIbins-2.3.1b-CK0.12.rar) - No guarantees for these. I tried creating a virtual machine using a spare XP Home licence and these fail to run on that, but i suspect that there's a setup problem in the VM's environment.

I suppose I should get this rant out of the way: I've noticed several posts from people asking for features or having problems which exist only because they are using a 'Lite' version of MeGUI. Supporting multiple differing versions of the interface merely increases the support load while yielding little benefit IMO. GUI programming is tedious anyway, but generating multiple versions of the interface just increases that tedium. For instance: SettingsForm.cs conatins three completely separate code streams for different versions of the program, meaning that any alteration or addition to the layout needs to be handled 3 times.

As MeGUI grows, the overhead involved in supporting different versions will expand as well, and TBH I can't really see the point, especially when the majority of people should be using the full version anyway. There is a justification for supporting an x264-SVN version, but the code for that should not involve any of the GUI elements.

[Edit]
Version CK0.13
Avisynth script creator now automatically inserts a call to dgdecode.dll.
Tidied up the input-enable states of some fields in the x264 config to reflect the level in circumstances where the contents aren't changed.
Modified Files (http://homepages.nildram.co.uk/~cajking/MeGUI-src.0.2.3.1b-CK0.13ChngdFls.rar)
.NET 1.1 binaries (http://homepages.nildram.co.uk/~cajking/MeGUIbins-2.3.1b-CK0.13.rar) - same caveat as above.

[And again]
Version CK0.14
Trying to get everything I want in place while I have some time.
Added some more automation to the avs creator and upgraded it to use the latest versions of the relevant dlls.
Modified Files (http://homepages.nildram.co.uk/~cajking/MeGUI-src.0.2.3.1b-CK0.14ChngdFls.rar)
.NET 1.1 binaries (http://homepages.nildram.co.uk/~cajking/MeGUIbins-2.3.1b-CK0.14.rar)

Sharktooth
26th November 2005, 22:02
merged patches and binaries are always here: http://files.x264.nl/Sharktooth/?dir=./megui
however i would remove the snow conditional compiling and add a checkbox on the settings dialog to select enable/disable non-SVN options (so full svn and x264 svn conditional compiling can be removed).
This is only a suggestion and would like to know your opinions about it.

charleski
26th November 2005, 22:21
add a checkbox on the settings dialog to select enable/disable non-SVN options (so full svn and x264 svn conditional compiling can be removed).
That would be easy enough to add.

Doom9
26th November 2005, 22:34
I'm still wondering if we can't turn the whole conditional compilation into just a few lines and ineritance between the GUI classes.. like having a SettingsForm that handles just x264, and a CompleteSettingsForm that derives from it and adds the additional elements.

Sharktooth
27th November 2005, 14:55
I got confirmation that trellis can be disabled in fast 1st pass

charleski
27th November 2005, 22:59
The problem with changing the graphic interface with different versions is that you need to layout the elements (text boxes, buttons, etc), and you need to take into consideration that the full version has a settings form thats about three times the size of the others.
One possibility would be to retain the layout of the full version and just disable those elements that weren't used in any specialised version. That would certainly require the least modification to the code.

acidsex
28th November 2005, 04:07
Maybe I am missing the option but can MeGUI muxer (mp4) be used to import avi files to be muxed to mp4? The drop down box only gives me the option to import mp4 files to be muxed. If not, any chance this can be added with relative ease?

leowai
28th November 2005, 05:44
@Doom9,
First of all, thanks for your clear explanation.
So for instance if you want to know what you get in an automated 2 pass, configure it as you want, then change the encoding mode to 2 pass first pass, and then to 2 pass second pass. Those two commandlines are exactly what you get when in automated 2 pass.. there cannot be any difference, no matter what you think.
Haa... I learn something new in using MeGUI. I really didn't aware of this before :( . My appologize for my mistake here. (May be I need to re-study on the "MeGUI manual"? :), just kidding.)

I'm not sure I'm the only one making this mistake because I thought there are no relationship between the "Automated 2 pass", "2pass - 1st pass" and "2pass - 2nd pass". Since each of these options appear in parallel in the drop down menu, I take for gruanted there are not linked.

If the dop down menu appears as follow, then I think won't miss this feature. I'm not here to request a change, but just to show my habit of reading related configurations.

Automated 2pass
: 2pass - 1st pass
: 2pass - 2nd pass
Automated 3pass
: 3pass - 1st pass
: 3pass - 2nd pass
: 3pass - 3st pass

Now I know the setting in "Automated 2 pass" will be preseved when changing from "Automated 2pass" to either of the 2pass with more specific details. Thanks. :D

Hence, I really see no reason to complicate matters and return multiple commandlines for virtual modes. It's not like it's possible that what I described above doesn't work in some case, it always works...
Yes, with your explanation above, I agree with you now. My previous suggestion seems to be quite redundance. :stupid:

Lastly, many thanks for the tips and the hard works on the MeGUI (including all other developers of MeGUI).

Doom9
28th November 2005, 09:12
Maybe I am missing the option but can MeGUI muxer (mp4) be used to import avi files to be muxed to mp4?No, that's not possible. The reason is that while mp4box can do that, it only works for MPEG-4 ASP, and since most people use MeGUI for MPEG-4 AVC, there would be hell to pay because it mostly doesn't work. So I think it's better not to offer this at all, than to offer an option 90% of the users cannot use because they have the wrong input.

Automated 2pass
: 2pass - 1st pass
: 2pass - 2nd pass
Automated 3pass
: 3pass - 1st pass
: 3pass - 2nd pass
: 3pass - 3st passDropdowns cannot have a hierarchy unless you write your own dropdown and I don't exactly feel like it. Plus, I don't really think that'll make clear how MeGUI works unless you know how it works already.

I've added a bunch of todo things to the first post if anybody's interested.

redfordxx
28th November 2005, 11:51
Hi, first, thanks to all devs for this nice tool... I am quite new, but if someone is interested I have some ideas (hope, nobody mentioned before). So, one of it:

IMO there could be some choice like "nth pass based on stats file".
Then all the parameters can be read and set from the stats file (which will be in pointed by the user).
Then, three types of parameters are possible
type 1 = do not change the nth pass behavior (I believe b-frames are purely based on stats file and not 2nd pass settings)
type 2 = should be same but can be changed (I don't know, maybe the IP and PB ratio?)
type 3 = can change (eg. bitrate)

then, type 1 will be always disabled, type 3 always enabled
there could be some "override parameters" checkbox, which could enable/disable parameters type 2
on top of that, if params type 2 overriden and differ from these in stats file, they could be redhighlighted...

There are IMHO many combobox choices concerning passes (1st,2nd,3rd). And the only think they differ is whether there is input stats, output stats and output video. So more interresting that having 7 or how many choices of passes can be to have different in and out stats file.

redfordxx
28th November 2005, 12:16
So put to the extreme, there could be one, but more flexible choice for all passes, like this picture.


Of course, probably some logic from past should be kept (not for example for me but for most users probably) and leave at least 1st pass and nth pass combobox choices separated...

There, again, are some obvious enable/disable/locked relations among the controls.
http://img207.imageshack.us/img207/8793/main1ng.jpg
[EDIT]Added picture instead of attachment to save the work for mod;)

charleski
28th November 2005, 13:10
IMO there could be some choice like "nth pass based on stats file".

You can do that already.
Select '3 pass - 2nd pass' and then go to the Advanced tab and points the stats field to your stats file.

IF I deciphered your post correctly, what you're asking is for a means to store the profile used to generate a stats file in a previous pass. This is a pretty advanced usage, since the vast majority of users will just be running a set of passes one after the other. If you think you might want to do an extra pass later and want to store the profile, you can always just copy the profile used from MeGUI's profiles directory to the dir with your video files, then copy it back if you want to reuse it (or just save it as a new profile with a unique name).

The modifications you ask for would just introduce more confusion for most users.

Doom9
28th November 2005, 13:53
there is a second way: instead of saving the profile, you could just keep the job around, load it again and just modify whichever settings you see fit.

And just so that we have no confusion: a stats file is what x264 generates. This does not include settings and it would be impossible to derive all encoding settings from a stats file. A profile is a file that keeps the settings for a given codec.

Come to think of it, wasn't it you (redfoxx) who posted something about MeGUI in the x264 development thread? It was about changing parameters without redoing the first pass, wasn't it?

Doom9
28th November 2005, 14:01
to all my fellow developers: I'm wondering if there's a reason to write the output of a 2nd pass in 3 pass mode (provided the settings don't ask for it.. there's a switch in the settings that ensures the third pass doesn't overwrite the second). Or perhaps an option to not write the 2nd pass output to speed things up a bit?

redfordxx
28th November 2005, 14:11
You can do that already.
Select '3 pass - 2nd pass' and then go to the Advanced tab and points the stats field to your stats file.But w/o loading the settings, right?
IF I deciphered your post correctly :D

I was not aware of the attachment pending feature, after you'll see it, it may be clearer.

what you're asking is for a means to store the profile used to generate a stats file in a previous pass. This is a pretty advanced usage, since the vast majority of users will just be running a set of passes one after the other. If you think you might want to do an extra pass later and want to store the profile, you can always just copy the profile used from MeGUI's profiles directory to the dir with your video files, then copy it back if you want to reuse it (or just save it as a new profile with a unique name).But you can't change it unless you edit it in the text file. The principle I proposed offers much more possibilities
When the newest x264 writes the settings to the stats file, it could be used.

The modifications you ask for would just introduce more confusion for most users.For me as a newbie is seeing so many multiple passes options confusing too.
And seeing now (if already correctly), that
3passes-3rd pass is same as 2passes 2nd pass
3passes-1st pass is same as 2passes 1st pass
3passes-2nd pass is same as 3passes 3rd pass+stats file

But the main effect I am aiming to is:
- once I am for whatever reason not satisfied with 2nd pass, I can redo it with changed settings.
- with this enable/disable scheme MeGUI will tell me, which settings can be safely changed in 2nd pass and for which I need new 1st pass.
- I for instance quite lately realized that 2nd pass does not do stats file. With the interface I proposed it is very clear, what is behind
- Storing (=not overwriting) all the stats files

redfordxx
28th November 2005, 14:30
there is a second way: instead of saving the profile, you could just keep the job around, load it again and just modify whichever settings you see fit.

And just so that we have no confusion: a stats file is what x264 generates. This does not include settings and it would be impossible to derive all encoding settings from a stats file. A profile is a file that keeps the settings for a given codec.

Come to think of it, wasn't it you (redfoxx) who posted something about MeGUI in the x264 development thread? It was about changing parameters without redoing the first pass, wasn't it?
It was redfordxx. ;)
That time not quite clear about and thinking of loading settings from job file. And then appeared x264 rev 374...

redfordxx
28th November 2005, 14:51
On the last page I have post with attachment. There is written "attachment pending approval" but I can display it. So, what does it mean?

gamr
29th November 2005, 04:29
bug report: if longer than 24hrs for a pass (athlon 1000) it seems to go nuts on the elapsed AND eta

Doom9
29th November 2005, 09:22
So, what does it mean?It means a moderator first has to approve it.

And then appeared x264 rev 374...Hmm.. why don't I see parsing statsfile and translate it into a class MeGUI understands? Could it be because reverse parsing is a PITA and has to be adapted each time there's a new option? And then you want the entire logic inside the codec duplicated into a GUI as well? I don't see the usefulness/time invested argument here at all. If you keep your stats file, wouldn't it be reasonable to keep the job as well so as to be able to redo things when necessary. I'm a big believer in the "keep your sources until such time when you're 200% sure you'll no longer need them". MeGUI already offers a big advantage over VDub and the like as you can resurrect and modify jobs. Just as in this case you won't check "delete temporary files", you shouldn't check "delete job after successful completion" either.

@gamr: I know.. my standard answer is "get a faster CPU".. an encoding session that takes more than 24h is the strongest indicator that your hardware is outdated beyond reason ;)

redfordxx
29th November 2005, 11:17
It means a moderator first has to approve it.OK, I replaced the attachment with picture on previous pagehas to be adapted each time there's a new optionSame as the settings interface, hand in handAnd then you want the entire logic inside the codec duplicated into a GUI as wellIf there is a way, how to benefit from the logic in the GUI before starting encoding... I don't know itIf you keep your stats fileI believe it is rewritten with the next pass, but OK, in most cases you use the next pass stats fileyou can resurrect and modify jobsThe only way I found was textediting the job file...

Doom9
29th November 2005, 11:42
Same as the settings interface, hand in handSo you want to double the amount of work for each commandline change.. and of course it's nice of somebody else does it, isn't it? And it is likely more than double the amount of work because you need additional code to handle unknown options, plus the next thing you'll ask for is load a commandline into the GUI.. and there we have multiple ways for the same option so more work again.

Also think about this: why would you need a GUI to finish off somebody else's work? I mean, as previously pointed out (and read the rest of my message as well), you can reload and modify jobs just fine. So the only real reason why anybody would want to load settings from a stats file into a GUI is to continue the work started in another software, in the VfW codec, on the commandline, etc. So, why would somebody make the first pass on the commandline and the second pass in a GUI?

The only way I found was textediting the job file...The setting "Delete completed Jobs" gets rid of jobs once they have been successfully completed. It is turned off by default, so all your jobs remain. So you can always select a job in the queue, press load, and voila, all its settings have been loaded. Then you can reconfigure what you want, and once you're done, go back to the queue and press the update button.. and the job will now have your modified settings. Or you could press queue to create a new job based on what you reconfigured.. the choice is yours. Double clicking on a job changes its status, so you can postpone it, or reactivate an already done job so that it can be encoded again, just like in VirtualDub.

There's a bunch of settings that influence if stats files are being overwritten or not. You could configure the settings so that your second pass output file is being kept, along with the second pass stats file. Those are not the default settings, but it's possible, you just have to activate the proper settings. There might even be an option to not write the second pass output at all in the future.

redfordxx
29th November 2005, 12:31
So you want to double the amount of work for each commandline change.. and of course it's nice of somebody else does it, isn't it?True, my programming knowledge is not good enough to contribute.

But please note, I do not want anybody to double his work or do anything else. I hope it was understandable from my post and from the post in x264 dev thread too. I am only sharing my ideas and trying to show my reasons which, I admit, come partially from lack of knowledge of 264 and MeGUI and all this stuff. Developer should decide whether to do it. The main and still present reason behind is the lack of knowledge about which settings should be consistent through passes (as you correctly recalled).

Anyway, thank you for all the further explanations. Seems to me I gave up exploring the possibilities of MeGUI too soon and left for CLI.

charleski
29th November 2005, 12:36
Well, I think a good idea is to get back to the root and look at what you actually want to do.


But the main effect I am aiming to is:
- once I am for whatever reason not satisfied with 2nd pass, I can redo it with changed settings.
- with this enable/disable scheme MeGUI will tell me, which settings can be safely changed in 2nd pass and for which I need new 1st pass.
It really looks quite simple to me. You encode a video, decide that it doesn't look good enough with the settings you've specified, and want to go back and re-encode it. Now, you want to know which settings you can alter without having to do the 1st pass again. I believe that those are discussed earlier in this thread, and it would be best to hunt back and find the posts. From what I can see, they're the subme value, macroblock analysis, ME algorithm, b-rdo and trellis, but check that. Those are easy enough to remember, or write down somewhere if you need to refer to them.

As I said before, one of the important aspects of designing a GUI is to keep it as simple as possible for the majority of users, who will have a standard profile and just do an automated 2pass encode. Adding in extra interface complexity to handle special cases would add needless confusion to the process for most people.

Sharktooth
29th November 2005, 13:50
disabled trellis in fast first pass (still have not much time to code, but this was pretty easy).
files (sources and bins) are at the usual place: http://files.x264.nl/Sharktooth/?dir=./megui

gamr
29th November 2005, 14:02
@gamr: I know.. my standard answer is "get a faster CPU".. an encoding session that takes more than 24h is the strongest indicator that your hardware is outdated beyond reason ;)

oh i realize this, its just the only windows box on the network these days, ill take the hint and swap a cpu with something

Doom9
29th November 2005, 15:11
@Sharktooth: are my auto2/3 pass changes included now?

Randall
29th November 2005, 15:14
fix the errors that ocurr if auto-popup of the status window is not enabled (events must not propagate to the progresswindow in that case)


This bug is of particular annoyance to me, on an otherwise excellent piece of software, that has fully replaced my Gordian Knot. Keep up the excellent work!!

Sharktooth
29th November 2005, 15:44
@Sharktooth: are my auto2/3 pass changes included now?

EDIT: sorry Doom9, charleski already did it in one of his patches. So, yes, it's there.

charleski
30th November 2005, 00:28
Quote:
Originally Posted by Doom9
fix the errors that ocurr if auto-popup of the status window is not enabled (events must not propagate to the progresswindow in that case)


This bug is of particular annoyance to me, on an otherwise excellent piece of software, that has fully replaced my Gordian Knot. Keep up the excellent work!!
Could you describe exactly what happens when this occurs? I always run MeGUI with the status window set to auto (ie Open Progress Window is checked), so have never seen this. I'm pretty sure it just needs a minor change to the flow control, but I want to be sure that would catch whatever error you see.

BTW, I've been thinking about including avi import, and it looks like it would be best to invoke DirectShow's IGraphBuilder. The most straightforward method that I've found of doing that in C# involves rewriting the IDL inteface and looks like it indirectly relies on a small amount of registry access for the GUID. (Typically, MS's own documentation was of no help on this at all, I finally tracked down the method on an independent website :angry: .)
This is from codeproject.com and looks like this:
// ======== C# version of ICaptureGraphBuilder2 (DsExtend.cs) ======

[ComVisible(true), ComImport,
Guid("93E5A4E0-2D50-11d2-ABFA-00A0C9C6E38D"),
InterfaceType( ComInterfaceType.InterfaceIsIUnknown )]
public interface ICaptureGraphBuilder2
{
[PreserveSig]
int SetFiltergraph( [In] IGraphBuilder pfg );

[PreserveSig]
int GetFiltergraph( [Out] out IGraphBuilder ppfg );
....
I want to use this so I can run graphedit from within the program and then know for sure whether the user has the correct filters installed to render the file. Just letting you know in case anyone has an aversion to including a dependency on DirectX (or knows of a better way to do it).

Chainmax
30th November 2005, 00:41
EDIT: sorry Doom9, charleski already did it in one of his patches. So, yes, it's there.

So, megui_0.2.3.1b_ck14_20051129 is the latest version? What do Doom9's auto2/3 pass changes consist of?

charleski
30th November 2005, 00:47
Just changes to the commandline preview in the configuration window. the actual commands sent to x264 remain the same.

Doom9
30th November 2005, 01:07
ould you describe exactly what happens when this occurs?Just run it once, you'll see. the logs is full with tons of exceptions.. while the progresswindow is always created, you can only send events to if it has been shown at least once... otherwise you get an exception. I described what needs to be done in the first post.. if you want to look at it, please have a look at the whole thing, not just the quick fix that gets rid of the exceptions.

charleski
30th November 2005, 01:44
Well, what I was thinking of was eating the events in another way if there's no window to send them to, filtering some into logfile messages if they're relevant. What sort of thing were you envisioning?
[Edit] Actually, now I did some tests and looked at the log: Are you talking about all those Invoke errors on a window with no handle? That's very easy to fix...)


On another point, maybe it's just my opinion, but the TODO
automatic deinterlacing of interlaced materialSounds a bit magical, heh. Almost all the material I deal with is PAL, but even in the PAL realm there's no such thing as automatic deinterlacing if you want optimal frame recovery. Those who want to deinterlace without worrying about the details are probably better-off just passing the material through LeakKernelDeInt, though that may produce a small amount of unecessary distortion. Since much of my material is PAL MPEG transport streams, I see a lot of odd things happen, like mode shifts from progressive to interlaced when they run the titles, often with mixed field shifts. And of course that doesn't even begin to compare to the nightmare that is NTSCi->PALi->PALp conversion. There are some good avisynth tools that can deal with these things, but they require user intervention, and I wouldn't want to delude people that we could automagically deinterlace anything they throw at MeGUI. In fact, one of my aims at some point is to write some GUI code to make tweaking the Telecide parameters easier, probably including some help in creating an override file for the filter as well.

Randall
30th November 2005, 06:05
Ok so where can I report a bug for MeGUI? The d2v project files that it writes are not compatible with avisynth. They crash instantly. the only way I can get a valid d2v file is to manually open up DGIndex and do the F4 dance. I would diff out the working and corrupted d2v files and post them here, but I am too tired to do it now.

Doom9
30th November 2005, 09:18
Are you talking about all those Invoke errors on a window with no handle? Yup. I actually halfway fixed them already by keeping track of the window.. I set a bool to true when I call show, and when the window is closed from within Form1 back to false. But that's only half of the story.. since you can close the window manually, but that only hides it, that state change should propagate back to the GUI.. it's not so much about the events there as it is to enable/disable the show progress window menu point.

Sounds a bit magical,Not really, AutoGK does a pretty good job at this.. better than any other software I know. Granted, nothing is perfect but if you can reach a success rate in the 90 percentile, you've done a pretty darned good job.

Ok so where can I report a bug for MeGUI? There's the thread where new builds are being posted and the like.. this thread is for people who speak C# as the first post says.

charleski
30th November 2005, 11:55
The d2v project files that it writes are not compatible with avisynth. They crash instantly.
If you're using one of the latest betas then you need to make sure that dgdecode.dll is not in the same directory as MeGUI.

Doom9
30th November 2005, 12:57
If you're using one of the latest betas then you need to make sure that dgdecode.dll is not in the same directory as MeGUI.I've always wondered why that is..

dimzon
30th November 2005, 13:16
Doom9
What does You think about such (http://forum.doom9.org/showthread.php?t=103069) audio encoding methodology?

Take look @ BeHappy alpha (http://www.mytempdir.com/289180)
http://img505.imageshack.us/img505/2240/untitled0hz.gif

Maybe we can integrate BeHappy into MeGUI?

Randall
30th November 2005, 13:34
If you're using one of the latest betas then you need to make sure that dgdecode.dll is not in the same directory as MeGUI.

Thank you for that notice. Maybe it was mentioned somewhere in the README or something, but I definately missed this little tidbit of info.

Doom9
30th November 2005, 14:00
What does You think about such audio encoding methodology? Hmm.. audio in AviSynth, the old topic. I was about to write how the heck is that going to work before I read the thread you linked to. Question is: what do we lose over using BeSweet? Basically I need all the options I'm currently using in MeGUI available (downmix, normalization, various codecs without hassle and using 10 different executables, delay). If that can be fullfilled, it could definitely be an option (finally resolving the cutting angle once and for all).

charleski
30th November 2005, 14:24
I've always wondered why that is..
http://forum.doom9.org/showthread.php?p=742763#post742763
I'll go back and remove the original dll imports that are causing the problem in the next patch. One of the bugaboos with DGMPGDec has always been the proliferation of different versions of dgdecode: DGIndexer gets updated and people upgrade it, then forget to copy the dll to all the program directories that rely on having their own copy. The solution is simply to load the dll straight from the directory in which DGindexer resides. Since we know that directory, this is simple.

BTW, I looked at AutoGK, it seems that it runs a script based on FrameEvaluate over a selection of frames and uses that to decide whether to Telecide or KernelDeInt. Has len0x ever mentioned what algorithm he uses?

Sharktooth
30th November 2005, 14:43
working on this: http://www.skybound.ca/developer/visualstyles/default.aspx
it's free...

Doom9
30th November 2005, 14:53
Has len0x ever mentioned what algorithm he uses?No: http://forum.doom9.org/showthread.php?t=100479 And the post you linked to only mentions that it has to be that way (I picked that up before), and not why. The solution with a given path has one disadvantage though: you are forced to configure the dgindex path, even if you're not going to use dgindex from within megui.

@Sharktooth: what about styles in .NET 2.0? The first megui version ever was built on 2.0 and it looked rather good and it seems to have styles enabled by default.

Sharktooth
30th November 2005, 14:58
@Doom9: it will require .NET 2.0 Framework. It's still not available for all windows regionalized versions.

dimzon
30th November 2005, 15:23
Question is: what do we lose over using BeSweet?
AviSynth is OpenSource, BeSweet is not (it's free but not OS)
AviSynth has well documented plugin API, BeSweet has not
AviSynth has multiple external plugins/sources (including NicDtsSource), BeSweet has not
External encoder with pipeline support is great solution - it's easy to add new encoder

Sharktooth
30th November 2005, 15:32
you forgot besweet has bugs... :)
one that bugs some users is a crash (or something) when using AAC as input.

Doom9
30th November 2005, 15:48
AviSynth is OpenSource, BeSweet is not (it's free but not OS)
AviSynth has well documented plugin API, BeSweet has not
AviSynth has multiple external plugins/sources (including NicDtsSource), BeSweet has not
External encoder with pipeline support is great solution - it's easy to add new encoderI asked the other way round, didn't I? Throwing away something perfectly good for something lesser just because it better fits your ideology may fit linux-lover-m$-hater but it's no way to write software that's going to be used by non programmers.
BeSweet cannot handle AAC input..

Don't get me wrong, AviSynth support is exciting, but dropping your eggs and running away flapping your arms never was a solution. Any major change has to be thought through first, followed by tests in critical areas, followed by proper design and last but not least the implementation.

dimzon
30th November 2005, 16:27
I asked the other way round, didn't I? Throwing away something perfectly good for something lesser just because it better fits your ideology may fit linux-lover-m$-hater but it's no way to write software that's going to be used by non programmers.
I believe any AviSynth user is programmer (a little). And don't forget:
AviSynth has well documented plugin API - it's easy to extend supported input formats. And it's allredy possible to use NicDtsSource for DTS Transcoding. And it's easy to create user frendly GUI for non programmers :) (Current BeHappy GUI is for my own use, flexible and extensible but not to be used by non programmers. But it's possible to write GUI for well-known filters (Resample/SSRC) and for well-known encoders (lame/vorbis/neroAAC))

I believe this architecture (AVS->Pipeline->CliEncoder) is MUCH more flexible and extensible then BeSweet.

Doom9
30th November 2005, 17:17
still waiting for a reasonable reply to the questions I have raised. You asked something.. I cannot answer until I have the answer to my questions. Even if you post ten pages of why this new method is so great, these questions do not go away..

dimzon
30th November 2005, 18:13
Basically I need all the options I'm currently using in MeGUI available (downmix, normalization, various codecs without hassle and using 10 different executables, delay). If that can be fullfilled, it could definitely be an option (finally resolving the cutting angle once and for all).

http://www.avisynth.org/FiltersByCategory

delay - there are build-in DelayAudio() filter
downmix is build-in for NicAc3Source and NicDtsSource.
Other downmix modes can be implemented in external AviSynth plugins or, maybe using MixAudio/GetChannel combination
normalization - there are build-in Normalize() filter
codecs:
AAC -> FAAC/NAAC/WinAmpAAC
Vorbis -> EncVorbis
MP3 -> LAME
mp2 -> tooLame
Speex -> SpeexEnc
MANY -> mencoder (!)
Any other encoder with cli interface and stdin support

stax76
30th November 2005, 18:55
it will require .NET 2.0 Framework. It's still not available for all windows regionalized versions.

Why would you want a localized .NET? Can't the english version be installed on all systems? If a chinese user crashes your app how do you gonna read the stacktrace?

Sharktooth
30th November 2005, 19:18
.NET 2.0 is installed thru windows update for the majority of users.
Windows update installs only the localized versions of the updates (including .NET).
So maybe compiling for .NET 2.0 is still too early until it gets widely spread.

Randall
30th November 2005, 19:39
May I suggest having a "default" or basic avisynth script that can be chosen in MeGUI. Much like the GordianKnot one, with deinterlacing, reverse teleclineing, and cleaning, options etc. THe cropping and resizing come from user selected options, wich is great, but perhaps it might not be a bad idea to supply a "generic" avisynth script for us newbs.

An even cooler idea would be to have script "pieces" that the user could choose. Break them down into categories like Cleaning, Deinterlacing, etc. Then the choices could get concationated into one avisynth script (assuming the choices made do not conflict with one another.) Just a thought.

stax76
30th November 2005, 19:54
.NET 2.0 is installed thru windows update for the majority of users.
Windows update installs only the localized versions of the updates (including .NET).
So maybe compiling for .NET 2.0 is still too early until it gets widely spread.


That depends mainly on how many project make the switch, so far I know MediaPortal, SharpDevelop and StaxRip of course. Since VS 2005 targets .NET 2.0 and SharpDevelop 2.0 around the corner also targeting .NET 2.0 I'm expecting a rather fast adoption.

charleski
30th November 2005, 20:45
May I suggest having a "default" or basic avisynth script that can be chosen in MeGUI. Much like the GordianKnot one, with deinterlacing, reverse teleclineing, and cleaning, options etc. THe cropping and resizing come from user selected options, wich is great, but perhaps it might not be a bad idea to supply a "generic" avisynth script for us newbs.

An even cooler idea would be to have script "pieces" that the user could choose. Break them down into categories like Cleaning, Deinterlacing, etc. Then the choices could get concationated into one avisynth script (assuming the choices made do not conflict with one another.) Just a thought.
Um, that's been my aim with the changes I made to the avisynth creator. It produces output similar to what you'd get with GK, only without all the unused stuff that's commented out. If you decide you want to change the way you handle the video, you need to recreate the script. One of my goals is to add a script function import feature as well, but there are other things I need to do first.

While GK provides a backbone, I too often find that I tweak the parameters by loading the avs into VirtualDub and into Notepad (Notepad2 actually), make a change then reopen, etc etc. I'd like to be able to provide all that functionality inside MeGUI with the Preview window, but it will take some work.

[Edit]

More patches
0.16 30 Nov 2005
Fixed the library calls so that users who have dgdecode.dll in the same dir as MeGUI won't experience a crash (TBH I was being sloppy in not cleaning up the library code). Users should still be encouraged to remove dgdecode.dll from their MeGUI directory for future compatibility reasons.
Fixed the check for presence of the Progress window so that update events won't be sent to it if it's not there.

0.15 29 Nov 2005
Removed trellis in turbo mode (Sharktooth)
Fixed file filter for the dialog to open stats files (was reading them as .log, but was writing them as .stats)
Added more info to one of the level violation warnings
Fixed the automatic dgindexer dialog call so that it won't close the avisynth script window if the dialog is cancelled
Added extra case variants to the MPEG input filter in avisynth script creator

Modified Files (http://homepages.nildram.co.uk/~cajking/MeGUI-src.0.2.3.1b-ChngdFlsCK0.16.rar)
.Net 1.1 binaries (http://homepages.nildram.co.uk/~cajking/MeGUI-src.0.2.3.1b-BinsCK0.16.rar) (No-one's said if these work or not, so I assume they do.)

@doom9: Can we sort out some decision over the major.minor.build.revision Assembly info? I've been simply adding my own version numbers to the version string that displays in the main window so that people can distinguish between different versions, but it would be best to integrate this into the Assembly info. ATM MeGUI builds display a nonsense file version as this hasn't been set in the program (ie myAssemblyName.Version = new Version("0.2.3.<betaversion>"); ). Since this is your project I'll leave that to you to decide.

Doom9
1st December 2005, 00:02
@Dimzon: Are you still working on bePipe? And I take it that since it has pipe in its name it'll pipe the data itself? It would be quite a hassle to support all the encoders you listed and not only worry about different commandlines, but extract a progress report from each of them, so that's where a common interface would come in handy. Perhaps you could even wrap around encoder dlls rather than the commandline tools? There is an example of a lame based encoder on codeproject ready to be used, all in C#.
There are not many audio options in MeGUI, basically downmix (or lack thereof), gain, delay correction (I'm assuming delayaudio works with all kind of audio input and supports both negative and positive values) and that is it. Assuming this all works with trimmed scripts as well, we may have something great here.

but it would be best to integrate this into the Assembly info.Is there a way to make sensible use of that? I don't have a clue where the build revision shows up.. I just know the build number goes up every time I recompile.

charleski
1st December 2005, 00:42
Is there a way to make sensible use of that? I don't have a clue where the build revision shows up.. I just know the build number goes up every time I recompile.
Just set it in AssemblyInfo.cs, eg:
using System.Reflection;
using System.Runtime.CompilerServices;

//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("MeGUI")]
[assembly: AssemblyDescription("GUI frontend for video encoding")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("Licensed under GPL")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:

[assembly: AssemblyVersion("0.2.3.16")]

Doom9
1st December 2005, 01:05
and then? except for looking at the source code, how will anybody know which build he/she is using?

charleski
1st December 2005, 01:43
and then? except for looking at the source code, how will anybody know which build he/she is using?
It shows up in the tooltip that pops up when you hover over the file in Explorer. It also shows in the Version tab of the Properties page in Explorer.

stax76
1st December 2005, 01:59
You got to fill out [assembly: AssemblyProduct("")] (can be done using the designer (project options dialog)) if you support input files from the cmdl. Without your application will show up screwed (no caption at all) under "Open With" in the Windows explorer context menu. I learned about this the hard way.

Sharktooth
1st December 2005, 04:48
source and bins rebuilt and repackaged here: http://files.x264.nl/Sharktooth/?dir=./megui

so, do you think moving the project to .NET 2.0 will be ok?

dimzon
1st December 2005, 10:31
Are you still working on bePipe?
No! It's VERY easy application - it's nothing to do more...
And I take it that since it has pipe in its name it'll pipe the data itself?
No! BePipe just sent audio from AVS to stdout. But BeHappy do it (BeHappy does'nt use BePipe)
It would be quite a hassle to support all the encoders you listed and not only worry about different commandlines, but extract a progress report from each of them
I believe You does'nt need to extract progress report from encoder. You can analyse 100*nSamplesSentToPipe/nOverallSamplesCount - it not VERY preciese but good enought (look how it works in latest foobar2000 beta - BeHappy GUI ideology is stolen from it)
Perhaps you could even wrap around encoder dlls rather than the commandline tools?
It's possible in future...
delay correction (I'm assuming delayaudio works with all kind of audio input and supports both negative and positive values)
Yes! It works fine!
this all works with trimmed scripts as well
What does trimmed scripts means in current context?

dimzon
1st December 2005, 10:46
Other downmix modes can be implemented in external AviSynth plugins or, maybe using MixAudio/GetChannel combination

downmix-related thread

berrinam
1st December 2005, 11:02
An idea I've been experimenting with is AVS profiles. They would be similar to video/audio profiles in MeGUI, and the information they would store is:
-a template script. This is the main part of the profiles, and it would mean that a particular filter or set of filters could be included in every encode, without MeGUI having to be specifically aware of them, the way it is of the denoising/deinterlacing filters at the moment. This would be human-editable and could look something like this:
<source>
<crop>
subtitle("This is a filter included in every encode")
<resize>MeGUI would then replace <source> with the appropriate DGDecode() function, and <crop> with the appropriate crop function, similarly with deinterlace, denoise, resize and possible deblock, covering everything that is currently in the gui.
-The profiles would also store which of the deinterlace, resize and denoise filters are used.
-This would also come with a Default Profile which would behave exactly the way the gui currently does

The idea behind this is it makes it easy to distribute customizable avs scripts, and to allow users to add a filter to each script, without MeGUI itself having to be changed. More customisability.

What do you think?

charleski
1st December 2005, 11:09
An idea I've been experimenting with is AVS profiles.Sounds good, I'd been wondering if there were a way for more advanced users to put in certain script blocks automatically, but couldn't think of a method to do it easily. Your idea sounds like a plan.

Doom9
1st December 2005, 11:30
so, do you think moving the project to .NET 2.0 will be ok?Well, I'd like to but I'm also a bit concerned that a lot of people will have to upgrade. Even I am still using VS 2003 and have no immediate plans to upgrade. It might come though when I get my PC at work re-setup again, and encrypted remoting channels would sure come in handy at work.

I believe You does'nt need to extract progress report from encoder. You can analyse 100*nSamplesSentToPipe/nOverallSamplesCount - it not VERY preciese but good enought (look how it works in latest foobar2000 beta - BeHappy GUI ideology is stolen from it)Hmm.. and how do I know how many samples I'm sending? You wrote in the other thread that you are porting avs2wav to C#, is Behappy the result of that (in other words, is it written in C#? It looks rather VB'ish).
What does trimmed scripts means in current context?Well, I mean what happens if I make creative use of trim commands to cut out stuff (e.g. you have a TS stream captured of your favorite TV show, and you want to cut out the commercials.. now instead of having to resort to an MPEG-2 cutter, you could simply demux the whole thing in DGIndex, then create an AviSynth script from it and cut from within AviSynth making use of the trim commands, so that in the end you have excluded the ads frame-accurately without the hassle of actually having to cut anything or re-encode anything because the ad didn't start at an I-frame).

Personally I have little use for filtering that goes beyond what the GUI currently offers, but if there's an interested for this template idea, it does sound interesting. My only concern is that MeGUI shouldn't become a full blown AviSynth script editor which would confuse most users - there will always be those that will use an external editor because of all the advanced functionality they need.

dimzon
1st December 2005, 11:44
Well, I'd like to but I'm also a bit concerned that a lot of people will have to upgrade. Even I am still using VS 2003 and have no immediate plans to upgrade. It might come though when I get my PC at work re-setup again, and encrypted remoting channels would sure come in handy at work.
Agreed by 100%! Please, does'nt move to 2.0!

Hmm.. and how do I know how many samples I'm sending?Take look @ BePipe source code (http://www.mytempdir.com/292219)

You wrote in the other thread that you are porting avs2wav to C#, is Behappy the result of that (in other words, is it written in C#? It looks rather VB'ish).
BePipe is result of porting avs2wav to C# (it's my first experiment), BeHappy is enhanced BePipe... Yes, BeHappy is pure C# apllication, take look @ source code (http://www.mytempdir.com/292219)

Doom9
1st December 2005, 11:56
@Dimzon: Alright, that does sound interesting. In the interest of not breaking anything, I think it would be prudent to continue to work on BeHappy first and to fully separate the processing and the GUI part, focusing mainly on the processing part which could be turned into a library, thus allowing multiple frontends. Once the library has been properly tested, it could then be used to replace the current audio encoding part. Since this encoding method is rather new, I think we should first make sure all the kinks have been worked out. In course of time, the library could also be modified to use other libraries for encoding rather than piping the data from AviSynth to stdin of an encoder program, but the library approach would mean no change in other software.

dimzon
1st December 2005, 12:03
fully separate the processing and the GUI part
Just look @ internal class Encoder in MainForm.cs ;)

Chainmax
1st December 2005, 17:11
Shouldn't the link in the 1st page be updated?

charleski
2nd December 2005, 03:12
New patch.
Avi files can now be loaded directly into the avisynth script creator. Currently this handles only the video element of the file. I may add support for avi demuxing later. A check is made via DirectShow's graphedit to ensure that the file can be rendered with the installed filters, but it is still possible that DirectShowSource could fail - I myself suffered this problem with at least one version of ffdshow, but changing to a different build solved it. The avi support includes a means of telling DirectShowSource what fps to use for those filters that don't supply it, as well as an option for FlipVertical().
Also note that I've altered the revision numbering system to something more logical.

Changelog:
0.3.2.1017 2Dec 2005
Added AVI and vdr (VirtualDub frameserver) support. Will need to clean up any unneeded interface code later. [If anyone wants to pitch in on this please feel fee]
Added MPEG2 colour correction using Wilbert's ColorMatrix function.
Fixed 'suggest resolution' for cases in which no DAR is specified.

Changed Files (http://homepages.nildram.co.uk/~cajking/MeGUI-src.ChngdFls_0.3.2.1017.rar)
.NET 1.1 bins (http://homepages.nildram.co.uk/~cajking/MeGUI.NETv1.1.Bins_0.2.3.1017.rar)

This patch works on the avis I've tested it on, but all the ones I have to hand are standard well-behaved xvids. Please test this on obscure avi variants if you have any lying around.

Sharktooth
2nd December 2005, 04:28
ehrr... sorry but version is 0.2.3.1017
repacked 1.1 NET bins and sources at usual place http://files.x264.nl/Sharktooth/?dir=./megui

dimzon
2nd December 2005, 10:54
and then? except for looking at the source code, how will anybody know which build he/she is using?


public MainForm()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
this.Text = ProductName + " v" + ProductVersion;
}

Doom9
2nd December 2005, 10:57
oh, so these are global variables taken from the assembly file? Then I guess why not.

dimzon
2nd December 2005, 10:59
oh, so these are global variables taken from the assembly file? Then I guess why not.
What does You talk about?

berrinam
2nd December 2005, 12:15
I've done the avs templates I spoke about earlier. They are built on the sources Sharktooth distributed of version 0.2.3.1017. I've attached the modified files. It all works basically the way I described earlier.

@charleski: I commented out the loadScript sections you seem to have added. Sorry :confused:, but it seems just as easy to keep all plugins in the Avisynth plugin dir, and it's confusing to keep track of all the plugins with templates, because you are never sure exactly which filters will be used.

@edit: since the attachment has to be approved first, I hosted it on rapidshare as well. Grab it here (http://rapidshare.de/files/8478116/changed.7z.html)

Doom9
2nd December 2005, 12:20
What does You talk about?I'm neither holy nor royalty, so you can safely use lower case ;) I was refering to your above post but that doesnt seem to be working for me. How do you extract stuff like the AssemblyProduct from the AssemblyInfo.cs and use it in another place? Oh and by the way, there's that rule about signature size.. yours takes an excessive amount of space. I'm an MCP, too, but that's no reason to take up all that space.

stax76
2nd December 2005, 12:21
AssemblyFile.cs normally is generated by the designer, AssemblyVersion and AssemblyFileVersion is then accessed from System.Windows.Forms.Application and System.Reflection.Assembly IIRC. Usually I set both the same and access it from the Application class only. Please let me know if you need some sample code.

dimzon
2nd December 2005, 12:49
How do you extract stuff like the AssemblyProduct from the AssemblyInfo.cs and use it in another place?
http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.productversion.aspx
http://msdn2.microsoft.com/en-us/library/system.windows.forms.application.productversion.aspx
.NET Framework make great work for You!



Oh and by the way, there's that rule about signature size.. yours takes an excessive amount of space. I'm an MCP, too, but that's no reason to take up all that space.
Ok, i will edit my signature a little later

stax76
2nd December 2005, 13:00
.NET Framework make great work for You!

VS 2005/.NET 2.0 even greater ;), you noticed Express Version is free for now?

charleski
2nd December 2005, 13:22
@berriman: re the LoadPlugin stuff - The problem is that I've been aiming the avisynth creator at people who are upgrading from GordianKnot. Both GK and AutoGK place all the filters in a different directory to avisynth's defined plugins dir, and then load them in as needed. I suspect len0x did this partially as a hold-over from the pre-2.06 days and partially so that he could distribute a single package that would ensure the program was working with versions of the plugins that it knew about (for instance the latest version of decomb has had its syntax changed).

I agree there's no real reason we need to continue doing things the way len0x did, and it does ultimately make things simpler to keep all the plugins in the place avisynth expects them to be, but we need to make sure that's highlighted in the documentation, or people are going to be posting complaints about the scripts not working because they don't realise what's changed. We do need to load the specific dgdecode.dll from the DGMPGDec directory - as I've said before, it's bad practice to require users to copy out dgdecode.dll to different places when they upgrade it.

@doom9: You can access the assembly attributes using Attribute.GetCustomAttribute(assembly,type). I'll add some code in the next patch to read that data in Form1.cs and set the main window that way so that upfdates to the version need only happen in the attribute.
[edit] Though yeah, dimzon's method is a bit easier, I'll use that.

BTW, I see no-one's claimed the grand prize yet by spotting the minor-yet-deadly flaw in the last patch. I realised I'd left it out right after I posted, but it was late.

Doom9
2nd December 2005, 13:34
but we need to make sure that's highlighted in the documentationI guess that's the main problem, educating the user. I still recall all he complaints about loadplugin not being int the script because people only know the GKnot scripts, whereas I develop on multiple machines that have plugins in different locations so transferring scripts always caused issues until I got rid of loadplugin paths.

Sharktooth
2nd December 2005, 14:16
I have problems enabling styles with .NET 2.0 in MeGUI.
I added all the stuff (i think) but the new style doesnt show up.
In the meantime i made a gui (for the ultra-lazyest lazy user) made in C# for .NET 2.0 for avc2avi.
i'm going to add it to my x264 builds as soon as i sort the MeGUI styles problems.

dimzon
2nd December 2005, 14:27
Hi! I have an idea how to turn MeGUI into very flexible and extensible application! The answer is short - plugins
take look @ technology demo (binaries & sources): http://www.mytempdir.com/294485
first run ExtensibilityDemo.Application alone
http://img525.imageshack.us/img525/3388/a07tc.gif
then close it and place ExtensibilityDemo.SamplePluginLib.dll and/or ExtensibilityDemo.SamplePluginLibInVB.dll to the execution folder and run it again.
http://img489.imageshack.us/img489/8555/a21uu.gif
Amaising, is't it.

How does it work:
ApiDefinition.dll contains definition for 2 custom attributes and 1 interface.
ExtensibilityDemo.Application on startup perform directory scan to search all assemblies marked with IsAsseblyWithPlugin custom attribute. When it found such assembly it scan this assembly in order to find types marked by IsPlugin custom attribute. For detail look @ loadPlugins() method in ExtensibilityDemo.Application.

Reflection is great, is'nt it?

stax76
2nd December 2005, 15:25
Extensibility generally is great. I have quite a bit experience with extensibility and reflection and can tell you doing it right is not so easy and it ain't easy to maintain either so I would think about it twice.

dimzon
2nd December 2005, 15:28
Extensibility generally is great. I have quite a bit experience with extensibility and reflection and can tell you doing it right is not so easy and it ain't easy to maintain either so I would think about it twice.
It's really easy if You exactly know how it works...

stax76
2nd December 2005, 16:03
It's really easy if You exactly know how it works...

Did you design a extensible apllication? I did and found it was not so easy. Maybe it's easy for simply applications but if you try to allow plugin authors to extend classes that must be serialized as settings as well being hosted in lists things get more and more complicated. All this would be needed if I would support plugins in StaxRip that provide additional preparers, encoders, muxers and things. You got to use adapter patterns, custom serialization and stuff. I know how all this works but rather try to make my application flexible enough without plugins and scripting. There are a lot traps like serialization finds assemlies only within the startup dir unless the AppDomain is configured for it.

dimzon
2nd December 2005, 16:09
Did you design a extensible apllication?
This is my primary work for past 5 years! I'm lead developer of instrumentation tools in our company :)
There are a lot traps like serialization finds assemlies only within the startup dir unless the AppDomain is configured for it.
public virtual event ResolveEventHandler AssemblyResolve

charleski
2nd December 2005, 16:51
It's really easy if You exactly know how it works...This does look interesting, but you've put your finger on the real problem - it would have to be written by someone who knows exactly how it works, i.e. you :D .

dimzon
2nd December 2005, 18:16
This does look interesting, but you've put your finger on the real problem - it would have to be written by someone who knows exactly how it works, i.e. you :D .
First step - which interfaces/classes does whe need to move in plugins.
MeGUI is job-based tool so there are such abstract classes/interfaces:
Job - some abstract job to add to joblist
JobExecutor - yet another abstract class. Seems like Job implementation must provide concrete JobExecutor implementation
JobProvider - some visible GUI to create and add job's. Must provide save/load state functionality.
Second step - which interfaces/classes MeGUI must provide for plugins:
JobPlanner - some class/interface with method AddJob(AbstractJob jobToAdd)
WellKnownFilenames provider - yet another idea/improvement. If I want to perform full DVD-backup i need to encode audio, encode video then mux then together. But I can't - schedule mux job - audio/video files does'nt exist! WellKnownFilenames provider must provide list of "files to be created after pending job completion" to allow choose this files in GUI for planning.

stax76
2nd December 2005, 19:11
The basic architecture of the sample is correct but there are quite a few things that can be done better e.g. creating objects using System.Activator and performance wise there is much room for improvement, some techniques are described here (http://msdn.microsoft.com/msdnmag/issues/05/07/Reflection/default.aspx).
Job - some abstract job to add to joblist

This yields the problem I described, let's say you inherit from job (or maybe profile) in your plugin and later remove that plugin. As result the entire deserialization will fail unless you do custom serialization. I would host the objects in a class implementing IList and ISerialization and save the stream of a serialized object in the list in a byte array so if a object in the list cannot be deserialized because the assembly no longer exists the other objects in the list can still be deserialized.

My biggest gripe with plugins is all the additional work involved to expose interfaces and breaking changes that hardly can be avoided if you want clean code and progress. Just lost half of my Firefox plugins after updating to 1.5. It must be very annoying for a plugin author if there are often breaking changes.

dimzon
2nd December 2005, 19:32
This yields the problem I described, let's say you inherit from job (or maybe profile) in your plugin and later remove that plugin. As result the entire deserialization will fail unless you do custom serialization. I would host the objects in a class implementing IList and ISerialization and save the stream a serialized object in the list in a byte array so if a object in the list cannot be deserialized because the assembly no longer exists the other objects in the list can still be deserialized.
Never use Binary Serialization for "save configuration" puposes! It can be broken even if your assembly still binary compatible (change/remove/add internal/private members to class). Binary Serilization is for short-term serialization for marshaling/network transmission puposes ONLY!!!!

I strongly recommend to use XmlSerializer and perform per-item serialization!

dimzon
2nd December 2005, 19:47
@Doom9
Why not to use SF and CVS for collective work?

Sharktooth
2nd December 2005, 20:16
maybe we'll have a SVN soon.
SF and his CVS are slow as hell and the mantainence is a pain.

stax76
2nd December 2005, 20:39
Never use Binary Serialization for "save configuration" puposes! It can be broken even if your assembly still binary compatible (change/remove/add internal/private members to class). Binary Serilization is for short-term serialization for marshaling/network transmission puposes ONLY!!!!

Last time I tried XML serializer it was very problemlematic to use with complex object graphs using things like generics, polymorphic objects within lists, hashtables or dictionaries etc. Maybe it was improved for 2.0 and maybe with enough experience XML serializing can work but I see absolutely no problem using binary serialization. There is no limit to the complexity of your object graphs, it will work, it will run fast and it won't riquire customizations like polymorphism with the xml serializer. Things like xml serializer calls ctor on deserialize usually yields awkward code. IIRC future .NET versions will be compatible with the 2.0 binary formatter. If you change fields you can call reflection to the rescue either by applying OptionalFieldAttribute (2.0 ;) or cleaner and better as missing or breaking fields with initializer get automatically instantiated:


Public Class Foo
Implements ISerializable

Public Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
For Each i As FieldInfo In Me.GetType.GetFields()
Try
i.SetValue(Me, info.GetValue(i.Name, i.FieldType))
Catch
End Try
Next
End Sub

Public Sub GetObjectData(ByVal info As SerializationInfo, ByVal context As StreamingContext) Implements ISerializable.GetObjectData
For Each i As FieldInfo In Me.GetType.GetFields()
info.AddValue(i.Name, i.GetValue(Me))
Next
End Sub
End Class


Of course if you have critical data that is never allowed to break you don't want to use binary serialization but for a application like MeGUI that's not really a problem.

berrinam
2nd December 2005, 21:49
Perhaps the main thread could be updated with the new bins?

Also, I, too, support setting up SVN for MeGUI.

charleski
2nd December 2005, 22:10
Well, I've been assuming that people have been beta-testing all the changes I've made (especially the avi-import stuff please!). I've corrected all the issues that I've found or have been reported so far.

I have one more patch to post, but if all this stuff works, it's time to move the build number up a notch IMO, but I'll leave that in doom9's hands.

[edit]
Ok, current patch status:

0.3.2.10018 2 Dec 2005
Forced avs output to YV12 - No-one wins the grand-prize, guess that saved me some cash!
Restructured the code to open a video source in order to accomodate opening the dialog with a source already
specified.
Altered the formation of the main window's title. Version changes need only be set in AssemblyInfo.cs now.
Added berriman's avs script profile changes. (Move your avisynth plugins!) - Fixed it to load dgdecode from the DGMPGDec directory

Changed Files (http://homepages.nildram.co.uk/~cajking/MeGUI-src.ChngdFls_0.3.2.1018.rar)
Antiquated .NET 1.1 bins (http://homepages.nildram.co.uk/~cajking/MeGUI.NETv1.1.Bins_0.2.3.1018.rar)

[another edit] Grah - that's 0.3.2.1018

Doom9
2nd December 2005, 23:25
My notebook started going nuts when I was on my way home, playing movies was no longe possible (abysmal performance), and while VS also had a lot of issues, I still managed to take care of one of the pending issues that've been bugging me in megui. The following makes the "show progress window" option in the view menu context sensitive:

add new private variable to Form1.cs

private bool isPwVisible = false;

In Form1.cs, method public bool startEncoding(Job job) add

this.isPwVisible = true;

to all three instances of the if:

if (this.settings.OpenProgressWindow)

in mnuView_Popup

replace

if (pw != null)

with

if (pw != null && !this.isPwVisible)

in mnuViewProcessStatus_Click

add
this.isPwVisible = true;

In ProgressWindow.cs

change

public delegate void WindowClosedCallback();

to

public delegate void WindowClosedCallback(bool hideOnly);

In OnClosing(CancelEventArgs e)

replace the code with the following

if (this.IsUserAbort)
{
e.Cancel = true;
this.Hide();
WindowClosed(true);
}
else
{
WindowClosed(false);
base.OnClosing (e);
}

charleski
3rd December 2005, 00:16
@doom9 I've been trying to integrate your changes, but I get the error:
Error 11 No overload for 'pw_WindowClosed' matches delegate 'MeGUI.WindowClosedCallback'
I think I've drunk too much wine to work this out tonight, and I'm not an MCP, my doctorates are in biology, heh.

Doom9
3rd December 2005, 00:42
Error 11 No overload for 'pw_WindowClosed' matches delegate 'MeGUI.WindowClosedCallback' Means you didn't patch everything or didn't tell me enough about the error (as in which file.. which method).

Sharktooth
3rd December 2005, 04:44
Charleski version is 0.2.3.1018 not 0.3.2.1018
However the http://files.x264.nl/Sharktooth/?dir=./megui link contains always the latest .NET 1.1 bins (made with .NET 1.1 SDK c# compiler - csc) and the changed files from the original 0.2.3.1b sources.

charleski
3rd December 2005, 04:53
Charleski version is 0.2.3.1018 not 0.3.2.1018
Ok, the fact that it took me 10 minutes to realise that 0.2.3 != 0.3.2 means i should probably look at this code tomorrow...

Sharktooth
3rd December 2005, 05:02
It's just the archive filename that's wrong... the right version number is 0.2.3.1018. The code is ok.

berrinam
3rd December 2005, 11:52
The Avisynth Script Creator window now doesn't open; a NullReferenceException due to the mainForm member being accessed when it is still null. To fix, move this.mainForm = mainForm; from about the middle of AviSynthWindow.<init> to the beginning of that constructor.

berrinam
4th December 2005, 09:58
ChronoCross posted (http://forum.doom9.org/showthread.php?p=746176#post746176) a bug report which seems to cause MeGUI to crash when opening an avs file. This is caused by the two following lines in VideoPlayer.InitializeComponent: ((System.ComponentModel.ISupportInitialize)(this.videoPreview)).BeginInit(); and ((System.ComponentModel.ISupportInitialize)(this.videoPreview)).EndInit(); While they could simply be deleted, perhaps a better way to fix this problem is to force VS to regenerate the InitializeComponent code, by moving some components around.

Sharktooth
5th December 2005, 15:20
as a quick workaround for my x264 builds i commented that lines out.
1.1 .NET binaries at the usual place ( http://files.x264.nl/Sharktooth/?dir=./megui ). sources are not updated.

edit: the avc2avi GUI i was talking of some posts above... this is the .NET 1.1 version: http://files.x264.nl/Sharktooth/utils/avc2avi_rev267+gui.7z
The .NET 2.0 version with default style looks much better though.

charleski
5th December 2005, 19:10
ChronoCross posted (http://forum.doom9.org/showthread.php?p=746176#post746176) a bug report which seems to cause MeGUI to crash when opening an avs file. This is caused by the two following lines in VideoPlayer.InitializeComponent:
I tracked down the cause of this:
PictureBox.System.ComponentModel.ISupportInitialize.BeginInit Method
...
Note: This method is new in the .NET Framework version 2.0.
Aargh. - the Forms Designer automatically adds .NET 2.0-only code, and the .NET 1.1 compiler wasn't detecting this particular problem at compile-time.

@doom9: I worked out what else needed to be added to your changes. Since you added a parameter to the WindowClosedCallback delegate, then
private void pw_WindowClosed()
{
pw = null
}
in Form1.cs needs to change to
private void pw_WindowClosed(bool hideOnly)
{
this.isPwVisible = false;
if (!hideOnly)
pw = null;
}
if I'm reading your intentions correctly.

Doom9
5th December 2005, 19:20
if I'm reading your intentions correctly.Yup, that's it. Did I miss that? It appears so.

charleski
5th December 2005, 19:35
I've added it into the source, but I'm playing around with getting the preview window to resize atm.

Doom9
5th December 2005, 20:04
what's wrong with the preview window? it resizes just fine here.

charleski
5th December 2005, 20:18
You can pull out a corner and resize the video? That's weird, I can' do that at all.

Sharktooth
5th December 2005, 20:24
i cant.

Doom9
5th December 2005, 20:27
why would you want to do that anyway? It's nice to know how big your video will finally be like, no?

Sharktooth
5th December 2005, 20:33
However, i fixed the style thing for .NET 2.0 only. with 1.1 styles are partially applied (only on tabs and menus).
any ideas?

.NET2.0 with styles:
http://www.webalice.it/f.corriga/temp/styled_megui.png
... looks much better :)

charleski
5th December 2005, 20:49
why would you want to do that anyway? It's nice to know how big your video will finally be like, no?
Well, it's good to know what your actual encoded size will be, but I often zoom the video up to tweak filter settings and deinterlace thresholds before encoding. I know you're obviously seeing the same thing, but it helps when working on a relatively small laptop screen.

@sharktooth: All I know is that there are quite a few .Forms Control properties that are only available in .NET 2.0, like UseVisualBackColor.

haubrija
6th December 2005, 05:14
Quick bug report using 0.2.3.1018

In the AVS Creator, upon clicking the IVTC option, the creator adds this line.

Telecide(guide=1).Decimate()

In actuallity, it should add this line.

Telecide(order=1,guide=1).Decimate()

FYI

Doom9
6th December 2005, 09:21
Telecide(order=1,guide=1).Decimate():The order thing rings a bell but that doesn't appear to be mandatory as I just used IVTC in MeGUI yesterday and it worked out just fine.

foxyshadis
6th December 2005, 10:19
Order is TFF/BFF and if it's not given it'll use whatever avisynth thinks it is, which mpeg2source will set correctly. So always using order=1 could actually get you into trouble with BFF sources.

charleski
6th December 2005, 12:11
Quick bug report using 0.2.3.1018

In the AVS Creator, upon clicking the IVTC option, the creator adds this line.

Telecide(guide=1).Decimate()

In actuallity, it should add this line.

Telecide(order=1,guide=1).Decimate()

FYI
Upgrade your Decomb filter to the latest version 5.2.2 from Donald Graft's site.
It no longer uses the order parameter.

[BTW, this is mentioned in the changelog, and I'll be ading some code to extract the correct TFF/BFF decision from the d2v.]

dimzon
6th December 2005, 18:46
@Doom9
Does You look @ internal class Encoder @ BeHappy source? Does You still need more? I believe - 30 minutes is enought to make it MeGUI.Encoder descendant ;)

Sharktooth
6th December 2005, 18:53
Dimzon: please do not push ppl doing something. everyone have it's own business and maybe he had no time to check it.

Doom9
6th December 2005, 19:43
@Dimzon: unfortunately I'm both swamped at work, and at home. A codec comparison takes a great deal of time, especially if you have a considerable list of potential codecs that you need to put through a qualification phase. This year's comparison effectively started last week and there is little chance I get to write any line of MeGUI code until the end of the year. But here's one:

In Calculator.cs, find the method codec_CheckedChanged and add updateBitrateSize(); so that the bitrate gets updated when switching between XviD and other codecs (XviD considers bitrate = raw bitstream bitrate, for all other codecs bitrate = final size / length).

And here's how I think the tri-state thing should finally look like (mind you the method may be incomplete and was never tested)

private void x264TriStateAdjustment(x264Settings xs)
{
if (xs.EncodingMode != 2 || xs.EncodingMode != 5)
xs.Turbo = false;
if (xs.Turbo)
{
xs.NbRefFrames = 1;
xs.SubPelRefinement = 0;
xs.METype = 0; // diamond search
xs.I4x4mv = false;
xs.P4x4mv = false;
xs.I8x8mv = false;
xs.P8x8mv = false;
xs.B8x8mv = false;
xs.AdaptiveDCT = false;
xs.MixedRefs = false;
xs.BRDO = false;
xs.Trellis = false;
}
if (!(xs.EncodingMode == 1 && xs.Profile == 2)) // lossless requires CQ mode
xs.Lossless = false;
else
xs.BitrateQuantizer = 0;
if (xs.NbRefFrames <= 1) // mixed references require at least two reference frames
xs.MixedRefs = false;
if (xs.NbBframes < 2) // pyramid requires at least two b-frames
xs.BFramePyramid = false;
if (xs.NbBframes == 0)
xs.AdaptiveBFrames = false;
if (!xs.Cabac) // trellis requires CABAC
xs.Trellis = 0;
if (xs.NbBframes == 0)
xs.WeightedBPrediction = false;
if (xs.NbBframes == 0 || xs.SubPelRefinement < 5) // BRDO requires RDO and b-frames
xs.BRDO = false;
if (!xs.P8x8mv) // p8x8 requires p4x4
xs.P4x4mv;
}
The same method could be used in x264ConfigurationDialog.cs where instead of using x264Settings you access the GUI elements. This allows grouping of all related code in a single method that can be called in showCommandLine. Then GUI element events basically just call showCommandLine

charleski
6th December 2005, 21:08
MeGUI 0.2.3.1019

Changelog:
0.3.2.1019 6 Dec 2005
Changes by doom9 to make show progress window context sensitive.
Added resizing to the video preview window.

(The resizing is not really as pretty as I'd have liked, but after trying several approaches I think it's impossible to get a smoother result without moving up to .NET 2.0 which has some important improvements in how it handles these events.)

Changed Files (http://homepages.nildram.co.uk/~cajking/MeGUI-src.ChngdFls_0.3.2.1019.rar)
.NET 1.1 bins (http://homepages.nildram.co.uk/~cajking/MeGUI.NETv1.1.Bins_0.2.3.1019.rar)

This patch doesn't include the changes doom9 suggested above. I'll have to add those next time.

Sharktooth
6th December 2005, 21:53
... MeGUI-src.ChngdFls_0.3.2.1019.rar .... 0.2.3.1019...

charleski
6th December 2005, 22:02
lol, I did it again.
Ok, changed my templates so i won't keep doing that :)

Sharktooth
6th December 2005, 22:16
merged sources and bins are a the usual place though.
however maybe it's time to switch to .NET 2.0?

berrinam
6th December 2005, 22:44
As a general note for coding: in MeGUI, you should use MeGUI.GetDirectoryName as opposed to Path.GetDirectoryName, as (at least in .NET 1.1) you Path.GetDirectoryName will have no trailing slashes, except if the passed parameter is a root directory. This means that generating a filename using this could have two consecutive slashes if the filename is a root directory.

MeGUI.GetDirectoryName (a static function) is simply a wrapper for this function, which removes the trailing slash if it exists.

Also, there's a problem with running a One Click encode. The process will be interrupted, because of a MessageBox that pops up. Removing MessageBox.Show(Environment.GetEnvironmentVariable("PATH"), "Path", MessageBoxButtons.OK); from JobUtil.openVideo should solve that.

Sharktooth
6th December 2005, 22:51
new bins and merged sources are up @ http://files.x264.nl/Sharktooth/?dir=./megui

edit: adding
Application.EnableVisualStyles();
in Main() will partially enable the visual styles on .NET 1.1 and enable all the style effects for .NET 2.0.

Sharktooth
6th December 2005, 23:02
an unhandled exception is triggered when clicking on Avisynth script creator menu entry: ************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at MeGUI.AviSynthWindow.generateScript()
at MeGUI.AviSynthWindow.showScript()
at MeGUI.AviSynthWindow.resizeFilterType_SelectedIndexChanged(Object sender, EventArgs e)
at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
at MeGUI.AviSynthWindow.set_Settings(AviSynthSettings value)
at MeGUI.AviSynthWindow.avsProfile_SelectedIndexChanged(Object sender, EventArgs e)
at System.Windows.Forms.ComboBox.OnSelectedIndexChanged(EventArgs e)
at System.Windows.Forms.ComboBox.set_SelectedIndex(Int32 value)
at MeGUI.AviSynthWindow..ctor(MeGUI mainForm)
at MeGUI.MeGUI.mnuToolsAviSynth_Click(Object sender, EventArgs e)
at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.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
Assembly Version: 0.2.3.1019
Win32 Version: 0.2.3.1019
CodeBase: file:///C:/Documents%20and%20Settings/Ebola/Desktop/meguisrc/megui.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
----------------------------------------
xuq2gagl
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
----------------------------------------
rg0wr9ln
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
----------------------------------------

haubrija
6th December 2005, 23:57
Upgrade your Decomb filter to the latest version 5.2.2 from Donald Graft's site.
It no longer uses the order parameter.

[BTW, this is mentioned in the changelog, and I'll be ading some code to extract the correct TFF/BFF decision from the d2v.]

Ah that must be it. Sorry for the inconvenience.

charleski
7th December 2005, 00:49
an unhandled exception is triggered when clicking on Avisynth script creator menu entry:

Fixed, I think the bug appeared when I put in doom9's progress window changes before one of the variables was assigned.

0.2.3.1020 6 Dec 2005
Altered Path.GetDirectoryName to MeGUI.GetDirectoryName
Removed a redundant piece of debugging code from jobUtil.openvideo
Fixed a bug caused by incorporating the progress window code in the wrong place
[Should add this to the changelog: I also tried putting Application.EnableVisualStyles() in as Sharktooth suggested. It actually makes things look worse for me, but I have a custom theme applied to Windows. Anyway, see what you think.]

0.2.3.1020 changes (http://homepages.nildram.co.uk/~cajking/MeGUI/MeGUI-src.ChngdFls_0.2.3.1020.rar)
Bins (http://homepages.nildram.co.uk/~cajking/MeGUI/MeGUI.NETv1.1.Bins_0.2.3.1020.rar)

Sharktooth
7th December 2005, 00:59
you preceded me. i was just working on fixing it.
however i updated the files on x264.nl as well.

dimzon
7th December 2005, 10:13
Still waiting for SVC... How about http://www.gotdotnet.com/

Sharktooth
8th December 2005, 16:16
megui restyling is near completion:
http://files.x264.nl/Sharktooth/megui/megui-styledpix/1.pnghttp://files.x264.nl/Sharktooth/megui/megui-styledpix/3.png
http://files.x264.nl/Sharktooth/megui/megui-styledpix/2.png

Kostarum Rex Persia
8th December 2005, 16:24
It's looks very very nice, Sharktooth.

When you will include all missing options to vfw?

Sharktooth
8th December 2005, 16:32
It's looks very very nice, Sharktooth.
Im working on integrating ms-styles (both from windows and user defined) on MeGUI.
I still have to write a configuration dialog for styles and save them in the MeGUI configuration file...

When you will include all missing options to vfw?
Sorry but i'm not going to add anything to VFW at this time.

charleski
8th December 2005, 16:33
When you will include all missing options to vfw?What missing options?

Sharktooth
8th December 2005, 16:46
What missing options?
He meant VFW has less options than CLI. MeGUI has everything.
x264 --no-fast-pskip would be helpfull (and MeGUI lacks it) though, it helps removing blocks in "bluesky".

Kostarum Rex Persia
8th December 2005, 17:04
Sorry but i'm not going to add anything to VFW at this time.

Ok, thank you for information. But, when, then. After new year? :(

Sharktooth
8th December 2005, 17:29
Maybe never. However you can still use CLI with MeGUI-x264 (or full) and AVC2AVI (both included in my builds) to have a perfectly working AVI file.

dimzon
8th December 2005, 17:38
<offtopic>
Does anybody use http://www.jetbrains.com/img/resharper1_5.gif - The Most Intelligent Add-In To VisualStudio.NET (http://www.jetbrains.com/resharper/) ???

ReSharper makes C# development a real pleasure. It decreases the time you spend on routine, repetitive handwork, giving you more time to focus on the task at hand. Its robust set of features for automatic error-checking and code correction cuts development time and increases your efficiency. You'll find that ReSharper quickly pays back its cost in increased developer productivity and improved code quality.

Sharktooth
8th December 2005, 17:51
no coz it's $$$ware and i'm not sure it's compatible with vs2005.

dimzon
8th December 2005, 17:53
it's compatible with vs2005.
It's only for VS.NET 2003!
Evaluate it for a month - it's really great tool!

Sharktooth
8th December 2005, 17:57
well... i use vs2005 express for MeGUI and vs2005 pro (licensed) for my company projects.
so, i think i should wait for a R# update.

dimzon
8th December 2005, 17:58
well... i use vs2005 express for MeGUI and vs2005 pro (licensed) for my company projects.
so, i think i should wait for a R# update.
I still use vs2003 (waiting for R# update) :)

dimzon
8th December 2005, 18:04
well... i use vs2005 express for MeGUI and vs2005 pro (licensed) for my company projects.
so, i think i should wait for a R# update.
2.0 Beta (supports VS2005) (http://www.jetbrains.net/confluence/display/ReSharper/Download)

dimzon
8th December 2005, 18:42
Hi! I'm trying to create workspace on www.gotdotnet.com for MeGUI development. Is this workspace licence text acceptable?

MeGUI by Doom9 and Doom9 Forum Community
Copyright (C) Doom9, http://www.doom9.org/, http://forum.doom9.org/

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Or visit http://www.gnu.org/copyleft/gpl.html


Once Workspace has been created, this license cannot be changed.

charleski
8th December 2005, 22:51
I'm working on rationalising and consolidating the tristate GUI code in x264ConfigurationDialog (which is a real PITA) and came across this:

switch (avcProfile.SelectedIndex)
{
...
case 2: // high profile, enable everything
...
if (!quantizerMatrixGroupbox.Enabled)
quantizerMatrixGroupbox.Enabled = false;
Shouldn't that be set to true? I've never used custom quantizer matrices, are they still off-limits?

[edit]nvm, I see it gets set to true lower down in the same case statement...

Is trellis restricted to High Profile?

foxyshadis
9th December 2005, 00:01
Sharktooth: Do you already have plans for rearranging the panels? I have partial ideas on a redesign, but I don't want to waste time on a mockup if you already have your own first.

dimzon
9th December 2005, 11:05
BeHappy is now hosted on www.gotdotnet.com !
Check my signature :cool:

Doom9
9th December 2005, 12:19
@foxyshadis: I tend to think that input is always welcome, and you can never rule out the possibility that whatever you come up with will just be shrugged aside..

Is trellis restricted to High Profile?No, but I think it needs CABAC. You can check what the cabac checkbox does, if there's any interconnection that onCheckedChanged event would be where dependency code would sit.

Sharktooth
9th December 2005, 15:04
I'm working on rationalising and consolidating the tristate GUI code in x264ConfigurationDialog (which is a real PITA) and came across this:

switch (avcProfile.SelectedIndex)
{
...
case 2: // high profile, enable everything
...
if (!quantizerMatrixGroupbox.Enabled)
quantizerMatrixGroupbox.Enabled = false;
Shouldn't that be set to true? I've never used custom quantizer matrices, are they still off-limits?

[edit]nvm, I see it gets set to true lower down in the same case statement...

Is trellis restricted to High Profile?

trellis is cabac dependant. i've already added the correct code for trellis tri-state in a previous patch though.

Sharktooth
9th December 2005, 17:31
Just a note. Next x264 builds will no longer "sport" Adaptive Quantization, coz the bluesky issue can be fixed with --no-fast-pskip (it also gives better quality)
so AQ can be removed in favour of this new option.

Sharktooth
9th December 2005, 19:46
Added NoFastPSkip x264 CLI option (fixes the BlueSky blocking bug and some other loss of details at the cost of encoding speed).
Removed Adaptive Quantization (no longer needed).

patch: http://files.x264.nl/Sharktooth/force.php?file=./megui/megui_nofastpskip_patch.7z

1.1 NET bins: http://files.x264.nl/Sharktooth/force.php?file=./megui/megui_0.2.3.1020_nofastpskip.7z

puffpio
9th December 2005, 21:03
the bins link doesn't work

Sharktooth
9th December 2005, 21:07
fixed... the "+" char isnt parsed correctly by the force.php script... :)

puffpio
9th December 2005, 21:12
thanks!

Sharktooth
9th December 2005, 22:10
Sharktooth: Do you already have plans for rearranging the panels? I have partial ideas on a redesign, but I don't want to waste time on a mockup if you already have your own first.
no... :)

foxyshadis
10th December 2005, 00:19
Isn't AQ useful for more than just the block-mismatches though? I thought it also reduced storage size for more-or-less solid blocks without noticable quality loss. Or does no-fast-pskip do that as well?

charleski
10th December 2005, 01:25
0.2.3.1021 9 Dec 2005
Added a size check to the video player resizing routine to prevent scaling out of the host form boundaries.
Consolidated and rationalised the tri-state dependencies in the x264 Config GUI.
Added Sharktooth's No Fast P-Skip option and removed AQ from x264 Config

Changed Files (http://homepages.nildram.co.uk/~cajking/MeGUI/MeGUI-src.ChngdFls_0.2.3.1021.rar)
Bins (http://homepages.nildram.co.uk/~cajking/MeGUI/MeGUI.NETv1.1.Bins_0.2.3.1021.rar)

Consolidating all the GUI dependencies in the x264 Config dialog was a major pain. I've tested as much of it as I could think of, but please check that everything's been caught properly.

Doom9
10th December 2005, 03:05
Consolidating all the GUI dependencies in the x264 Config dialog was a major pain. You betcha.. guess why I never did it.. the mere prospect of it had me put development on hold indefinitely. I'm really glad you guys are picking off the slack

Pasqui
10th December 2005, 12:45
Using MeGUI 0.2.3.1021, in x264 configuration panel, I8x8 High Profile macroblock option is always unchecked. When I check it and close the panel before reopening it, it goes back to unchecked state.

charleski
10th December 2005, 13:29
Thanks for checking, I thought I'd got the logic right, but it goes back to unchecked on re-opening. I'll fix that in the next patch.
Please check for any other combination of events that set the options incorrectly.

[Edit]Found the bug - ordering of the components on intialisation matters and i hadn't altered that accordingly

Entire source (http://homepages.nildram.co.uk/~cajking/MeGUI/MeGUI-src.0.2.3.1022.rar)
Changed files (http://homepages.nildram.co.uk/~cajking/MeGUI/MeGUI-src.ChngdFls_0.2.3.1022.rar)
Bins (http://homepages.nildram.co.uk/~cajking/MeGUI/MeGUI.NETv1.1.Bins_0.2.3.1022.rar)

Sharktooth
10th December 2005, 23:41
Uhm, would it be hard to add the WinAMP AAC+ encoder support to MeGUI?

Doom9
11th December 2005, 00:20
Found the bug - ordering of the components on intialisation matters and i hadn't altered that accordinglyDon't you disable event firing, or at least use of the tri-state checking method during initialization? If you do, you won't have to bother about the order anymore, at the end of loading any settings you trigger the method once with event firing still set so that any GUI changes won't trigger the method again, and there you have it.

Uhm, would it be hard to add the WinAMP AAC+ encoder support to MeGUI?Adding additional encoders is kinda annoying because changes go quite far. And when looking at audio, it might be worth looking into the whole bepipe idea.. that offers a whole new realm of possibilities and the possibility to redesign the audio part (perhaps we should just have two audio codecs, and some settings that decide which encoder is going to be used in the end)

bond
11th December 2005, 01:04
Uhm, would it be hard to add the WinAMP AAC+ encoder support to MeGUI?ic people jumping on winamp, but did anyone actually ever made a comparison showing that winamp aac is any good? if yes, any link, so i can read this up myself?

Sharktooth
11th December 2005, 04:51
Hydrogen audio did (can't find the link though), and the winamp AAC+ encoder is really good.

charleski
11th December 2005, 13:01
0.2.3.1023 11 Dec 2005
Fixed a bug in generation of turbo 1st pass job in automated 2(or 3)-pass mode.

Changed Files (http://homepages.nildram.co.uk/~cajking/MeGUI/MeGUI-src.ChngdFls_0.2.3.1023.rar)
Bins (http://homepages.nildram.co.uk/~cajking/MeGUI/MeGUI.NETv1.1.Bins_0.2.3.1023.rar)

bond
11th December 2005, 13:24
Hydrogen audio did (can't find the link though), and the winamp AAC+ encoder is really good.i guess i found it:
http://www.hydrogenaudio.org/forums/index.php?showtopic=36868

seems like coding techs he-aac codec, the same way as real's freely available he-aac codec, stumbs nero he-aac to the ground at 64kbps (another proove that nero isnt really a that good aac encoder)

Sharktooth
11th December 2005, 16:05
nero has excellent quality @ 128kbps but not on low bitrates.
the new aac-he2 encoder r0x hard though and it's even better than winamp (but it's not free).

Sirber
11th December 2005, 16:16
@Shark

url?

Sharktooth
11th December 2005, 16:20
Included in Nero7 web release.

@devs: well... i'll add the new nero7 encoder support.

bond
11th December 2005, 16:44
nero has excellent quality @ 128kbps but not on low bitrates.well seems "excellent quality" is not good enough:

according to guru apple beats nero also clearly at 128kbps as written here (http://www.hydrogenaudio.org/forums/index.php?showtopic=38792&hl=)
also even lame mp3 is clearly _better_ (yeah better) than nero aac on classical samples and only slightly worse on non-classical...
also vorbis beats it

the new aac-he2 encoder r0x hard though and it's even better than winamp (but it's not free). any listening test backing this claim or are you relying on the nero devs statements? ;)

m0rc1
12th December 2005, 00:20
The old bug that makes the bottom of the dialogs disappear when clicking on "show commandline" with hi DPI displays has returned.

Davide.

charleski
12th December 2005, 00:55
The old bug that makes the bottom of the dialogs disappear when clicking on "show commandline" with hi DPI displays has returned.

Davide.I'm running 0.2.3.1023 now and can't see any graphical glitches with Show Commandline. Could you post a picture showing this so i know what problem you're having?

Sharktooth
12th December 2005, 14:59
well seems "excellent quality" is not good enough:

according to guru apple beats nero also clearly at 128kbps as written here (http://www.hydrogenaudio.org/forums/index.php?showtopic=38792&hl=)
also even lame mp3 is clearly _better_ (yeah better) than nero aac on classical samples and only slightly worse on non-classical...
also vorbis beats it

any listening test backing this claim or are you relying on the nero devs statements? ;)
Always hydrogen audio.
In the 128k test they used the internet profile that's not quite 128kbps ABR... it's the closest possible choice though.
Vorbis is my preferred choice for audio, but it's not a choice when we use MP4 as container...

Doom9
12th December 2005, 15:50
I'm running 0.2.3.1023 now and can't see any graphical glitches with Show Commandline. Could you post a picture showing this so i know what problem you're having?It's not show commandline, it's the x264 build and switching between tabs in the main GUI if you change your resolution to 120 dpi and reboot (the reboot is mandatory, otherwise it will look just fine). Apparently, minsize at the time it is stored doesn't properly reflect the actual GUI size.

Is there a delta of all changed files since my last release? I'm still using VS 2k3 so I can't take your rar archive and open the project.
Also, what's up with that properties.rar file and all the upgradelog things?

Sagittaire
12th December 2005, 16:15
according to guru apple beats nero also clearly at 128kbps as written here
also even lame mp3 is clearly _better_ (yeah better) than nero aac on classical samples and only slightly worse on non-classical...
also vorbis beats it

And it's only test with guru's ears. Ogg Vorbis is better only and strictly only for guru's ears because it's an subjective test and because guru's ears are not universal ears (certainely good reference but not good overall reference)

Moreover since time that guru makes tests it is now able to recognize the characteristic artefact for each audio codec. It's difficult to make "blind test" if you are able to recognize the competitor ... isn't it?

charleski
12th December 2005, 17:58
The Properties directory appeared as part of the code beriiman added. I archived it in case it was important. berriman's avs-profile stuff doesn't work quite as I'd expect it to and probably needs a bit of work, but I haven't looked at the code for it. The upgradelog is just the report from conversion to VS2005.

Changes from 0.2.3.1b are here (http://homepages.nildram.co.uk/~cajking/MeGUI/meGUI.0.2.3.1023-ChangesFrom 0.2.3.1b.rar)

Sharktooth
12th December 2005, 18:33
well... that was the purpouse of merging the changed sources and publish it on x264.nl ...

edit: besweet seems to be unstable with the new nero encoder...

puffpio
12th December 2005, 20:04
yeah i think megui + besweet + nero aac = broken
I am using nero 6 aac dll's

they worked before...

here is my log

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Next job job1 is an audio job. besweet commandline:
"C:\Program Files\besweet\BeSweet.exe" -core( -input "C:\work\fc\Formula Continental0001.ac3" -output "C:\work\fc\Formula Continental0001.mp4" -logfile "C:\work\fc\Formula Continental0001.besweet.log" ) -azid( -s stereo -c normal -L -3db ) -bsn( -2ch -vbr_streaming -codecquality_high -aacprofile_he ) -ota( -g max )
successfully set up audio encoder and callbacks for job job1
----------------------------------------------------------------------------------------------------------

Log for job job1

besweet: "C:\Program Files\besweet\BeSweet.exe" -core( -input "C:\work\fc\Formula Continental0001.ac3" -output "C:\work\fc\Formula Continental0001.mp4" -logfile "C:\work\fc\Formula Continental0001.besweet.log" ) -azid( -s stereo -c normal -L -3db ) -bsn( -2ch -vbr_streaming -codecquality_high -aacprofile_he ) -ota( -g max )


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

and here is the besweet log

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

BeSweet v1.5b31 by DSPguru.
--------------------------
Using azid.dll v1.9 (b922) by Midas (midas@egon.gyaloglo.hu).
Using Shibatch.dll v0.25 by Naoki Shibata & DSPguru (shibatch.sourceforge.net).
Using bsn.dll v0.24 by DPeshev,Richard,E-Male,DSPguru (DSPguru.Doom9.org).

Logging start : 12/12/05 , 11:03:49.

C:\Program Files\besweet\BeSweet.exe -core( -input C:\work\fc\Formula Continental0001.ac3 -output C:\work\fc\Formula Continental0001.mp4 -logfile C:\work\fc\Formula Continental0001.besweet.log ) -azid( -s stereo -c normal -L -3db ) -bsn( -2ch -vbr_streaming -codecquality_high -aacprofile_he ) -ota( -g max )

[00:00:00:000] +------- BeSweet -----
[00:00:00:000] | Input : C:\work\fc\Formula Continental0001.ac3
[00:00:00:000] | Output: C:\work\fc\Formula Continental0001.mp4
[00:00:00:000] | Floating-Point Process: No

Doom9
12th December 2005, 20:31
@puffpio: go to the commandprompt, paste the following and post everything you see on screen here:

"C:\Program Files\besweet\BeSweet.exe" -core( -input "C:\work\fc\Formula Continental0001.ac3" -output "C:\work\fc\Formula Continental0001.mp4" -logfile "C:\work\fc\Formula Continental0001.besweet.log" ) -azid( -s stereo -c normal -L -3db ) -bsn( -2ch -vbr_streaming -codecquality_high -aacprofile_he ) -ota( -g max )

puffpio
12th December 2005, 20:36
results of that:

-=-==-=-=-=-=-=-=-=-=-=-
C:\work\fc>"C:\Program Files\besweet\BeSweet.exe" -core( -input "C:\work\fc\Form
ula Continental0001.ac3" -output "C:\work\fc\Formula Continental0001.mp4" -logfi
le "C:\work\fc\Formula Continental0001.besweet.log" ) -azid( -s stereo -c normal
-L -3db ) -bsn( -2ch -vbr_streaming -codecquality_high -aacprofile_he ) -ota( -
g max )
BeSweet v1.5b31 by DSPguru.
--------------------------

SR: 48000, Table idx: 8 - start 13, stop 11

C:\work\fc>

-=-=-=-=-=-=-=-=-=-=-=-

besweet log file looks the same.

I have the 2 nero dll's in the besweet directory...and also in program files\common files\ahead\audioplugins

so unsure what is happening...i did notice that when setting the besweet directory in the megui settings window, it used to popup a dialog box telling me to make sure the dll's where in the besweet directory twice (for the 2 different aac encoders). Now it only pops up once for the OTHER aac encoder..not the nero ones

puffpio
12th December 2005, 21:03
on further thought...it may be my installation that is screwed up..because I copied those nero aac dll's from one computer to another..do the dll's need to be registered?

I tried the audio encoding on the original computer and it worked

charleski
12th December 2005, 21:06
on further thought...it may be my installation that is screwed up..because I copied those nero aac dll's from one computer to another..do the dll's need to be registered?I'm pretty sure they look for a valid SN.

puffpio
12th December 2005, 21:08
I'm pretty sure they look for a valid SN.
well..there's my answer!

m0rc1
13th December 2005, 02:42
I'm running 0.2.3.1023 now and can't see any graphical glitches with Show Commandline. Could you post a picture showing this so i know what problem you're having?

I'm using 0.2.3.1b.
This is an old bug which seems to resurface from time to time, I already contributed a patch for it some month ago.
In some of the dialogs (for example XVID config) if you click on "Show commandline" using a >96 DPI video mode the dialog, insted to extend to accomodate the command line options, gets cut (this was because the resizing code was using absolute sizes instead of relatives ones, I haven't checked the new code now but I guess this is the same problem).
Other dialogs (like AVC config) are fine.

Davide.

Doom9
13th December 2005, 09:31
In some of the dialogs (for example XVID config) If somebody only mentioned that they were experiencing this in config dialog X and not Y, that would've been a huge help. Both charleski and myself only tested once, found it working and concluded what you're saying is simply not true. If you'd given details from the getgo, that would've got us thinking a bit more ;)

look for
private void commandlineVisible_CheckedChanged(object sender, System.EventArgs e)
{
if (commandlineVisible.Checked)
{
this.Size = new Size(this.Width, 588);
this.showCommandLine();
}
else
{
this.Size = new Size(this.Width, 524);
}
}In the commandline region of every configuration dialog
If it contains these numbers, you need to replace it with

private void showCommandline_CheckedChanged(object sender, System.EventArgs e)
{
if (showCommandline.Checked)
{
this.Size = new Size(this.Width, this.Height + commandline.Height + 10);
disableCommandlineGeneration = false;
showCommandLine();
}
else
{
disableCommandlineGeneration = true;
this.Size = new Size(this.Width, this.Height - commandline.Height - 10);
}
}
[

The x264 config dialog is already okay, as is the faac dialog, the others all need this change to make it work with granny fonts.

I'm not sure what causes the problems in the x246 build barring sourcode I can build, I can't test. I experienced the same with my own latest release, but changing the dpi and recompiling I suddenly had a build that worked.

Sharktooth
13th December 2005, 14:53
i'm doing it.
i'm also adding --no-fast-pskip to the "turbo" exclusions.

Sharktooth
13th December 2005, 15:17
changed sources: http://files.x264.nl/Sharktooth/?dir=./megui

Doom9
13th December 2005, 15:32
umm.. I downloaded your MeGUI-src.ChngdFls_0.2.3.1023.rar and put it into a directory where I previously put the 0.2.3.1b source. Is there just no way for us people with VS2k3?

Sharktooth
13th December 2005, 15:35
it should work ?!?
what's wrong?
In that way i can even convert the project to Sharp Develop.

charleski
13th December 2005, 15:49
The changes since 0.2.3.1b have included a few extra files. You might need to add them to your existing project, but that's easy enough.

Doom9
13th December 2005, 16:26
VS2k3 says: Unable to read the project file 'MeGUI.csproj'. The file 'D:\MeGUI\MeGUI.csproj' is not a valid project file. The project file is missing the 'VisualStudioProject' section.

charleski
13th December 2005, 16:40
Well I don't use VS2k3, but I'd have thought the way to integrate them would be to create a directory with just the old 0.2.3.1b files (including the old .csproj/.suo/.sln etc files) - that should load into VS2k3 since it created the .csproj itself. Then just copy the .cs files over from the new build and insert them into the project from within VS2k3.

Sharktooth
13th December 2005, 17:10
that's exactly the way i suggested (and how i do it).

Doom9
13th December 2005, 23:26
here's something that might be useful for weird errors that people sometimes report: keep all the data read from stdout and stderr in a buffer that's discarded when the process properly completes, but dump it in case of an abort (or offer to abort it, or via a setting) so that we know what actually happened behind the scenes.

Sharktooth
14th December 2005, 14:10
new patch: 0.2.3.1023b adds wpredb to the turbo exclusions list.
sources and bins are here: http://files.x264.nl/Sharktooth/?dir=./megui

also superdump told me 29.97FPS is 30000/1001 (thats 29.97002997002997...).
so this part:
if (this.muxFPS.SelectedIndex != -1)
job.Settings.Framerate = Double.Parse(muxFPS.Text);
if (this.muxFPS.SelectedIndex != -1 || isInputMP4())
{
if (this.enableSplit.Checked && !splitSize.Text.Equals(""))
job.Settings.SplitSize = Int32.Parse(this.splitSize.Text) * 1024;
job.Commandline = gen.generateMP4BoxCommandline(this.settings.Mp4boxPath, job.Settings, job.Input, job.Output);
}
should be rewritten to accomodate that change.
I'll do it in the next patch.

dimzon
14th December 2005, 14:19
also superdump told me 29.97FPS is 30000/1001 (thats 29.97002997002997...).
Can anybody tell me why not just 2997/100 ?

Sharktooth
14th December 2005, 14:22
coz 2997/1000 produces a 1 frame desync every 10 hours that's about 33ms.

redfordxx
14th December 2005, 14:34
Can anybody tell me why not just 2997/100 ?
Standard could be 30fps and 24fps or 30000fpms and 24000fpms.
But for some reason both was it divided by 1.001. I read some article on net, can't remember the reason, only remember the reason was mentioned as a stupid one.
So the standard aproximation is 23.976 and 29.97.

Doom9
14th December 2005, 15:08
umm.. I'd liek to see a reason for making any change to the framerate other than irrelevant technicalities (1 frame every 10 hours is irrelevant.. you don't encode a 10 hour bit as one piece). And it stands to be proven that mp4box even accepts such inputs and handles them properly.

Sharktooth
15th December 2005, 03:19
well... four line of code are not really a problem...
just adding:
if (this.muxFPS.SelectedIndex == 0)
job.Settings.Framerate = 24000/1001;
if (this.muxFPS.SelectedIndex == 3)
job.Settings.Framerate = 30000/1001;
should do the trick.

Doom9
15th December 2005, 18:44
still waiting to see any proof that my code is flawed in any way. If I look at my AviSynth scripts from DVDs, they all have a precise framerate of 23.976.. so muxing at any other framerate is going to cause problems, not the other way round.

tritical
16th December 2005, 12:55
Sorry if this is somewhat off topic, but an avisynth script with dvd source using dvd2avi/mpeg2decX or dgindex/dgdecode for decoding will have a framerate of 29.970 and not 30000/1001 because mpeg2decX/dgdecode have always set it that way. Actually, what happens is that dvd2avi and dgindex pick up the correct rate (30000/1001, 24000/1001, etc...), but when they write the framerate into the d2v file they multiply it up by 1000 and then round to int. mpeg2decX/dgdecode then set the framerate in avisynth by using the value in the d2v file as the numerator and 1000 for the denominator. The more interesting thing is that mpeg2decX and dgdecode (prior to version 1.4 or 1.4.1, can't remember exactly) had an internal maximum number of frames of 1,000,000... which if you calculate it out is the exact point that you end up with a 1 frame desync from using 29.970 instead of 30000/1001. An assumefps(30000,1001) or assumefps(24000,1001) in the avs file can fix the discrepancy... I think this was once on the list of things to be fixed in dgdecode but might have gotten lost somewhere along the way.

m0rc1
16th December 2005, 15:24
If somebody only mentioned that they were experiencing this in config dialog X and not Y, that would've been a huge help.

Sorry about that, but I had not realized it myself (until it was too late).

Davide.

haubrija
16th December 2005, 16:58
Hey fellas,

This is an issue I've had for awhile but I kept forgeting to post my log. Upon completing an automated 2pass or 3pass, the muxjob always appears to try to run twice. Its not that big of an inconvenience coz my file comes out fine but it is an issue nonethless. Here is a job I ran last nite and that shows the symptoms of the issue.

Generating jobs. Desired size: 393216000 bytes
Setting desired size of video to 393216000 bytes
Next job job1-1 is an audio job. besweet commandline:
"C:\MP4 Encoding\BeSweetv1.5b29\besweet.exe" -core( -input "D:\In the Cards\1 T01 3_2ch 448Kbps DELAY 0ms.ac3" -output "D:\In the Cards\audio.mp4" -logfile "D:\In the Cards\audio.besweet.log" ) -azid( -s dplii -c normal -L -3db ) -bsn( -2ch -vbr_extreme -codecquality_high -aacprofile_he ) -ota( -g max )
successfully set up audio encoder and callbacks for job job1-1
----------------------------------------------------------------------------------------------------------

Log for job job1-1

besweet: "C:\MP4 Encoding\BeSweetv1.5b29\besweet.exe" -core( -input "D:\In the Cards\1 T01 3_2ch 448Kbps DELAY 0ms.ac3" -output "D:\In the Cards\audio.mp4" -logfile "D:\In the Cards\audio.besweet.log" ) -azid( -s dplii -c normal -L -3db ) -bsn( -2ch -vbr_extreme -codecquality_high -aacprofile_he ) -ota( -g max )

BeSweet v1.5b30 by DSPguru.
--------------------------

[00:00:00:000] Initializing...
[00:00:00:000] -- Initializing...

[00:45:27:328] |

SR: 48000, Table idx: 6 - start 12, stop 8
SR: 48000, Table idx: 6 - start 12, stop 8
[00:45:27:328] Finalizing...
[00:45:27:328] Conversion Completed !

----------------------------------------------------------------------------------------------------------
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 393216000 bytes and video bitrate of 700 kbit/s
Third pass job found: job1-4
The size of the first audio track is 39089845 bytes
Desired video size after substracting audio size is 345162Setting the desired bitrate of the subsequent video jobs to 1036 kbit/s
Next job job1-2 is a video job. encoder commandline:
"C:\MP4 Encoding\x264.exe" --pass 1 --bitrate 1036 --stats "D:\In the Cards\1.stats" --bframes 3 --b-pyramid --subme 1 --analyse none --qpstep 1 --me dia --progress --no-psnr --output NUL "D:\In the Cards\1.avs"
successfully set up video encoder and callbacks for job job1-2
----------------------------------------------------------------------------------------------------------

Log for job job1-2

avis [info]: 640x480 @ 23.98 fps (65390 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE 3DNow!
x264 [info]: slice I:445 Avg QP:16.40 size: 32125
x264 [info]: slice P:19188 Avg QP:18.29 size: 10818
x264 [info]: slice B:45757 Avg QP:20.08 size: 2870
x264 [info]: mb I I16..4: 32.7% 0.0% 67.3%
x264 [info]: mb P I16..4: 15.2% 0.0% 0.0% P16..4: 70.1% 0.0% 0.0% 0.0% 0.0% skip:14.7%
x264 [info]: mb B I16..4: 0.8% 0.0% 0.0% B16..8: 50.8% 0.0% 0.0% direct:10.1% skip:38.2%
x264 [info]: final ratefactor: 19.79
x264 [info]: kb/s:1036.1

Actual bitrate after encoding without container overhead: 1036.16

----------------------------------------------------------------------------------------------------------
job job1-2 has been processed. This job is linked to the next job: job1-3
Next job job1-3 is a video job. encoder commandline:
"C:\MP4 Encoding\x264.exe" --pass 3 --bitrate 1036 --stats "D:\In the Cards\1.stats" --ref 5 --mixed-refs --bframes 3 --b-pyramid --subme 6 --b-rdo --weightb --trellis 2 --analyse all --8x8dct --qpstep 1 --progress --no-psnr --output "D:\In the Cards\video.mp4" "D:\In the Cards\1.avs"
successfully set up video encoder and callbacks for job job1-3
----------------------------------------------------------------------------------------------------------

Log for job job1-3

avis [info]: 640x480 @ 23.98 fps (65390 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE 3DNow!
mp4 [info]: initial delay 250 (scale 2997)
x264 [info]: slice I:445 Avg QP:15.93 size: 30550
x264 [info]: slice P:19188 Avg QP:17.66 size: 10460
x264 [info]: slice B:45757 Avg QP:19.45 size: 3036
x264 [info]: mb I I16..4: 17.1% 53.2% 29.7%
x264 [info]: mb P I16..4: 3.6% 8.1% 2.3% P16..4: 48.0% 16.9% 6.5% 0.3% 0.1% skip:14.3%
x264 [info]: mb B I16..4: 0.1% 0.5% 0.1% B16..8: 48.5% 1.2% 1.3% direct: 1.3% skip:46.9%
x264 [info]: 8x8 transform intra:58.4% inter:51.8%
x264 [info]: ref P 65.2% 17.8% 8.6% 4.4% 3.9%
x264 [info]: ref B 83.1% 11.5% 3.1% 1.4% 0.9%
x264 [info]: kb/s:1036.0

Actual bitrate after encoding without container overhead: 1036.09
desired video bitrate of this job: 1036 kbit/s - obtained video bitrate: 1038.381594797 kbit/s
----------------------------------------------------------------------------------------------------------
job job1-3 has been processed. This job is linked to the next job: job1-4
Next job job1-4 is a video job. encoder commandline:
"C:\MP4 Encoding\x264.exe" --pass 3 --bitrate 1036 --stats "D:\In the Cards\1.stats" --ref 5 --mixed-refs --bframes 3 --b-pyramid --subme 6 --b-rdo --weightb --trellis 2 --analyse all --8x8dct --qpstep 1 --progress --no-psnr --output "D:\In the Cards\video.mp4" "D:\In the Cards\1.avs"
successfully set up video encoder and callbacks for job job1-4
----------------------------------------------------------------------------------------------------------

Log for job job1-4

avis [info]: 640x480 @ 23.98 fps (65390 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE 3DNow!
mp4 [info]: initial delay 250 (scale 2997)
x264 [info]: slice I:445 Avg QP:16.14 size: 29742
x264 [info]: slice P:19188 Avg QP:17.70 size: 10426
x264 [info]: slice B:45757 Avg QP:19.47 size: 3058
x264 [info]: mb I I16..4: 17.1% 54.1% 28.8%
x264 [info]: mb P I16..4: 3.5% 8.1% 2.2% P16..4: 47.9% 16.8% 6.4% 0.3% 0.1% skip:14.7%
x264 [info]: mb B I16..4: 0.1% 0.5% 0.1% B16..8: 48.3% 1.2% 1.3% direct: 1.3% skip:47.1%
x264 [info]: 8x8 transform intra:58.6% inter:51.8%
x264 [info]: ref P 65.3% 17.8% 8.6% 4.4% 3.9%
x264 [info]: ref B 83.2% 11.5% 3.1% 1.4% 0.9%
x264 [info]: kb/s:1036.0

Actual bitrate after encoding without container overhead: 1036.05
desired video bitrate of this job: 1036 kbit/s - obtained video bitrate: 1038.34729580719 kbit/s
----------------------------------------------------------------------------------------------------------
job job1-4 has been processed. This job is linked to the next job: job1-5
Next job job1-5 is a mux job. mp4box commandline:
"C:\MP4 Encoding\mp4box.exe" -add "D:\In the Cards\video.mp4" -add "D:\In the Cards\audio.mp4" -chap "D:\In the Cards\VTS_02 - Chapter Information - OGG.txt" -fps 23.976 -new "D:\5x25 - In the Cards.mp4"
successfully set up muxer and callbacks for job job1-5
----------------------------------------------------------------------------------------------------------

Log for job job1-5

IsoMedia import - track ID 1 - Video (size 640 x 480)
IsoMedia import - track ID 1 - HE-AAC (SR 24000 - SBR-SR 48000 - 2 channels)
IsoMedia import - track ID 2 - media type "odsm:mp4s"
IsoMedia import - track ID 3 - media type "sdsm:mp4s"
Saving D:\5x25 - In the Cards.mp4: 0.500 secs Interleaving

----------------------------------------------------------------------------------------------------------
Muxjob ended and deletion of intermediate files is activated
----------------------------------------------------------------------------------------------------------

Log for job job1-5

IsoMedia import - track ID 1 - Video (size 640 x 480)
IsoMedia import - track ID 1 - HE-AAC (SR 24000 - SBR-SR 48000 - 2 channels)
IsoMedia import - track ID 2 - media type "odsm:mp4s"
IsoMedia import - track ID 3 - media type "sdsm:mp4s"
Saving D:\5x25 - In the Cards.mp4: 0.500 secs Interleaving
an exception ocurred when trying to read from stdout: Object reference not set to an instance of an object.
----------------------------------------------------------------------------------------------------------
The current job contains errors. Skipping chained jobs
Muxjob ended and deletion of intermediate files is activated

Doom9
16th December 2005, 17:02
@haubrija: am I correct to assume that the only jobs you have in the queue are those 5 and that you have not done any moving around, deleting of existing jobs, or anything the like? If you have, please share the complete contents of your jobs directory (zip and attach please).

Also, after the mux job runs for the first time, what is the status of the job in the queue? You can prevent the second start if while muxing you press stop.. this will stop the queue.

haubrija
16th December 2005, 18:26
@haubrija: am I correct to assume that the only jobs you have in the queue are those 5 and that you have not done any moving around, deleting of existing jobs, or anything the like? If you have, please share the complete contents of your jobs directory (zip and attach please).

Also, after the mux job runs for the first time, what is the status of the job in the queue? You can prevent the second start if while muxing you press stop.. this will stop the queue.

Doom9,

No messing around with my jobs. I set up the auto 3 pass mode and press start. That's it. No reason to move jobs. So your assumption was correct.

I'm not really sure I understand your second question. I run my encoding on a seperate machine that I'm not in front of while its encoding so I'm not entirely sure what the status of the jobs are while running.

Doom9
16th December 2005, 18:33
well.. I need you there at the end of the third pass so that when muxing starts, you can press stop and see what happens. But muxing only takes a few minutes. In fact, if the intermediary files are still there, you could just double click on job 1-5 to reactivate it, and run it again, see what happens then.

haubrija
16th December 2005, 18:34
Ok... at work right now but will run a short test tommorrow and test my findings

m0rc1
19th December 2005, 00:25
This may well be way off topic but I don't know where else to ask for it: the AviReader class used in MeGUI is part of a larger library or has been written from scratch (I'm asking since I'd need its complementary AviWriter class - I'm writing a small app to convert movie files for the pocketpc).

Thanks,
Davide.

Doom9
19th December 2005, 00:51
the AviReader class used in MeGUI is part of a larger library or has been written from scratchmohita, author of mpeg4modifier (http://forum.doom9.org/showthread.php?t=78050) submitted it when I asked for a way to open avisynth files in C#. mpeg4modifier also needs to write files, so perhaps that'll help you. Keep in mind though, GPL means your project also needs to be released under the GPL.

You can also find a lot of info on codeproject: http://www.codeproject.com/cs/media/aviFileWrapper.asp

Sharktooth
19th December 2005, 20:41
I added the support for the latest Nero encoder (the one in the 7.0.1.x).
Parametric stereo gets automatically enabled for CBR modes under 48kbps (included) and for "Tape" and "Radio" VBR presets.
Sources are here (including the precedent fixes): http://files.x264.nl/Sharktooth/?dir=./megui/Sources
Binaries here: http://files.x264.nl/Sharktooth/?dir=./megui/Binaries

m0rc1
19th December 2005, 20:46
mohita, author of mpeg4modifier (http://forum.doom9.org/showthread.php?t=78050) submitted it when I asked for a way to open avisynth files in C#. mpeg4modifier also needs to write files, so perhaps that'll help you. Keep in mind though, GPL means your project also needs to be released under the GPL.
I know that very well.
And I'm with you when you say that open source software is the only way to ensure a long life to your backup software.
You can also find a lot of info on codeproject: http://www.codeproject.com/cs/media/aviFileWrapper.asp
This is what I'm using now but I'm having a lot of troubles writing compressed audio streams and reading avisynth scripts (something I can do with AviReaded most, but not all, of the times).

Davide.

Sharktooth
19th December 2005, 21:44
w00ps... fixed a bug in VBR command line generation (a missing "space") :)
MeGUI-x264 and MeGUI-x264-svn were not affected by that...
sources (0.2.1.1023d): http://files.x264.nl/Sharktooth/?dir=./megui/Sources
bins (0.2.1.1023d): http://files.x264.nl/Sharktooth/?dir=./megui/Binaries

Sharktooth
19th December 2005, 23:20
some goodies...
http://www.webalice.it/f.corriga/temp/main.png http://www.webalice.it/f.corriga/temp/x264config.png

acidsex
19th December 2005, 23:28
Thats tight dude. Is that available in the latest bins?

klicker4546
19th December 2005, 23:29
How about this??? System.FormatException was caught
Message="Input string was not in a correct format."
Source="mscorlib"
StackTrace:
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Int32.Parse(String s)
at MeGUI.VideoEncoder.getFPS(String line) in D:\megui_src\VideoEncoder.cs:line 516
at MeGUI.VideoEncoder.mencoderEncoding() in D:\megui_src\VideoEncoder.cs:line 271
;)

w00ps... fixed a bug in VBR command line generation (a missing "space") :)
MeGUI-x264 and MeGUI-x264-svn were not affected by that...
sources (0.2.1.1023d): http://files.x264.nl/Sharktooth/?dir=./megui/Sources
bins (0.2.1.1023d): http://files.x264.nl/Sharktooth/?dir=./megui/Binaries

Kostarum Rex Persia
19th December 2005, 23:30
Wow, Sharktooth, you are genius, indeed. Nice work.

One question: is NAAC Nero HE-AAC v2 audio codec?

Can you tell us, what is your further plans with MeGUI new look.

Sharktooth
19th December 2005, 23:30
@acidsex: not yet, im still having some troubles with loading the msstyles.
i didnt also finish the "Select skin" dialog.

@KRP: yes.
MeGUI will have a set of skins based on msstyles. that requires full styles and external fonts. just like changing the style in winxp.
also, i'll bypass the signature check so you can use non-official MS styles. Those styles will be completely unbound or bound (your choice) from the actual windows style.

@klicker4546: i'll look at it.

Sharktooth
20th December 2005, 15:56
0.2.1.1023e: some little changes to fix the dialogs with Segoe font (Windows Vista default font).

0.2.1.1023f: more fixes for Vista...

sources (including the previous fixes): http://files.x264.nl/Sharktooth/?dir=./megui/Sources
bins: http://files.x264.nl/Sharktooth/?dir=./megui/Binaries

klicker4546
20th December 2005, 19:30
Hi Sharktooth,

how about the bugs I reported? Do you plan to fix them too?



0.2.1.1023e: some little changes to fix the dialogs with Segoe font (Windows Vista default font).

0.2.1.1023f: more fixes for Vista...

sources (including the previous fixes): http://files.x264.nl/Sharktooth/?dir=./megui/Sources
bins: http://files.x264.nl/Sharktooth/?dir=./megui/Binaries

Sharktooth
20th December 2005, 19:34
when do they happen?
can you post a more detailed log?

klicker4546
20th December 2005, 19:45
Maybe you look here for further reference:


http://forum.doom9.org/showthread.php?p=750857#post750857

I've already tried to debug it with the help of doom9. But I haven't heard anything of him after my last post.

And... uhmm... I didn't mean to be rude or anything. :o


when do they happen?
can you post a more detailed log?

Sharktooth
20th December 2005, 19:52
try contacting doom9 by PM.

klicker4546
20th December 2005, 19:55
Ok, that's what I will do. Thanks anyway.

try contacting doom9 by PM.

Doom9
21st December 2005, 00:10
Alright, found and fixed the problem. It seems mencoder now indicates fps using 2 digits after the decimal point and my fps parsing code was written to handle integer fps values.

I'm attaching an updated VideoEncoder and Encoder class, that also prevents some other crashes that could happen when things change and my commandline parsing can't keep up.

klicker4546
21st December 2005, 00:37
Well that's really great! Now I can enjoy my holidays! ;)

Alright, found and fixed the problem. It seems mencoder now indicates fps using 0 digits after the decimal point and my fps parsing code was written to handle integer fps values.

I'm attaching an updated VideoEncoder and Encoder class, that also prevents some other crashes that could happen when things change and my commandline parsing can't keep up.

stax76
21st December 2005, 02:11
Alright, found and fixed the problem. It seems mencoder now indicates fps using 2 digits after the decimal point and my fps parsing code was written to handle integer fps values.

Did you try the debugging method I had suggested? It breaks then in the correct line:

return (double)Int32.Parse(fps);

Otherwise the the application terminates without giving the slightest hint what's wrong.

Sharktooth
21st December 2005, 04:07
0.2.3.1023g: integrated the doom9's above patch.

sources (diff 0.2.3.1023->0.2.3.1023g): http://www.webalice.it/f.corriga/megui/megui_src_0.2.3.1023g.7z
sources (diff 0.2.3.1b->0.2.3.1023): http://www.webalice.it/f.corriga/megui/MeGUI-src.ChngdFls_0.2.3.1023.rar
sources (0.2.3.1b): http://www.webalice.it/f.corriga/megui/MeGUI-src.0.2.3.1b.rar

bins (0.2.3.1023g): http://www.webalice.it/f.corriga/megui/megui_0.2.3.1023g.7z


0.2.3.1023h: integrated this patch: http://forum.doom9.org/showthread.php?p=754853#post754853

sources (diff 0.2.3.1023->0.2.3.1023h): http://www.webalice.it/f.corriga/megui/megui_src_0.2.3.1023h.7z

bins (0.2.3.1023h): http://www.webalice.it/f.corriga/megui/megui_0.2.3.1023h.7z


Did you try the debugging method I had suggested? It breaks then in the correct line:

return (double)Int32.Parse(fps);

Otherwise the the application terminates without giving the slightest hint what's wrong.
Sorry i had no time to add it. it's 4.40AM and im quite tired. If you want (and have time to do it) you can add it. the latest source is above.

acidsex
21st December 2005, 21:17
doh. Is there something I have to do in order to get Nero 7 audio recognized? I copied the .dlls over from the Common Files Ahead directory to my besweet directory but when I que up an audio encode nothing happens when started. Any suggestions?

Sharktooth
21st December 2005, 21:22
what do you mean? You need the bsn plugin for besweet: http://corecodec.org/frs/?group_id=45&release_id=235#r235

acidsex
21st December 2005, 21:25
doh. thats what I am missing. :) Much thanks.

Doom9
21st December 2005, 21:26
Did you try the debugging method I had suggested? It breaks then in the correct line:No, I forgot about that, but I really found it very quickly.. it's a definite advantage if you've written the code. I should've already caught it looking at the contents of the line variable that was posted.. it already reveals that the encoding speed is now given with 2 decimal digits.

Sharktooth
21st December 2005, 21:28
doh... yesterday night i was so tired i thought i should have add some code for debugging...

acidsex
21st December 2005, 21:37
still did not work for me. I copied the Nero7WA.dll to my BeSweet directory and again, after queing it up and starting, the windows closely immediately and nothing gets encoded.

Sharktooth
21st December 2005, 21:39
Nero7WA.dll ??
you should copy Aac.dll, aacenc32.dll and NeroIPP.dll (if it isnt already there)...

acidsex
21st December 2005, 21:44
Before I get confused. I copied my aac.dll and aacenc32.dll from Programs\commonfiles\ahead\audio plugsins to besweet. But whenever I load up an audio file in MeGUI and queue, the window closes and nothing gets encoded.

the bsn_Nero7WA.dll was what I thought you were saying I was missing in order to use Nero 7 audio in MeGUI.

Sharktooth
21st December 2005, 21:45
it's bsn_NeroAAC.dll

acidsex
21st December 2005, 21:47
I have that (bsn_NeroAAC.dll) in my BeSweet directory also.

Sharktooth
21st December 2005, 21:48
what is the besweet version?

acidsex
21st December 2005, 21:49
v.1.5b31

Sharktooth
21st December 2005, 21:51
bsn.dll is there?

acidsex
21st December 2005, 21:52
yes it is in there.

acidsex
21st December 2005, 21:53
Now heres the funny thing. If I put my old Nero 6 aac dlls back in there I can encode with no problem.

Sharktooth
21st December 2005, 21:53
libmmd.dll ?

acidsex
21st December 2005, 21:55
Nope. Never had libmmd.dll before and they encoded fine. Is this a new file required for use of N7?

acidsex
21st December 2005, 21:56
The only libmmd.dll on my system is the one from Sony Vegas 6

Sharktooth
21st December 2005, 21:57
i have it in my besweet dir (it's needed for software compiled with the intel compiler)... however what version of Nero7 you have? Also, have you a valid serial installed?

acidsex
21st December 2005, 22:05
7.0.1.4and yes I have a valid serial. :)

Sharktooth
21st December 2005, 22:05
dunno... it should work (im actually using it).

acidsex
21st December 2005, 22:05
ok, copied the libmmd.dll to besweet directory and tried again to no avail.

Sharktooth
21st December 2005, 22:09
dunno... really.
it works here.

acidsex
21st December 2005, 22:10
my nero dlls versions are AAC.dll v 3.0.0.7 and aacenc32.dll V.4.2.2.3

Sharktooth
21st December 2005, 22:14
same versions here.

acidsex
21st December 2005, 22:15
nope not beta. did a reimage of my laptop yesterday and those were the ones that were installed from the nero 7.0.1.4 package on the web.

acidsex
21st December 2005, 22:17
Heres my log from MeGUI after I try to encode.


Next job job1 is an audio job. besweet commandline:
"C:\Documents and Settings\patrick\Desktop\megui\BeSweetv1.5b31\besweet.exe" -core( -input "C:\DETROIT_ROCK_CI\VIDEO_TS\drc T02 2_0ch 192Kbps DELAY 0ms.ac3" -output "C:\DETROIT_ROCK_CI\VIDEO_TS\drc T02 2_0ch 192Kbps DELAY 0ms.mp4" -logfile "C:\DETROIT_ROCK_CI\VIDEO_TS\drc T02 2_0ch 192Kbps DELAY 0ms.besweet.log" ) -azid( -s stereo -c normal -L -3db ) -bsn( -2ch -vbr_streaming -codecquality_high -aacprofile_he ) -ota( -g max )
successfully set up audio encoder and callbacks for job job1
----------------------------------------------------------------------------------------------------------

Log for job job1

besweet: "C:\Documents and Settings\patrick\Desktop\megui\BeSweetv1.5b31\besweet.exe" -core( -input "C:\DETROIT_ROCK_CI\VIDEO_TS\drc T02 2_0ch 192Kbps DELAY 0ms.ac3" -output "C:\DETROIT_ROCK_CI\VIDEO_TS\drc T02 2_0ch 192Kbps DELAY 0ms.mp4" -logfile "C:\DETROIT_ROCK_CI\VIDEO_TS\drc T02 2_0ch 192Kbps DELAY 0ms.besweet.log" ) -azid( -s stereo -c normal -L -3db ) -bsn( -2ch -vbr_streaming -codecquality_high -aacprofile_he ) -ota( -g max )

BeSweet v1.5b31 by DSPguru.
--------------------------

[00:00:00:000] Initializing...
[00:00:00:000] -- Initializing...

----------------------------------------------------------------------------------------------------------

Sharktooth
21st December 2005, 22:17
no... i was wrong...i have the same versions here.
however can you post the besweet commandline generated by MeGUI?

EDIT: d'oh!

acidsex
21st December 2005, 22:19
"C:\Documents and Settings\patrick\Desktop\megui\BeSweetv1.5b31\besweet.exe" -core( -input "C:\DETROIT_ROCK_CI\VIDEO_TS\drc T02 2_0ch 192Kbps DELAY 0ms.ac3" -output "C:\DETROIT_ROCK_CI\VIDEO_TS\drc T02 2_0ch 192Kbps DELAY 0ms.mp4" -logfile

Sharktooth
21st December 2005, 22:22
besweet: "C:\Documents and Settings\patrick\Desktop\megui\BeSweetv1.5b31\besweet.exe" -core( -input "C:\DETROIT_ROCK_CI\VIDEO_TS\drc T02 2_0ch 192Kbps DELAY 0ms.ac3" -output "C:\DETROIT_ROCK_CI\VIDEO_TS\drc T02 2_0ch 192Kbps DELAY 0ms.mp4" -logfile "C:\DETROIT_ROCK_CI\VIDEO_TS\drc T02 2_0ch 192Kbps DELAY 0ms.besweet.log" ) -azid( -s stereo -c normal -L -3db ) -bsn( -2ch -vbr_streaming -codecquality_high -aacprofile_he ) -ota( -g max )
seems to be good...

acidsex
21st December 2005, 22:24
i thought so too but for some reason it just doesnt want to let me encode the audio using N7 audio. Again, if I throw the old N6 dlls back in there I can encode with them no problem.

Sharktooth
21st December 2005, 22:26
it has no sense... it's working here. and the support for nero dlls is not in MeGUI but in besweet + bsn.
i only added the commandline options for the new encoder.
it even works with belight...

acidsex
21st December 2005, 22:31
this is driving me nutz. It has to be a besweet thing. I just loaded up BeLight and tried encoding ac3 to Nero AAC so unless BeLight doesnt support N7, then I have to have a BeSweet prob on my end.

Sharktooth
21st December 2005, 22:34
get belight 0.22b8 full..
update it with the latest daily build...
place the nero dlls in the belight dir, check if encoding works with PS profiles for nero and if it works set megui to use the besweet.exe in that dir.

acidsex
21st December 2005, 22:42
Nope didnt work. Updated it and tried running an encode again from Belight and as soon as I start processing I get a window that tells me Transcoding finished completely.

Sharktooth
21st December 2005, 22:45
at this point i dont know what to tell... i can zip my belight directory and send it to you... that's the best i can do.

Sharktooth
21st December 2005, 22:49
here it is: http://www.webalice.it/f.corriga/temp/BeLight.7z (use 7-zip 4.32)

acidsex
21st December 2005, 22:50
Thank you very much. Ill give it a shot.

Sharktooth
21st December 2005, 22:52
if it still doesnt work then you have a problem with your serials.

acidsex
21st December 2005, 22:54
It didnt work. I guess Ill just go back to N6 dlls again. : Thansk for trying though.

Sharktooth
21st December 2005, 22:56
ok... the last thing to do is cleaning up your nero installation with the clean up utility and reinstall it with the serials.

stax76
21st December 2005, 23:01
No, I forgot about that, but I really found it very quickly.. it's a definite advantage if you've written the code. I should've already caught it looking at the contents of the line variable that was posted.. it already reveals that the encoding speed is now given with 2 decimal digits.


Appears to be the last rescue sometimes, I came to it over a weird issue with absolutely no way around (don't remember if it was VS beta). That was as soon as the avifile API was used, the next exception happening somewhere terminated the application leaving no trace what happened so I had to find this way and use it always since then.

acidsex
21st December 2005, 23:01
Checking my serials now against the order confirmation Nero sent me. Serial is still good and encoding still fails me. :(

leowai
22nd December 2005, 04:29
if it still doesnt work then you have a problem with your serials.I think a valid serial for Nero Burning only is not sufficient. May be valid serial for Recode (that encodes HE-AAC) is required.

@acidsex, did your Recode works fine?

acidsex
22nd December 2005, 04:35
Recode works fine and everything. Thats why this is so frustrating.

acidsex
22nd December 2005, 22:19
I gave up and gave the AACPlusV2 a try in Easy CD Xtractor and I love it. Ill just start using this for audio encoding instead. Woohoo.

charleski
23rd December 2005, 05:09
Fix for ensuring that the log file saves properly on exit:

In Form1.cs saveLog()
change
if (!Directory.Exists(logDirectory))
Directory.CreateDirectory(logDirectory);
string fileName = logDirectory + @"\logfile-" + DateTime.Now.ToShortDateString() + "-" + DateTime.Now.ToShortTimeString().Replace(":", "-") + ".log";
to
if (!Directory.Exists(logDirectory))
Directory.CreateDirectory(logDirectory);
string fileName = logDirectory + @"\logfile-" + DateTime.Now.ToString("yy-MM-dd") + "-" + DateTime.Now.ToShortTimeString().Replace(":", "-") + ".log";Under certain locales the ToShortDateString() function will insert backslashes into the date, which results in a failure when trying to save to a non-existent directory.

Sorry I haven't had time to integrate this with all the other stuff.

dimzon
23rd December 2005, 09:21
logDirectory + @"\logfile-" + DateTime.Now.ToString("yy-MM-dd") + "-" + DateTime.Now.ToShortTimeString().Replace(":", "-") + ".log";
Hi! This is really ugly code!
try this:
string.Format(@"{0}\logfile-{1}.log", logDirectory , DateTime.Now.ToString("yy'-'MM'-'dd'-'HH'-'mm'-'ss"));

Doom9
23rd December 2005, 13:22
the problem with String.Format imho is that while people coming from C love it, it's so much harder to read and understand, especially if you don't come from C.

dimzon
23rd December 2005, 14:06
the problem with String.Format imho is that while people coming from C love it, it's so much harder to read and understand, especially if you don't come from C.
main goal is to replace ugly
DateTime.Now.ToString("yy-MM-dd") + "-" + DateTime.Now.ToShortTimeString().Replace(":", "-")
with this:
DateTime.Now.ToString("yy'-'MM'-'dd'-'HH'-'mm'-'ss")

PS. How about version control hosting (CVS or others?)

charleski
23rd December 2005, 14:51
0.2.3.1024
Altered the name formation for the filename used for the log when saving.
Tidied up the resolution calculations in the avisynth creator so that they behave consistently.
Added 1.78 to the list of accepted aspect ratios in getAspectRatio() (not sure why it wasn't there already...).
Altered the code executed on opening an avs file in the main form so that it will always change the output filename appropriately.
Sharktooth's changes:
Integrated changes to use Nero7 audio encoder
Weighted prediction and no-fast pskip removed from turbo first pass
Corrected bug that caused the mencoder call-back to hang
Fixes to GUI layout for Segoe font

Changed Files (from Sharktooth's 0.2.3.1023g) (http://homepages.nildram.co.uk/~cajking/MeGUI/MeGUI-src.ChngdFls_0.2.3.1024.rar)
.NET 1.1 binaries (http://homepages.nildram.co.uk/~cajking/MeGUI/MeGUI.NETv1.1.Bins_0.2.3.1024.rar)

Sharktooth
23rd December 2005, 14:57
there was also an "h" version: http://www.webalice.it/f.corriga/megui/megui_src_0.2.3.1023h.7z which included this changes: http://forum.doom9.org/showthread.php?p=754853#post754853

are the fixes included?

charleski
23rd December 2005, 15:34
oops, yes, the 1023h changes are included.

I'll add the dgindexer fix to the changelog so we can keep track of things.

Sharktooth
23rd December 2005, 15:46
ok new merged sources (0.2.3.1b -> 0.2.3.1024): http://www.webalice.it/f.corriga/megui/MeGUI-src.ChngdFls_0.2.3.1024.rar

new bins: http://www.webalice.it/f.corriga/megui/megui_0.2.3.1024.7z (link fixed)

Sharktooth
23rd December 2005, 16:48
the changelog is not updated yet...
however i badly need a SVN or i'll become mad...

charleski
23rd December 2005, 17:16
0.2.3.1024 23 Dec 2005
Altered the name formation for the filename used for the log when saving.
Tidied up the resolution calculations in the avisynth creator so that they behave consistently.
Added 1.78 to the list of accepted aspect ratios in getAspectRatio() (not sure why it wasn't there already...).
Altered the code executed on opening an avs file in the main form so that it will always change the output filename appropriately.
Sharktooth's changes:
Integrated changes to use Nero7 audio encoder
Weighted prediction and no-fast pskip removed from turbo first pass
Corrected bug that caused the mencoder call-back to hang
Fixes to GUI layout for Segoe font
Fix for force-film modification of d2v files.

Just paste that over the old one.

About an SVN: dimzon was talking about making a workspace for meGUI over on godotnet, though no-one replied when he asked about the license that he should specify. Godotnet does require a Microsoft Passport to sign in, though, and I know there are people with religious difficulties over that.

Since there's been a lot of talk about a code store but no action :), I've presumed to send in a registration request for a meGUI Project on Sourceforge. Here's the description I posted:
meGUI is a graphical front-end to a variety of modern video and audio encoders capable of producing video that adheres to the MPEG-4 standard, both MPEG-4 Part 2 (ASP) and MPEG-4 Part 10 (AVC). Its aim is to ease the usage of other Open Source encoder projects, although it has support for a proprietary AAC audio encoder as well.

The following video encoders are supported:
x264
xvid and libavcodec via mencoder
snow
The following audio encoders are supported via BeSweet:
faac
lame mp3
Nero AAC (proprietary - both version 6 and 7 supported)

It has integrated multiplexing support for the production of mp4 (via mp4box), mkv and avi containers (AVC video is only supported in mp4 and mkv), incorporating video, audio, chapters and subtitles. It accepts input video in MPEG-2 format (using DGIndexer) as well as .avi and .vdr (VirtualDub framserver) formats.

Additional features include an integrated Avisynth script creator similar to that found in GordianKnot, a bitrate calculator and a One Click Encoder which chains together the various steps needed to convert a series of .VOB files to a final encoded file. Additional utilities include an AVC quantiser matrix editor and chapter editor.

Development of meGUI was begun in early 2005 by doom9 (the webmaster of the popular video encoding board www.doom9.net, which has been in existence for around 5 years), who has written the majority of the application. Support is primarily handled through the MPEG-4 AVC forum on doom9.net.
The Trove categorisations are:
# License :: OSI-Approved Open Source :: GNU General Public License (GPL)
# Intended Audience :: by End-User Class :: End Users/Desktop
# Development Status :: 5 - Production/Stable
# Topic :: Multimedia :: Video :: Conversion
# Programming Language :: C#
# Operating System :: Grouping and Descriptive Categories :: 32-bit MS Windows (NT/2000/XP)
# User Interface :: Graphical :: .NET/Mono When it gets approved I'll turn ownership of it over to doom9.

Sharktooth
23rd December 2005, 18:14
# Development Status :: 5 - Production/Stablewell... maybe Development/Unstable...

however SF CVS is a PITA... :)

charleski
23rd December 2005, 18:21
well... maybe Development/Unstable...I may have been guilty of pumping it a bit to sell the project :)

however SF CVS is a PITA... :)The free versions of VS 2005 don't have any CVS support (grrr), so cheap bastards like me will have to use a separate CVS integrator anyway.

Sharktooth
23rd December 2005, 18:46
what about moving the project development over sharpdevelop (free and opensource)?
i've already tried the VS2003 project conversion and it works pretty well...

Doom9
23rd December 2005, 18:55
#develop? Heck no... a software without debugging capabilities? I'm all for open source but I have yet to see anything free that gets close to Visual Studio.

stax76
23rd December 2005, 19:58
I think they have a debugger though not mature. I still believe VS with compilers and libraries is the best application in existence and mean application in general and not only dev tools.

Raithmir
24th December 2005, 10:59
Could perhaps the "shutdown when finished" tick box be moved out of the settings onto the queue tab. I keep forgetting to disable it again and will just be doing a simple mux, only for the computer to then shutdown! lol :D

Doom9
24th December 2005, 13:43
@Sharktooth: your source and binary link go to the same file ;)

Sharktooth
24th December 2005, 15:59
fixed ;)

Sharktooth
24th December 2005, 16:01
Could perhaps the "shutdown when finished" tick box be moved out of the settings onto the queue tab. I keep forgetting to disable it again and will just be doing a simple mux, only for the computer to then shutdown! lol :D
yeah, it happens to me too... :)
i'm just busy for xmas but i'll give it a shot as soon as i can.

Caroliano
24th December 2005, 22:20
The megui remaining time apears to have a bug with too high values.
I was trying to encode an short insane clip with more than insane setings (HQ-Insane + Exaustive search 64 and turbo off) for the sake of slowness.

After one hour and a half, the window apears that way: http://img458.imageshack.us/img458/2364/meguitime5jp.png
Before that was somewere around 18:15:15. This 49 can be 49days? And it take too much time to refresh. Only refreshed 4 times or so in this time.

Doom9
24th December 2005, 23:33
I figure that's another instance of the 24h wrap problem.. your estimated time went beyond 24h, I figure your estimated completion time is 24 hours and 49 seconds.

Caroliano
25th December 2005, 03:26
Is this easy to fix? Because I think that encodes that superpass 24h isn't so incomum. I can easely make it with HQ-Slower in my celeron 1.7. To add suport for weeks or months, then is more questionable, but also would be good.

Doom9
25th December 2005, 13:11
hmm.. x264 does almost 40fps on my box ;) For me, anything below real-time seriously gets on my nerves and makes me think of faster hardware (in my case there's no point, it's one of the fastest cpus money can buy), or switching the codec to something that agrees with the amount of patience I can muster. I suppose it's not so hard but I'm just guessing out loud, I have no idea really. What I can say is that the number that is behind that indication (and the elapsed time) can easily be coverted to say number of seconds and that this number is accurate.. it's only a matter of putting that into the 24h format, and I just guess because it's called 24h format, it only goes to 23:59:59.. if you want more, you probably have to convert it to something else, like dd hh:mm:ss, which may or may not be possible with a single line, or write a conversion routine on your own (also not that hard, just a bunch of ifs, divisions and substractions). But I'm still working on a codec comparison..

Caroliano
25th December 2005, 14:49
I don't know programing (yet..), so I'm willing to wait until you have time to do it.

For this insane test I will use Virtualdub, that suport more time. Even if it is lacking of the more advanced features, the Exaustive Search with range 64 is there. :devil:

Merry Christmas!

Doom9
25th December 2005, 15:37
well.. what is the problem except for the indication of how long it'll take? It'll still encode.. and you can always figure out the remaining time by looking at how many frames have already been encoded and how long it took (keeping in mind that time elapsed wraps as well once you go beyond 24 hours). And exhaustive search is insane and has no effect on quality whatsoever.. it makes no sense to use options that just slow you down, but don't bring anything noticeable to the table.

Caroliano
25th December 2005, 23:25
I'm was only playing with x264. I said:
I was trying to encode an short insane clip with more than insane setings (HQ-Insane + Exaustive search 64 and turbo off) for the sake of slowness.
I was only wanting to know how many time it would take. :p

And is relatively important for us know some time, if not, you would not have implemented it in Megui. It also can confuse some people that look only in the remaing time to see if they can manage to encode in time. They see for example 12h there and think that is reasonable, but it is 36h in reality and then may be no way back.

I hope that you fix it. Thanks.

charleski
28th December 2005, 13:38
Ok, the meGUI project has been approved on Sourceforge. I've populated the CVS with the code for 0.2.3.1024 and added a file release of the latest binaries.
https://sourceforge.net/forum/forum.php?forum_id=524347

doom9 and Sharktooth: if you PM me with your Sourceforge usernames I'll add you as Admins. The code can be accessed anonymously using a CVS client (I use TortoiseCVS) -
server cvs.sourceforge.net
folder /cvsroot/megui
module MeGUI-src.CVS
Contact one of the admins if you want to be added as a developer.

There's space for a web page as well, if anyone wants to design something for that.

dimzon
28th December 2005, 13:58
Contact one of the admins if you want to be added as a developer.

2 Admins
my SF nickname is dimzon, please add me as developer!
Thanx!

Sharktooth
28th December 2005, 15:17
sharkx1976

Doom9
28th December 2005, 15:28
my username is doom9 of course ;)
@dimzon: thinking about changing the audio part?

Sharktooth
28th December 2005, 15:30
it would be great. i checked behappy and it "sounds good" :)

dimzon
28th December 2005, 15:30
@dimzon: thinking about changing the audio part?
And, maybe, adding more extensiblity/flexibility like in BeHappy...

Sharktooth
28th December 2005, 16:04
I dropped the skinning engine based on MS-Styles... it b0krs completely on Vista or with WindowBlinds.
However using system theme (.NET 2.0 defaults) just work...

max-holz
28th December 2005, 16:18
I dropped the skinning engine based on MS-Styles... it b0krs completely on Vista or with WindowBlinds.
However using system theme (.NET 2.0 defaults) just work...

Now we can use Sourceforge CVS to get all the source update like this one?

Sharktooth
28th December 2005, 16:25
Yup. CVS is already working, though i did not include the skinning engine coz charleski didnt still add the devs to the project and for the above reason.
However using full styles require .NET 2.0 compiling.

charleski
28th December 2005, 16:42
Ok, doom9 is added as a Project Manager and dimzon as a developer, but SF says the username you gave doesn't exist Sharktooth (.

Doom9
28th December 2005, 17:55
I've added a few more todo things to the first post.

I'll also install VS 2k5 shortly and then perhaps we should consider moving the whole project and fixing all those warnings that ocurr when compiling in .NET 2.0

dimzon
28th December 2005, 19:44
I've added a few more todo things to the first post.


Why not to use SF tracker for such puposes?

godhead
28th December 2005, 20:02
Can I get added as a developer? I'm not sure how much I can contribute as of now, but I'm looking for a project to donate some of my free time to.

SF user: geeaich

Thanks!

berrinam
28th December 2005, 22:16
Could I also be added as a developer please? Username: berrinam

charleski
29th December 2005, 01:21
Ok, I've added you two as developers.

Still no luck getting sourceforge to recognise the username you gave sharktooth, but there is a user named 'sharktooth' registered on SF, is that you? (Just need to check before giving the username Project Admin status :)).

To everyone else: just want to make it clear that you don't need to be registered if you just want to look at the code and see if there's anything you can add. You can browse the code either by using the web-based browser through the CVS link or by using an anonymous 'pserver' CVS checkout. I use TortoiseCVS (http://www.tortoisecvs.org), which integrates directly into the Explorer shell.

Added a new patch to the CVS:
0.2.3.1025 29 Dec 2005
Fix for safe profile alteration - it was improperly overwriting the old profile.
Increased the cropping maximum to 200.

berrinam
29th December 2005, 04:16
A few questions about MeGUI's new location:

Is there somewhere on SF which lists the revisions and the changelog, like how the x264 SVN repository does?
Do minor updates like cosmetics warrant a CVS update, and do they warrant a new version number?

Sharktooth
29th December 2005, 04:42
Ok, I've added you two as developers.

Still no luck getting sourceforge to recognise the username you gave sharktooth, but there is a user named 'sharktooth' registered on SF, is that you? (Just need to check before giving the username Project Admin status :)).

To everyone else: just want to make it clear that you don't need to be registered if you just want to look at the code and see if there's anything you can add. You can browse the code either by using the web-based browser through the CVS link or by using an anonymous 'pserver' CVS checkout. I use TortoiseCVS (http://www.tortoisecvs.org), which integrates directly into the Explorer shell.

Added a new patch to the CVS:
0.2.3.1025 29 Dec 2005
Fix for safe profile alteration - it was improperly overwriting the old profile.
Increased the cropping maximum to 200.
ehrr.... it's "sharx1976" (without "k") :)
however it seems i can't get 0.2.3.1025... infact the file versions are not changed...
for what concerns berrinam he already coded some big megui parts so he fully deserves to be a megui dev (at least more than me).

EDIT: Seems CVS has been just updated :)

Sharktooth
29th December 2005, 04:44
A few questions about MeGUI's new location:

Is there somewhere on SF which lists the revisions and the changelog, like how the x264 SVN repository does?
Do minor updates like cosmetics warrant a CVS update, and do they warrant a new version number?
CVS has a different revision system than SVN. In CVS every file has it's own version but that does not influence the global revision numbering. While in SVN every revision (file update) rises by 1 the global project revision number.

LiFe
29th December 2005, 07:45
And here is the current TODO list:
Sorry, I havn't perused this entire thread, and this may have already been requested. Can I please add "Context Sensitive Help" to the todo list? I'm happy to write it (I'm sure the docs already exist to be trimmed up). As I see it, there should be a 'View Hints' option, which would pop up a box at the bottom or side (like the command line) that would give specific info about the command/option/button your mouse was hovering over.

berrinam
29th December 2005, 07:57
@LiFe: As far as I am aware, there is no documentation for MeGUI whatsoever, except for perhaps a few guides to the settings for x264 and XviD. The large part of the work involved in the context sensitive help would (imo) be actually writing all the documentation.

LiFe
29th December 2005, 10:46
I'm sure there's enough from x264 help, doom9 and other web guides, to mostly copy and paste - I'm happy to do it myself if need be.

charleski
29th December 2005, 12:17
Ok, added Sharktooth.

Sourceforge maintains 2 separate caches of the CVS data. The secure (developer) cache is updated immediately, but changes take around 5 hours to propagate to the anonymous cache.

Sharktooth
29th December 2005, 15:23
well, i used the anonymous cvs access since i was not yet added as dev... :)

Sharktooth
29th December 2005, 17:18
Uhm... there's an unneded reference in the solution: Microsoft.DirectX.AudioVideoPlayback

Mutant_Fruit
29th December 2005, 23:06
Just wondering if you want/need a hand with development with MeGUI and/or AVC2AVI. I have a fairly decent grasp of the .NET framework. I've been using C# for the last 6-8 months (albeit mostly for web development, and one or two small home projects).

If theres a list of small bugs you'd like quashed, or basic features you'd like added that i could help with (to start me off and see if i'm up to the task) gimme a shout.

@sharktooth: you're pm box is full :p

EDIT: i'd help with anything c# related really... its all good experience for me, and i'd like to help out if i can.

berrinam
30th December 2005, 00:07
CVS Update

0.2.3.1026
Add support in commandline for --level command
Allow user to choose to enable PSNR calculations for x264 in the x264 config
Fixed >24h ProgressWindow problem (included support for days)
Fixed AviSynthWindow so that checking Mpeg 2 Deblocking triggered an event
Fixed displaying of a loaded job's FPS so that it doesn't show hundreds of decimal places

Sharktooth
30th December 2005, 04:57
@sharktooth: you're pm box is full :p
Eh... made some space...

@all devs: i think we can now restart the original version numbering.

EDIT: Uploaded 0.2.3.1026 binaries.

max-holz
30th December 2005, 08:56
When I update from cvs I always receive a conflict warning for the file MeGUI.suo, it's a user solution options hidden file, I'am wondering if it's necessary to include this file in the cvs or if it's a my prob caused by some wrong setting?

charleski
30th December 2005, 11:34
When I update from cvs I always receive a conflict warning for the file MeGUI.suo, it's a user solution options hidden file, I'am wondering if it's necessary to include this file in the cvs or if it's a my prob caused by some wrong setting?Hmm, yeah, the .suo file probably shouldn't be there. Has anyone had problems with the .csproj and .sln files? (those are both the ones generated by VS2005).

As far as numbering goes, it's probably time to shift to 0.2.4 :).

@Mutant_Fruit: You can take a look at the first page for doom9's TODO list. Or just see if there are any things you'd like to add for yourself (which is why I started writing code for it).

dimzon
30th December 2005, 12:56
@All
I will perform a little code refactoring today

Mutant_Fruit
30th December 2005, 13:23
redesign the x264 configuration

At the risk of biting off more than i can chew, is anyone working on this? And more importantly, does anyone mind if i do take a crack at this?

I don't want to choose something that'd take too long for me to complete and end up holding up development :P Also, what exactly needs to be done design wise? Just restructure it and make it look nice? Or make sure there are dropdowns/checkboxes for all the x264 settings and all obsolete ones are removed?

If theres something smaller someone would like me to take a crack at, let me know.

max-holz
30th December 2005, 14:00
@All
I will perform a little code refactoring today

Plan to insert the new --bime option?

dimzon
30th December 2005, 14:39
@All
WTF

http://img529.imageshack.us/img529/9714/wtf1nl.gif

In C:\Documents and Settings\DAlexandrov\My Documents\Visual Studio Projects\1\MeGui\MeGUI-src.CVS: "C:\Program Files\TortoiseCVS\cvs.exe" "commit" "-m" "" "xvidSettings.cs"
CVSROOT=:ext:dimzon@cvs.sourceforge.net:/cvsroot/megui

cvs: rcs.c:4188: RCS_checkout: Assertion `rev == ((void *)0) || ((*__ctype_b_loc ())[(int) (((unsigned char) *rev))] & (unsigned short int) _ISdigit)' failed.
cvs [commit aborted]: received abort signal

Error, CVS operation failed


PS. This is my first CVS expirience (using MS VSS for 5 years, never CVS)

dimzon
30th December 2005, 14:45
Plan to insert the new --bime option?
no! Just little code cleanup && refactoring

charleski
30th December 2005, 15:50
You'd have to ask the TortoiseCVS people why you got that error on commit dimzon. Unfortunately I know little about it :(.

BTW, please update the changelog.txt file as well when you make any changes.

dimzon
30th December 2005, 16:14
You'd have to ask the TortoiseCVS people why you got that error on commit dimzon. Unfortunately I know little about it :(.

BTW, please update the changelog.txt file as well when you make any changes.
Changed files: http://www.mytempdir.com/352243

1) modified VideoCodecSettings::clone method implementation
2) removed VideoCodecSettings::clone overrides from all VideoCodecSettings descendants
3) FourCCs is now defined per-type, not per-instance and is readonly!
4) Minor version increased

charleski
30th December 2005, 18:23
Ok, added dimzon's changes to the CVS (and updated changelog.txt).
Published a new file release.
Removed MeGUI.suo from the CVS.

Sharktooth
30th December 2005, 19:59
New x264 switch: --bime (bidirectional motion extimation)

Doom9
30th December 2005, 20:29
At the risk of biting off more than i can chew, is anyone working on this? And more importantly, does anyone mind if i do take a crack at this?I don't think so. What is needed/expected? The GUI design basically comes from early January 04 when I made the first release (phew, it's about time I can celebrate the first birthday of my very first dvd backup software).. the grouping was based on what at that time made sense to me. Since then, there have been many new options, some that came and went again, others that stuck.. at this point a different grouping probably makes more sense as new options keep getting added where there's free space, not necessarily at a place that would be most logical. I would suggest you attack the first two tabs first, leaving the whole zones thing alone (it's quite complex and I have some plans for that when it comes to cutting via avisynth). Do not be afraid to change the size of the dialog to better accomodate a more sensible grouping of the available options.

And then there's the new --bime option (which I guess would make the most sense when grouped together with other b-frame related options).

Also, looking at the poll, I propose that we permanently move to .NET 2.0.. so that new development can make full use of the new goodies of the new platform, and we can attack the removal of deprecated code and get rid of all the warnings.

max-holz
30th December 2005, 20:50
Someone could explain to me this continuous error?

In C:\MeGUI\Source\MeGUI-src.CVS: "C:\Programmi\TortoiseCVS\cvs.exe" "-q" "update" "-d" "-P" "."
CVSROOT=:pserver:anonymous@cvs.sourceforge.net:/cvsroot/megui

cvs.exe update: Empty password used - try 'cvs login' with a real password

cvs.exe [update aborted]: Error reading from server cvs.sourceforge.net: 0

Error, CVS operation failed

Mutant_Fruit
30th December 2005, 21:11
I would suggest you attack the first two tabs first, leaving the whole zones thing alone (it's quite complex and I have some plans for that when it comes to cutting via avisynth). Do not be afraid to change the size of the dialog to better accomodate a more sensible grouping of the available options.
Rightio then. I'll get cracking on that tomorrow. I've got VC# express installed, so i'll use that (meaning .NET2.0).

I'll read through what options are being displayed, what options are displayed in the x264 dialog itself, and structure the new window with that in mind. Expect me to come back with questions :p

@Doom9: I got your PM, and i fully agree with your thinking. We'll see how i go with this.

Doom9
30th December 2005, 21:20
Expect me to come back with questionswill try to answer them to your satisfaction. Don't trust anything you hear in between me coming home from the new year's party and 12+ hours after that though ;)

bob0r
30th December 2005, 22:31
Wow nice, CVS :)

And yes, SF always has weird errors.

I myself have to retry like 10x also before it works:
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/megui co -P MeGUI-src.CVS

@Sharktooth, yeah LOL, when i update ffdshow i need to wait for the damn files to update also :)

Browsing http://cvs.sourceforge.net/viewcvs.py/megui/MeGUI-src.CVS/ until a new version number is visible is the best solution!

@All:

Here a simple script to get megui source and compile it with .net 1.1, example from my system:

#!/bin/sh

## Change paths
megui_dir=/home/user/MeGUI-src.CVS/
net_dir=C:\\/WINDOWS\\/Microsoft.NET\\/Framework\\/v1.1.4322\\/

if [ ! -d "$megui_dir" ]; then
while true; do
cd; cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/megui co -P MeGUI-src.CVS;
if [ -d "$megui_dir" ]; then
break
fi
sleep 10
done
fi

cd $megui_dir;

sed -e 's/csc \/res/'$net_dir'csc \/res/' compile.bat > compile_m.bat;
start //low //b //w compile_m x264-svn;

## Manually enter: exit
## Blame csc.exe, not me :)

charleski
30th December 2005, 23:13
Ok, to simplify things a bit and open it up, doom9 suggested we used the patch tracker. Just go to the main megui sourceforge page, click on Patches then click on Submit New on the 2nd line. Fill in a description of the changes and attach the files you've changed.

You'll need to be registered with SourceForge, but don't need anything special other than that. Just use the anonymous pserver method to get the code from the CVS. Unfortuantely SF can be a bit slow, and I suspect you're seeing a problem with timeouts max-holz, I had similar problems when setting the CVS up at first. When that happens it's best just to wait 20 mins or so.

LiFe
31st December 2005, 00:44
@Mutant_Fruit: Can you please help me implement my earlier request for context sensitive help while you're re-working the x264 gui?

Am fairly experienced with video compression, but a newbie with x264, and it took me an hour last night to work out what the majority of the more complex options did (lots of doom9 searches). I'd really appreiciate being able to integrate all the available info into the GUI, so anyone with a video compression background can understand what each option does with a recommended range of settings.

Personally I'm thinking that a layout more like Nero Recode gives pretty good settings grouping. And I'd love to see a box at the bottom or side (like the cmd line) that will show info about each setting you hover the mouse over.

I am happy to write this from all the guides and recommendations in the forum.

Please let me know.

Mutant_Fruit
31st December 2005, 00:50
@life: I'll gladly put that in. Just let me know what info you want displayed, and roughly how you want it to be displayed and i'll work it in somehow. It'd be a shame to do everything up now, and then have to redo it again later to allow that.

If you need to talk to me, i use MSN (mostly), so you could PM me an MSN address to add.

EDIT: Got any screenshots of nero recode? I don't actually have that installed.

charleski
31st December 2005, 01:53
Just my personal opinion, but after having spent the past few months encoding several videos a week (archiving stuff from off-air), I think the most critical parameters are:
1) bitrate (obviously)
2) deblocking parameters (A bit of a Black Art atm: Despite the stern admonitions in the mplayer encoding pages I've found myself moving them steadily down from 0,0 and am using -2,-2 right now, but it's very much a matter of taste.)
3) Keyframe interval (seekability is important IMO, one of the big advantages of watching stuff you've encoded is that you can rewind and skip ahead to bits you want to see, but there's obviously a tradeoff in terms of compressibility).
4) SAR (Right now this should automtically be set by the Avisynth creator if you load the file in directly. But if you're loading files in a batch, this is a field you need to check. One of the main advantages of mp4 is its enforced AR transform on playback, something that needs to be used since the majority of sources implement anamorphic input and keeping that resolution gives a huge advantage.)

[BTW, and this is only my own opinion, I found Nero Recode's GUI a bit confusing (particularly with regard to their resize/AR element, in which they hide too much). I moved over to x264/meGUI because it's more transparent in terms of what's actually going on.]

berrinam
31st December 2005, 02:02
Anonymous CVS access works for me, but developer access now seems to have stopped working. TortoiseCVS comes up with this error:
cvs checkout: failed to create lock directory for `/cvsroot/megui/MeGUI-src.CVS' (/cvsroot/megui/MeGUI-src.CVS/#cvs.lock): Permission denied
cvs checkout: failed to obtain dir lock in repository `/cvsroot/megui/MeGUI-src.CVS'
cvs [checkout aborted]: read lock failed - giving up
cvs.exe checkout: in directory .:
cvs.exe checkout: cannot open CVS/Entries for reading: No such file or directory

Error, CVS operation failed A google of "failed to obtain dir lock in repository" shows this result (http://gallery.menalto.com/node/710), which gives the advice: I am told that this happens sometimes when a check in doesn't work correctly, and the project admin needs to delete the #cvs.lock file.

charleski
31st December 2005, 02:41
Anonymous CVS access works for me, but developer access now seems to have stopped working.
Yep, I'm evil and disabled CVS write privileges for everyone except admins so that we use the Patch Tracker, hehe. It's a training period so that admins get used to checking it as much as anything else.

Just upload your files as detailed above and they'll get integrated.

Mutant_Fruit
31st December 2005, 02:46
Just to throw an idea out there before i head off to bed...

After a bit of discussion with someone else (LiFE), i've the following idea. How about we ditch the tabular layout, and go for a treeview layout? How do people feel about a treeview layout as opposed to the tabs at the top? Do people prefer the treelayout, or would i be best leaving it as is with the tabs?

Personally, i like treeviews. But if the consensus is "no", then i'll stick with tabs.

(in case you're wondering, a treeview is like the windows explorer view of your harddrive).

acidsex
31st December 2005, 03:10
do you have an example of a treeview as i am not quite understanding what you are saying? May be my tiredness.

Mutant_Fruit
31st December 2005, 03:19
This is a tree view. The settings for the video codec could be displayed in the same manner as the folders and subfolders are displayed under the D:

http://img511.imageshack.us/img511/2569/treeview9xi.jpg

Sharktooth
31st December 2005, 04:45
Yep, I'm evil and disabled CVS write privileges for everyone except admins so that we use the Patch Tracker, hehe. It's a training period so that admins get used to checking it as much as anything else.

Just upload your files as detailed above and they'll get integrated.
Why not add berrinam to the admins?

LiFe
31st December 2005, 04:49
Re what we were discussing:
Tree
+ Visual Tree makes it easier to recall where settings are (see recode).
+ Easier to implement a large number of 'sections' (old Firefox had similar)
- Uses more screen real estate

Tabs
+ Compact way of displaying many settings (see MS Office Options)
+ Advanced users feel at home
- Does not scale well for 5+ tabs (see MS Office Options)
- Scares off newbies
- Very difficult to recall which setting is in which tab, particularly if tabs toggle between front and back (Office Options)

Keeping in mind that we're gonna need quite a few more tabs to fit everything in:
- Optional context sensitive help
- Expand the names of the options, atm almost everything is abbrieviated
- Proper drop down lists with explanations
- A few sliders (currently implemented as number boxes)
- Maybe some radio check boxes

To prevent the screen being too big, it will probably be neccessary to have 6 'sections' broken down into
"Rate Control": Includes: Basic Rate Control and Profiles
"Main Options": General Options & Tools
"Advanced Options": Macroblocks and Other Options
"Advanced Rate Control": Rate Control & VBV stuff
"Quantizers": Quantizers
"Zones": Zones

Sharktooth
31st December 2005, 04:57
@all devs: please commit one patch at a time. i mean one commit for each modification of a single feature. it will be easier to read the changes in the cvs and to find the code changes.
For example:
1) modified VideoCodecSettings::clone method implementation
2) removed VideoCodecSettings::clone overrides from all VideoCodecSettings descendants
3) FourCCs is now defined per-type, not per-instance and is readonly!
4) Removed redundant reference to DirectShow videoplayback module

would mean 4 commits.

foxyshadis
31st December 2005, 04:59
The general consensus in the UI/usability community is that tree-views range from slightly bad to very bad unless you have lots of heigharchial groups; I have enough experience with misapplied treeviews to be very wary. Nicer tabs might be nice.

Now that presets are such an easily useable part of the app, thanks to sharktooth's wonderful efforts, my opinion is that the basic first screen should have minimal options: preset and bitrate. I'd argue bitrate should be shown without going into "config", next to profile, unless it's a first pass or automatically derived. Half the time that's the only thing I want to change, the only thing that profiles can't usefully dictate.

Once in config, only basic options should be shown: profile (which should ideally set the profile when changed), mode, B-frames, AVC profile & level, deblock dropdown (low, normal, high, custom). Maybe # reference frames, # b-frames, logfile. And of course, an advanced option, giving us everything else on the first panel split into better categories, plus trellis, me algo, and sar, matrix, and commandline. The rest of the second panel stuff (plus maybe chroma me and cabac?) should be relegated to another panel like "control settings" or "stream settings". "Advanced" doesn't quite fit the bill. Finally a zones option. (Maybe a quantizer edit option, as stated above, but does anyone really want to see and edit those ugly 8-part quantizers from inside megui?) Then doom9 can do whatever he wants with zones.

"Advanced options" can be a set of buttons that opens new panels, or a checkbox that opens more tabs, but I lean toward the former even if it's a bit cluttery. Then you have one control center, not many tabs or a big tree. Definitely don't do buttons as "more..." like XviD, of course, and give the panel a little more room to breathe... and hey, maybe add some pretties like divx, but I won't push that one too hard. ;)

Somewhere, there should be a "multi-processor" option, which sets the number of threads equal to the number of processors on your system, unless you'd rather keep it to #threads option only.

In general UIs should strive to keep the most common settings the most easily accessible, highlight the most important, without overly inconveniencing those who need to change the rest. I hope this proposal sounds as if it would do that.

charleski
31st December 2005, 05:48
Why not add berrinam to the admins?

Because
a) I'm evil (didn't I say that already?) Mmm, blood, blood....
b) Using the Patch Tracker properly means we all need to keep an eye on what people have uploaded. The last thing we want is for someone's contributions to go unnoticed - even if we don't want to integrate his/her mods as they are, we should give a reason.
c) It's New Years' weekend and I thought it would be OK to try out the change (berriman admits he was just fiddling - ahah! um, well whatever)
d) See a), except with added 'nutirients'. MMMm Nutrients! (tack on H. Simpson image)

Sharktooth
31st December 2005, 06:00
CVS update:
0.2.3.1028 - added --bime support (and fixed some controls for NET 1.1 designer...)

Maybe there's some errors coz it 6AM here... but it compiles.
Had no time to post binaries too...

max-holz
31st December 2005, 08:56
Could someone post the new sources in any other place, the Cvs seems very busy.

Thanks

Doom9
31st December 2005, 12:06
Somewhere, there should be a "multi-processor" option, which sets the number of threads equal to the number of processors on your system, unless you'd rather keep it to #threads option only.That's already in the settings and I think it makes sense to keep it there especially seeing that lavc also supports SMP, XviD is about to support it and XviD AVC will support it. I think it's in the interest of most people that if they have an SMP capable system, the encoder makes full use of it, all the time, and they can still control CPU use by using the job priority.

I don't think Treeviews make a lot of sense for a codec configuration either. They make a lot of sense for a usergroup configuration where higher level group inherint from lower level ones and where you can manipulate membership and the "group is part of group" relationship via drag & drop (I built such a thing once.. it's quite awsome when you get it working compared to what we used to have before), but for a codec I don't really see the grouping.

Sharktooth
31st December 2005, 14:23
i uploaded the assemblyinfo.cs to reflect the version change (yesterday was too late to remember that...) and the bins for 0.2.3.1028.

max-holz
31st December 2005, 14:54
i uploaded the assemblyinfo.cs to reflect the version change (yesterday was too late to remember that...) and the bins for 0.2.3.1028.
Anonimous cvs takes much time to update, could you post the assembly also here please?

Sharktooth
31st December 2005, 14:55
just change 0.2.3.1027 in 0.2.3.1028 in AssemblyInfo.cs :)
but yesterday was really too late to remember that...

Sharktooth
31st December 2005, 15:28
It was so late i forgot to do some things too...

CVS update: added the missing stuff...
0.2.3.1028 bins re-released

max-holz
31st December 2005, 16:05
A little request :)
Is it possible to download also the source code for any version as many other projects in sourceforge without use the cvs.

Ciao

Sharktooth
31st December 2005, 16:08
http://www.webalice.it/f.corriga/megui/MeGUI-src.CVS.0.2.3.1028.7z

max-holz
31st December 2005, 16:18
http://www.webalice.it/f.corriga/megui/MeGUI-src.CVS.0.2.3.1028.7z
Thanks

Mutant_Fruit
31st December 2005, 16:28
Everything within ***'s is going to be a groupbox. The numbers represent different tabs. I'm not sure i have everything placed in the most logical area (mostly because i don't know what they all the options do :p), so let me know.


General

**********************************
Mode
Bitrate
Keyframe interval
fourcc
**********************************

**********************************
Threads
**********************************

**********************************
AVC Level
AVC Profile
**********************************

**********************************
User Profile
**********************************

Macroblock - BFrames

**********************************
The existing Macroblock option block
**********************************

**********************************
Ref Frames
B Frames (number of bframes)
B Frame Options
RDO B Frames
B Frame Bias
B Frame mode
**********************************

M.E. - RateControl

**********************************
Chroma ME
Bidirectional ME
ME Algorithm
ME Range
**********************************

**********************************
Subpixel Refinement
Weighted Prediction
**********************************

**********************************
Existing Rate Control Block
**********************************

Quantisation

**********************************
Existing Quantisation options block
**********************************

**********************************
Trellis
No Fast P-Skip?
Cabac?
**********************************

**********************************
Quant Matrix selection
quant matrix file selection
**********************************

Misc

**********************************
Deblock filter
Alpha Deblock
Beta Deblock
SCD Sensitivity
Min GOP size
SA
PSNR Calc
Custom command line.
**********************************


EDIT: On an unrelated note.... once i make a change, how do i submit it? Is there a linky somewhere which explains the procedure for creating/submitting a patch?

Sharktooth
31st December 2005, 17:20
CVS Update: Cosmetics in CommandLineGenerator.cs

until the SF CVS doesnt update: http://www.webalice.it/f.corriga/megui/MeGUI-src.CVS.0.2.3.1028a.7z

EDIT: i've found some x264 settings are not ported for mencoder (brdo, nofastpskip, bime...). Since i've no practical experience with mencoder cli, can anyone check the docs and add them?

Sharktooth
31st December 2005, 18:10
CVS Update:
More cosmetics in commadlinegenerator.cs
Added --bime to the list for disabled option for 1st pass "Turbo" (x264)

Sources (until anonymous cvs updates): http://www.webalice.it/f.corriga/megui/MeGUI-src.CVS.0.2.3.1029.7z
Binaries are on SF.

foxyshadis
31st December 2005, 18:46
....
It's pretty nice, though I think SCD, GOP Size, Keyframe Interval, and B-frame Bias&Mode really belong in or near the Rate Control area. SAR I'd put with them except that it might be accessed a lot more often than the rest... Otherwise those are all "stream" options. And macroblock might make better sense going with Quantization, then the rest of b-frames would have to go somewhere... maybe the main page. That's all MHO, anyway, do with it as you will. :p

Mutant_Fruit
31st December 2005, 18:58
Could anyone give me a quick heads up on how i'm supposed to send in an updated file?

i.e. i've changed the x264config dialog, and now i want to send in those changes. I've never done this before and i don't want to do it wrong a screw something up.

@Foxy: Some of my layout was based on space constraints, but i'll considar your suggestions alright. In my opinion, i thought it was better to group all B frame options together as opposed to having some bframe options in one dialog, and more bframe options in a seperate dialog (such as bias and mode).

What do people think about that? Keep bframe options together in one section, or keep them seperated as is currently done?

If SAR is a frequent option, i could throw it in the "General" settings on the main page.

Sharktooth
31st December 2005, 19:06
@Mutant_Fruit: use the Patches Traking Sytem: http://sourceforge.net/tracker/?atid=798478&group_id=156112&func=browse
It would be better you post a final patch. In the meanwhile you can provide some work-in-progress binaries for testing.
Also, have you included the 0.2.3.1029 changes?

Mutant_Fruit
31st December 2005, 19:17
Also, have you included the 0.2.3.1029 changes?
Thats one of the things i was unsure about. Am i going to have to do a fresh CVS checkout, then apply my changes to those files, and then submit them hoping someone else doesn't submit in the meantime?

I assume by "patch" you mean just the changed file? Or do i need to run a special patch making program to create a "patch" file containing the difference between my changed file and the original CVS file which i then submit?

Sharktooth
31st December 2005, 19:24
get the sources from my web (i linked it above) coz the CVS may need some time to synch. with the last updates.
Once you're on it, apply your changes to the source you just got.

For what concerns the patching method you can choose whatever you think it's better.
I'm used to the posix tools (patch, diff etc.) but it really doesnt matter.

Mutant_Fruit
31st December 2005, 19:43
For work in progress, check out here (http://www.fileshack.us/files/741/Test1.rar).

I've implemented some help tooltips. Open the x264 config dialog and just hover over the text boxes etc. I'm currently in the middle of moving around the options and suchlike, but the stupid bug with VS that makes VS forget the events linked to controls when you cut and paste them is still there, so it'll take a while to move everything and relink them.

Sharktooth
31st December 2005, 19:49
nice stuff :)

Mutant_Fruit
31st December 2005, 20:34
Because i'm stupid and may not update the patch thingy correctly, here's (http://www.fileshack.us/files/741/0.2.3.1029.rar) the source for build 0.2.3.1030. It just adds context sensitive help to the last build done by sharktooth.

The restructure of the config screen is in the middle of being done. But it'll take another while.

berrinam
1st January 2006, 09:20
Patch uploaded to sourceforge. Detailed description in the posted patch, but it has some reorganisation of the AutoEncode and OneClick GUIs and extends their operability to not needing a target filesize. The patch is based on 0.2.3.1029. Sorry Mutant_Fruit, I didn't integrate your changes.

EDIT: I accidentally submitted it twice. Both should be identical, so choose whichever you want ;)

Mutant_Fruit
1st January 2006, 14:34
Berri: You never included the cs file for the oneclickconfiguration window. Post that up whenever you can. Can't compile with your patch without it :p

Sharktooth
1st January 2006, 16:45
yup... it's not complete.

CVS Update: Context Help as been fixed and submitted.

Mutant_Fruit
1st January 2006, 17:34
Just uploaded the patch for the restructured x264 dialog. Let me know if anything needs to be moved around. I'm sure it ain't right yet, but hopefully its a bit better. (liink to source is in the patch details thingy in case i screwed up the patch)

I hope i created the patch right. Let me know if i havn't. I'm only getting the hang of it at the moment.

max-holz
1st January 2006, 17:45
Where could I find the source for 0.2.3.1029a .Net 2.0?

Ciao

Sharktooth
1st January 2006, 17:47
@mutant_fruit: With NET 1.1:
x264ConfigurationDialog.cs(521,13): error CS0117: 'System.Windows.Forms.TabPage'
does not contain a definition for 'UseVisualStyleBackColor'
x264ConfigurationDialog.cs(527,13): error CS0117: 'System.Windows.Forms.Label'
does not contain a definition for 'Padding'
x264ConfigurationDialog.cs(545,13): error CS0117: 'System.Windows.Forms.Label'
does not contain a definition for 'Padding'
x264ConfigurationDialog.cs(732,13): error CS0117: 'System.Windows.Forms.Label'
does not contain a definition for 'Margin'
x264ConfigurationDialog.cs(741,13): error CS0117: 'System.Windows.Forms.Label'
does not contain a definition for 'Margin'
x264ConfigurationDialog.cs(750,13): error CS0117: 'System.Windows.Forms.Label'
does not contain a definition for 'Margin'
x264ConfigurationDialog.cs(787,13): error CS0117:
'System.Windows.Forms.CheckBox' does not contain a definition for
'Padding'
x264ConfigurationDialog.cs(798,13): error CS0117: 'System.Windows.Forms.Label'
does not contain a definition for 'Padding'
x264ConfigurationDialog.cs(807,13): error CS0117:
'System.Windows.Forms.CheckBox' does not contain a definition for
'Padding'
x264ConfigurationDialog.cs(817,13): error CS0117:
'System.Windows.Forms.CheckBox' does not contain a definition for
'Padding'
x264ConfigurationDialog.cs(871,13): error CS0117: 'System.Windows.Forms.Label'
does not contain a definition for 'Padding'
x264ConfigurationDialog.cs(880,13): error CS0117: 'System.Windows.Forms.Label'
does not contain a definition for 'Padding'
x264ConfigurationDialog.cs(889,13): error CS0117: 'System.Windows.Forms.Label'
does not contain a definition for 'Padding'
x264ConfigurationDialog.cs(900,13): error CS0117:
'System.Windows.Forms.CheckBox' does not contain a definition for
'Padding'
x264ConfigurationDialog.cs(915,13): error CS0117: 'System.Windows.Forms.TabPage'
does not contain a definition for 'UseVisualStyleBackColor'
x264ConfigurationDialog.cs(1183,13): error CS0117:
'System.Windows.Forms.TabPage' does not contain a definition for
'UseVisualStyleBackColor'
x264ConfigurationDialog.cs(1530,13): error CS0117:
'System.Windows.Forms.TabPage' does not contain a definition for
'UseVisualStyleBackColor'
x264ConfigurationDialog.cs(2054,13): error CS0117:
'System.Windows.Forms.ToolTip' does not contain a definition for
'IsBalloon'

it compiles only with NET 2.0.

@All: Shall we drop NET 1.1?

Sharktooth
1st January 2006, 17:54
Where could I find the source for 0.2.3.1029a .Net 2.0?

Ciao
http://www.webalice.it/f.corriga/megui/MeGUI-src.CVS.0.2.3.1029a.7z

as usual the anonymous CVS takes a while to update...

Mutant_Fruit
1st January 2006, 17:54
@All: Shall we drop NET 1.1?
Whoops, i thought we had already moved to .NET2.0! I've been working with 2.0. Buggerit. I could rejig to work with .NET1.1 if ya want. But if development is moving to 2.0 i won't bother.

Sharktooth
1st January 2006, 18:04
The layout isnt bad but i suppose it's not finished at all.
However i would move the SAR option is Misc. Rename Alpha and Beta debloking to Strenght and Threshold respectively. Rename Profiles (the MeGUI profiles) to Presets. Move all the B-Frames option in one place.
However keep it NET 2.0, before making any NET version changes let's hear the other devs.

Mutant_Fruit
1st January 2006, 19:10
Patch2 up for the layout. Did all the changes listed above. If anyone thinks more changes are needed, just let me know. Might as well get this right.

Sharktooth
1st January 2006, 19:27
note: do not upload the patches to SF if they're not completed or i (or the other admins) have to reject them.
Just post screenshots or include/attach them here.
Also, is it incemetal (restuctured2 goes over restructure1) or is it from scratch (restructure2 goes over the megui sources)?

Raithmir
1st January 2006, 19:58
Feature request : Could you add a date/time stamp at the start and end of logging each job? Would be useful to see how long each bit takes as I usually just set my PC to shutdown when finished and then go back looking at the logs (which incidently it seems to sometimes write two identical logs a few seconds apart, I've not figured out what scenario's it does it yet).

Sharktooth
1st January 2006, 20:43
you mean in the logfiles?

Mutant_Fruit
1st January 2006, 22:01
note: do not upload the patches to SF if they're not completed or i (or the other admins) have to reject them.
Ah right. I won't do that in future then.


Also, is it incemetal (restuctured2 goes over restructure1) or is it from scratch (restructure2 goes over the megui sources)?
It is incremental, structured2 goes over structured1.

In future i'll just host temp builds until everyone's satisfied with the changes, then i'll post it on SF. I'll remove the two patches from SF regarding the layout changes, and i'll submit a final one later (that goes over the CVS source) when everything is double checked.

Sharktooth
1st January 2006, 22:04
i said that coz the Patch tracking is inteder for "working" or almost ready to be submitted patches

Mutant_Fruit
1st January 2006, 22:09
i said that coz the Patch tracking is inteder for "working" or almost ready to be submitted patches
No worries. I'm new to this, so please point out any mistakes i make. Also, am i creating the patches correctly, or is the way i'm creating the patch making it awkward for you to apply it? I'm using the commandline diff and patch utils for creating the patches.

Sharktooth
1st January 2006, 22:13
it's ok. it just creates some minor problems.

Mutant_Fruit
2nd January 2006, 00:05
Heres a build if anyone wants to check out the new x264 configuration dialog layout.

Let me know of any problems.

http://www.fileshack.us/files/741/MeGUI-New-x264-Dialog.zip

berrinam
2nd January 2006, 02:04
Ok, after having some problems with patching (TortoiseCVS patching requires CVS access, and with unreliable anonymous access, and disallowed developer access :devil: , this didn't eventuate), I ended up just copying the changed files into a separate folder. The changes are the same as last time, but this time, it includes the new files. Some files are no longer needed, ie both of the OneClickDefault window ones (cs and resx), and the OneClickDefaults.cs file. I've made no change to the version number as I don't know what numbering system we are following.

The changes are here on rapidshare. (http://rapidshare.de/files/10229683/oneclick_changes_net_2_0.zip.html) The code I have attached only works in .NET 2.0. If it is decided that we should stay in .NET 1.1 for the moment, then I will change the code, but for now it is too much work. The code should work if you simply copy and replace the files in my archive on top of the 1029a version Sharktooth posted. As to going with .NET 2.0, :stupid: I had somehow assumed that we were already using .NET 2.0

Yep, I'm evil and disabled CVS write privileges for everyone except admins so that we use the Patch Tracker, hehe. It's a training period so that admins get used to checking it as much as anything else.
As I said above: anonymous CVS is a pain, as is making patches. :devil: Can I have my developer access back, please, or can I be made an admin? This 'training period' excuse seems quite flimsy to me.

Changelog:
-Redesigned One Click mode to have a basic and advanced tab. Added oneclick profiles, and added support for avs profiles inside oneclick.
-Allowed user to select "Don't care" for the file target in both AutoEncode and OneClick, so that MeGUI will not adjust the bitrate to reach the target, but will instead use the profile's settings. This also allows the use of crf and qp in AutoEncode and OneClick.

Sharktooth
2nd January 2006, 15:33
So the question rises again... Shall we move to .NET 2.0?

Mutant_Fruit
2nd January 2006, 15:51
Well, there's no disadvantages to moving except that people will have to install the .NET2.0 package (but they'll either already have it thanks to windows update, or will have to install it soon enough anyway). Advantages include more controls and hopefully faster development due to VC# Express being a bit better, so i'd say go for it.

Sharktooth
2nd January 2006, 15:56
I know what are the advantages... also the "x264 ppl" chosen .NET 2.0 too ( http://forum.doom9.org/showthread.php?t=104797 ), but the other devs should agree to move to .NET 2.0 (im all for it though).

Sharktooth
2nd January 2006, 16:15
Heres a build if anyone wants to check out the new x264 configuration dialog layout.

Let me know of any problems.

http://www.fileshack.us/files/741/MeGUI-New-x264-Dialog.zip
It's Deblocking Strenght and Deblocking Threshold.

Mutant_Fruit
2nd January 2006, 16:30
Whoops, my bad. I just renamed them, created a patch and uploaded to SF. I think its pretty much finished. I havn't spotted any cut-off text. Everything seems to be placed appropriately. All the controls are still linked to their correct events (as far as i can tell). So i think its good to go.

Doom9
2nd January 2006, 16:33
Shall we move to .NET 2.0?Yes.. I've just installed VS2k5 on every machine I develop on.

Sharktooth
2nd January 2006, 16:57
On my way... :)

Sharktooth
2nd January 2006, 17:03
CVS Update: included berrinam patch. It now requires .NET 2.0 to compile.
0.2.3.1030 2 Jan 2005
Redesigned One Click mode to have a basic and advanced tab. Added oneclick profiles, and added support for avs profiles inside oneclick.
Allowed user to select "Don't care" for the file target in both AutoEncode and OneClick, so that MeGUI will not adjust the bitrate to reach the target, but will instead use the profile's settings. This also allows the use of crf and qp in AutoEncode and OneClick.


However snow and x264 conditional compiling is br0ken. Easy to fix but have no time to do it right now.

max-holz
2nd January 2006, 18:50
CVS Update: included berrinam patch. It now requires .NET 2.0 to compile.
0.2.3.1030 2 Jan 2005
Redesigned One Click mode to have a basic and advanced tab. Added oneclick profiles, and added support for avs profiles inside oneclick.
Allowed user to select "Don't care" for the file target in both AutoEncode and OneClick, so that MeGUI will not adjust the bitrate to reach the target, but will instead use the profile's settings. This also allows the use of crf and qp in AutoEncode and OneClick.


However snow and x264 conditional compiling is br0ken. Easy to fix but have no time to do it right now.
Possible having source on webalice? ;)

Ciao

Doom9
2nd January 2006, 19:54
Made my first changes. Is it possible to tell tortoise to store my password? It's not like anybody else could use this box.

Also, does anybody know how tortoise will act when I take those files to my notebook tomorrow, work in them on my way to work and back, then put them back on the PC where I have tortoise installed?

And does anybody know of a good diff that tortoise could use?

Last but not least, has anybody figured out how to make VS2k5 (or Express) stop complaining about GUI classes with conditional compilation statements? It's not like this warning has any useful meaning in the current context.

Pasqui
2nd January 2006, 19:55
Using MeGUI 0.2.3.1029a for .NET2.0, I cannot set the avisynth plugins folder. The dialog box only shows the Program Files folder and its subfolders, but my Avisynth installation in another folder (F:\DVD\AviSynth2).

Raithmir
2nd January 2006, 20:24
you mean in the logfiles?

Yes in the log files, I know that it has the time in the queue tab but I delete those entries when I've finished and have been going back looking through the log files.

...and yes lets move to .NET 2.0! :)

bob0r
3rd January 2006, 00:51
compile x264-svn:

Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

OneClickConfigurationDialog.cs(201,16): error CS0246: The type or namespace name 'OneClickSettings' could not be found (are you missing a using directive or an assembly reference?)
OneClickProfile.cs(9,11): error CS0246: The type or namespace name 'OneClickSettings' could not be found (are you missing a using directive or an assembly reference?)
OneClickProfile.cs(10,10): error CS0246: The type or namespace name 'OneClickSettings' could not be found (are you missing a using directive or an assembly reference?)
OneClickProfile.cs(22,39): error CS0246: The type or namespace name 'OneClickSettings' could not be found (are you missing a using directive or an assembly reference?)
OneClickWindow.cs(16,17): error CS0246: The type or namespace name 'lavcSettings' could not be found (are you missing a using directive or an assembly reference?)
OneClickWindow.cs(17,17): error CS0246: The type or namespace name 'snowSettings' could not be found (are you missing a using directive or an assembly reference?)
OneClickWindow.cs(18,17): error CS0246: The type or namespace name 'xvidSettings' could not be found (are you missing a using directive or an assembly reference?)
OneClickWindow.cs(29,17): error CS0246: The type or namespace name 'VideoUtil' could not be found (are you missing a using directive or an assembly reference?)
OneClickWindow.cs(377,37): error CS0246: The type or namespace name 'AspectRatio' could not be found (are you missing a using directive or an assembly reference?)

berrinam
3rd January 2006, 01:20
The transition to .NET 2.0 means that compile.bat no longer works (it uses the .NET 1.1 compiler). Anyway, MeGUI 0.2.3.1030 adds no features that are relevant to x264-svn, so try compiling 1029a, as that should work with .NET 1.1

LiFe
3rd January 2006, 01:37
Hmm dev has sorta exploded? I didn't get as much of the help file done as desired during the hols, and I'm back at work (and got 2 after work jobs to get done). Next update will be done on the weekend.

bob0r
3rd January 2006, 01:56
@berrinam

I cant compile with 1.1 also anymore:

compile x264-svn:

Microsoft (R) Visual C# .NET Compiler version 7.10.6001.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

OneClickConfigurationDialog.cs(13,12): error CS1518: Expected class, delegate, enum, interface, or struct
OneClickConfigurationDialog.Designer.cs(3,5): error CS0116: A namespace does not directly contain members such as fields or methods
OneClickConfigurationDialog.Designer.cs(3,19): error CS0101: The namespace 'MeGUI' already contains a definition for 'OneClickConfigurationDialog'
OneClickConfigurationDialog.cs(13,26): (Location of symbol related to previous error)
OneClickWindow.cs(13,12): error CS1518: Expected class, delegate, enum, interface, or struct
OneClickWindow.Designer.cs(3,5): error CS0116: A namespace does not directly contain members such as fields or methods
OneClickWindow.Designer.cs(3,19): error CS0101: The namespace 'MeGUI' already contains a definition for 'OneClickWindow'
OneClickWindow.cs(13,26): (Location of symbol related to previous error)

I already have a working version of megui.exe with older source, i was just pointing this out, so DEVs can fix it :sly:

Mutant_Fruit
3rd January 2006, 08:53
bob0r: You need .NET2.0 to compile it from now on. It won't work against 1.1 or older.

Doom9
3rd January 2006, 09:03
I'll see to it that compile.bat will work properly under .NET 2.0 but as already pointed out, the move has been done.. I've already made several changes towards that effect and I'm currently revamping the video encoder architecture.. as a sideffect getting rid of the last two remaining compiler warnings that affect .NET 2.0.

And as Sharktooth mentioned: conditional compilation is currently broken.. so you can't build any new svn builds.. but since there have been no changes for that particular version, it shouldn't be too problematic.

Sharktooth
3rd January 2006, 17:01
@doom9: tortoise svn cant store the pass.

Microsoft.DirectX.AudioVideoPlayback is not necessary!!! :P

Sharktooth
3rd January 2006, 17:27
CVS update:
Fixed x264 and Snow conditional compiling
Removed Microsoft.DirectX.AudioVideoPlayback from the references

Sources: http://www.webalice.it/f.corriga/megui/MeGUI-src.CVS.0.2.3.1030.7z
Bins on SF (http://www.sf.net/projects/megui).

godhead
3rd January 2006, 18:41
Sorry, been away from computer access for the New year. I'll grab the latest CVS tonight and start looking at what I can fix now that we've moved to the 2.0 framework.

Are we going to start using the task and bug reporting features of SF so that we can coordinate changes more efficiently? I'd like to just look at my SF account to see what changes are needed rather than digging through this long thread.

Raithmir
3rd January 2006, 19:53
AVISynth Script creator not working for me in 2.3.1030, clicking on the edit tab is just blank, 1029a works fine.

Sharktooth
3rd January 2006, 20:53
ensure to load the default profile.

Raithmir
3rd January 2006, 21:09
ah that worked :)

Mutant_Fruit
3rd January 2006, 22:01
redo the whole x264 tri-state section to have one big method that handles activation/deactivation for each GUI element. That method will be called by showCommandline. In addition, make it so that showCommandline is only triggered once the GUI is fully created and the entire settings have been loaded.
Does this still have to be done, and what exactly do you mean by tri-state section.

Also I assume you mean enabling and disabling of controls when you see activation/deactivation.

Sharktooth
3rd January 2006, 22:02
The TO DO list is not up to date :(
I think it has been already done (or at least partially done).
As soon as doom9 updates the TO DO list in the first post i'll add a TODO.txt to the CVS.

fegul
3rd January 2006, 22:33
I dont speak programming, but I'd like to see MeGUI get better as it has a lot of potential. The main errors and bugs that I have encountered thus far; When I use the Avisynth creator and hit prevew after inputing the d2v file, I get a narrow black bar that has no video. Also, when I hit crop, I get this;
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentNullException: Value cannot be null.
Parameter name: image
at System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y, Int32 width, Int32 height)
at MeGUI.VideoPlayer.resizeBitmap(Bitmap b, Int32 nWidth, Int32 nHeight)
at MeGUI.VideoPlayer.positionSlider_Scroll(Object sender, EventArgs e)
at MeGUI.VideoPlayer.crop(Int32 left, Int32 top, Int32 right, Int32 bottom)
at MeGUI.AviSynthWindow.sendCropValues()
at MeGUI.AviSynthWindow.crop_CheckedChanged(Object sender, EventArgs e)
at System.Windows.Forms.CheckBox.OnCheckedChanged(EventArgs e)
at System.Windows.Forms.CheckBox.set_CheckState(CheckState value)
at System.Windows.Forms.CheckBox.OnClick(EventArgs e)
at System.Windows.Forms.CheckBox.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.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///E:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
megui
Assembly Version: 0.2.3.1030
Win32 Version: 0.2.3.1030
CodeBase: file:///F:/DVD%20Rips/bitcalc/MeGUI/megui.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
bvd27uqz
Assembly Version: 0.2.3.1030
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
jq7878b1
Assembly Version: 0.2.3.1030
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
8yf-dzrk
Assembly Version: 0.2.3.1030
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///E:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Does null mean that this has not been developed yet?

Sharktooth
3rd January 2006, 22:38
No it means a value cannot be "null"... :)
Can you post your .avs and .d2v files too?

fegul
3rd January 2006, 22:52
No it means a value cannot be "null"... :)
Can you post your .avs and .d2v files too?

I couldnt get an avs file made since the program crashed before it could make one

Heres the link to my d2v file; http://hailut.homedns.org/VTS_08_1.d2v

made it using DGindex 1.45

godhead
3rd January 2006, 23:23
The TO DO list is not up to date :(
I think it has been already done (or at least partially done).
As soon as doom9 updates the TO DO list in the first post i'll add a TODO.txt to the CVS.

Shouldn't the TODO be moved to Source Forge tasks so that it's not required to get a CVS update just to see the TODO?

berrinam
3rd January 2006, 23:37
@fegul: This sounds like it could be a problem with either DGDecode.dll in the wrong place (I'm no longer exactly sure where it should be, but charleski should know), or the Default Profile not selected in the avs profile window.

@devs: The problem with the default profile not selected by default should be solved by changing avsProfile = "default"; in MeGUISettings.<init> to avsProfile = "Default Profile";