Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#7870 closed defect (duplicate)

HEVC: JPEG output does not wait until a complete frame is found

Reported by: Peter Krefting Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
I am trying to generate a screenshot from a HEVC stream, but it fails, giving me a partial image.

The stream is a MPEG transport stream received off the Astra satellite, where I fetch several seconds worth of data. Since I do not know where I jump into the data stream, it does not necessarily start with a key frame, so I expect ffmpeg to continue decoding the stream until it has enough data to create a proper image, but the actual result is that I get a partially decoded image.

How to reproduce:

$ ffmpeg -an -i Astra_UHD1_\(1\).ts -vframes 1 ffmpeg-bug.jpg
ffmpeg version N-93674-g1e01f66822 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: 
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 52.100 / 58. 52.100
  libavformat    58. 27.103 / 58. 27.103
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 49.100 /  7. 49.100
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
[hevc @ 0x55af326de000] PPS id out of range: 0
    Last message repeated 1 times
[hevc @ 0x55af326de000] Error parsing NAL unit #2.
[...these error messages are repeated several times...]
Input #0, mpegts, from 'Astra_UHD1_(1).ts':
  Duration: 00:00:11.28, start: 72787.815722, bitrate: 14235 kb/s
  Program 2 
    Metadata:
      service_name    : UHD1 by ASTRA / HD+
      service_provider: SES ASTRA
    Stream #0:0[0x65]: Video: hevc (Main 10) ([36][0][0][0] / 0x0024), yuv420p10le(tv, bt2020nc/bt2020/arib-std-b67), 3840x2160 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x66](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s (clean effects)
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[hevc @ 0x55af3279f000] Could not find ref with POC 32
[swscaler @ 0x55af3559f480] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'ffmpeg-bug2.jpg':
  Metadata:
    encoder         : Lavf58.27.103
    Stream #0:0: Video: mjpeg, yuvj420p(pc), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 50 fps, 50 tbn, 50 tbc
    Metadata:
      encoder         : Lavc58.52.100 mjpeg
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame=    1 fps=0.0 q=4.8 Lsize=N/A time=00:00:00.02 bitrate=N/A dup=1 drop=1 speed=0.0333x    
video:90kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

My current workaround is to pass -ss 1 to hard-code decoding one second of video, to make sure I get to an I-frame.

The off-air clip used is available here:
https://www.dropbox.com/s/jmmo8rdjc4a12hb/Astra_UHD1_%281%29.ts?dl=0

Attachments (2)

ffmpeg-output.txt (94.0 KB ) - added by Peter Krefting 5 years ago.
Output of -report -v 9 -loglevel 99
ffmpeg-20190426-133651.log (84.9 KB ) - added by Peter Krefting 5 years ago.
Report generated by -report -v 9 -loglevel 99

Download all attachments as: .zip

Change History (6)

by Peter Krefting, 5 years ago

Attachment: ffmpeg-output.txt added

Output of -report -v 9 -loglevel 99

by Peter Krefting, 5 years ago

Attachment: ffmpeg-20190426-133651.log added

Report generated by -report -v 9 -loglevel 99

comment:1 by Gyan, 5 years ago

Try

ffmpeg -an -skip_frame nokey -i Astra_UHD1_\(1\).ts -vframes 1 ffmpeg-bug.jpg

comment:2 by Carl Eugen Hoyos, 5 years ago

Resolution: duplicate
Status: newclosed

Duplicate of ticket #4888.

in reply to:  1 ; comment:3 by Peter Krefting, 5 years ago

Replying to Gyan:

Try

ffmpeg -an -skip_frame nokey -i Astra_UHD1_\(1\).ts -vframes 1 ffmpeg-bug.jpg

This still gives me a broken JPEG; redirecting to #4888

in reply to:  3 comment:4 by Peter Krefting, 5 years ago

Replying to nafmo:

This still gives me a broken JPEG; redirecting to #4888

Wrong version, git-master tip seems to give me a picture with this command line. It still outputs all the error messages, though.

Note: See TracTickets for help on using tickets.