Files
srs/trunk
Jacob Su 1316ceb7e9 DVR: Fix HEVC mp4 recording error. v6.0.185 (#4605) (#4605)
When recording HEVC streams to MP4, DVR fails with error "doesn't support
hvcC change" (ERROR_MP4_HVCC_CHANGE).

The root cause is in video_avc_demux(): the SrsVideoFrame object is reused
across frames, and its initialize() method does not reset avc_packet_type.
When a sequence header is processed, avc_packet_type is set to 0 
(SrsVideoAvcFrameTraitSequenceHeader). When the next video info frame
arrives (which only appears in HEVC streams), the function returns early
without assigning video->avc_packet_type, so it retains the value 0 from
the previous sequence header frame.

When DVR processes this video info frame, it checks avc_packet_type and
incorrectly identifies it as a sequence header. Since the real HEVC sequence
header was already recorded, DVR returns the "hvcC change" error.

The fix assigns video->avc_packet_type = packet_type before returning
early for VideoInfoFrame, ensuring DVR correctly identifies the frame
type.

Fix #4603 for 6.0release

---------

Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-12-06 18:32:58 -05:00
..
2023-09-28 11:03:34 +08:00
2024-07-27 11:40:10 +08:00