Opened 7 years ago

Closed 7 years ago

#6699 closed defect (fixed)

MP4 with HEVC keyint=2 not decoded properly due to edit list (first frames are missing)

Reported by: tospi Owned by: Sasi Inguva
Priority: normal Component: avformat
Version: git-master Keywords: mov hevc edts
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Problem: HEVC streams encoded with short key intervals (2,4,...) inside MP4 cannot be decoded properly.

Description: The first few frames (probably the first GOP) are missing and not decoded (not reaching the decoder). In earlier versions of FFmpeg (e.g. FFmpeg 2.8.11), decoding of the same file works without problems. In the current version, decoding only works if "-ignore_editlist 1" is specified, so apparently the edit list feature is somehow not working correctly in this case.

Command to produce the MP4 file (file is also attached):

% ./ffmpeg -f lavfi -i testsrc=duration=1 -c:v libx265 -x265-params keyint=2 hevc_keyint2.mp4
ffmpeg version N-87394-g89a2472ec5-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.4.0 (Debian 6.4.0-5) 20170906
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
  libavutil      55. 76.100 / 55. 76.100
  libavcodec     57.106.101 / 57.106.101
  libavformat    57. 82.101 / 57. 82.101
  libavdevice    57.  8.101 / 57.  8.101
  libavfilter     6.106.100 /  6.106.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, lavfi, from 'testsrc=duration=1':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
File 'hevc_keyint2.mp4' already exists. Overwrite ? [y/N] y^C
thomas@thomas-desktop:~/Downloads/ffmpeg-git-20170926-64bit-static$ ./ffmpeg -f lavfi -i testsrc=duration=1 -c:v libx265 -x265-params keyint=2 hevc_keyint2.mp4
ffmpeg version N-87394-g89a2472ec5-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.4.0 (Debian 6.4.0-5) 20170906
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
  libavutil      55. 76.100 / 55. 76.100
  libavcodec     57.106.101 / 57.106.101
  libavformat    57. 82.101 / 57. 82.101
  libavdevice    57.  8.101 / 57.  8.101
  libavfilter     6.106.100 /  6.106.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, lavfi, from 'testsrc=duration=1':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
