Log in

View Full Version : Problem with x264


jml_90
11th February 2007, 05:56
Hi! I'm new in this forum, and i'm totally new in H.264. I only know about MPEG-1/2 and some of 4. But the reason why i'm writing now is that i got a new iPod Video 5.5G, and how you know it can play AVC movies. So I started to search software for converting DVD for iPod format (in H.264 with 640x480). But the programs were disappointing, the fact that are shareware and had bad quality. So I Found this program, MeGUI and with a manual in MeWiki i started to convert my DVDs to H.264. The quality is excellent but i have a problem with the dark areas o solid color areas, it creates ugly blocks that in my iPod are very visible. So i searched everywhere what i was doing wrong? I tried everything. I put all the configuration right, i do the avs script, i rezise it with Lanczos4 (Sharp) to 640x480 in 4:3 aspect, i put denosing with minimal noise (because it has not noisy), i work with original DVDs so the quality in the DVDs are excellent and has no Blocking. I use x264 and in the configuration i put iPod 5.5 Profile but i change somethings like i activate Deblocking (0,0), i activate No Fast P-Skip, i activate all macroblocks options that are able to activate, and i put more bitrate (less than 1500). But it's the same, there are a lot of ugly blocks in the dark areas, solid color areas, sky, fog, etc.
I'm sorry bothering you but i'm totally new in AVC coding. I searched in this forum my problem but no one has my same problem. Thank You. Bye
P/D: I have already tried with Blockbuster with noise method and the default options and it didn't work.

check
11th February 2007, 06:03
this is somewhat an artifact of how x264 encodes, but you can follow these steps to minimise it:
o use spline36resize. This will give you a slightly less sharp picture, but that will make it easier to compress and hopefully increase the overall quality some
o try adding the following line under 'custom commandline options' in the x264 codec config: --aq-strength 0.3

