View Full Version : Erroneous frames in the beginning of x264 encode
SergeyFedosov
30th November 2006, 09:41
x264 (version 600 as well as several previous) produces a few erroneous frames at the beginning of an encode. This can be a one black frame followed by 0 - 2 completely green frames. The original material was an AviSynth script for a vob-file, or files compressed with Xvid, DivX, x264. An example of encoding parameters is given below.
640x256 fps=1000000/40000 cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x133 me=hex subme=5 brdo=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 chroma_qp_offset=0 slices=1 bframes=2 b_pyramid=0 b_adapt=1 b_bias=0 direct=2 wpredb=1 bime=0 keyint=300 keyint_min=30 scenecut=40 pass=2 bitrate=2001 ratetol=1.0 rceq='blurCplx^(1-qComp)' qcomp=0.60 qpmin=10 qpmax=51 qpstep=4 cplxblur=20.0 qblur=0.5 ip_ratio=1.40 pb_ratio=1.30
Seb.26
30th November 2006, 11:37
are U sure this wrong frames are in your file ?!
( not just due to playback post processing filters like TemporalSoften & Co ... )
I haven't notice that ...
DarkZell666
30th November 2006, 11:41
What do the erroneous frames actually look like ? Can you post a screenshot ? If they're grey, the problem doesn't come from x264 but from avisynth having a problem decoding your source.
You would be wise to post your script too :)
Seb.26
30th November 2006, 11:45
What do the erroneous frames actually look like ? Can you post a screenshot ? If they're grey, the problem doesn't come from x264 but from avisynth having a problem decoding your source.
You would be wise to post your script too :)
What version of AVisynth do that ?! ...
( with what kind of source ?! ... a .d2v file ?! )
DarkZell666
30th November 2006, 12:34
What version of AVisynth do that ?! ...
( with what kind of source ?! ... a .d2v file ?! )
You must have been landing on the moon recently ;) Avisynth has a problem with directshowsource on certain sources (not all, far from it ;)). In version 2.5.5, one of my sources (which now produces grey frames in 2.5.7) crashes avisynth literally.
Seb.26
30th November 2006, 12:47
You must have been landing on the moon recently ;) Avisynth has a problem with directshowsource on certain sources (not all, far from it ;)). In version 2.5.5, one of my sources (which now produces grey frames in 2.5.7) crashes avisynth literally.
<< Houston, we've got a problem. >> :D
Ok ... I did not know ...
( I only use MPEG2Source(...) ... )
Thanks,
Seb.
SergeyFedosov
30th November 2006, 15:37
This effect is not associated with AviSynth, because the same behavior was observed when opening avi-files with VirtualDub (all versions 1.5 (Mod) - 1.7) and compressing them with x264. The first black frame (not a gray frame) was present always, disregarding contents of the original. On the contrary, 1-2 additional green frames (completely green) were observed only when the original video started with a sequence faded to black.
Seb.26
30th November 2006, 16:15
This effect is not associated with AviSynth, because the same behavior was observed when opening avi-files with VirtualDub (all versions 1.5 (Mod) - 1.7) and compressing them with x264. The first black frame (not a gray frame) was present always, disregarding contents of the original. On the contrary, 1-2 additional green frames (completely green) were observed only when the original video started with a sequence faded to black.
"When" during your encoding chain does this green frames appear ?!
1) open .avs file in vdub -> Green frames ?!
2) encode .avs in x264 file
3) open x264 file in vdub -> Green frames ?!
4) open x264 file in your player -> green frames ?!
( do you use FFDShow ?! ... and have you some temporal denoiser activated ?! ... especialy TemporalSoften() in Blur & NR )
<< May the force B with U ... >>
:D
bond
30th November 2006, 20:16
propably an issue with avi not being able to handle b-frames. try encoding without b-frames and check whether this solves the problem
DarkZell666
30th November 2006, 20:42
If the frames are black/green, then +1 for the bframes-in-avi stuff :)
SergeyFedosov
1st December 2006, 09:35
Bond, your suggestion is correct. When encoding without B-frames, the effect disappears. Strangely enough, when I set a forced key-frames interval to 1 without disabling B-frames, the spoiled frame is still present. I could have expected all my frames to be I-type. When the forced I-interval is 5, the effect is present and distribution of key-frames is 1,2,7,12,17... instead of 1,5,10,15,...
foxyshadis
1st December 2006, 11:37
Really, you should find yourself a cli gui to continue the encoding, instead of troubleshooting the vfw. No developers are going to try to fix it, and even if they did it'd require all kinds of extra parser support.
SergeyFedosov
1st December 2006, 13:13
Generally speaking, this defect is of no importance for ripping a DVD to a one long avi-file. However, video editing is a different matter. My problem is, that I am making a lot of relatively short fragments. They are subjected to some filtering and afterwards assembled together using VirtuaDub as a general purpose editing program. You can imagine, that I would prefer to avoid an erroneous start of each fragment when using x264 codec. But I can definitely switch off B-frames during intermediate steps of editing.
bond
1st December 2006, 19:50
try avidemux as video editor with mp4 files encoded in x264 cli
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.