File 'hevc_keyint2.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> hevc (libx265))
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 2.5+17-f8ae7afc1f61
x265 [info]: build info [Linux][GCC 6.4.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main 4:4:4 profile, Level-2 (Main tier)
x265 [info]: Thread pool created using 16 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 4 / wpp(4 rows)
x265 [warning]: Source height < 720p; disabling lookahead-slices
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 1 / 2 / 40 / 5.00
x265 [info]: Cb/Cr QP Offset                     : 6 / 6
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 rskip signhide tmvp strong-intra-smoothing
x265 [info]: tools: deblock sao
Output #0, mp4, to 'hevc_keyint2.mp4':
  Metadata:
    encoder         : Lavf57.82.101
    Stream #0:0: Video: hevc (libx265) (hev1 / 0x31766568), gbrp, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.106.101 libx265
[Parsed_testsrc_0 @ 0x3ff8800] EOF timestamp not reliable
frame=   25 fps=0.0 q=-0.0 Lsize=      35kB time=00:00:00.88 bitrate= 321.2kbits/s speed=1.84x    
video:31kB audio:0kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 9.688936%
x265 [info]: frame I:     13, Avg QP:30.75  kb/s: 486.43  
x265 [info]: frame P:      1, Avg QP:32.27  kb/s: 34.20   
x265 [info]: frame B:     11, Avg QP:39.00  kb/s: 5.87    
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 21.4% 78.6% 0.0% 0.0% 0.0% 

encoded 25 frames in 0.46s (54.66 fps), 256.90 kb/s, Avg QP:34.44

Decoding command with current version that is missing frames (22 frames):

% ./ffmpeg -i hevc_keyint2.mp4 -f null -
ffmpeg version N-87394-g89a2472ec5-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.4.0 (Debian 6.4.0-5) 20170906
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
  libavutil      55. 76.100 / 55. 76.100
  libavcodec     57.106.101 / 57.106.101
  libavformat    57. 82.101 / 57. 82.101
  libavdevice    57.  8.101 / 57.  8.101
  libavfilter     6.106.100 /  6.106.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hevc_keyint2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf57.82.101
  Duration: 00:00:01.00, start: 0.040000, bitrate: 282 kb/s
    Stream #0:0(und): Video: hevc (Rext) (hev1 / 0x31766568), gbrp(tv, gbr/unknown/unknown, progressive), 320x240 [SAR 1:1 DAR 4:3], 257 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf57.82.101
    Stream #0:0(und): Video: wrapped_avframe, gbrp, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc57.106.101 wrapped_avframe
frame=   22 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.92 bitrate=N/A speed=  75x    
video:11kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Extended decoding command with current version that is working (25 frames):

% ./ffmpeg -ignore_editlist 1 -i hevc_keyint2.mp4 -f null -
ffmpeg version N-87394-g89a2472ec5-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.4.0 (Debian 6.4.0-5) 20170906
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
  libavutil      55. 76.100 / 55. 76.100
  libavcodec     57.106.101 / 57.106.101
  libavformat    57. 82.101 / 57. 82.101
  libavdevice    57.  8.101 / 57.  8.101
  libavfilter     6.106.100 /  6.106.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hevc_keyint2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf57.82.101
  Duration: 00:00:01.00, start: 0.080000, bitrate: 282 kb/s
    Stream #0:0(und): Video: hevc (Rext) (hev1 / 0x31766568), gbrp(tv, gbr/unknown/unknown, progressive), 320x240 [SAR 1:1 DAR 4:3], 257 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf57.82.101
    Stream #0:0(und): Video: wrapped_avframe, gbrp, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc57.106.101 wrapped_avframe
frame=   25 fps=0.0 q=-0.0 Lsize=N/A time=00:00:01.00 bitrate=N/A speed=81.6x    
video:13kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Attachments (2)

hevc_keyint2.mp4 (34.5 KB ) - added by tospi 7 years ago.
MP4 with HEVC and key interval 2
hevc_keyint2_testsrc2.mp4 (85.0 KB ) - added by tospi 7 years ago.
Better example file with testsrc2 as source (YUV420)

Download all attachments as: .zip

Change History (11)

by tospi, 7 years ago

Attachment: hevc_keyint2.mp4 added

MP4 with HEVC and key interval 2

comment:1 by tospi, 7 years ago

Complete console output:

% ./ffmpeg -v 9 -loglevel 99 -i hevc_keyint2.mp4 -f null -
ffmpeg version N-87394-g89a2472ec5-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.4.0 (Debian 6.4.0-5) 20170906
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
  libavutil      55. 76.100 / 55. 76.100
  libavcodec     57.106.101 / 57.106.101
  libavformat    57. 82.101 / 57. 82.101
  libavdevice    57.  8.101 / 57.  8.101
  libavfilter     6.106.100 /  6.106.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.                                                                                                       
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.                                                                                        
Reading option '-i' ... matched as input url with argument 'hevc_keyint2.mp4'.                                                                                                             
Reading option '-f' ... matched as option 'f' (force format) with argument 'null'.                                                                                                         
Reading option '-' ... matched as output url.                                                                                                                                              
Finished splitting the commandline.                                                                                                                                                        
Parsing a group of options: global .                                                                                                                                                       
Applying option v (set logging level) with argument 9.                                                                                                                                     
Successfully parsed a group of options.                                                                                                                                                    
Parsing a group of options: input url hevc_keyint2.mp4.                                                                                                                                    
Successfully parsed a group of options.                                                                                                                                                    
Opening an input file: hevc_keyint2.mp4.                                                                                                                                                   
[NULL @ 0x45aad60] Opening 'hevc_keyint2.mp4' for reading                                                                                                                                  
[file @ 0x45ab580] Setting default whitelist 'file,crypto'                                                                                                                                 
Probing mov,mp4,m4a,3gp,3g2,mj2 score:100 size:2048
Probing mp3 score:1 size:2048                                                                                                                                                              
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'ftyp' parent:'root' sz: 28 8 35333
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'free' parent:'root' sz: 8 36 35333
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'mdat' parent:'root' sz: 32220 44 35333                                                                                                         
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'moov' parent:'root' sz: 3077 32264 35333                                                                                                       
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'mvhd' parent:'moov' sz: 108 8 3069                                                                                                             
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] time scale = 1000                                                                                                                                    
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'trak' parent:'moov' sz: 2863 116 3069                                                                                                          
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'tkhd' parent:'trak' sz: 92 8 2855                                                                                                              
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'edts' parent:'trak' sz: 36 100 2855                                                                                                            
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'elst' parent:'edts' sz: 28 8 28                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] track[0].edit_count = 1                                                                                                                              
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] duration=1000 time=1024 rate=1.000000                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'mdia' parent:'trak' sz: 2727 136 2855                                                                                                          
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'mdhd' parent:'mdia' sz: 32 8 2719                                                                                                              
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'hdlr' parent:'mdia' sz: 45 40 2719                                                                                                             
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] ctype=[0][0][0][0]                                                                                                                                   
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stype=vide                                                                                                                                           
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'minf' parent:'mdia' sz: 2642 85 2719                                                                                                           
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'vmhd' parent:'minf' sz: 20 8 2634                                                                                                              
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'dinf' parent:'minf' sz: 36 28 2634                                                                                                             
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'dref' parent:'dinf' sz: 28 8 28                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'stbl' parent:'minf' sz: 2578 64 2634
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'stsd' parent:'stbl' sz: 2102 8 2570                                                                                                            
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] size=2086 4CC=hev1 codec_type=0                                                                                                                      
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'hvcC' parent:'stsd' sz: 1974 8 2000                                                                                                            
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'fiel' parent:'stsd' sz: 10 1982 2000                                                                                                           
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'pasp' parent:'stsd' sz: 16 1992 2000                                                                                                           
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'stts' parent:'stbl' sz: 24 2110 2570                                                                                                           
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] track[0].stts.entries = 1                                                                                                                            
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] sample_count=25, sample_duration=512                                                                                                                 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'stss' parent:'stbl' sz: 68 2134 2570                                                                                                           
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] keyframe_count = 13                                                                                                                                  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'ctts' parent:'stbl' sz: 208 2202 2570                                                                                                          
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] track[0].ctts.entries = 24                                                                                                                           
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=1024                                                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=1536                                                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=512                                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=1536                                                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=512                                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=1536                                                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=512                                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=1536                                                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=512                                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=2, duration=1024                                                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=1536                                                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=512                                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=1536                                                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=512                                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=1536                                                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=512                                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=1536                                                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=512                                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=1536                                                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=512                                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=1536                                                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=512                                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=1536                                                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] count=1, duration=512                                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] dts shift 0                                                                                                                                          
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'stsc' parent:'stbl' sz: 28 2410 2570                                                                                                           
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] track[0].stsc.entries = 1                                                                                                                            
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'stsz' parent:'stbl' sz: 120 2438 2570                                                                                                          
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] sample_size = 0 sample_count = 25                                                                                                                    
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'stco' parent:'stbl' sz: 20 2558 2570                                                                                                           
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 0, offset 2c, dts 0, size 2467, distance 0, keyframe 1                                                                      
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 1, offset 9cf, dts 512, size 2450, distance 0, keyframe 1                                                                   
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 2, offset 1361, dts 1024, size 34, distance 1, keyframe 0                                                                   
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 3, offset 1383, dts 1536, size 2479, distance 0, keyframe 1                                                                 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 4, offset 1d32, dts 2048, size 35, distance 1, keyframe 0                                                                   
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 5, offset 1d55, dts 2560, size 2429, distance 0, keyframe 1                                                                 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 6, offset 26d2, dts 3072, size 33, distance 1, keyframe 0                                                                   
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 7, offset 26f3, dts 3584, size 2436, distance 0, keyframe 1                                                                 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 8, offset 3077, dts 4096, size 30, distance 1, keyframe 0                                                                   
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 9, offset 3095, dts 4608, size 175, distance 2, keyframe 0                                                                  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 10, offset 3144, dts 5120, size 2416, distance 0, keyframe 1                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 11, offset 3ab4, dts 5632, size 2485, distance 0, keyframe 1                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 12, offset 4469, dts 6144, size 30, distance 1, keyframe 0                                                                  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 13, offset 4487, dts 6656, size 2466, distance 0, keyframe 1                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 14, offset 4e29, dts 7168, size 33, distance 1, keyframe 0                                                                  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 15, offset 4e4a, dts 7680, size 2428, distance 0, keyframe 1                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 16, offset 57c6, dts 8192, size 31, distance 1, keyframe 0                                                                  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 17, offset 57e5, dts 8704, size 2471, distance 0, keyframe 1                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 18, offset 618c, dts 9216, size 35, distance 1, keyframe 0                                                                  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 19, offset 61af, dts 9728, size 2481, distance 0, keyframe 1                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 20, offset 6b60, dts 10240, size 33, distance 1, keyframe 0                                                                 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 21, offset 6b81, dts 10752, size 2463, distance 0, keyframe 1                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 22, offset 7520, dts 11264, size 33, distance 1, keyframe 0                                                                 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 23, offset 7541, dts 11776, size 2199, distance 0, keyframe 1                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] AVIndex stream 0, sample 24, offset 7dd8, dts 12288, size 40, distance 1, keyframe 0                                                                 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] Processing st: 0, edit list 0 - media time: 1024, duration: 12800
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 512 ctts: 1536, ctts_index: 1, ctts_count: 25                                                                                                  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 1024 ctts: 512, ctts_index: 2, ctts_count: 25                                                                                                  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 1536 ctts: 1536, ctts_index: 3, ctts_count: 25                                                                                                 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 2048 ctts: 512, ctts_index: 4, ctts_count: 25                                                                                                  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 2560 ctts: 1536, ctts_index: 5, ctts_count: 25                                                                                                 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 3072 ctts: 512, ctts_index: 6, ctts_count: 25                                                                                                  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 3584 ctts: 1536, ctts_index: 7, ctts_count: 25                                                                                                 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 4096 ctts: 512, ctts_index: 8, ctts_count: 25                                                                                                  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 4608 ctts: 1024, ctts_index: 9, ctts_count: 25                                                                                                 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 5120 ctts: 1024, ctts_index: 10, ctts_count: 25                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 5632 ctts: 1536, ctts_index: 11, ctts_count: 25                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 6144 ctts: 512, ctts_index: 12, ctts_count: 25                                                                                                 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 6656 ctts: 1536, ctts_index: 13, ctts_count: 25                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 7168 ctts: 512, ctts_index: 14, ctts_count: 25                                                                                                 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 7680 ctts: 1536, ctts_index: 15, ctts_count: 25                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 8192 ctts: 512, ctts_index: 16, ctts_count: 25                                                                                                 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 8704 ctts: 1536, ctts_index: 17, ctts_count: 25                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 9216 ctts: 512, ctts_index: 18, ctts_count: 25                                                                                                 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 9728 ctts: 1536, ctts_index: 19, ctts_count: 25                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 10240 ctts: 512, ctts_index: 20, ctts_count: 25                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 10752 ctts: 1536, ctts_index: 21, ctts_count: 25                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 11264 ctts: 512, ctts_index: 22, ctts_count: 25                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stts: 11776 ctts: 1536, ctts_index: 23, ctts_count: 25                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] Offset DTS by 1024 to make first pts zero.                                                                                                           
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'udta' parent:'moov' sz: 98 2979 3069
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'meta' parent:'udta' sz: 90 8 90                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'hdlr' parent:'meta' sz: 33 8 78                                                                                                                
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] ctype=[0][0][0][0]                                                                                                                                   
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stype=mdir                                                                                                                                           
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'ilst' parent:'meta' sz: 45 41 78                                                                                                               
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] type:'[169]too' parent:'ilst' sz: 37 8 37                                                                                                            
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] on_parse_exit_offset=35333                                                                                                                           
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] Before avformat_find_stream_info() pos: 35333 bytes read:35333 seeks:0 nb_streams:1
[hevc @ 0x45ac440] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0                                                                                                                 
[hevc @ 0x45ac440] Decoding VPS                                                                                                                                                            
[hevc @ 0x45ac440] Range Extension profile bitstream                                                                                                                                       
[hevc @ 0x45ac440] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0                                                                                                                 
[hevc @ 0x45ac440] Decoding SPS                                                                                                                                                            
[hevc @ 0x45ac440] Range Extension profile bitstream                                                                                                                                       
[hevc @ 0x45ac440] Decoding VUI                                                                                                                                                            
[hevc @ 0x45ac440] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0                                                                                                                 
[hevc @ 0x45ac440] Decoding PPS                                                                                                                                                            
[hevc @ 0x45ac440] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0                                                                                                          
[hevc @ 0x45ac440] Decoding SEI                                                                                                                                                            
[hevc @ 0x45ac440] Skipped PREFIX SEI 5                                                                                                                                                    
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 0, dts -80000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0: start_time: 0.040 duration: 1.000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] format: start_time: 0.040 duration: 1.000 bitrate=282 kb/s                                                                                           
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] After avformat_find_stream_info() pos: 4961 bytes read:68101 seeks:1 frames:1
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'hevc_keyint2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf57.82.101
  Duration: 00:00:01.00, start: 0.040000, bitrate: 282 kb/s
    Stream #0:0(und), 1, 1/12800: Video: hevc (Rext), 1 reference frame (hev1 / 0x31766568), gbrp(tv, gbr/unknown/unknown, progressive), 320x240 [SAR 1:1 DAR 4:3], 0/1, 257 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Successfully opened the file.
