Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

播放RTMP视频流频繁丢帧 #78

Open
ztywhy001 opened this issue Feb 28, 2025 · 1 comment
Open

播放RTMP视频流频繁丢帧 #78

ztywhy001 opened this issue Feb 28, 2025 · 1 comment

Comments

@ztywhy001
Copy link

[IJKMEDIA][h264 @ 0x10a723310] nal_unit_type: 7(SPS), nal_ref_idc: 3
[IJKMEDIA][h264 @ 0x10a723310] Decoding VUI
[IJKMEDIA][h264 @ 0x10a723310] nal_unit_type: 8(PPS), nal_ref_idc: 3
[IJKMEDIA][h264 @ 0x10a723310] nal_unit_type: 7(SPS), nal_ref_idc: 3
[IJKMEDIA][h264 @ 0x10a723310] nal_unit_type: 8(PPS), nal_ref_idc: 3
[IJKMEDIA][h264 @ 0x10a723310] nal_unit_type: 5(IDR), nal_ref_idc: 3
[IJKMEDIA][h264 @ 0x10a723310] Decoding VUI
[IJKMEDIA][h264 @ 0x10cd2aef0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[IJKMEDIA][h264 @ 0x10cd2aef0] Decoding VUI
[IJKMEDIA][h264 @ 0x10cd2aef0] nal_unit_type: 8(PPS), nal_ref_idc: 3
[IJKMEDIA][h264 @ 0x10cd2aef0] nal_unit_type: 7(SPS), nal_ref_idc: 3
[IJKMEDIA][h264 @ 0x10cd2aef0] nal_unit_type: 8(PPS), nal_ref_idc: 3
[IJKMEDIA][h264 @ 0x10cd2aef0] nal_unit_type: 5(IDR), nal_ref_idc: 3
[IJKMEDIA][h264 @ 0x10cd2aef0] Decoding VUI

RTMP视频流播放时,经常会出现丢帧现象,此时日志类似上图,查询文档好像是因为频繁触发关键帧导致解码器重置,但是在网页端播放相同的RTMP流却是正常的,播放器设置如下:

[options setOptionIntValue:1 forKey:@"framedrop" ofCategory:kIJKFFOptionCategoryPlayer];
[options setOptionIntValue:1 forKey:@"videotoolbox" ofCategory:kIJKFFOptionCategoryPlayer];
[options setOptionIntValue:30 forKey:@"max-fps" ofCategory:kIJKFFOptionCategoryPlayer];

请问是哪里设置出了问题么?

@debugly
Copy link
Owner

debugly commented Feb 28, 2025

日志太短没看出来丢帧了,开启硬解使用这个key:

//使用硬件加速解码视频帧,降低 CPU 消耗
[options setPlayerOptionIntValue:1 forKey:@"videotoolbox_hwaccel"];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants