Opened 5 years ago

Closed 5 years ago

#685 closed defect (fixed)

H264 decoder error

Reported by: anatoly Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: h264
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

There is a stream obtained from IP Camera which cannot be correctly decoded by ffmpeg but successfully decoded by Elecard StreamEye? and IPP.
FFmpeg report:
./ffprobe ~/projects/decodeh264/frame.264
ffprobe version N-34962-gfd1cea6, Copyright (c) 2007-2011 the FFmpeg developers

built on Nov 25 2011 13:28:59 with gcc 4.4.5
configuration: --disable-optimizations
libavutil 51. 26. 0 / 51. 26. 0
libavcodec 53. 35. 0 / 53. 35. 0
libavformat 53. 20. 0 / 53. 20. 0
libavdevice 53. 4. 0 / 53. 4. 0
libavfilter 2. 48. 1 / 2. 48. 1
libswscale 2. 1. 0 / 2. 1. 0

[h264 @ 0x27a7c40] negative number of zero coeffs at 0 0
[h264 @ 0x27a7c40] error while decoding MB 0 0
[h264 @ 0x27a7c40] concealing 396 DC, 396 AC, 396 MV errors
[h264 @ 0x27a1880] Estimating duration from bitrate, this may be inaccurate
Input #0, h264, from '/home/alien/projects/decodeh264/frame.264':

Duration: N/A, bitrate: N/A

Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 352x288, 25 tbr, 1200k tbn, 50 tbc

Attachments (2)

frame.264 (22.0 KB) - added by anatoly 5 years ago.
movie.264 (805.6 KB) - added by anatoly 5 years ago.

Download all attachments as: .zip

Change History (8)

Changed 5 years ago by anatoly

Changed 5 years ago by anatoly

comment:1 Changed 5 years ago by anatoly

I've made some investigations and found that the problem may be in flag dct8x8_allowed. Thus the following patch makes file "frame.264" decodable.

diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c
index b0dc999..ff39d3f 100644
--- a/libavcodec/h264_cavlc.c
+++ b/libavcodec/h264_cavlc.c
@@ -799,10 +799,12 @@ decode_intra_mb:
         if(IS_INTRA4x4(mb_type)){
             int i;
             int di = 1;
+            /*
             if(dct8x8_allowed && get_bits1(&s->gb)){
                 mb_type |= MB_TYPE_8x8DCT;
                 di = 4;
             }
+            */
 
 //                fill_intra4x4_pred_table(h);
             for(i=0; i<16; i+=di){

This is an ugly fix but it may shows the way to resolve this issue.

comment:2 Changed 5 years ago by cehoyos

  • Keywords h264 added
  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from unspecified to git-master

Given that the reference decoder also fails ("ERROR: failed to find Total Zeros !cdc"), I would assume the sample is broken...

comment:3 follow-up: Changed 5 years ago by cehoyos

  • Component changed from undetermined to avcodec

comment:4 in reply to: ↑ 3 Changed 5 years ago by anatoly

I also tried reference decoder and it fails. But Elecard StreamEye? successfully decode this stream. Why?

comment:5 Changed 5 years ago by anatoly

I think I found the solution. It looks like flag "transform_8x8_mode_flag" is wrongly set to 1. After inverting this flag to 0 both streams become decodeable. And it also looks like StreamEye? support old version of AVC standart that doesn't provide "transform_8x8_mode_flag".

Thus, I think this ticket may be closed.

comment:6 Changed 5 years ago by cehoyos

  • Resolution set to fixed
  • Status changed from open to closed

Fixed by you.

Note: See TracTickets for help on using tickets.