Log in

View Full Version : 2nd pass problem with x264


Pages : [1] 2

uk10
14th October 2006, 12:06
Using x264 version 574 and above I get such an error while trying to make 2nd pass:

x264 [error]: requested bitrate is too low. estimated minimum is 35711 kbps
x264 [error]: x264_encoder_open failed

The command line that I use for the 2nd pass is:

x264.exe --pass 2 --bitrate 876 --stats "D:\new.stats" --ref 8 --mixed-refs --bframes 3 --b-pyramid --b-rdo --bime --weightb --direct auto --filter 1,1 --subme 6 --trellis 1 --analyse all --8x8dct --vbv-maxrate 25000 --me umh --merange 12 --threads 2 --thread-input --progress --no-psnr --output "D:\new.mp4" "D:\new.avs"

The command line that I use for the 1st pass is:

x264.exe --pass 1 --bitrate 876 --stats "D:\new.stats" --bframes 3 --b-pyramid --direct auto --filter 1,1 --subme 1 --analyse none --vbv-maxrate 25000 --me dia --merange 12 --threads 2 --thread-input --progress --no-psnr --output NUL "D:\new.avs"

What should I do to make it work properly?

Sharktooth
14th October 2006, 12:47
post your .avs.

foxyshadis
14th October 2006, 13:01
This kind of thing usually happens if you screw up your script with something similar to AssumeFPS(30000,1.001).

uk10
14th October 2006, 13:22
Here it is:

AVISource("new.avi")
KillAudio()
ConvertToYV12()

check
14th October 2006, 14:06
does the avi have null frames? ie is it pseudo-vfr?

uk10
14th October 2006, 14:24
No it doesn't.

Sharktooth
14th October 2006, 14:26
have you tried using directshowsource and specifying the soure FPS?

uk10
14th October 2006, 14:29
I've tried DirectShowSource without specifying the soure FPS - the result was the same.

DarkZell666
14th October 2006, 14:32
Just to be sure : try doing a crf or cqp encore and check what the final filesize is (crf 20 for ex.) If it's really huge it might well just be that your source isn't compressible at all (or its 1024*768 @ 120fps ... >_<), 'coz 35mbps is indeed a lot 8-)

uk10
14th October 2006, 14:37
My source is 640*480 @ 29.97fps and I've already coded it earlier with previous version of x264 (vfw 552) and the same settings.

check
14th October 2006, 14:43
have you tried using directshowsource and specifying the soure FPS?
sharktooth already suggested this - have you tried it?

uk10
14th October 2006, 14:52
I'm trying it now...

uk10
14th October 2006, 15:03
Using:

DirectShowSource("new.avi", fps=29.970)
KillAudio()
ConvertToYV12()

I've got just the same with only one difference - error is now not specified (x264 just breaks on the 2nd pass).

bond
14th October 2006, 15:13
try using the same commandline for the first and second pass

Sharktooth
14th October 2006, 15:13
uhm... i suppose the avi is somewhat broken then.

uk10
14th October 2006, 15:17
uhm... i suppose the avi is somewhat broken then.
It's not the first avi which gives me such results :(

try using the same commandline for the first and second pass
I'll try, but this command lines are supposed to work properly (they are from Sharktooth x264 profile).

check
14th October 2006, 15:37
post up a few seconds of this avi.

uk10
14th October 2006, 15:42
Here are first 3 sec - deleted

check
14th October 2006, 16:15
sorry, rule #6. Try animesuki.

uk10
14th October 2006, 16:28
According to animesuki license database it's not licensed yet.

check
14th October 2006, 16:49
the idea of "licenced" anime and "unlicenced" anime can be better described as "japanese owner has sold distribution licence to an american reseller" and "japanese owner hasn't". The japanese creator of the show owns the rights worldwide (at least in all countries that respect ownership laws), they do not only exist in the western world when a reseller buys the rights to resell in america.

