Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
18th August 2005, 20:00 | #321 | Link | |
clueless n00b
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
|
Quote:
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org |
|
19th August 2005, 03:46 | #322 | Link | |
Registered User
Join Date: May 2005
Posts: 184
|
Quote:
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. |
|
19th August 2005, 04:34 | #323 | Link | |
結城有紀
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
|
Quote:
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 |
|
19th August 2005, 13:23 | #324 | Link |
Registered User
Join Date: Apr 2005
Posts: 1,740
|
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 Code:
else if (containerFormat.SelectedIndex == 2) // mp4 Code:
else if (containerFormat.SelectedIndex == 1 || containerFormat.SelectedIndex == 2) // mkv or mp4 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 Code:
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; } } Code:
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; } } Code:
private int outputSARX; private int outputSARY; Code:
int scriptVerticalResolution = VideoUtil.suggestResolution(reader.Height, reader.Width, Double.Parse(customDAR.Text), AutoCropValues, (int)horizontalResolution.Value, signalAR.Checked, out outputSARX, out outputSARY); Code:
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: Code:
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) Code:
// Signal the AR if (signalAR) applyAspectRatio(SARX, SARY, videoSettings); muxedOutput);[code] to Code:
mjob = jobUtil.generateMuxJob(vjobs[vjobs.Length - 1], audio, subtitles, chapters, muxtype, SARX, SARY, muxedOutput); 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; } } Code:
private int sarX, sarY; Code:
/// <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;} } Code:
sarX = -1; sarY = -1; Code:
public MuxJob generateMuxJob(VideoJob vjob, SubStream[] audioStreams, SubStream[] subtitleStreams, string chapterFile, MUXTYPE type, int SARX, int SARY, string output) Code:
job.Settings.SARX = SARX; job.Settings.SARY = SARY; Code:
string retval = "\"" + mkvmergePath + "\" -o \"" + output + "\" "; if (settings.SARX > 0 && settings.SARY > 0) retval += "--aspect-ratio 0:" + settings.SARX + "/" + settings.SARY + " "; retval += "-A -S \"" + input + "\" "; Code:
vUtil.generateJobSeries(videoInput, videoOutput, muxedOutput.Text, this.videoSettings.clone(), aStreams, audio, subtitles, chapters, desiredSize, splitSize, (double)containerOverhead.Value, type, -1, -1, false); Code:
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); 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) |
19th August 2005, 13:39 | #325 | Link |
Registered User
Join Date: Apr 2005
Posts: 1,740
|
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 Code:
else videoOutput += ".mkv"; Code:
else videoOutput += ".mp4"; Last edited by berrinam; 19th August 2005 at 13:45. |
19th August 2005, 19:27 | #326 | Link | |||
clueless n00b
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
|
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.
Quote:
Quote:
And for those codecs that support signalling on stream level: wouldn't it be better to rely on that? Quote:
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org |
|||
19th August 2005, 21:36 | #327 | Link | ||||
Registered User
Join Date: Apr 2005
Posts: 1,740
|
Quote:
Quote:
Quote:
Quote:
Last edited by berrinam; 19th August 2005 at 21:43. |
||||
19th August 2005, 22:20 | #328 | Link | ||
clueless n00b
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
|
Quote:
Quote:
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org |
||
19th August 2005, 23:40 | #329 | Link |
clueless n00b
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
|
I've upped the latest sources.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org |
21st August 2005, 08:52 | #330 | Link |
結城有紀
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 894
|
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 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 i use: Code:
this.Text = (double)((int)(su.PercentageDoneExact * 100)) / (double)100 + " % - " + su.JobName + " - MeGUI " + version; Last edited by MeteorRain; 21st August 2005 at 09:03. |
21st August 2005, 13:25 | #331 | Link | ||
clueless n00b
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
|
Quote:
Quote:
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.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org |
||
21st August 2005, 20:30 | #333 | Link |
clueless n00b
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
|
@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.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org |
22nd August 2005, 02:34 | #334 | Link |
Registered User
Join Date: Aug 2003
Posts: 17
|
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 Code:
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 . |
22nd August 2005, 07:45 | #335 | Link | |
FFmpeg fan
Join Date: Dec 2003
Location: Germany
Posts: 427
|
Quote:
Hellfred |
|
29th August 2005, 12:54 | #336 | Link |
clueless n00b
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
|
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.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org |
29th August 2005, 16:15 | #337 | Link |
Mr. Sandman
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
|
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.
__________________
MPEG-4 ASP Custom Matrices: EQM V1(old), EQM AutoGK Sharpmatrix (aka EQM V2), EQM V3HR (updated 01/10/2004), EQM V3LR, EQM V3ULR (updated 04/02/2005), EQM V3UHR (updated 17/12/2004) and EQM V3EHR (updated 05/10/2004) Info about my ASP matrices. MPEG-4 AVC Custom Matrices: EQM AVC-HR Info about my AVC matrices My x264 builds. Mooo!!! |
29th August 2005, 17:23 | #338 | Link |
clueless n00b
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
|
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.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org |
30th August 2005, 07:22 | #339 | Link |
Registered User
Join Date: Apr 2005
Posts: 1,740
|
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 Code:
videoSettings.SARX = outputSARX; videoSettings.SARY = outputSARY; Add to MuxSettings Code:
private int sarX, sarY; Code:
sarX = -1; sarY = -1; Code:
/// <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;} } Code:
job.Settings.SARX = vjob.Settings.SARX; job.Settings.SARY = vjob.Settings.SARY; CommandlineGenerator.generateMkvmergeCommandline should be changed in an identical way to my previous post, ie changing the first line into the following four: Code:
string retval = "\"" + mkvmergePath + "\" -o \"" + output + "\" "; if (settings.SARX > 0 && settings.SARY > 0) retval += "--aspect-ratio 0:" + settings.SARX + "/" + settings.SARY + " "; retval += "-A -S \"" + input + "\" "; Code:
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); Code:
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; } Code:
if (videoSettings is xvidSettings && outputSARX > 0 && outputSARY > 0) ((xvidSettings)videoSettings).PAR = roundPAR(); Code:
this.width = (int) horizontalResolution.Value; this.height = scriptVerticalResolution; |
Tags |
development, megui, not a help thread |
Thread Tools | Search this Thread |
Display Modes | |
|
|