SIGN IN SIGN UP
ossrs / srs UNCLAIMED

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181, with codec support for H.264, H.265, AV1, VP9, AAC, Opus, and G.711.

0 0 127 C++

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>
J
Jacob Su committed
1316ceb7e9d01aaee1ddc905c614f101b84592d3
Parent: 9f8670b
Committed by GitHub <noreply@github.com> on 12/6/2025, 11:32:58 PM