Hey, is there a possibility too find corrupted frames in my encode (h264, 10-bit)?
Frames like this: https://vgy.me/Tiw4WX.png
Regards
+ Reply to Thread
Results 1 to 24 of 24
-
-
It's difficult. You may remux using ffmpeg, mkvmerge or mkvalidator and see if any errors appear. But it is not guaranteed to find all errors.
Are you sure your streams are actually corrupted? Similar artifacts can be seen when trying to decode 10 bit video with an 8 bit video decoder. Try a different decoder like LAV Video or latest VLC. Upload a sample if you are not sure. -
-
FFmpeg or MKVtoolnix don’t show me any error :/
-
Nope, nothing :/
Here is a segment from the video with the corrupted frames: https://a.desu.sh/bleeeb.rar -
Upload a sample. Maybe the file isn't broken or it is just a muxing/demuxing problem.
-
https://a.desu.sh/bleeeb.rar
The original file is not remuxed, it's directly from x264. I have this in some other encodes too. -
So that is the re-encode? Maybe the error is probably not in libx264 encoding but somehow in the source or the demuxing/decoding process of the source. Do you have a sample of the source? If you re-encode it twice is the error exactly the same (same position etc.)?
Do you also happen to not only have a source sample but also a sample with the error within the first 2 seconds? -
The source is the original m2ts from the BDMV. In the BDMV this scene looks good. The scene looks in avspmod good too (I have loaded the file with LwlibavVideoSource). I have this problem in few other encodes too. I have tested already the RAM and HDD of errors but both works great.
-
And if you re-do an encode from the m2ts the error appears in the exact same spot? If you run the same script through a different encoder (e.g. x265 --preset ultrafast) the error is also in the exact same spot? Only with 4:4:4 predictive or also other profiles?
You will need to narrow it down further until you find the culprit. If you find it make bug report to x264 or ffmpeg. Which x264 binary are you using? Same error with newest binary from Videolan? -
-
That is strange. H.264 decoding as well as x264 encoding should be deterministic (except when using --non-deterministic). This would lead me to assume it is not an x264 error and the sample of the re-encoded file isn't useful.
- Test the hardware again. HDD, RAM. Also run Intel burn test.
- You only tried LwlibavVideoSource on the source m2ts? Same problem with threads=1? Latest revision?
- Same problem with ffvideosource, DGDecNV or ffmpeg?
I know it's difficult to test when you have to manually look for errors but I don't see any way around. Well, I guess that's exactly why you opened this thread...
Maybe for these tests it can be automated to some extend. As I said encoding is deterministic so if you encode multiple times we "just" have to look at which point the files aren't identical anymore. The question is how to do it in a convenient way. -
It's likely the problem is in the decoding of the source. The encoder may be reading frames out of order which may cause the decoder to screw up. In such case there are no errors in your encoded video -- it correctly encoded what it got. The only way to detect this kind of problem would be to compare the source the encoded video. Frame-to-frame RGBDifference on just the encoded file will give too many false positives, especially with animated material.
Although, I have seen encoders screw up like this now and then when the CPU is overheating. Check your CPU temps while encoding -- especially if you are using a laptop.Last edited by jagabo; 11th Dec 2016 at 07:59.
-
I have some AVISynth code that I created to find individual bad frames which don't match either of the adjacent frames. I wrote it to find photographer flashes so I could replace the frame with a motion estimated frame created from the two adjacent frames. I could post this if it would be useful.
-
My suggestion is to compare frames between versions. A threshold value will have to be found experimentally, but won't be too hard considering the blatant character of the artifact.
-
Another method might be to use per frame PSNR or SSIM (e.g. with ffmpeg) testing encode vs. source, then excel/spreadsheet or notepad++ to filter out values less than some threshold number
The assumption is that your computer is working properly other wise ffmpeg decoding might decode source (or encode) with errors. -
My code is nothing special: YDifferenceNext and YDifferencePrevious are the main functions. I keep a moving average of these values and, when I find a frame where both the YDifferenceNext and the YDifferencePrevious values change dramatically compared to the moving average, that means the current frame is dramatically different from both adjacent frames.
It works really well for photographer flashes, blank frames, and any situation where the frame gets really garbled. However, if you have 2-3 frames in a row that have become corrupted, then this won't work.
So, if you truly just have single frame glitches, let me know and I'll post the code. -
It may not help the OP whose video has bursts of several frames with bad frames (thumbnails of 16 consecutive frames, top left to bottom right):
[Attachment 39881 - Click to enlarge]
It also has single frames that are significantly different from surrounding frames but are not errors:
[Attachment 39882 - Click to enlarge]
But I'd like to see your "flash detecting" script. -
What about comparing the MP4 to the M2TS?
Code:# Choose a value that reliably picks up the error threshold = 50 orig = MPEG2Source("myvid.d2v") recode = DirectShowSource("myvid.mp4") WriteFileIf("bad_frame.log", "RGBDifference(orig, recode) > threshold" , "current_frame")
-
In post #16 above, I mentioned that I have some code which will find bad frames. I updated it so that it will not only find them, but will optionally either output the frame numbers (to a text file) of all bad frames found, or will automatically replace all bad frames with new frames synthesized (using motion estimation) from adjacent good frames. Here is a link to the thread where I posted the script:
Finding individual "bad" frames in video and save frame number, or repair
Similar Threads
-
h264 TS remuxed into MKV with MKVToolNix -> corrupted frames?
By NailBomber in forum Video ConversionReplies: 3Last Post: 6th Nov 2015, 14:33 -
how to find key frames in h264
By Chris33 in forum Video ConversionReplies: 4Last Post: 27th Jan 2014, 05:18 -
Where I can find a codec MPEG2 for windows xp to encode from my timeline
By marcorocchini in forum Newbie / General discussionsReplies: 18Last Post: 7th Jun 2013, 20:40 -
How do I find out how codecs encode and decode and how frameserving works?
By Onceler2 in forum ProgrammingReplies: 4Last Post: 5th Feb 2013, 12:21 -
How to find duplicated frames?
By Zabar12 in forum RestorationReplies: 5Last Post: 21st Feb 2012, 01:49