Parsing a group of options: output url -.                                                                                                                                                  
Applying option f (force format) with argument null.                                                                                                                                       
Successfully parsed a group of options.                                                                                                                                                    
Opening an output file: -.                                                                                                                                                                 
Successfully opened the file.                                                                                                                                                              
detected 16 logical cores                                                                                                                                                                  
[hevc @ 0x45c85a0] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0                                                                                                                 
[hevc @ 0x45c85a0] Decoding VPS                                                                                                                                                            
[hevc @ 0x45c85a0] Range Extension profile bitstream                                                                                                                                       
[hevc @ 0x45c85a0] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0                                                                                                                 
[hevc @ 0x45c85a0] Decoding SPS                                                                                                                                                            
[hevc @ 0x45c85a0] Range Extension profile bitstream                                                                                                                                       
[hevc @ 0x45c85a0] Decoding VUI                                                                                                                                                            
[hevc @ 0x45c85a0] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0                                                                                                                 
[hevc @ 0x45c85a0] Decoding PPS                                                                                                                                                            
[hevc @ 0x45c85a0] nal_unit_type: 39(SEI_PREFIX), nuh_layer_id: 0, temporal_id: 0                                                                                                          
[hevc @ 0x45c85a0] Decoding SEI                                                                                                                                                            
[hevc @ 0x45c85a0] Skipped PREFIX SEI 5                                                                                                                                                    
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    Last message repeated 1 times
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 1, dts -40000
[hevc @ 0x45c85a0] nal_unit_type: 21(CRA_NUT), nuh_layer_id: 0, temporal_id: 0
cur_dts is invalid (this is harmless if it occurs once at the start per stream)                                                                                                            
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 2, dts 0
[hevc @ 0x45d2480] nal_unit_type: 8(RASL_N), nuh_layer_id: 0, temporal_id: 0
cur_dts is invalid (this is harmless if it occurs once at the start per stream)                                                                                                            
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 3, dts 40000
[hevc @ 0x45e7d60] nal_unit_type: 21(CRA_NUT), nuh_layer_id: 0, temporal_id: 0
cur_dts is invalid (this is harmless if it occurs once at the start per stream)                                                                                                            
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 4, dts 80000
[hevc @ 0x45f83e0] nal_unit_type: 8(RASL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x45f83e0] Output frame with POC 2.                                                                                                                                                
cur_dts is invalid (this is harmless if it occurs once at the start per stream)                                                                                                            
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 5, dts 120000
[hevc @ 0x4608e20] nal_unit_type: 21(CRA_NUT), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x4608e20] Output frame with POC 3.                                                                                                                                                
cur_dts is invalid (this is harmless if it occurs once at the start per stream)                                                                                                            
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 6, dts 160000
[hevc @ 0x4619960] nal_unit_type: 8(RASL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x4619960] Output frame with POC 4.
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 7, dts 200000
[hevc @ 0x462a480] nal_unit_type: 21(CRA_NUT), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x462a480] Output frame with POC 5.
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 8, dts 240000
[hevc @ 0x463af40] nal_unit_type: 8(RASL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x45e7d60] Decoded frame with POC 4.
[hevc @ 0x45c85a0] Decoded frame with POC 2.
[hevc @ 0x463af40] Output frame with POC 6.
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 9, dts 280000
[hevc @ 0x464ba60] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x45f83e0] Decoded frame with POC 3.
[hevc @ 0x464ba60] Output frame with POC 7.
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 10, dts 320000
[hevc @ 0x465c520] nal_unit_type: 21(CRA_NUT), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x465c520] Output frame with POC 8.
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 11, dts 360000
[hevc @ 0x4608e20] Decoded frame with POC 6.
[hevc @ 0x466d040] nal_unit_type: 21(CRA_NUT), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x466d040] Output frame with POC 9.
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 12, dts 400000
[hevc @ 0x467db00] nal_unit_type: 8(RASL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x4619960] Decoded frame with POC 5.
[hevc @ 0x467db00] Output frame with POC 10.
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 13, dts 440000
[hevc @ 0x468e640] nal_unit_type: 21(CRA_NUT), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x462a480] Decoded frame with POC 8.
[hevc @ 0x468e640] Output frame with POC 11.
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 14, dts 480000
[hevc @ 0x469f180] nal_unit_type: 8(RASL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x463af40] Decoded frame with POC 7.
[hevc @ 0x469f180] Output frame with POC 12.
[hevc @ 0x464ba60] Decoded frame with POC 9.
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 15, dts 520000
[hevc @ 0x46afcc0] nal_unit_type: 21(CRA_NUT), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x46afcc0] Output frame with POC 13.
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 16, dts 560000
[hevc @ 0x46c0800] nal_unit_type: 8(RASL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x465c520] Decoded frame with POC 10.
[hevc @ 0x46c0800] Output frame with POC 14.
[hevc @ 0x466d040] Decoded frame with POC 12.
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 17, dts 600000
[hevc @ 0x45c85a0] nal_unit_type: 21(CRA_NUT), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x45c85a0] Output frame with POC 15.
[hevc @ 0x467db00] Decoded frame with POC 11.
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 18, dts 640000
[hevc @ 0x45d2480] nal_unit_type: 8(RASL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x45d2480] Output frame with POC 16.
[hevc @ 0x45e7d60] nal_unit_type: 21(CRA_NUT), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x468e640] Decoded frame with POC 14.
[hevc @ 0x45e7d60] Output frame with POC 17.
[hevc @ 0x469f180] Decoded frame with POC 13.
[hevc @ 0x46afcc0] Decoded frame with POC 16.
[graph 0 input from stream 0:0 @ 0x479ab20] Setting 'video_size' to value '320x240'
[graph 0 input from stream 0:0 @ 0x479ab20] Setting 'pix_fmt' to value '82'
[hevc @ 0x46c0800] Decoded frame with POC 15.
[graph 0 input from stream 0:0 @ 0x479ab20] Setting 'time_base' to value '1/12800'
[graph 0 input from stream 0:0 @ 0x479ab20] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 0x479ab20] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x479ab20] Setting 'frame_rate' to value '25/1'
[graph 0 input from stream 0:0 @ 0x479ab20] w:320 h:240 pixfmt:gbrp tb:1/12800 fr:25/1 sar:1/1 sws_param:flags=2
[AVFilterGraph @ 0x45ca4e0] query_formats: 3 queried, 2 merged, 0 already done, 0 delayed
Output #0, null, to 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf57.82.101
[hevc @ 0x45c85a0] Decoded frame with POC 18.
    Stream #0:0(und), 0, 1/25: Video: wrapped_avframe, 1 reference frame, gbrp, 320x240 [SAR 1:1 DAR 4:3], 0/1, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc57.106.101 wrapped_avframe
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 19, dts 680000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 20, dts 720000
[hevc @ 0x45f83e0] nal_unit_type: 8(RASL_N), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x45f83e0] Output frame with POC 18.
[hevc @ 0x4608e20] nal_unit_type: 21(CRA_NUT), nuh_layer_id: 0, temporal_id: 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 21, dts 760000
[hevc @ 0x45d2480] Decoded frame with POC 17.
[hevc @ 0x4608e20] Output frame with POC 19.
[hevc @ 0x4619960] nal_unit_type: 8(RASL_N), nuh_layer_id: 0, temporal_id: 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x45aad60] stream 0, sample 22, dts 800000
[hevc @ 0x4619960] Output frame with POC 20.
[hevc @ 0x462a480] nal_unit_type: 21(CRA_NUT), nuh_layer_id: 0, temporal_id: 0
[hevc @ 0x462a480] Output frame with POC 21.
[hevc @ 0x463af40] Output frame with POC 22.
[hevc @ 0x464ba60] Output frame with POC 24.
[hevc @ 0x45e7d60] Decoded frame with POC 20.
[hevc @ 0x45f83e0] Decoded frame with POC 19.
[hevc @ 0x4608e20] Decoded frame with POC 22.
[hevc @ 0x462a480] Decoded frame with POC 24.
[hevc @ 0x4619960] Decoded frame with POC 21.
[out_0_0 @ 0x479b140] EOF on sink link out_0_0:default.
No more output streams to write to, finishing.
frame=   22 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.92 bitrate=N/A speed=69.7x    
video:11kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (hevc_keyint2.mp4):
  Input stream #0:0 (video): 23 packets read (29705 bytes); 22 frames decoded; 
  Total: 23 packets (29705 bytes) demuxed
