View Full Version : x264 and 2nd pass artifacts
radius
14th January 2011, 03:00
Hi,
I'm facing a new problem when encoding blu-ray compatible x264 stuff, I can get the stream to mux on scenarist now but there are artifacts at different places on the video like this (resized for convenience):
http://r4di.us/temp/x264_2ndpass.jpg
This screenshot is from the beginning of the video (it starts at frame 102) so I could see it easily, I tried various decoders to confirm the problem is on the encoded video,
Then I tried :
- encoding the whole video (170975 frames) multiple times and changing some settings in 2 passes but I always get the artifacts approximately at the same place,
- encoding the first 500 frames (tried 10000 too) in 2 passes and there's no problem this time
- encoding the first 500 frames (the second pass only) using the whole video 1st pass stats file and I get the artifacts again
So it seems there's something bad on the stats file when I encode the whole thing :/
Here is the last test command line I used :
x264 --bitrate 20000 --preset fast --tune film --weightp 1 --bframes 3 --nal-hrd vbr --vbv-maxrate 35000 --vbv-bufsize 30000 --level 4.1 --keyint 24 --b-pyramid strict --slices 4 --aud --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 --fps 24000/1001 --force-cfr --stats filmc.stats --output out.264 video.avs
As for the qpfile, the 1st chapter only starts at frame 9521
Here are some of the files :
blocky video (cut from the whole file) : http://r4di.us/temp/outblocky.264
corresponding stats file (maybe from another of the bad encodes) : http://r4di.us/temp/filmblocky.stats
stats file from a 10000 frames encode without problem : http://r4di.us/temp/filmok.stats
Could someone help with this ?
Dark Shikari
14th January 2011, 03:35
Looks like a source problem. Not related to x264.
radius
14th January 2011, 04:38
Yep i thought about that too but when I play the avs there's no problem and if I encode only a small part of it there's no problem too,
could you think about a way to check if the source / avs is the problem ?
Blue_MiSfit
14th January 2011, 05:44
encoding the first 500 frames (the second pass only) using the whole video 1st pass stats file and I get the artifacts again
If I'm reading this correctly, we should be able to reproduce this issue with your stats file and the 500 frame sample, correct?
Derek
7ekno
14th January 2011, 15:56
Content of the AVS script?
7ek
radius
14th January 2011, 16:24
If I'm reading this correctly, we should be able to reproduce this issue with your stats file and the 500 frame sample, correct?
Derek
Yep, if you want to give it a try, here's a zip containing :
- a .m2ts cut from the 10 first seconds of the original source
- the stats files (the mbtree was 2GB so i cut 40MB from the start, it seems it still works)
- the .avs file loading the .m2ts
- the .bat file with the 2nd pass command line
- the x264 binary (win32)
URL : http://r4di.us/temp/x264stuff.zip (66MB)
With those files I could not reproduce the same blocky thing like in the snapshot above but looks like some frames are skipped at the place,
I'll try with other stats file if needed,
Btw when I check the output file from the 1st pass I can't see the problem happen (at the beginning of the video at least) only the 2nd pass has it
radius
14th January 2011, 16:25
Content of the AVS script?
7ek
this :
DirectShowSource("original.m2ts", fps=23.976, audio=false)
radius
15th January 2011, 00:01
I've been encoding cuts of the video like this :
- 50000 first frames -> no artifacts
- 100000 first frames -> no artifacts
- 150000 first frames -> no artifacts
- 170900 first frames -> this one as artifacts
the movie is 170975 so the last encode only misses only a couple of seconds, i guess it's not really related with x264 but I don't get why the full and near full encodes could make the rest of the video corrupted :/ ...
7ekno
15th January 2011, 03:27
this :
DirectShowSource("original.m2ts", fps=23.976, audio=false)
There's ya problem ;)
Use FFMS2, DGSource (after indexing) or DSS2 and problem will vanish ;)
Tek
Blue_MiSfit
15th January 2011, 08:03
Indeed. The problem may very well lie in the decoding.
radius
15th January 2011, 17:19
There's ya problem ;)
Use FFMS2, DGSource (after indexing) or DSS2 and problem will vanish ;)
Tek
Hi,
just tested using dds2 this way :
LoadPlugin("C:\Program Files (x86)\Haali\MatroskaSplitter\avss.dll")
DSS2("U:\Bad Boys 1995 Bluray 1080p AVC DTS-HD MA5.1-CHDBits\BDMV\STREAM\00011.m2ts", fps=23.976)
I'm still getting the problem at the same place :/
should I test the other methods ?
nm
15th January 2011, 21:04
I'm still getting the problem at the same place :/
should I test the other methods ?
DSS2 is still using the same decoder as DSS. Try FFmpegSource.
7ekno
16th January 2011, 08:16
-CHDBits
Am guessing that's enough to get the thread closed ...
But in follow-up, DSS2 will indeed use the same decoder as DSS, so should limit resolution attempts to FFMS2 / DGSource as source filters ...
Am guessing it's Windows 7 without the Media Foundation Bypass Tool being deployed ...
7ek
LoRd_MuldeR
16th January 2011, 13:46
LoadPlugin("C:\Program Files (x86)\Haali\MatroskaSplitter\avss.dll")
DSS2("U:\Bad Boys 1995 Bluray 1080p AVC DTS-HD MA5.1-CHDBits\BDMV\STREAM\00011.m2ts", fps=23.976)
Where do you have that file from ???
radius
17th January 2011, 13:59
My bad, it's just a copy / paste found when searching for usage of DSS2 with avisynth
Btw I did not disable Media Foundation as said 7ekno.
I just encoded using x264 (from http://x264.nl/) with the internal ffms decoder using directly my .m2ts file as input,
It encoded without the artifact error, could you tell if it's OK to encode using the embedded decoder or should I always use avisynth ?
nm
17th January 2011, 14:24
could you tell if it's OK to encode using the embedded decoder or should I always use avisynth ?
AviSynth is only needed for advanced filtering and editing. If you have a nice progressive source and don't want to denoise, x264's internal decoders and filtering system are fine.
radius
18th January 2011, 17:21
Thanks,
I can't understand why the artefacts only appear on the 2nd pass when using ddshow but I can live with it :)
As x264 internal decoders is OK I'll just not use avisynth (with ddshow) anymore.
Thanks you guys for your help
HowlerX
18th January 2011, 21:53
I've seen similar corrupted video frames recently and I don't even encode such large files. I just encoded some TV shows to my iPod with the latest MeGUI which contains the latest x264 and started seeing this recently. When going back to the older version of x264 (r1649) everything looks and plays back perfectly.
TheRyuu
18th January 2011, 22:03
Try using one of the dgdecode avisynth plugins with BD stuff. dss2, ffms2, lavf (through x264) can all cause corruption like that with that kind of source.
nm
18th January 2011, 22:25
dss2, ffms2, lavf (through x264) can all cause corruption like that with that kind of source.
At least lavf can also be fixed if you provide a clip for reproducing the issue.
Mug Funky
19th January 2011, 00:01
@TheRyuu:
[citation needed]
seriously, saying stuff like that without evidence can cause problems.
also, anything that gets fixed in lavf will be fixed in ffms2 shortly afterward.
DSS2 obviously depends on a multitude of factors on the host machine, and is likely to be different on every computer.
INear
4th February 2011, 18:46
I was having the same problem. Within the first few seconds of the video I was getting the scrambled video. The solution for mine was to go back to an older version of Haali Media Splitter.
dansus
9th February 2011, 06:39
Could someone be kind enough to point me to a thread where i can learn the code needed to encode with the internal ffms2 decoder.
Thanks.
J_Darnley
9th February 2011, 11:46
If you want to learn how to use the ffms library in code, read its header and then some examples (such as x264's input/ffms.c).
If you mean just using the ffms decoder in x264, it will probably be used by default. If not you can try --demuxer ffms
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.