[Libav-user] HEVC 2/3 of the frame is green

Strahinja Radman dr.strashni at gmail.com
Thu Mar 23 21:06:33 EET 2023


On Thu, 23 Mar 2023 at 20:05, Michael Wood <mornwood23 at gmail.com> wrote:

>
>
> On Thu, Mar 23, 2023 at 6:20 PM Michael Wood <mornwood23 at gmail.com> wrote:
>
>> Hi,
>>
>> 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.
>>
>> 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
>>
>> *DESCRIBE* response contains all required *VPS,SPS,PPS* fields that are
>> passed as extra data to the codec context.
>>
>> This is what is returned from *DESCRIBE*:
>>
>> v=0
>> o=- 1679598602413481 1679598602413481 IN IP4 192.168.1.212
>> s=Media Presentation
>> e=NONE
>> b=AS:5050
>> t=0 0
>> a=control:rtsp://
>> 192.168.1.212/Streaming/Channels/101/?transportmode=unicast&profile=Profile_1
>> m=video 0 RTP/AVP 96
>> c=IN IP4 0.0.0.0
>> b=AS:5000
>> a=recvonly
>> a=x-dimensions:3840,2160
>> a=control:rtsp://
>> 192.168.1.212/Streaming/Channels/101/trackID=1?transportmode=unicast&profile=Profile_1
>> a=rtpmap:96 H265/90000
>> a=fmtp:96 sprop-vps=QAEMA///AWAAAAMAgAAAAwAAAwCWAAC94Eg=;
>> sprop-sps=QgEDAWAAAAMAgAAAAwAAAwCWAACgAeAgAhx/jb33am7uS/YC3AQEBBAAAD6AAALuByHe5RAAmRgACsPgAEyMAAVh8EACZGAAKw+AATIwABWHwg==;
>> sprop-pps=RAHBcrCcCgFGZA==
>>
>> a=Media_header:MEDIAINFO=494D4B48010300000400050000000000000000000000000081000000000000000000000000000000;
>> a=appversion:1.0
>>
>> When trying to decode packets i'm getting this output from hevc, the
>> *ffplay/VLC* works normally with the incoming stream.
>>
>> [hevc @ 0x14ac15600] nal_unit_type: 32(VPS), nuh_layer_id: 0,
>> temporal_id: 0
>> [hevc @ 0x14ac15600] nal_unit_type: 33(SPS), nuh_layer_id: 0,
>> temporal_id: 0
>> [hevc @ 0x14ac15600] nal_unit_type: 34(PPS), nuh_layer_id: 0,
>> temporal_id: 0
>> [hevc @ 0x14ac15600] Decoding VPS
>> [hevc @ 0x14ac15600] Main profile bitstream
>> [hevc @ 0x14ac15600] Decoding SPS
>> [hevc @ 0x14ac15600] Main profile bitstream
>> [hevc @ 0x14ac15600] Decoding VUI
>> [hevc @ 0x14ac15600] Decoding PPS
>> [hevc @ 0x14ac15600] nal_unit_type: 32(VPS), nuh_layer_id: 0,
>> temporal_id: 0
>> [hevc @ 0x14ac15600] Decoding VPS
>> [hevc @ 0x14ac15600] Main profile bitstream
>> [hevc @ 0x14ac15600] nal_unit_type: 33(SPS), nuh_layer_id: 0,
>> temporal_id: 0
>> [hevc @ 0x14ac15600] Decoding SPS
>> [hevc @ 0x14ac15600] Main profile bitstream
>> [hevc @ 0x14ac15600] Decoding VUI
>> [hevc @ 0x14ac15600] nal_unit_type: 34(PPS), nuh_layer_id: 0,
>> temporal_id: 0
>> [hevc @ 0x14ac15600] Decoding PPS
>> [hevc @ 0x14ac15600] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0,
>> temporal_id: 0
>> [hevc @ 0x14ac15600] Format yuvj420p chosen by get_format().
>> [hevc @ 0x14ac15600] Output frame with POC 0.
>> [hevc @ 0x14ac15600] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0,
>> temporal_id: 0
>> [hevc @ 0x14ac15600] First slice in a frame missing.
>> [hevc @ 0x14ac15600] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0,
>> temporal_id: 0
>> [hevc @ 0x14ac15600] First slice in a frame missing.
>> [hevc @ 0x14ac15600] nal_unit_type: 32(VPS), nuh_layer_id: 0,
>> temporal_id: 0
>> [hevc @ 0x14ac15600] Decoding VPS
>> [hevc @ 0x14ac15600] Main profile bitstream
>> [hevc @ 0x14ac15600] nal_unit_type: 33(SPS), nuh_layer_id: 0,
>> temporal_id: 0
>> [hevc @ 0x14ac15600] Decoding SPS
>> [hevc @ 0x14ac15600] Main profile bitstream
>> [hevc @ 0x14ac15600] Decoding VUI
>> [hevc @ 0x14ac15600] nal_unit_type: 34(PPS), nuh_layer_id: 0,
>> temporal_id: 0
>> [hevc @ 0x14ac15600] Decoding PPS
>> [hevc @ 0x14ac15600] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0,
>> temporal_id: 0
>> [hevc @ 0x14ac15600] Output frame with POC 0.
>> [hevc @ 0x14ac15600] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0,
>> temporal_id: 0
>> [hevc @ 0x14ac15600] First slice in a frame missing.
>> [hevc @ 0x14ac15600] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0,
>> temporal_id: 0
>> [hevc @ 0x14ac15600] First slice in a frame missing.
>> [hevc @ 0x14ac15600] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0,
>> temporal_id: 2
>> [hevc @ 0x14ac15600] Output frame with POC 1.
>> [hevc @ 0x14ac15600] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0,
>> temporal_id: 2
>> [hevc @ 0x14ac15600] First slice in a frame missing.
>> [hevc @ 0x14ac15600] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0,
>> temporal_id: 2
>> [hevc @ 0x14ac15600] First slice in a frame missing.
>> [hevc @ 0x14ac15600] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0,
>> temporal_id: 2
>> [hevc @ 0x14ac15600] Output frame with POC 2.
>> [hevc @ 0x14ac15600] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0,
>> temporal_id: 2
>> [hevc @ 0x14ac15600] First slice in a frame missing.
>> [hevc @ 0x14ac15600] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0,
>> temporal_id: 2
>> [hevc @ 0x14ac15600] First slice in a frame missing.
>>
>> If I write the stream to the file and play that file either through
>> *ffplay* or *VLC* the frames are rendered normally.
>>
>> Any suggestion would be welcomed.
>>
>> Thanks,
>> Milos
>>
>
>  Hey Strahinja,
>
> Thanks for the answer,
>
> Can you provide more info on how to do it ?
>
> Best,
> Milos
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/libav-user
>
> To unsubscribe, visit link above, or email
> libav-user-request at ffmpeg.org with subject "unsubscribe".
>
Hey Milos,

In AVFrame structure, check width, height and stride variables.


-- 

Regards
Strahinja Radman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20230323/00aecffc/attachment.htm>


More information about the Libav-user mailing list