Output file #0 (pipe:):
  Output stream #0:0 (video): 22 frames encoded; 22 packets muxed (11616 bytes); 
  Total: 22 packets (11616 bytes) muxed
22 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x45b3740] Statistics: 68101 bytes read, 1 seeks

in reply to:  description ; comment:2 by Carl Eugen Hoyos, 7 years ago

Replying to tospi:

In earlier versions of FFmpeg (e.g. FFmpeg 2.8.11), decoding of the same file works without problems.

The file you attached works significantly better here with current FFmpeg git head than 2.8.

by tospi, 7 years ago

Attachment: hevc_keyint2_testsrc2.mp4 added

Better example file with testsrc2 as source (YUV420)

in reply to:  2 comment:3 by tospi, 7 years ago

Replying to cehoyos:

Replying to tospi:

In earlier versions of FFmpeg (e.g. FFmpeg 2.8.11), decoding of the same file works without problems.

The file you attached works significantly better here with current FFmpeg git head than 2.8.

Well yes, the used "testsrc" apparently produced gbrp pixel format output, so the HEVC test file also used this format which was not supported in this old FFmpeg version. Therefore is was not a good sample, sorry.

I created a new sample with the testsrc2 source which uses YUV420.

./ffmpeg -f lavfi -i testsrc2=duration=1 -b:v 1000k -c:v libx265 -x265-params keyint=2 hevc_keyint2_testsrc2.mp4