In short, just because it's only aired in Japan doesn't mean filesharing in western countries is legal. Try animesuki :)

uk10
14th October 2006, 17:07
OK. I understand (I'm personaly not from a "western" country), but the problem remains. There is not only anime that I can not encode but also some private shots from digital camera (they are originally in wmv format) :(

uk10
14th October 2006, 19:23
So, about encoding form wmv. I tried to encode a conference which was recorded with digital camera using the next script:

DirectShowSource("unian.05.10.06.wmv")
KillAudio()
Trim(0, 33333)
ConvertToYV12()

(I took only 26min). I used the same parameters as were shown in post 1 and got such an error:

x264 [error]: requested bitrate is too low. estimated minimum is -2147483648 kbps
x264 [error]: x264_encoder_open failed

How can you explain such a result?

uk10
14th October 2006, 19:37
Oh, I forgot to mention: file can be found here - deleted (~150 MB)

bond
14th October 2006, 21:53
striked for rule 6, link removed

uk10
15th October 2006, 12:25
Anyway, can somebody explain me why do I get minus value in estimated bitrate minimum? Is it a bug in x264?

mpioner
15th October 2006, 15:15
I have the same proplem
on 2 pass
x264 [error]: requested bitrate is too low. estimated minimum is -2147483648 kbps
x264 [error]: x264_encoder_open failed
i use HQ-Slow video profile

unmei
15th October 2006, 23:36
The minus is certainly not the problem, it just means that value is a signed 32bit int that overflew. If it was a wider datatype it wouldn't overflow and stay positive - but the problem would remain that it thinks your source needs more than 2TB/s.

There is something seriously wrong, no video of remotely sane resolution/fps can need that much bitrate, not even in lossless mode.

lexor
16th October 2006, 12:46
poor guy can't catch a break, he posts anime, he gets a strike, he posts a link to some conference, he gets a strike...

check
16th October 2006, 13:24
ahh, try adding a convertfps=true to the directshowsource line too.

uk10
16th October 2006, 14:17
ahh, try adding a convertfps=true to the directshowsource line too.
I've tried it, but the result was the same. I wonder: can it be a problem with AviSynth? I use AviSynth v2.5.6.

check
16th October 2006, 14:43
Unlikely. Post the avisynth output of version() though, and reinstall it with a new download of 2.5.6a from the site though (there have been a few silent updates).
What size does a constant quality encode come out at? Just use q=22

lexor
17th October 2006, 17:38
ahh, try adding a convertfps=true to the directshowsource line too.
I've tried it, but the result was the same. I wonder: can it be a problem with AviSynth? I use AviSynth v2.5.6.
the 25fps thing is a common problem when muxing to mp4, there has been a lot of posts about it a while back, the reason is that muxers default to 25fps when putting things into mp4 container, so you have to change that in the tool you use to mux.

uk10
17th October 2006, 18:44
Post the avisynth output of version() though
AviSynth 2.5.6, build:Oct 28 2005 [18:44:09]

uk10
17th October 2006, 19:13
What size does a constant quality encode come out at? Just use q=22
Constant quality encode (with q=22) produces something "funny": an mp4 file with size of 30MB, but of 22min, which I wanted to encode, it encoded only 6min and then produced some garbage (purple squares and rectangles for few seconds). Produced file reports video length of 22min.

uk10
17th October 2006, 19:14
the 25fps thing is a common problem when muxing to mp4, there has been a lot of posts about it a while back, the reason is that muxers default to 25fps when putting things into mp4 container, so you have to change that in the tool you use to mux.
My video is exactly 25fps.

check
17th October 2006, 23:22
what happens if you only use the first line of the avs script. Does it still die?

uk10
18th October 2006, 20:10
what happens if you only use the first line of the avs script. Does it still die?
Yes (on the same place).

check
19th October 2006, 11:35
sounds like a problem with the avi file then. You could try remuxing it to a better format. It's not h264 in avi is it?

uk10
19th October 2006, 12:17
sounds like a problem with the avi file then. You could try remuxing it to a better format. It's not h264 in avi is it?
No, better to say it's not an avi at all (Windows Media Video).

hanti
6th November 2006, 16:55
uk10 i solved this problem u just can't use threads more than 1
if u using megui u must uncheck this option too
/tools/settings/automaticaly set number of threads

pozdr

uk10
7th November 2006, 18:25
thanks a lot, hanti!!!

Sharktooth
7th November 2006, 18:28
uk10, have you a core2duo CPU?

uk10
8th November 2006, 15:37
no, it's P4 with HT

hushkamala
8th November 2006, 21:21
I'm getting the same error doing a dvdrip to x264/mkv. Even with only one thread :( (x264 r600 and last version of megui).

My script

# Set DAR in encoder to 47 : 20. The following line is for automatic signalling
global MeGUI_darx = 47
global MeGUI_dary = 20

Dgdecode_MPEG2Source("E:\grandmas\VTS_01_1.d2v",info=3).ColorYUV(levels="TV->PC").ColorMatrix(hints=true).Crop(0,58,0,-60)

Undot()

LanczosResize(720,368) # Lanczos (Sharp)

#Trim(25000,30000)

soosharp = Soothe(last.LimitedSharpenFaster(ss_x=1.45,ss_y=1.45,Smode=4),last,24)

noise = soosharp.blockbuster("noise",block_size=3,detail_min=1,detail_max=18,variance=0.1,seed=10)

bv2 = noise.MVAnalyse( isb = true, delta = 2, pel = 2,truemotion=true, overlap=0, idx = 3,sharp=1 )
bv1 = noise.MVAnalyse( isb = true, delta = 1, pel = 2,truemotion=true, overlap=0, idx = 3,sharp=1 )
fv1 = noise.MVAnalyse( isb = false, delta = 1, pel = 2,truemotion=true, overlap=0, idx = 3,sharp=1 )
fv2 = noise.MVAnalyse( isb = false, delta = 2, pel = 2,truemotion=true, overlap=0, idx = 3,sharp=1 )

denoised = noise.mvdegrain1(fv1+fv2,bv1+bv2)

return denoised

Error log

Starting job job1 at 19:27:34
encoder commandline:
--pass 2 --bitrate 1613 --stats "E:\grandmas.stats" --ref 5 --mixed-refs --no-fast-pskip --bframes 2 --b-pyramid --b-rdo --bime --weightb --filter 1,1 --subme 6 --trellis 2 --analyse all --8x8dct --vbv-bufsize 25000 --vbv-maxrate 25000 --thread-input --sar 1081:900 --cqmfile "E:\CQMS\x264\eqm_avc_hr.cfg" --progress --no-psnr --output "E:\grandmas.mkv" "E:\grandmas.avs"
successfully started encoding
Processing ended at 19:27:39
----------------------------------------------------------------------------------------------------------

Log for job job1

avis [info]: 720x368 @ 23.98 fps (136450 frames)
x264 [info]: using SAR=1081/900
x264 [error]: requested bitrate is too low. estimated minimum is -2147483648 kbps
x264 [error]: x264_encoder_open failed


This only happens when doing the second pass. And if i enable trim in the script (movie=~4min) it does the 2-passes without problems.

Sharktooth
9th November 2006, 16:01
MeGUI does not take any part in that problem.
Can you please do a test?
Backup the x264.exe in the megui directory... download the one on x264.nl and use it.
See if the error is still there. If it does then you can safely put the old x264.exe back into the megui dir.
If the error disappear then it's a problem with my builds.

hushkamala
9th November 2006, 18:54
i've red another post about this error... and someone said that the problem looks like to be in the stats file. after reading hanti's solution i've tryied to do a 2nd pass/1thread with the stats file done with 2threads.

going to do 1stpass again and if the error stays i'll try x264.nl builds.

hushkamala
10th November 2006, 16:28
error dissapeared! looks like the problem is in x264 1st pass with more than one thread.

Sharktooth
11th November 2006, 14:20
can you please verify if the same problem happens with the x264.nl build of x264?

Al79
12th November 2006, 06:24
Hi, i actually have almost the same error
Starting job job1-1 at 16:19:01
encoder commandline:
--pass 1 --bitrate 860 --stats "D:\HARUHI_01\Tokimeki_Memorial_02.stats" --bframes 3 --b-pyramid --direct auto --filter 1,1 --subme 1 --analyse none --me dia --threads 2 --thread-input --progress --no-psnr --output NUL "D:\HARUHI_01\Tokimeki_Memorial_02.avs" --deadzone-inter 6 --deadzone-intra 6
successfully started encoding
Processing ended at 17:36:53
----------------------------------------------------------------------------------------------------------

Log for job job1-1
avis [info]: 704x384 @ 23.98 fps (35125 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
x264 [info]: slice I:260 Avg QP:22.29 size: 27221
x264 [info]: slice P:11998 Avg QP:24.93 size: 8588
x264 [info]: slice B:22867 Avg QP:25.82 size: 2095
x264 [info]: mb I I16..4: 33.3% 0.0% 66.7%
x264 [info]: mb P I16..4: 14.2% 0.0% 0.0% P16..4: 49.5% 0.0% 0.0% 0.0% 0.0% skip:36.3%
x264 [info]: mb B I16..4: 0.6% 0.0% 0.0% B16..8: 9.6% 0.0% 0.0% direct:14.0% skip:75.8%
x264 [info]: final ratefactor: 26.14
x264 [info]: direct mvs spatial:99.7% temporal:0.3%
x264 [info]: SSIM Mean Y:0.9852973
x264 [info]: kb/s:862.9

encoded 35125 frames, 7.53 fps, 863.93 kb/s

----------------------------------------------------------------------------------------------------------
Job completed successfully and deletion of intermediate files is activated
job job1-1 has been processed. This job is linked to the next job: job1-2
Starting job job1-2 at 17:36:53
encoder commandline:
--pass 2 --bitrate 860 --stats "D:\HARUHI_01\Tokimeki_Memorial_02.stats" --ref 16 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --b-rdo --bime --weightb --direct auto --filter 1,1 --subme 7 --trellis 2 --analyse all --8x8dct --me esa --threads 2 --thread-input --progress --no-psnr --output "D:\HARUHI_01\Tokimeki_Memorial_02.mp4" "D:\HARUHI_01\Tokimeki_Memorial_02.avs" --deadzone-inter 6 --deadzone-intra 6
successfully started encoding
Processing ended at 19:02:24
----------------------------------------------------------------------------------------------------------

Log for job job1-2

avis [info]: 704x384 @ 23.98 fps (35125 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2

I use a P4 with HT
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\asharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\aWarpSharp.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\Deen.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\eDeen.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\TemporalCleaner.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\VSFilter.dll")
loadplugin("C:\Program Files\AviSynth 2.5\plugins\UnFilter_Avisynth_2.5_Alpha\unfilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\UnDot.dll")
AVISource("E:\HARUHI_01\Tokimeki_Capi_02_ae.avi")
converttoyv12()
temporalcleaner(6,12)
Deen ("a3d",2,6,6)
edeen(2,8,8,2,3,true)
asharp(1.5,0)
aWarpSharp()
lanczosresize (704,384)
textsub("E:\haruhi_01\Tokimeki_Memorial_cap_02.ass")

http://img100.imageshack.us/img100/9364/paneldecontrol1uf0.th.jpg (http://img100.imageshack.us/my.php?image=paneldecontrol1uf0.jpg)like u see x264 crash, in the finish :( what can i do, the thing shark say, or another thing?