srs
srs copied to clipboard
When recording in HEVC format, it is not possible to segment the recording by time intervals.
Describe the bug Enable DVR recording configuration to record in segments based on duration. When streaming in HEVC, segmentation does not occur and a .tmp file is continuously generated, whereas streaming in H.264 functions normally.
Version v6.0-d3
To Reproduce
- Compile: Execute the command
./configure --h265. - Run: Start the server using
./objs/srs -c conf/dvr.segment.conf. - Stream: Configure OBS to use HEVC video encoding and push the stream to SRS via RTMP.
- In the DVR directory of SRS, a
.flv.tmpfile is continuously being created without generating a complete.flvfile according to the specified duration.
Expected behavior
Stream using HEVC encoding and record segmented files based on the dvr_duration setting.
Additional context
In the update_duration function within the srs_app_dvr.cpp file, when the duration threshold is reached, the file is segmented at the next keyframe. However, it seems that only H.264 keyframes are being checked for, and there might be an oversight in not checking for H.265 keyframes.
TRANS_BY_GPT4
Welcome to patch.