Log in

View Full Version : x264 MeGUI 2nd pass has more frames than 1st?


zerowalker
5th February 2014, 20:02
Never got this issue before and can't find a solution.

I am trying to encode an AVI files which is losslessly encoded from a script and is 37650 frames.

But the 2nd pass says it wants 18825 frames, which is exactly half that, which makes me think there must be something wrong.

I have done this many times with other files, saved the original through my script to a lossless avi then encode it, as it goes faster with 2 passes (instead of running through the script 2 times).

It's a normal Avisource compatible file so it should be frame accurate.


Any ideas, i am using the latest MeGUI and it's tools.

program --preset veryslow --pass 2 --bitrate 200 --stats ".stats" --input-depth 16 --input-res 640x480 --output "output" "input"

The scripted file is in 16bit and i encode to 10bit, so i use this way to reduce the dithering being done.

sneaker_ger
5th February 2014, 20:37
From your description I'm not really sure what exactly it is that you are doing but not only is 18825 exactly half of 37650, 8 bit is exactly half of 16 bit as well. My guess would be that you are feeding x264 with 8 bit data while it is expecting 16 bit and thus produce garbage. For further help you will probably have to provide more info, e.g. the format of the avi file, your avisynth script and a MeGUI log.

zerowalker
5th February 2014, 20:46
How stupid of me, you are correct, i know looked through the files and it seems that file hasn't been done with the script i thought.
Not sure how i could have failed, i think i did some debugging and forgot about it.

Will see if it get's solved by redoing everything, most likely it will.

zerowalker
5th February 2014, 23:56
It doesn't seem to work still, i just don't get it.

Here is the Script:

Avisource("...")
ConvertToYV12(matrix="Rec601", interlaced=false)
smdegrain(tr=2,lsb=true,thsad=500,lsb_out=true,search=3)
fft3dgpu(sigma=1.3, plane=3)
Dither_convey_yuv4xxp16_on_yvxx()
dither_DitherPost(mode=0, stacked=True, interlaced=False, y=3, u=3, v=3, staticnoise=False)

So the file saved will be 16bit, so i just tell x264 to treat it like 16bit and encode it to 10bit.

PS:

Okay wait, it seems i have ditherpost for some reason left after my debugging, probably that's the thing as it turns the 16bit to 8bit or whatever it will be in the end.
Will report back once again;P

sneaker_ger
6th February 2014, 10:46
Okay wait, it seems i have ditherpost for some reason left after my debugging, probably that's the thing as it turns the 16bit to 8bit or whatever it will be in the end.

Yes, that would be the case. I'm also wondering about the fft3dgpu within the 16 bit part - not sure if fft3dgpu is suited for 16 bit processing.

zerowalker
7th February 2014, 02:01
The fft3dgpu is supposed to remove the great chroma noise i have with my webcam, it's probably not ideal for it, but i can't find another way to do it as fast as it does.

zerowalker
13th February 2014, 07:39
Okay i am having more problems, not the same but stuck.

here is all the information:

Megui Log:
--[Error] [2/13/2014 7:25:41 AM] Standard error stream
---[Information] [2/13/2014 7:25:42 AM] raw [info]: 640x480p 1:1 @ 625000/20921 fps (cfr)
---[Information] [2/13/2014 7:25:42 AM] x264 [info]: using SAR=1/1
---[Information] [2/13/2014 7:25:44 AM] x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
---[Information] [2/13/2014 7:25:44 AM] x264 [info]: profile High 10, level 3.0, 4:2:0 10-bit
---[Information] [2/13/2014 7:34:53 AM] x264 [info]: frame I:188 Avg QP:46.88 size: 14430
---[Information] [2/13/2014 7:34:53 AM] x264 [info]: frame P:55354 Avg QP:49.89 size: 10436
---[Information] [2/13/2014 7:34:53 AM] x264 [info]: frame B:29 Avg QP:50.52 size: 10116
---[Information] [2/13/2014 7:34:53 AM] x264 [info]: consecutive B-frames: 99.9% 0.0% 0.0% 0.0% 0.0% 0.1% 0.0% 0.0% 0.0%
---[Information] [2/13/2014 7:34:53 AM] x264 [info]: mb I I16..4: 69.6% 0.0% 30.4%
---[Information] [2/13/2014 7:34:53 AM] x264 [info]: mb P I16..4: 98.2% 0.0% 0.0% P16..4: 1.8% 0.0% 0.0% 0.0% 0.0% skip: 0.0%
---[Information] [2/13/2014 7:34:53 AM] x264 [info]: mb B I16..4: 50.1% 0.0% 0.0% B16..8: 17.8% 0.0% 0.0% direct:28.7% skip: 3.4% L0:36.7% L1:57.1% BI: 6.3%
---[Information] [2/13/2014 7:34:53 AM] x264 [info]: final ratefactor: 29.79
---[Information] [2/13/2014 7:34:53 AM] x264 [info]: direct mvs spatial:89.7% temporal:10.3%
---[Information] [2/13/2014 7:34:53 AM] x264 [info]: coded y,uvDC,uvAC intra: 54.3% 81.2% 77.8% inter: 63.5% 97.9% 84.5%
---[Information] [2/13/2014 7:34:53 AM] x264 [info]: i16 v,h,dc,p: 22% 66% 11% 1%
---[Information] [2/13/2014 7:34:53 AM] x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 1% 89% 5% 0% 1% 0% 1% 0% 2%
---[Information] [2/13/2014 7:34:53 AM] x264 [info]: i8c dc,h,v,p: 21% 78% 0% 1%
---[Information] [2/13/2014 7:34:53 AM] x264 [info]: Weighted P-Frames: Y:10.3% UV:10.2%
---[Information] [2/13/2014 7:34:53 AM] x264 [info]: kb/s:2497.29
---[Information] [2/13/2014 7:34:53 AM] encoded 55571 frames, 100.77 fps, 2497.29 kb/s
---[Error] [2/13/2014 7:34:55 AM] avs [error]: Error occurred while writing frame 28943
---[Information] [2/13/2014 7:34:55 AM] (Maybe x264 closed)
--[Information] [2/13/2014 7:34:55 AM] Job completed


Script, resaved to a simple AVI file with Avspmod.
Avisource("...").SyncAudio(0.999887261060145).DelayAudio(-0.0229780263762223)
ConvertToYV12(matrix="Rec601", interlaced=false).Normalize(0.9)
smdegrain(tr=3,lsb=true,thsad=300,lsb_out=true,search=3,truemotion=true)
fft3dgpu(sigma=3.0, plane=3)
Dither_convey_yuv4xxp16_on_yvxx()


The resaved AVI file feeded into Megui.
Avisource("...")



The error occurs when the encoding is done on 1st pass, so it looks like all is well but then instead of Done i get Error, at the same frame, which i don't understand what's wrong with.

Hopefully it's something easy, but as with earlier, i can't figure it out.