<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><br><br><blockquote type="cite">On 23. 3. 2023., at 20:19, Michael Wood <mornwood23@gmail.com> wrote:<br><br class="Apple-interchange-newline"><br><br>On Thu, Mar 23, 2023 at 8:06 PM Strahinja Radman <dr.strashni@gmail.com> wrote:<br><br><br>On Thu, 23 Mar 2023 at 20:05, Michael Wood <mornwood23@gmail.com> wrote:<br><br><br>On Thu, Mar 23, 2023 at 6:20 PM Michael Wood <mornwood23@gmail.com> wrote:<br>Hi,<br><br>I'm having a weird issue with the decoding of H265 4K stream where 1/3 of the frame is rendered normally and the other 2/3 is in green (https://ibb.co/C8yFygm). This only happens if i try to decode 4K stream, for non 4K streams everything works as expected.<br><br>I'm using live555 library to get stream from RTSP server after which packets are sent to the ffmpeg to be decoded and later rendered<br><br>DESCRIBE response contains all required VPS,SPS,PPS fields that are passed as extra data to the codec context.<br><br>This is what is returned from DESCRIBE:<br><br>v=0<br>o=- 1679598602413481 1679598602413481 IN IP4 192.168.1.212<br>s=Media Presentation<br>e=NONE<br>b=AS:5050<br>t=0 0<br>a=control:rtsp://192.168.1.212/Streaming/Channels/101/?transportmode=unicast&profile=Profile_1<br>m=video 0 RTP/AVP 96<br>c=IN IP4 0.0.0.0<br>b=AS:5000<br>a=recvonly<br>a=x-dimensions:3840,2160<br>a=control:rtsp://192.168.1.212/Streaming/Channels/101/trackID=1?transportmode=unicast&profile=Profile_1<br>a=rtpmap:96 H265/90000<br>a=fmtp:96 sprop-vps=QAEMA///AWAAAAMAgAAAAwAAAwCWAAC94Eg=; sprop-sps=QgEDAWAAAAMAgAAAAwAAAwCWAACgAeAgAhx/jb33am7uS/YC3AQEBBAAAD6AAALuByHe5RAAmRgACsPgAEyMAAVh8EACZGAAKw+AATIwABWHwg==; sprop-pps=RAHBcrCcCgFGZA==<br>a=Media_header:MEDIAINFO=494D4B48010300000400050000000000000000000000000081000000000000000000000000000000;<br>a=appversion:1.0<br><br>When trying to decode packets i'm getting this output from hevc, the ffplay/VLC works normally with the incoming stream.<br><br>[hevc @ 0x14ac15600] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0<br>[hevc @ 0x14ac15600] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0<br>[hevc @ 0x14ac15600] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0<br>[hevc @ 0x14ac15600] Decoding VPS<br>[hevc @ 0x14ac15600] Main profile bitstream<br>[hevc @ 0x14ac15600] Decoding SPS<br>[hevc @ 0x14ac15600] Main profile bitstream<br>[hevc @ 0x14ac15600] Decoding VUI<br>[hevc @ 0x14ac15600] Decoding PPS<br>[hevc @ 0x14ac15600] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0<br>[hevc @ 0x14ac15600] Decoding VPS<br>[hevc @ 0x14ac15600] Main profile bitstream<br>[hevc @ 0x14ac15600] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0<br>[hevc @ 0x14ac15600] Decoding SPS<br>[hevc @ 0x14ac15600] Main profile bitstream<br>[hevc @ 0x14ac15600] Decoding VUI<br>[hevc @ 0x14ac15600] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0<br>[hevc @ 0x14ac15600] Decoding PPS<br>[hevc @ 0x14ac15600] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0, temporal_id: 0<br>[hevc @ 0x14ac15600] Format yuvj420p chosen by get_format().<br>[hevc @ 0x14ac15600] Output frame with POC 0.<br>[hevc @ 0x14ac15600] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0, temporal_id: 0<br>[hevc @ 0x14ac15600] First slice in a frame missing.<br>[hevc @ 0x14ac15600] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0, temporal_id: 0<br>[hevc @ 0x14ac15600] First slice in a frame missing.<br>[hevc @ 0x14ac15600] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0<br>[hevc @ 0x14ac15600] Decoding VPS<br>[hevc @ 0x14ac15600] Main profile bitstream<br>[hevc @ 0x14ac15600] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0<br>[hevc @ 0x14ac15600] Decoding SPS<br>[hevc @ 0x14ac15600] Main profile bitstream<br>[hevc @ 0x14ac15600] Decoding VUI<br>[hevc @ 0x14ac15600] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0<br>[hevc @ 0x14ac15600] Decoding PPS<br>[hevc @ 0x14ac15600] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0, temporal_id: 0<br>[hevc @ 0x14ac15600] Output frame with POC 0.<br>[hevc @ 0x14ac15600] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0, temporal_id: 0<br>[hevc @ 0x14ac15600] First slice in a frame missing.<br>[hevc @ 0x14ac15600] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0, temporal_id: 0<br>[hevc @ 0x14ac15600] First slice in a frame missing.<br>[hevc @ 0x14ac15600] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 2<br>[hevc @ 0x14ac15600] Output frame with POC 1.<br>[hevc @ 0x14ac15600] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 2<br>[hevc @ 0x14ac15600] First slice in a frame missing.<br>[hevc @ 0x14ac15600] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 2<br>[hevc @ 0x14ac15600] First slice in a frame missing.<br>[hevc @ 0x14ac15600] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 2<br>[hevc @ 0x14ac15600] Output frame with POC 2.<br>[hevc @ 0x14ac15600] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 2<br>[hevc @ 0x14ac15600] First slice in a frame missing.<br>[hevc @ 0x14ac15600] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 2<br>[hevc @ 0x14ac15600] First slice in a frame missing.<br><br>If I write the stream to the file and play that file either through ffplay or VLC the frames are rendered normally. <br><br>Any suggestion would be welcomed.<br><br>Thanks,<br>Milos<br><br> Hey Strahinja,<br><br>Thanks for the answer,<br><br>Can you provide more info on how to do it ?<br><br>Best,<br>Milos<br>
_______________________________________________<br>
Libav-user mailing list<br>
Libav-user@ffmpeg.org<br>
https://ffmpeg.org/mailman/listinfo/libav-user<br>
<br>
To unsubscribe, visit link above, or email<br>
libav-user-request@ffmpeg.org with subject "unsubscribe".<br>
Hey Milos,<br><br>In AVFrame structure, check width, height and stride variables. <br><br><br>-- <br><br>Regards<br>Strahinja Radman<br>
_______________________________________________<br>
Libav-user mailing list<br>
Libav-user@ffmpeg.org<br>
https://ffmpeg.org/mailman/listinfo/libav-user<br>
<br>
To unsubscribe, visit link above, or email<br>
libav-user-request@ffmpeg.org with subject "unsubscribe".<br><br>Hey Strahinja,<br><br>It seems that both width & height are set correctly. I can't find stride, i don't see any reference to it in the AVFrame header.<br><br>Thanks,<br>Milos<br>
_______________________________________________<br>Libav-user mailing list<br>Libav-user@ffmpeg.org<br>https://ffmpeg.org/mailman/listinfo/libav-user<br><br>To unsubscribe, visit link above, or email<br>libav-user-request@ffmpeg.org with subject "unsubscribe”.<br></blockquote><br>Hey Milos,<br><br>What does a parameter linesize say?<br><br><font size="2">AVFrame->linesize[0]</font><div><font size="2"><br></font></div><div><font size="2">Kind regards,</font></div><div><font size="2">Strahinja<br></font><br><br></div></body></html>