Log in

View Full Version : Fighting with floating blocks during h264 encoding


alexVS
22nd February 2008, 10:59
I'm trying to encode TV captured mpeg2 into MP4 (with x264.exe) using megui. The source picture have some grain.

And the problem is the final picture (after encoding) has too many floating blocks. BTW that grain the source picture dissapeared, but how can I get rid of these floating blocks in final video? What parameters in megui to use? It's better to have grain than these floating blocks.

I encode the picture, that has the size 720x576 or 640x480 with bitrate 2000Kb/s and I don't want to increase bitrate more then that.

Dark Shikari
22nd February 2008, 11:08
Can you paste your commandline?

Do you have the latest x264 version in MeGUI? (736M)

alexVS
22nd February 2008, 14:08
I use 1P-intermediate profile
Command line:
--bitrate 2000 --bframes 3 --weightb --analyse p8x8,b8x8,i4x4,p4x4 --threads auto --thread-input --progress --no-psnr --no-ssim --output "output" "input"

Here is 15 sec example of source, d2v, avs, and final mp4 (30Mb) http://rapidshare.de/files/38642783/Video_Example.zip.html

And my avisynth script
global MeGUI_darx = 4
global MeGUI_dary = 3
DGDecode_mpeg2source("Untitle.d2v")
SeparateFields()
Bob(0.0, 1.0)
Undot()
Letterbox(8,8,0,0)
ConvertToYV12()

P.S. I think it's better to somehow save source grain and not to receive that big blocks in final video. Is there a way to do it?

Dark Shikari
22nd February 2008, 16:16
Try a higher quality 2pass profile--that'll help.

Additionally, note that bobbing a video doubles its FPS--so it needs (close to) double the bitrate.

alexVS
23rd February 2008, 13:47
Thanks for advice!

And one more thing.
I tried to encode the same clip in TMpg Xpress 4, and got much better result then Avisynth+Megui (x264.exe)

IMHO the reason: Tmpg XPress does double frame deinterlace much better then my Avisynth script (separate field+bob). After Tmpg XPress processing all logos on video are stable (there's no jitter). So because of this jitter I receive additional artefacts during megui+x264 encoding.

How should I change my AVS script to solve this?

PS Weakness of TMpg Encoder is unsupported mp4 container at 50FPS and slow speed.

Didée
23rd February 2008, 14:47
I tried to encode the same clip in TMpg Xpress 4, and got much better result then Avisynth+Megui (x264.exe)

IMHO the reason: Tmpg XPress does double frame deinterlace much better then my Avisynth script (separate field+bob).
Let's put it the other way round: of all possible ways to bob-deinterlace an interlaced source, you have chosen the worst.

Note that Avisynth smartly prevented you from even worse damage. Your code reads
> SeparateFields().Bob()
but Avisynth "knows" that this complete nonsense, and executed only
> Bob()

To see what SeparateFields().Bob() actually would do when executed literally, try this:
> SeparateFields().AssumeFrameBased().Bob()

(you'll get a half-height clip at 400% of the original frame rate ...)

If you want to double framerate before encoding, better use a dedicated deinterlacer for that. Often-used ones are Tdeint or Yadif, they deliver fair quality at fair processing speed.