Janus recording h265 with POC error

there is something wrong in h265 recording, error message:

(+) Video --vid=1 (*) (hevc 640x480 29.463fps)

File tags:

Comment: {"t": "v", "c": "h265", "x": {"13": "urn:3gpp:video-orientation"}, "s": 1695872227178224, "u": 1695872227418988}

[ffmpeg/video] hevc: Could not find ref with POC 2

[ffmpeg/video] hevc: Could not find ref with POC 1

[ffmpeg/video] hevc: Could not find ref with POC 2

[ffmpeg/video] hevc: Could not find ref with POC 1

[ffmpeg/video] hevc: Could not find ref with POC 2

[ffmpeg/video] hevc: Could not find ref with POC 1

[ffmpeg/video] hevc: Could not find ref with POC 6

[ffmpeg/video] hevc: Could not find ref with POC 2

[ffmpeg/video] hevc: Could not find ref with POC 1

[ffmpeg/video] hevc: Could not find ref with POC 6

[ffmpeg/video] hevc: Could not find ref with POC 2

[ffmpeg/video] hevc: Could not find ref with POC 6

[ffmpeg/video] hevc: Could not find ref with POC 6

[ffmpeg/video] hevc: Could not find ref with POC 6

VO: [libmpv] 640x480 yuv420p

[ffmpeg/video] hevc: Could not find ref with POC 6

V: 00:00:10 / 00:00:16 (63%) Dropped: 2

Exiting... (Quit)

janus version: v1.0.0, v1.1.1, v1.2.0

BTW, h264 works.

Our support for H.265 recordings (or H.265 in general) is very sketchy and experimental, since basically no browser supports it so we have no way to test it. Besides, as a very closed proprietary codec, my interest in it is very low, to be honest.

Thank you for your answer which makes sense.

I am testing hevc under the tech preview version of Safari which supports hevc in webrtc, and planing to use hevc for my mobile peers which are with hevc hw codec.

After spending some time to read and debug the janus-pp-rec code to see what happend. I find that you didn’t handle all nalu types. For my case, I just add type == 1(NAL_TRAIL_R) to let it work.

347a348,349
> 		} else {
> 			JANUS_LOG(AV_LOG_WARNING, "WARN: unhandled header type: %d\n", type);
439c441
< 			if(type == 32 || type == 33 || type == 34) {
---
> 			if(type == 32 || type == 33 || type == 34 || type == 1) { // added type 1
453,454c455
< 			}
< 			if(type == 49) {
---
> 			} else if(type == 49) {
457a459
> 				uint8_t endbit = (fuh & 0x40) >> 6;
477a480,483
> 				JANUS_LOG(LOG_HUGE, "[RTP FU]: startbit: %d, endbit: %d, len: %d, frameLen: %d\n", 
> 					startbit, endbit, len, frameLen);
> 			} else {
> 				JANUS_LOG(LOG_HUGE, "unhandled type: %d\n", type);