jml_90
11th February 2007, 10:04
Thank a lot check, but it didn't work the blocking is the same The thing is that in my screen and when i connect the ipod to tv it doesn't show a lot of blocks (they aren't to visible), but in the ipod screen is very visible, and it's noisy.
This is an artifact only for the codec x264 or for all AVC codecs? I tried with Nero Digital and it looks good but hasn't a profile for 640X480 AVC iPod it only has one for 320x240. There are other ways to make the codec don't compress to much the dark area? Thanks. Bye.

check
11th February 2007, 11:25
well, can you post the output from x264 that appears in the log after a successful encode? If you closed megui the log should still be saved in the megui\logs directory. The output looks like this:

avis [info]: 1280x544 @ 23.98 fps (1000 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
mp4 [info]: initial delay 0 (scale 24000)
x264 [info]: slice I:4 Avg QP:15.50 size: 51333
x264 [info]: slice P:996 Avg QP:19.12 size: 17036
x264 [info]: mb I I16..4: 22.3% 32.5% 45.2%
x264 [info]: mb P I16..4: 5.7% 9.0% 2.2% P16..4: 25.3% 21.4% 7.9% 0.8% 0.5% skip:27.2%
x264 [info]: 8x8 transform intra:52.7% inter:27.7%
x264 [info]: kb/s:3293.9

jml_90
12th February 2007, 01:20
I ripped as an example a little part of a Seinfeld DVD with DVD Shrink. I created a d2v file and with the ac3 audio extracted i encoded to Nero Digital AAC-LC 44,100Hz CBR96Kbps Stereo with Belight. Then i made an avs script with the d2v file this is the script:
DGDecode_mpeg2source("C:\Prueba\VTS_01_1.d2v")
#deinterlace
#crop
Spline36Resize(480,368) # Spline36 (Neutral)
#denoise

The source is progressive so i didn't deinterlaced it. Then i open with megui the avs file and i put x264 as codec mp4 as file format and PD-iPod 5.5G as Video Profile, then i put Config and this is what i put:
http://aycu23.webshots.com/image/8662/2003773506098840816_rs.jpg
http://aycu26.webshots.com/image/11065/2003758319007304422_rs.jpg
http://aycu01.webshots.com/image/9040/2003748738583605439_rs.jpg
http://aycu03.webshots.com/image/9122/2003734082277112659_rs.jpg
Then i encode, i put 2 thread because i have an Pentium IV HT with 3 GHZ. I mux the video with the audio with MP4Box (one modified for iTunes 7). The results are a MP4 file of 10,9 MB of 1 minute and 32 seconds. And this is the encode log that megui do:

Looking for job processor for job...
Processor found!
Starting job job1 at 05:44:29 a.m.
Starting preprocessing of job...
Preprocessing finished!
encoder commandline:
-AIF=[C:\Prueba\VTS_01_1.VOB] -OF=[C:\Prueba\VTS_01_1] -exit -minimize -OM=2
successfully started encoding
Processing ended at 05:44:31 a.m.
----------------------------------------------------------------------------------------------------------

Log for job job1

Film percentage: 99,95 meets force film thresholdSuccessfully applied force film
----------------------------------------------------------------------------------------------------------
Starting postprocessing of job...
Job completed successfully and deletion of intermediate files is activated
Postprocessing finished!
Looking for job processor for job...
Processor found!
Starting job job1-1 at 05:49:39 a.m.
Starting preprocessing of job...
Preprocessing finished!
encoder commandline:
--pass 1 --bitrate 900 --stats "C:\Prueba\Prueba.stats" --level 3 --no-cabac --subme 1 --analyse none --qpmin 16 --vbv-maxrate 1000 --me dia --merange 12 --threads 2 --thread-input --progress --no-psnr --no-ssim --output NUL "C:\Prueba\Prueba.avs" --aq-strength 0.3
successfully started encoding
Processing ended at 05:50:33 a.m.
----------------------------------------------------------------------------------------------------------

Log for job job1-1

avis [info]: 480x368 @ 23.98 fps (2208 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
x264 [warning]: VBV maxrate specified, but no bufsize.
x264 [info]: slice I:9 Avg QP:19.44 size: 21124
x264 [info]: slice P:2199 Avg QP:22.02 size: 4634
x264 [info]: mb I I16..4: 30.5% 0.0% 69.5%
x264 [info]: mb P I16..4: 12.0% 0.0% 0.0% P16..4: 57.4% 0.0% 0.0% 0.0% 0.0% skip:30.5%
x264 [info]: final ratefactor: 21.99
x264 [info]: kb/s:901.8

encoded 2208 frames, 41.87 fps, 901.89 kb/s

----------------------------------------------------------------------------------------------------------
Starting postprocessing of job...
Job completed successfully and deletion of intermediate files is activated
Postprocessing finished!
Looking for job processor for job...
Processor found!
Starting job job1-2 at 05:50:33 a.m.
Starting preprocessing of job...
Preprocessing finished!
encoder commandline:
--pass 2 --bitrate 900 --stats "C:\Prueba\Prueba.stats" --level 3 --no-fast-pskip --no-cabac --subme 6 --analyse p8x8,b8x8,i4x4,p4x4 --qpmin 16 --vbv-maxrate 1000 --me umh --merange 12 --threads 2 --thread-input --progress --no-psnr --no-ssim --output "C:\Prueba\Prueba.mp4" "C:\Prueba\Prueba.avs" --aq-strength 0.3
successfully started encoding
Processing ended at 05:52:41 a.m.
----------------------------------------------------------------------------------------------------------

Log for job job1-2

avis [info]: 480x368 @ 23.98 fps (2208 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
x264 [warning]: VBV maxrate specified, but no bufsize.
mp4 [info]: initial delay 0 (scale 24000)
x264 [info]: slice I:9 Avg QP:19.89 size: 19978
x264 [info]: slice P:2199 Avg QP:21.36 size: 4633
x264 [info]: mb I I16..4: 29.2% 0.0% 70.8%
x264 [info]: mb P I16..4: 4.1% 0.0% 3.1% P16..4: 48.5% 19.4% 3.1% 0.7% 0.3% skip:20.9%
x264 [info]: kb/s:900.6

encoded 2208 frames, 17.43 fps, 900.64 kb/s

desired video bitrate of this job: 900 kbit/s - obtained video bitrate (approximate): 901 kbit/s
----------------------------------------------------------------------------------------------------------
Starting postprocessing of job...
Job completed successfully and deletion of intermediate files is activated
Found intermediate output file 'C:\Prueba\Prueba.stats', deleting...
Deletion succeeded.Postprocessing finished!
Looking for job processor for job...
Processor found!
Starting job job1 at 05:53:58 a.m.
Starting preprocessing of job...
Preprocessing finished!
encoder commandline:
-add "C:\Prueba\Prueba.mp4" -add "C:\Prueba\VTS_01_1 T01 2_0ch 192Kbps DELAY -61ms.mp4":lang=eng -new "C:\Prueba\Final.mp4"
successfully started encoding
Processing ended at 05:53:59 a.m.
----------------------------------------------------------------------------------------------------------

Log for job job1

Saving C:\Prueba\Final.mp4: 0.500 secs Interleaving
ISO File Writing: | | (01/100)
ISO File Writing: | | (02/100)
ISO File Writing: | | (03/100)
ISO File Writing: | | (04/100)
ISO File Writing: |= | (05/100)
ISO File Writing: |= | (06/100)
ISO File Writing: |= | (07/100)
ISO File Writing: |= | (08/100)
ISO File Writing: |= | (09/100)
ISO File Writing: |== | (10/100)
ISO File Writing: |== | (11/100)
ISO File Writing: |== | (12/100)
ISO File Writing: |== | (13/100)
ISO File Writing: |== | (14/100)
ISO File Writing: |=== | (15/100)
ISO File Writing: |=== | (16/100)
ISO File Writing: |=== | (17/100)
ISO File Writing: |=== | (18/100)
ISO File Writing: |=== | (19/100)
ISO File Writing: |==== | (20/100)
ISO File Writing: |==== | (21/100)
ISO File Writing: |==== | (22/100)
ISO File Writing: |==== | (23/100)
ISO File Writing: |==== | (24/100)
ISO File Writing: |===== | (25/100)
ISO File Writing: |===== | (26/100)
ISO File Writing: |===== | (27/100)
ISO File Writing: |===== | (28/100)
ISO File Writing: |===== | (29/100)
ISO File Writing: |====== | (30/100)
ISO File Writing: |====== | (31/100)
ISO File Writing: |====== | (32/100)
ISO File Writing: |====== | (33/100)
ISO File Writing: |====== | (34/100)
ISO File Writing: |======= | (35/100)
ISO File Writing: |======= | (36/100)
ISO File Writing: |======= | (37/100)
ISO File Writing: |======= | (38/100)
ISO File Writing: |======= | (39/100)
ISO File Writing: |======== | (40/100)
ISO File Writing: |======== | (41/100)
ISO File Writing: |======== | (42/100)
ISO File Writing: |======== | (43/100)
ISO File Writing: |======== | (44/100)
ISO File Writing: |========= | (45/100)
ISO File Writing: |========= | (46/100)
ISO File Writing: |========= | (47/100)
ISO File Writing: |========= | (48/100)
ISO File Writing: |========= | (49/100)
ISO File Writing: |========== | (50/100)
ISO File Writing: |========== | (51/100)
ISO File Writing: |========== | (52/100)
ISO File Writing: |========== | (53/100)
ISO File Writing: |========== | (54/100)
ISO File Writing: |=========== | (55/100)
ISO File Writing: |=========== | (56/100)
ISO File Writing: |=========== | (57/100)
ISO File Writing: |=========== | (58/100)
ISO File Writing: |=========== | (59/100)
ISO File Writing: |============ | (60/100)
ISO File Writing: |============ | (61/100)
ISO File Writing: |============ | (62/100)
ISO File Writing: |============ | (63/100)
ISO File Writing: |============ | (64/100)
ISO File Writing: |============= | (65/100)
ISO File Writing: |============= | (66/100)
ISO File Writing: |============= | (67/100)
ISO File Writing: |============= | (68/100)
ISO File Writing: |============= | (69/100)
ISO File Writing: |============== | (70/100)
ISO File Writing: |============== | (71/100)
ISO File Writing: |============== | (72/100)
ISO File Writing: |============== | (73/100)
ISO File Writing: |============== | (74/100)
ISO File Writing: |=============== | (75/100)
ISO File Writing: |=============== | (76/100)
ISO File Writing: |=============== | (77/100)
ISO File Writing: |=============== | (78/100)
ISO File Writing: |=============== | (79/100)
ISO File Writing: |================ | (80/100)
ISO File Writing: |================ | (81/100)
ISO File Writing: |================ | (82/100)
ISO File Writing: |================ | (83/100)
ISO File Writing: |================ | (84/100)
ISO File Writing: |================= | (85/100)
ISO File Writing: |================= | (86/100)
ISO File Writing: |================= | (87/100)
ISO File Writing: |================= | (88/100)
ISO File Writing: |================= | (89/100)
ISO File Writing: |================== | (90/100)
ISO File Writing: |================== | (91/100)
ISO File Writing: |================== | (92/100)
ISO File Writing: |================== | (93/100)
ISO File Writing: |================== | (94/100)
ISO File Writing: |=================== | (95/100)
ISO File Writing: |=================== | (96/100)
ISO File Writing: |=================== | (97/100)
ISO File Writing: |=================== | (98/100)
ISO File Writing: |=================== | (99/100)

----------------------------------------------------------------------------------------------------------
Starting postprocessing of job...
Job completed successfully and deletion of intermediate files is activated
Postprocessing finished!

I hope this will help you to understand my problem. Thanks for the help. Bye.

check
12th February 2007, 02:29
Your logs and setup check out ok. Is this video very dark and noisy the whole way through? Post up some typical screenshots of it.

jml_90
12th February 2007, 03:09
Here I put some screenshots from the original DVD:
http://aycu18.webshots.com/image/11057/2003166871316054880_rs.jpg
http://aycu32.webshots.com/image/8591/2003194491770540824_rs.jpg
http://aycu31.webshots.com/image/8630/2003129597106769474_rs.jpg

And here are the screeshots from the converted H.264 (the blocks don't show it too much like in my iPod):
http://aycu32.webshots.com/image/8111/2003150467291421955_rs.jpg
http://aycu02.webshots.com/image/8841/2003117477117616111_rs.jpg
http://aycu19.webshots.com/image/8538/2003110754183819954_rs.jpg

So i don't know what am i doing wrong? And this is not the only video all the DVDs that i'm tryng to convert do the same problem. Is a codec problem? I didn't install the ffdshows codecs because i have nero that reads the avc files. i don't know if that is the problem. Thanks for helping me. Bye.

check
12th February 2007, 04:34
well, I cannot see any blocks there at all sorry. You could try resizing to ipod resolution, so the ipod doesn't have to resize on playback. Just set the resolution to 320x___.

jml_90
12th February 2007, 11:52
I'm sorry what the images that i putted there i don't know why they don't show blocks but in the original yes. And like i said in the ipod is more visible. You see the second image? the whole dark area has grey macroblocks that are very noisy. In the first and third image it looks good but in zones like the sofa or other dark areas appear the famous blocks. Well so my problem is very rare? or is something natural in x264?. Question Does every avc codecs does this blocks? Thank You. Bye

Sharktooth
12th February 2007, 14:43
I cant see blocks as well but maybe your ipod brightness/contrast is set way too high...

jml_90
13th February 2007, 07:04
sharktooth the problems is that the image doesn't show the noisy blocks that i see (i don't know why). I always use my iPod with the highest of brightness, but i when i encoded a part of a dvd with cucusoft (of course with watermark) and doesn't show that blocks. For that i'm asking about is a problem with all the avc codecs? or only for x264? have yo got the same problems? Thanks Bye

*.mp4 guy
13th February 2007, 07:44
You can't see the blocks because the images are on a white background, save them and view them in media player classic fullscreen and they will be very obvious (not that they aren't already...). The second image has the worst blocking.

try this script

DGDecode_mpeg2source("C:\Prueba\VTS_01_1.d2v", info=3).colormatrix(hints=true)
fluxsmoothST(5,5)
Spline36Resize(480,368)
ttempsmooth(maxr=7)
gradfun2db(1.5)

Those dvd's are very low quality, hard for any codec to recompress, and for x264 in particular. That script may make the video look a bit "too smooth" but thats because there is very little detail on the dvd's and that script will remove the noise that hides the details absence. It should however look much better compressed by x264 then the unprocessed source, since x264 would remove the noise anyway. You should also try lowering deblocking, try -1:-2, that works well for a lot of people.

jml_90
13th February 2007, 09:32
Thanks a lot *.mp4 guy but i still have the blocks, i tried your script with the last configuration that i put in the images aboves with deblocking with -1,-2 but the blocks are still there. Here is a image of the output:
http://aycu35.webshots.com/image/12074/2003503766861802282_rs.jpg

Respect of the original, the DVDs that i'm enconding are original so the quality is supposed to be better. I tried with the original of Pirates of The Caribbean 2 and have the same problems, in the darks scenes are fully of blocks and in light scenes have a good quality but if there is something solid appears the blocks. Anyway thanks for the help. Bye