View Full Version : What to do if MeGUI can't auto-detect deinterlace pattern?
Kiichi
8th August 2007, 15:25
Hello there,
This is my first post, I used MeGUI for a few months without problems. But now I have one that I can't solve....
Since English is not my native language, the following description may have some grammar error, sorry in advance.
I would like to compress an anime DVD (I don't know if it is sutable to say its name) to x264 mp4 file so that I can store or play it on my PSP or PS3. But when I ripped its file, DGindex-ed it, and load the result d2v file as usual, MeGUI says "Source detection couldn't determine the source type!" when it finished deinterlace auto detection.
I wrote a simple avs script and look it in virtual dub, I found its opening is 30fps progressive. I also looked the starting portion of the main part, it has 2 frame combed after 3 progressive, likely telecined. But in my experience, MeGUI should detect such movie without problem, even it is hybrid source.
Then I tried to separate opening movie (ch1) and main movie (other chapters), and detect main part only, but it didn't work.
Finally I tried to alter the source detector configuration many times, I ended up with:
Analysis percentage = 10%
Minimum analysis sections = 200
Hybrid threshold = 5%
Hybrid Field order threshold = 10%
I also tried portions allowed both ON and OFF (with default value), but still don't work.
Can someone tell me what can I do? Any suggestion is appreciated.
check
8th August 2007, 15:59
The video is variable framerate. You have three options:
o deinterlace it all: you get smooth OP/ED motion, jerky main motion
o IVTC it all: vice versa
o encode as vfr. Uses mkv or mp4 timecodes to produce a file that runs at 29.97 for the OP/ED and 23.976 for the main scenes. Read the tdecimate help file for info on this.
Selur
8th August 2007, 16:21
one could bob the material,...
Kiichi
8th August 2007, 16:55
o encode as vfr. Uses mkv or mp4 timecodes to produce a file that runs at 29.97 for the OP/ED and 23.976 for the main scenes. Read the tdecimate help file for info on this.
Hello check,
Actually what I am going to do is like vfr way, (my plan is encode OP at 29.97fps in 1.mp4 and IVTC main part in 2.mp4, then use mp4box to join them and mux the audio.) But as I wrote in first post: Even though I separated the main part via just rip ch2~4 of the vob, the MeGUI still couldn't detect what kind of IVTC parameters it should use.
Usually it can detect without problem. But I guess the still picture in this anime is too much so that MeGUI cannot recognize the comb pattern. I don't know if my guess is correct, if someone knows the fact I will be glad to know.
It seems I have no choice but write IVTC script manually in such situation, I read TFM and TDecimate document but it have so much modes to set. Is there any way to figure out what mode should I use? (Or it is not possible since MeGUI cannot detect it either...)
check
9th August 2007, 00:38
well, there is YATTA, but it's pretty complicated and mostly only for use when you *really* want perfect quality -- which you dont need for small screen rips. I'd say just use tfm().tdecimate() for your IVTC and the output should be pretty good. For deinterlacing I'd go with tdeint().
foxyshadis
10th August 2007, 00:19
Since it's only progressive OP/ED and telecined main, it probably won't be that hard to just manually find the cut points and reuse it for all the episodes. Won't take long, and it's better than megui's hybrid methods, which all coerce it to one framerate or another rather than vfr.
If there's any hybrid in the main part, for flashes, effects, or whatever, it can get a lot more complicated though. If you want to post a short segment of the original .m2v, one of us can look over it and see if it's possible to improve megui's detection.
Kiichi
10th August 2007, 15:12
If there's any hybrid in the main part, for flashes, effects, or whatever, it can get a lot more complicated though. If you want to post a short segment of the original .m2v, one of us can look over it and see if it's possible to improve megui's detection.
Thanks foxyshadis, I am willing to help. I think I should demux mpeg2 video (I guess .m2v means it) from vob, cut some segment, and test it in MeGUI to make sure it is un-detectable.
But unfortunately I don't know how to do because I know only basic steps for ripping and compressing. Is there any guide or thread I can follow?
check
10th August 2007, 15:34
I have some ancient version of chopperXP that I use for vob cutting, see if you can find a version of that online. If not, just google and see what comes up.
DeathAngelBR
10th August 2007, 17:50
The TIVTC I downloaded comes with 2 VFR scripts, one for first pass and another for second pass.
first pass:
LoadPlugin("c:\avsfilters\dgdecode.dll")
LoadPlugin("c:\avsfilters\tivtc.dll")
d2vpath = "c:\vobs\ep1.d2v"
mpeg2source(d2vpath)
tfm(d2v=d2vpath,output="c:\vobs\ep1-tfm.txt")
tdecimate(mode=4,output="c:\vobs\ep1-tdec.txt")
# this next line assumes the source is dvd 720x480
# and crops it down to 32x32 to save processing time
# since we're only interested in letting tfm/tdecimate
# gather info and not the actual result
crop(344,224,-344,-224)
second pass:
LoadPlugin("c:\avsfilters\dgdecode.dll")
LoadPlugin("c:\avsfilters\tivtc.dll")
#load other needed plugins for filtering
d2vpath = "c:\vobs\ep1.d2v"
mpeg2source(d2vpath)
tfm(d2v=d2vpath,input="c:\vobs\ep1-tfm.txt")
# If your source is not anime or cartoon then add
# vfrDec=0 into the line below
tdecimate(mode=5,hybrid=2,input="c:\vobs\ep1-tdec.txt",tfmIn="c:\vobs\ep1-tfm.txt",mkvOut="c:\vobs\ep1-timecodes.txt")
# add other processing below, such as filtering
# cropping, resizing, color correction, etc...
Kiichi
10th August 2007, 18:03
I uploaded the "next preview" part of this anime by rapidshare.
http://rapidshare.com/files/48159934/Yokoku.rar.html
My MeGUI cannot detect its interlace type.
There is one thing I would like to know: does PS3 accepts VFR mp4 movie?
DeathAngelBR
10th August 2007, 18:14
My MeGUI cannot detect its interlace type.
I too had this problem, so I selected "hybrid/mostly film" with "top field first" in megui.
The bad part about the 2 VFR scripts in my post above is that it shows only 260 video frames at 29,97fps. But then again these frames remain interlaced/combed without it.
Kiichi
11th August 2007, 09:25
According to AVISynth WIKI VFR process (http://avisynth.org/mediawiki/VFR), There is three ways to do VFR:
1. Generate 120fps avi with drop-frames and mux it to mp4: I don't know how to do this because it does not have detail description.
2. Generate OP in 29.97fps progressive mp4, Then Generate Main+ED+next Preview in 23.97fps decimated mp4, use "mp4box -cat OP.mp4 -cat main.mp4 -new all.mp4". But after the process done my mp4 can only play until OP ends. After 1:30 the sound continues but video freezes at the last frame of OP and cannot continue. I searched doom9 and found that mp4box cannot join two movies with different setting, but my meGUI profile for these two files are the same except their fps.
3. Use tfm and tdecimate to generate MKV timecode, then use tc2mp4 to import it. The file is playable, but the ssa file I "burned" into mp4 during 2nd pass of encoding have timing problem. (In some times subtitle appears faster than sound, some other times it appears slower) I think its because timecode is muxed after subtitles goes in. Since PS3 and PSP does not support SSA playing, I cannot use external SSA.
foxyshadis
11th August 2007, 11:56
3. Burn the sub prior to trimming. ie, instead of:
trim(4300,0) # start of main movie
textsub("mysubs")
you use:
textsub("mysubs")
trim(4300,0) # start of main movie
2 kind of sucks, it depends on what patches are in your build of mp4box, some builds are more permissive than others. A bit of a PITA. 1 is not really a good idea if you use b-frames. It might work or it might go horribly out of sync.
Kiichi
11th August 2007, 13:47
3. Burn the sub prior to trimming. ie, instead of:
trim(4300,0) # start of main movie
textsub("mysubs")
you use:
textsub("mysubs")
trim(4300,0) # start of main movie
Sorry foxyshadis, I don't understand your meaning.
Following codes is what I used in method 3, I didn't use trimming to separate OP and main movie in this case:
1st pass, generate field matching and decimate log:
# Set DAR in encoder to 16 : 9. The following line is for automatic signalling
global MeGUI_darx = 16
global MeGUI_dary = 9
LoadPlugin("D:\Program Files2\AviSynth 2.5\plugins\TIVTC.dll")
LoadPlugin("D:\Program Files2\AviSynth 2.5\plugins\DGDecode.dll")
DGDecode_mpeg2source("VTS_01_1.d2v",cpu=4,info=3)
ColorMatrix(hints=true,interlaced=true)
tfm(mode=1, output="tfm.txt")
TDecimate(mode=4, output="stats.txt")
After I got played 1st avs thru virtualdub, I got tfm.txt and stats.txt and go to next step, this is where I burned the subtitle in.
2nd pass, encode and generate MKV timecode:
# Set DAR in encoder to 16 : 9. The following line is for automatic signalling
global MeGUI_darx = 16
global MeGUI_dary = 9
LoadPlugin("D:\Program Files2\AviSynth 2.5\plugins\VSFilter.dll")
LoadPlugin("D:\Program Files2\AviSynth 2.5\plugins\TIVTC.dll")
LoadPlugin("D:\Program Files2\AviSynth 2.5\plugins\DGDecode.dll")
DGDecode_mpeg2source("VTS_01_1.d2v",cpu=4,info=3)
ColorMatrix(hints=true,interlaced=true)
tfm(mode=1)
TDecimate(mode=5, hybrid=2, dupthresh=1.0, input="stats.txt", tfmin="tfm.txt", mkvout="timecodes.txt")
textsub("mysub.ssa")
I loaded pass2.avs into megui and encoded it. Also I got timecodes.txt. Then I muxed timecode file into pass2.mp4:
tc2mp4.exe -i pass2.mp4 -t timecodes.txt -o pass2-vfr.mp4
The result file (pass2-vfr.mp4) is playable but subs are out of sync. If there is anything wrong please correct me.
foxyshadis
12th August 2007, 05:24
Just put textsub before tdecimate. Once you go vfr, you will no longer have any audio or subtitle sync at all, until you remux with timecodes. Before that time, everything is still in sync.
Kiichi
12th August 2007, 14:35
Thank you foxyshadis!
Finally I made all these stuff to work properly.
I hope one day some guru will make an automatic tool to handle 120fps avi and VFR mp4 :p
Many thanks to all people who helps.
Krad
12th August 2007, 20:18
There is one guide how to make vfr mkv files from 120 fps avi.
Just look here - http://forum.doom9.org/showthread.php?s=&threadid=68562
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.