This file works in the old FFmpeg 2.8.11, but still not in the current version.

comment:4 by Sasi Inguva, 7 years ago

Owner: set to Sasi Inguva
Status: newopen

The latest version contains the edit list parsing code http://git.videolan.org/?p=ffmpeg.git;a=commit;h=ca6cae73db207f17a0d5507609de12842d8f0ca3 which will modify the index based on the edit lists.

The mov_fix_index function tries to seek to the nearest keyframe with the timestamp that is less than or equal to the edit list start timestamp.

The issue here is that the index timestamps are decoding timestamps, while the edit list start refers to the presentation timestamp.

Usually this is not a problem, since whenever DTS != PTS i.e. that the video has B-frames. And the found key-frame is before the B-frame that corresponds to edit list start.

However in this case we have two I-frames right-after each other in decoding order. The key-frame that is found is the 2nd key-frame, however the edit list start is referring to the 1st B-frame.
packet|pts_time=0.000000|dts_time=-0.080000|flags=K_ (edit list start)
packet|pts_time=0.080000|dts_time=-0.040000|flags=K_ (What the code seeks to )
packet|pts_time=0.040000|dts_time=0.000000|flags= (B frame)

Hence the demuxer doesn't output the first I frame.

I have a patch, which will refine the edit list start search based on PTS computed by adding CTTS values. It should fix this problem.

