N
O
D
E
M
E
D
I
A
Thinking
首页
产品
文档
博客
订单
文档
推流API
2026年 5月 20日 下午3:55
## NodePublisher NodePublisher是用于直播推流的低延迟推流器 ### NodePublisher *NodePublisher_new(const char *license); 创建推流实例,传入授权码 ### void NodePublisher_free(NodePublisher *ctx); 释放推流实例 ### void NodePublisher_setEventCallback(NodePublisher *ctx, onEventCallback cb, void *userdata); 设置事件回调 ### void NodePublisher_setLogLevel(NodePublisher *ctx, int logLevel); 设置日志等级 ### void NodePublisher_setHwaccelEnable(NodePublisher *ctx, bool enable); 设置是否开启硬件加速 ### void NodePublisher_setCryptoKey(NodePublisher *ctx, const char *cryptoKey); 设置音视频内容加密密码 ### void NodePublisher_setAudioCodecParam(NodePublisher *ctx, int codec, int profile, int samplerate, int channels, int bitrate); 设置音频参数 ### void NodePublisher_setVideoCodecParam(NodePublisher *ctx, int codec, int profile, int width, int height, int fps, int bitrate); 设置视频参数 ### void NodePublisher_setVideoKeyInterval(NodePublisher *ctx, int keyint); 设置视频关键帧间隔,单位秒 ### int NodePublisher_getVersion(NodePublisher *ctx); 获取版本 ### int NodePublisher_attachView(NodePublisher *ctx, HWND hwnd); 附加到hwnd视图 ### int NodePublisher_attachViewEx(NodePublisher *ctx, HWND hwnd, int x, int y, int w, int h); 附加到hwnd视图,但自定义位置大小 ### int NodePublisher_detachView(NodePublisher *ctx); 从hwnd中移除视图 ### int NodePublisher_onResize(NodePublisher *ctx); 视图大小改变,通知推流器重新计算画布大小 ### int NodePublisher_onResizeEx(NodePublisher *ctx, int x, int y, int w, int h); 视图大小改变,通知推流器重新计算画布大小,并自定义位置大小 ### int NodePublisher_getDeviceList(NodePublisher *ctx, NMC_Device ***devices); 获取摄像头麦克风设备列表 ### int NodePublisher_openCamera(NodePublisher *ctx, const char *name); 打开摄像头捕获 ### int NodePublisher_closeCamera(NodePublisher *ctx); 关闭摄像头 ### int NodePublisher_openMicrophone(NodePublisher *ctx, const char *name); 打开麦克风捕获 ### int NodePublisher_closeMicrophone(NodePublisher *ctx); 关闭麦克风 ### int NodePublisher_openWindow(NodePublisher *ctx, const char *name, int x, int y, int width, int height, bool drawMouse); 打开桌面窗口捕获,默认name "desktop" ### int NodePublisher_closeWindow(NodePublisher *ctx); 关闭桌面窗口捕获 ### int NodePublisher_start(NodePublisher *ctx, const char *url); 开始推流 ### int NodePublisher_stop(NodePublisher *ctx); 结束推流 ## 推流事件 ### 2000 准备推流 ### 2001 推流成功 ### 2002 推流失败 ### 2003 推流重连 ### 2004 推流结束 ### 2005 推流中网络异常 ### 2006 推流超时
嘿,我是小R,需要帮助随时找我哦
QQ客服:281269007
邮件支持
扫码加微信
回到顶部