comment:5 by Sasi Inguva, 7 years ago

Sent the patch to review. Inerested parties, please review http://ffmpeg.org/pipermail/ffmpeg-devel/2017-November/218930.html

comment:6 by Sasi Inguva, 7 years ago

There is also another issue, where the trailing B-frame is not being output by the demuxer even though that B-frame is inside edit.

This is because, we stop parsing the index in mov_fix_index as soon as we encounter a key-frame with (pts + duration) >= edit_list_end. So in this case, we are ignoring the B-frame that comes after the key frame, but is still included in the edit i.e. (pts + duration) < edit_list_end.

Edit list:
media_time , duration
1024 12800
Frame#24 : I - DTS: 11776 , PTS: 13312 , DURATION: 512 - PTS + DURATION >= (1024 +12800)
Frame#25 : B - DTS: 12288 , PTS: 12800 , DURATION: 512 - PTS + DURATION < (1024 +12800)

I have sent a patch which will keep parsing until we encounter 2 keyframes that are outside the edit list.

comment:7 by Sasi Inguva, 7 years ago

There is also another issue, where the trailing B-frame is not being output by the demuxer even though that B-frame is inside edit.

This is because, we stop parsing the index in mov_fix_index as soon as we encounter a key-frame with (pts + duration) >= edit_list_end. So in this case, we are ignoring the B-frame that comes after the key frame, but is still included in the edit i.e. (pts + duration) < edit_list_end.

Edit list:
media_time , duration
1024 12800
Frame#24 : I - DTS: 11776 , PTS: 13312 , DURATION: 512 - PTS + DURATION >= (1024 +12800)
Frame#25 : B - DTS: 12288 , PTS: 12800 , DURATION: 512 - PTS + DURATION < (1024 +12800)

I have sent a patch which will keep parsing until we encounter 2 keyframes that are outside the edit list.

comment:8 by Carl Eugen Hoyos, 7 years ago

Reproduced by developer: set

Partially fixed in c2a8f0fcbe57ea9ccaa864130f078af10516c3c1, the trailing B-frame is still missing.

comment:9 by Carl Eugen Hoyos, 7 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.