Live555: Compiling with VS2008

本文介绍如何使用Visual Studio 2008编译Live555 Streaming Media,包括配置环境变量、修改链接库选项及构建步骤等关键信息。

Compiling Live555 Streaming Media with Visual Studio 2008 isn’t obvious. Using Cygwin or MinGW is just a pain and frankly unnecessary. There is no built-in support for VS solution files, because Windows support is a low priority for the Live555 community. This is evidenced by this forum response from Ross Finlayson:

>4. Is it possible to include a Visual Studio solution in the
>distrubution to make it more convenient for Windows developers to
>use live555?
>5. Is it possible for live555 to generate adequate makefiles for
>Windows systems with development environments newer than Visual
>Studio 2003?

I have no current plans to change this. (These days, fewer and fewer people seem to be using Windows for development of system software.)

Regardless, Live555 works fine on Windows and is actually quite easy to build. Simply do the following:

  1. Open the ‘win32config’ file and change the TOOLS32=... variable to your VS2008 install directory. For me, it’s TOOLS32=C:\Program Files\Microsoft Visual Studio 9.0\VC
  2. In ‘win32config’, modify the LINK_OPTS_0=... line from msvcirt.lib to msvcrt.lib. This fixes the link error:
    LINK : fatal error LNK1181: cannot open input file 'msvcirt.lib'
  3. Open the Visual Studio command prompt.
  4. From the ‘live’ source directory, run genWindowsMakefiles
  5. Now you’re ready to build. Simply run the following commands:
    cd liveMedia
    nmake /B -f liveMedia.mak
    cd ..\groupsock
    nmake /B -f groupsock.mak
    cd ..\UsageEnvironment
    nmake /B -f UsageEnvironment.mak
    cd ..\BasicUsageEnvironment
    nmake /B -f BasicUsageEnvironment.mak
    cd ..\testProgs
    nmake /B -f testProgs.mak
    cd ..\mediaServer
    nmake /B -f mediaServer.mak

That’s it. You should be good to go.

[root@RV1126_RV1109:/xyd]# ./main media get entity by name: stream_cif_dvp_id0 is null media get entity by name: stream_cif_dvp_id1 is null media get entity by name: stream_cif_dvp_id2 is null media get entity by name: stream_cif_dvp_id3 is null media get entity by name: rkcif-lvds-subdev is null media get entity by name: rkcif-lite-lvds-subdev is null media get entity by name: stream_cif is null media get entity by name: rkcif-dvp-sof is null media get entity by name: rkisp-mpfbc-subdev is null media get entity by name: rkisp_dmapath is null media get entity by name: rockchip-mipi-dphy-rx is null media get entity by name: rkcif_dvp is null media get entity by name: rkcif_dvp is null media get entity by name: rkcif_lite_mipi_lvds is null [14:14:23.160762][CAMHW]:XCAM ERROR CamHwIsp20.cpp:1022: No free isp&ispp needed by fake camera! register factory : rkmpp register factory : rkmpp register factory : live555_rtsp_server register factory : video_enc register factory : audio_enc register factory : video_dec register factory : file_read_flow register factory : file_write_flow register factory : filter register factory : link_flow register factory : source_stream register factory : muxer_flow register factory : audio_dec register factory : output_stream register factory : move_detec register factory : occlusion_detec register factory : file_write_stream register factory : file_read_stream register factory : alsa_playback_stream register factory : alsa_capture_stream register factory : v4l2_capture_stream register factory : v4l2_output_stream register factory : drm_output_stream rga_api version 1.3.0_[11] (RGA is compiling with meson base: $PRODUCT_BASE) register factory : rkrga register factory : through_guard register factory : ANR register factory : AEC register factory : rockx_filter register factory : nn_result_input register factory : draw_filter register factory : rknn register factory : face_capture register factory : rockface_detect register factory : rockface_evaluate register factory : rockface_bodydetect register factory : rockface_recognize register factory : rkaudio register factory : rkaudio_aud register factory : rkaudio_vid register factory : rkaudio_aud register factory : rkaudio_vid register factory : rkaudio_resample register factory : rkaudio_audio_fifo TF卡未挂载到路径: /mnt/sdcard
08-05
[root@RV1126_RV1109:/xyd]# ./main media get entity by name: stream_cif_dvp_id0 is null media get entity by name: stream_cif_dvp_id1 is null media get entity by name: stream_cif_dvp_id2 is null media get entity by name: stream_cif_dvp_id3 is null media get entity by name: rkcif-lvds-subdev is null media get entity by name: rkcif-lite-lvds-subdev is null media get entity by name: stream_cif is null media get entity by name: rkcif-dvp-sof is null media get entity by name: rkisp-mpfbc-subdev is null media get entity by name: rkisp_dmapath is null media get entity by name: rockchip-mipi-dphy-rx is null media get entity by name: rkcif_dvp is null media get entity by name: rkcif_dvp is null media get entity by name: rkcif_lite_mipi_lvds is null [00:17:42.994663][CAMHW]:XCAM ERROR CamHwIsp20.cpp:1022: No free isp&ispp needed by fake camera! register factory : rkmpp register factory : rkmpp register factory : live555_rtsp_server register factory : video_enc register factory : audio_enc register factory : video_dec register factory : file_read_flow register factory : file_write_flow register factory : filter register factory : link_flow register factory : source_stream register factory : muxer_flow register factory : audio_dec register factory : output_stream register factory : move_detec register factory : occlusion_detec register factory : file_write_stream register factory : file_read_stream register factory : alsa_playback_stream register factory : alsa_capture_stream register factory : v4l2_capture_stream register factory : v4l2_output_stream register factory : drm_output_stream rga_api version 1.3.0_[11] (RGA is compiling with meson base: $PRODUCT_BASE) register factory : rkrga register factory : through_guard register factory : ANR register factory : AEC register factory : rockx_filter register factory : nn_result_input register factory : draw_filter register factory : rknn register factory : face_capture register factory : rockface_detect register factory : rockface_evaluate register factory : rockface_bodydetect register factory : rockface_recognize register factory : rkaudio register factory : rkaudio_aud register factory : rkaudio_vid register factory : rkaudio_aud register factory : rkaudio_vid register factory : rkaudio_resample register factory : rkaudio_audio_fifo ##RKMEDIA Log level: 2 [RKMEDIA][SYS][Info]:text is all=2 [RKMEDIA][SYS][Info]:module is all, log_level is 2 [INFO rtsp_demo.c:281:rtsp_new_demo] rtsp server demo starting on port 554 [DEBUG rtsp_demo.c:481:rtsp_new_session] add session path: /xyd/9203 ID: 0, sensor_name is m01_f_gc2053 1-0037, iqfiles is /oem/etc/iqfiles [00:17:43.114601][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:6920: calib_check_getID_by_name(6920): subtag: focusInfPosition from parent tag: zoomfocus_tbl is unknown, assert!!! [00:17:43.115554][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:6998: calib_check_tag_attrs(6998): parent_tag_id:439 tag_id:1201 --- tag id is is wrong: min:0 max:1201 [00:17:43.116765][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:7044: calib_check_tag_attrs(7044): parent_tag_id:439 parent_tag_name:zoomfocus_tbl tag_id:1201 tag_name:unknown --- ASSERT!!! [00:17:43.118117][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:7188: calib_check_tag_mark(7188): parent_tag_id:439 tag_id:1201 --- tag_id is wrong: min:0 max:1201 [00:17:43.119308][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:6920: calib_check_getID_by_name(6920): subtag: focusMacroPosition from parent tag: zoomfocus_tbl is unknown, assert!!! [00:17:43.120655][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:6998: calib_check_tag_attrs(6998): parent_tag_id:439 tag_id:1201 --- tag id is is wrong: min:0 max:1201 [00:17:43.121833][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:7044: calib_check_tag_attrs(7044): parent_tag_id:439 parent_tag_name:zoomfocus_tbl tag_id:1201 tag_name:unknown --- ASSERT!!! [00:17:43.123215][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:7188: calib_check_tag_mark(7188): parent_tag_id:439 tag_id:1201 --- tag_id is wrong: min:0 max:1201 [00:17:43.405121][XCORE]:XCAM ERROR v4l2_device.cpp:196: open device() failed [ 1063.408027] clk_mipicsi_out2io_fracdiv p_rate(297000000) is low than rate(24000000)*20, use integer or half-div [00:17:43.415449][CAMHW]:XCAM ERROR LensHw.cpp:199: get vcm cfg failed [00:17:43.432364][XCORE]:XCAM ERROR CamHwIsp20.cpp:3751: |||set DC-Iris PwmDuty: 100 [00:17:43.432618][CAMHW]:XCAM ERROR LensHw.cpp:411: iris is not supported [00:17:43.459533][CAMHW]:XCAM ERROR LensHw.cpp:296: focus is not supported rk_aiq_uapi_sysctl_init/prepare succeed [ 1063.464709] rkcif_mipi_lvds: stream[0] start streaming [ 1063.465696] rkcif_mipi_lvds: Allocate dummy buffer, size: 0x002a3000 [ 1063.465790] rockchip-mipi-csi2 ffb10000.mipi-csi2: stream on, src_sd: 28581007, sd_name:rockchip-mipi-dphy-rx [ 1063.465807] rockchip-mipi-csi2 ffb10000.mipi-csi2: stream ON [ 1063.465836] rockchip-mipi-dphy-rx ff4b0000.csi-dphy: stream on:1 [ 1063.465853] rockchip-mipi-dphy-rx: data_rate_mbps 594 [ 1063.466906] rockchip-mipi-dphy-rx ff4b0000.csi-dphy: stream on:1 rk_aiq_uapi_sysctl_start succeed SAMPLE_COMM_ISP_SetFrameRate start 30 SAMPLE_COMM_ISP_SetFrameRate 30 [RKMEDIA][SYS][Info]:RK_MPI_VI_EnableChn: Enable VI[0:0]:rkispp_scale0, 1280x720 Start... [RKMEDIA][SYS][Info]:RKAIQ: parsing /dev/media0 media get entity by name: rkcif-lvds-subdev is null media get entity by name: rkcif-lite-lvds-subdev is null [RKMEDIA][SYS][Info]:RKAIQ: parsing /dev/media1 media get entity by name: rkisp-mpfbc-subdev is null media get entity by name: rkisp_dmapath is null media get entity by name: rockchip-mipi-dphy-rx is null [RKMEDIA][SYS][Info]:RKAIQ: model(rkisp0): isp_info(0): isp-subdev entity name: /dev/v4l-subdev5 [RKMEDIA][SYS][Info]:RKAIQ: parsing /dev/media2 [RKMEDIA][SYS][Info]:RKAIQ: model(rkispp0): ispp_info(0): ispp-subdev entity name: /dev/v4l-subdev0 [RKMEDIA][SYS][Info]:#V4l2Stream: camraID:0, Device:rkispp_scale0 [RKMEDIA][SYS][Warn]:camera_id: 0, chn: rkispp_scale0 [RKMEDIA][SYS][Warn]:camera_id: 0, chn: rkispp_scale0, idx: 0 [RKMEDIA][SYS][Info]:#V4l2Stream: camera id:0, VideoNode:/dev/video19 [ 1063.508487] rkispp0: scale0:0x0 out of range: [ 1063.508487] [wUsing mplane plugin for capture idth max:3264 ratio max:8 min:1] [ 1063.508543] rkispp0: scale0:0x0 out of range: [ 1063.508543] [width max:2080 ratio max:8 min:1] [ 1063.508562] rkispp0: scale0:0x0 out of range: [ 1063.508562] [width max:3264 ratio max:8 m[RKMEDIA][SYS][Info]:#V4L2Ctx: open /dev/video19, fd 93 in:1] [ 1063.508577] rkispp0: scale0:0x0 out of range: [ 1063.508577] [width max:3264 ratio max:8 min:1] [ 1063.508593] rkispp0: scale0:0x0 out of range: [ 1063.508593] [width max:3264 ratio max:8 min:1] [RKMEDIA][SYS][Info]:RK_MPI_VI_EnableChn: Enable VI[0:0]:rkispp_scale0, 1280x720 End... [RKMEDIA][SYS][Info]:RK_MPI_VENC_CreateChn: Enable VENC[0], Type:5 Start... [RKMEDIA][SYS][Info]:ParseMediaConfigFromMap: rect_x = 0, rect_y = 0, rect.w = 1280, rect.h = 720 mpp[587]: mpp_rt: NOT found ion allocator mpp[587]: mpp_rt: found drm allocator mpp[587]: mpp_info: mpp version: 57ff4c6b author: Herman Chen 2021-09-13 [cmake]: Enable HAVE_DRM by default [RKMEDIA][VENC][Info]:MPP Encoder: MPPConfig: cfg init sucess! [RKMEDIA][VENC][Info]:MPP Encoder: qpMaxi use default value:48 [RKMEDIA][VENC][Info]:MPP Encoder: qpMini use default value:8 [RKMEDIA][VENC][Info]:MPP Encoder: qpMax use default value:48 [RKMEDIA][VENC][Info]:MPP Encoder: qpMin use default value:8 [RKMEDIA][VENC][Info]:MPP Encoder: qpInit use default value:-1 [RKMEDIA][VENC][Info]:MPP Encoder: qpStep use default value:2 [RKMEDIA][VENC][Info]:MPP Encoder: rect_x use default value:0 [RKMEDIA][VENC][Info]:MPP Encoder: rect_y use default value:0 [RKMEDIA][VENC][Info]:MPP Encoder: rotaion = 0 [RKMEDIA][VENC][Info]:MPP Encoder: automatically calculate bsp with bps_target [RKMEDIA][VENC][Info]:MPP Encoder: Set output block mode. [RKMEDIA][VENC][Info]:MPP Encoder: Set input block mode. [RKMEDIA][VENC][Info]:MPP Encoder: bps:[1024000,921600,819200] fps: [30/1]->[30/1], gop:30 qpInit:-1, qpMin:8, qpMax:48, qpMinI:8, qpMaxI:48. [RKMEDIA][VENC][Info]:MPP Encoder: AVC: encode profile 77 level 0 mpp[587]: mpp_enc: MPP_ENC_SET_RC_CFG bps 921600 [819200 : 1024000] fps [30:30] gop 30 mpp[587]: h264e_api_v2: MPP_ENC_SET_PREP_CFG w:h [1280:720] stride [1280:720] mpp[587]: mpp_enc: send header for set cfg change input/format [RKMEDIA][VENC][Info]:MPP Encoder: w x h(1280[1280] x 720[720]) mpp[587]: mpp_enc: mode cbr bps [819200:921600:1024000] fps fix [30/1] -> fix [30/1] gop i [30] v [0] [RKMEDIA][SYS][Info]:RK_MPI_VENC_CreateChn: Enable VENC[0], Type:5 End... [RKMEDIA][SYS][Info]:RK_MPI_VENC_CreateChn: Enable VENC[1], Type:5 Start... [RKMEDIA][SYS][Info]:ParseMediaConfigFromMap: rect_x = 0, rect_y = 0, rect.w = 1280, rect.h = 720 mpp[587]: mpp_info: mpp version: 57ff4c6b author: Herman Chen 2021-09-13 [cmake]: Enable HAVE_DRM by default [RKMEDIA][VENC][Info]:MPP Encoder: MPPConfig: cfg init sucess! [RKMEDIA][VENC][Info]:MPP Encoder: qpMaxi use default value:48 [RKMEDIA][VENC][Info]:MPP Encoder: qpMini use default value:8 [RKMEDIA][VENC][Info]:MPP Encoder: qpMax use default value:48 [RKMEDIA][VENC][Info]:MPP Encoder: qpMin use default value:8 [RKMEDIA][VENC][Info]:MPP Encoder: qpInit use default value:-1 [RKMEDIA][VENC][Info]:MPP Encoder: qpStep use default value:2 [RKMEDIA][VENC][Info]:MPP Encoder: rect_x use default value:0 [RKMEDIA][VENC][Info]:MPP Encoder: rect_y use default value:0 [RKMEDIA][VENC][Info]:MPP Encoder: rotaion = 0 [RKMEDIA][VENC][Info]:MPP Encoder: automatically calculate bsp with bps_target [RKMEDIA][VENC][Info]:MPP Encoder: Set output block mode. [RKMEDIA][VENC][Info]:MPP Encoder: Set input block mode. [RKMEDIA][VENC][Info]:MPP Encoder: bps:[1024000,921600,819200] fps: [30/1]->[30/1], gop:30 qpInit:-1, qpMin:8, qpMax:48, qpMinI:8, qpMaxI:48. [RKMEDIA][VENC][Info]:MPP Encoder: AVC: encode profile 77 level 0 mpp[587]: mpp_enc: MPP_ENC_SET_RC_CFG bps 921600 [819200 : 1024000] fps [30:30] gop 30 mpp[587]: h264e_api_v2: MPP_ENC_SET_PREP_CFG w:h [1280:720] stride [1280:720] mpp[587]: mpp_enc: send header for set cfg change input/format [RKMEDIA][VENC][Info]:MPP Encoder: w x h(1280[1280] x 720[720]) mpp[587]: mpp_enc: mode cbr bps [819200:921600:1024000] fps fix [30/1] -> fix [30/1] gop i [30] v [0] [RKMEDIA][SYS][Info]:RK_MPI_VENC_CreateChn: Enable VENC[1], Type:5 End... [RKMEDIA][SYS][Info]:RK_MPI_SYS_Bind: Bind Mode[VI]:Chn[0] to Mode[VENC]:Chn[0]... [RKMEDIA][SYS][Info]:RK_MPI_SYS_Bind: Bind Mode[VI]:Chn[0] to Mode[VENC]:Chn[1]... [RKMEDIA][SYS][Info]:RK_MPI_AI_EnableChn: Enable AI[0] Start... [RKMEDIA][SYS][Info]:AlsaCaptureStream: Layout 0, output chan 2, alsa chan 2 [RKMEDIA][SYS][Info]:Camera 0 stream 93 is started [RKMEDIA][SYS][Info]:RK_MPI_AI_EnableChn: Enable AI[0] End... [RKMEDIA][SYS][Info]:RK_MPI_AI_EnableChn: Enable AI[1] Start... [RKMEDIA][SYS][Info]:AlsaCaptureStream: Layout 0, output chan 1, alsa chan 1 [RKMEDIA][SYS][Info]:RK_MPI_AI_EnableChn: Enable AI[1] End... [RKMEDIA][AENC][Info]:rk codec name=MP2 (MPEG audio layer 2) [RKMEDIA][AENC][Info]:rk codec name=PCM A-law / G.711 A-law [RKMEDIA][SYS][Info]:RK_MPI_SYS_Bind: Bind Mode[AI]:Chn[0] to Mode[AENC]:Chn[0]... [RKMEDIA][SYS][Info]:RK_MPI_SYS_Bind: Bind Mode[AI]:Chn[1] to Mode[AENC]:Chn[1]... 为什么卡在这里不往下执行推流
08-02
#include "main.h" rtsp_demo_handle g_rtsplive = NULL;//rtsp服务器核心指针 rtsp_session_handle g_rtsp_session;//rtsp服务器配置 int end_flag = 0; void mysignal(int sig) { sig = sig; end_flag = 1; } int main(void) { //系统初始化 RK_MPI_SYS_Init(); g_rtsplive = create_rtsp_demo(554); g_rtsp_session = rtsp_new_session(g_rtsplive,"/xyd/9203"); rtsp_set_video(g_rtsp_session, RTSP_CODEC_ID_VIDEO_H264, NULL, 0); rtsp_set_audio(g_rtsp_session, RTSP_CODEC_ID_AUDIO_G711A, NULL, 0); rtsp_sync_video_ts(g_rtsp_session, rtsp_get_reltime(), rtsp_get_ntptime()); rtsp_sync_audio_ts(g_rtsp_session, rtsp_get_reltime(), rtsp_get_ntptime()); // pthread_t video_tid, audio_tid; // pthread_t muxer_tid = 0; // 创建视频线程 init_video_capture(); // pthread_create(&video_tid, NULL, video_thread_func, NULL); // 创建音频线程 init_audio_capture(); // pthread_create(&audio_tid, NULL, audio_thread_func, NULL); // 创建合成线程 // init_hecheng(); // pthread_create(&muxer_tid, NULL, muxer_thread_func, NULL); //音视频推流 RK_MPI_SYS_RegisterOutCb(&v_pstDestChn,myVioutcbfunc); RK_MPI_SYS_RegisterOutCb(&aenc1_pstDestChn, myoutcbfunc_g711a); signal(2,mysignal); // 主线程等待 Ctrl+C while (!end_flag) { sleep(1); } // 等待线程退出 deinit_audio_capture(); deinit_video_capture(); // deinit_hecheng_capture(); // pthread_join(video_tid, NULL); // pthread_join(audio_tid, NULL); // pthread_join(muxer_tid, NULL); return 0; } #include "audio.h" RK_U32 ai_chn = 1; RK_U32 nbsmp_mp2 = 1152; RK_U32 nbsmp_g711a = 1024; RK_U32 srate_mp2 = 48000; RK_U32 srate_g711a = 8000; // FILE *file_mp2; // FILE *file_g711a; MPP_CHN_S ai_pstSrcChn0 = {0}, aenc0_pstDestChn = {0}; MPP_CHN_S ai_pstSrcChn1 = {0}, aenc1_pstDestChn = {0}; void myoutcbfunc_g711a(MEDIA_BUFFER mb) { //1、推流 rtsp_tx_audio(g_rtsp_session, RK_MPI_MB_GetPtr(mb), RK_MPI_MB_GetSize(mb),RK_MPI_MB_GetTimestamp(mb)); rtsp_do_event(g_rtsplive); RK_MPI_MB_ReleaseBuffer(mb); } // void myoutcbfunc_mp2(MEDIA_BUFFER mb) // { // if (end_flag) // { // RK_MPI_MB_ReleaseBuffer(mb); // return; // } // // fwrite(RK_MPI_MB_GetPtr(mb),1,RK_MPI_MB_GetSize(mb),file_mp2); // RK_MPI_MB_ReleaseBuffer(mb); // } int init_audio_capture(void) { // file_mp2 = fopen("./output_mp2.mp2", "wb"); // file_g711a = fopen("./output_g711a.g711", "wb"); // 设置 AI 通道属性 // AI0 用于 MP2 编码 AI_CHN_ATTR_S ai_pstAttr0 = {0}; ai_pstAttr0.enAiLayout = AI_LAYOUT_NORMAL; ai_pstAttr0.enSampleFormat = RK_SAMPLE_FMT_S16; ai_pstAttr0.pcAudioNode = "default:CARD=Device"; ai_pstAttr0.u32Channels = 2; ai_pstAttr0.u32NbSamples = nbsmp_mp2; ai_pstAttr0.u32SampleRate = srate_mp2; RK_MPI_AI_SetChnAttr(0, &ai_pstAttr0); RK_MPI_AI_EnableChn(0); RK_MPI_AI_StartStream(0); // AI1 用于 G711A 编码 AI_CHN_ATTR_S ai_pstAttr1 = {0}; ai_pstAttr1.enAiLayout = AI_LAYOUT_NORMAL; ai_pstAttr1.enSampleFormat = RK_SAMPLE_FMT_S16; ai_pstAttr1.pcAudioNode = "default:CARD=Device"; ai_pstAttr1.u32Channels = ai_chn; ai_pstAttr1.u32NbSamples = nbsmp_g711a; ai_pstAttr1.u32SampleRate = srate_g711a; RK_MPI_AI_SetChnAttr(1, &ai_pstAttr1); RK_MPI_AI_EnableChn(1); RK_MPI_AI_StartStream(1); // 创建 AENC0(MP2 编码) AENC_CHN_ATTR_S aenc0_pstAttr = {0}; aenc0_pstAttr.enCodecType = RK_CODEC_TYPE_MP2; aenc0_pstAttr.stAencMP2.u32Channels = 2; aenc0_pstAttr.stAencMP2.u32SampleRate = srate_mp2; aenc0_pstAttr.u32Bitrate = 64000; aenc0_pstAttr.u32Quality = 1; RK_MPI_AENC_CreateChn(0, &aenc0_pstAttr); // 创建 AENC1(G711A 编码) AENC_CHN_ATTR_S aenc1_pstAttr = {0}; aenc1_pstAttr.enCodecType = RK_CODEC_TYPE_G711A; aenc1_pstAttr.stAencG711A.u32Channels = 1; aenc1_pstAttr.stAencG711A.u32NbSample = nbsmp_g711a; aenc1_pstAttr.stAencG711A.u32SampleRate = srate_g711a; aenc1_pstAttr.u32Bitrate = 64000; aenc1_pstAttr.u32Quality = 1; RK_MPI_AENC_CreateChn(1, &aenc1_pstAttr); // 绑定 AI0 → AENC0(MP2 编码) ai_pstSrcChn0.enModId = RK_ID_AI; ai_pstSrcChn0.s32ChnId = 0; ai_pstSrcChn0.s32DevId = 0; aenc0_pstDestChn.enModId = RK_ID_AENC; aenc0_pstDestChn.s32ChnId = 0; aenc0_pstDestChn.s32DevId = 0; RK_MPI_SYS_Bind(&ai_pstSrcChn0, &aenc0_pstDestChn); // RK_MPI_SYS_RegisterOutCb(&aenc0_pstDestChn, myoutcbfunc_mp2); // 绑定 AI1 → AENC1(G711A 编码) ai_pstSrcChn1.enModId = RK_ID_AI; ai_pstSrcChn1.s32ChnId = 1; ai_pstSrcChn1.s32DevId = 0; aenc1_pstDestChn.enModId = RK_ID_AENC; aenc1_pstDestChn.s32ChnId = 1; aenc1_pstDestChn.s32DevId = 0; RK_MPI_SYS_Bind(&ai_pstSrcChn1, &aenc1_pstDestChn); return 0; } int deinit_audio_capture(void) { // 释放 AI、AENC 等资源 // fclose(file_mp2); // fclose(file_g711a); // rtsp_del_demo(g_rtsplive); RK_MPI_SYS_UnBind(&ai_pstSrcChn0, &aenc0_pstDestChn); RK_MPI_SYS_UnBind(&ai_pstSrcChn1, &aenc1_pstDestChn); RK_MPI_AENC_DestroyChn(0); RK_MPI_AENC_DestroyChn(1); RK_MPI_AI_DisableChn(0); RK_MPI_AI_DisableChn(1); return 0; }#include "video.h" RK_S32 s32CamId = 0; //摄像头ID RK_BOOL bMultictx = RK_FALSE; RK_CHAR *pIqfilesPath = "/oem/etc/iqfiles";//ISP配置文件路径 RK_U32 Width = 1280; RK_U32 Heigh = 720; // FILE *file_h264; MPP_CHN_S v_pstSrcChn = {0},v_pstDestChn = {0}; MPP_CHN_S v_pstSrcChn1 = {0},v_pstDestChn1 = {0}; int time_count = 30*30;//30s的帧数 void myVioutcbfunc(MEDIA_BUFFER mb) { if (time_count) { printf("time_count = %d\n",time_count); time_count--; } else { RK_MPI_MB_ReleaseBuffer(mb);//释放 return ; } //回调函数---最核心的是获取数据内容和大小 //1、推流 rtsp_tx_video(g_rtsp_session, RK_MPI_MB_GetPtr(mb), RK_MPI_MB_GetSize(mb),RK_MPI_MB_GetTimestamp(mb)); rtsp_do_event(g_rtsplive); //2.本地保存 // fwrite(RK_MPI_MB_GetPtr(mb),1,RK_MPI_MB_GetSize(mb),file_h264); RK_MPI_MB_ReleaseBuffer(mb); } int init_video_capture(void) { // file_h264 = fopen("./output_h264.h264", "wb"); // 初始化 VI、VENC 等 rk_aiq_working_mode_t hdr_mode = RK_AIQ_WORKING_MODE_NORMAL; int fps = 30; SAMPLE_COMM_ISP_Init(s32CamId, hdr_mode, bMultictx, pIqfilesPath); SAMPLE_COMM_ISP_Run(s32CamId); SAMPLE_COMM_ISP_SetFrameRate(s32CamId, fps); //VI0 VI_CHN_ATTR_S vi_pstChnAttr = {0}; vi_pstChnAttr.enBufType = VI_CHN_BUF_TYPE_MMAP; vi_pstChnAttr.enPixFmt = IMAGE_TYPE_NV12; vi_pstChnAttr.enWorkMode = VI_WORK_MODE_NORMAL; vi_pstChnAttr.pcVideoNode = "rkispp_scale0"; vi_pstChnAttr.u32BufCnt = 3; vi_pstChnAttr.u32Height = Heigh; vi_pstChnAttr.u32Width = Width; RK_MPI_VI_SetChnAttr(0,0,&vi_pstChnAttr); RK_MPI_VI_EnableChn(0,0); //VI1 // VI_CHN_ATTR_S vi_pstChnAttr1 = {0}; // vi_pstChnAttr1.enBufType = VI_CHN_BUF_TYPE_MMAP; // vi_pstChnAttr1.enPixFmt = IMAGE_TYPE_NV12; // vi_pstChnAttr1.enWorkMode = VI_WORK_MODE_NORMAL; // vi_pstChnAttr1.pcVideoNode = "rkispp_scale0"; // vi_pstChnAttr1.u32BufCnt = 3; // vi_pstChnAttr1.u32Height = Heigh; // vi_pstChnAttr1.u32Width = Width; // RK_MPI_VI_SetChnAttr(0,1,&vi_pstChnAttr1); // RK_MPI_VI_EnableChn(0,1); VENC_CHN_ATTR_S venc_stVencChnAttr = {0}, venc1_stVencChnAttr = {0}; venc_stVencChnAttr.stRcAttr.enRcMode = VENC_RC_MODE_H264CBR; venc_stVencChnAttr.stRcAttr.stH264Cbr.fr32DstFrameRateDen = 1; venc_stVencChnAttr.stRcAttr.stH264Cbr.fr32DstFrameRateNum = 30; venc_stVencChnAttr.stRcAttr.stH264Cbr.u32BitRate = Width*Heigh; venc_stVencChnAttr.stRcAttr.stH264Cbr.u32Gop = 30; venc_stVencChnAttr.stRcAttr.stH264Cbr.u32SrcFrameRateDen = 1; venc_stVencChnAttr.stRcAttr.stH264Cbr.u32SrcFrameRateNum = 30; venc_stVencChnAttr.stVencAttr.enType = RK_CODEC_TYPE_H264; venc_stVencChnAttr.stVencAttr.imageType = IMAGE_TYPE_NV12; venc_stVencChnAttr.stVencAttr.u32PicHeight = Heigh; venc_stVencChnAttr.stVencAttr.u32PicWidth = Width; venc_stVencChnAttr.stVencAttr.u32Profile = 77; venc_stVencChnAttr.stVencAttr.u32VirHeight = Heigh; venc_stVencChnAttr.stVencAttr.u32VirWidth = Width; RK_MPI_VENC_CreateChn(0,&venc_stVencChnAttr); // 创建 VENC1 memcpy(&venc1_stVencChnAttr, &venc_stVencChnAttr, sizeof(VENC_CHN_ATTR_S)); RK_MPI_VENC_CreateChn(1, &venc1_stVencChnAttr); // 绑定 VI0 -> VENC0 v_pstSrcChn.enModId = RK_ID_VI; v_pstSrcChn.s32ChnId = 0; v_pstSrcChn.s32DevId = 0; v_pstDestChn.enModId = RK_ID_VENC; v_pstDestChn.s32ChnId = 0; v_pstDestChn.s32DevId = 0; RK_MPI_SYS_Bind(&v_pstSrcChn,&v_pstDestChn); // 绑定 VI0 -> VENC1 v_pstSrcChn1.enModId = RK_ID_VI; v_pstSrcChn1.s32ChnId = 0; v_pstSrcChn1.s32DevId = 0; v_pstDestChn1.enModId = RK_ID_VENC; v_pstDestChn1.s32ChnId = 1; v_pstDestChn1.s32DevId = 0; RK_MPI_SYS_Bind(&v_pstSrcChn1, &v_pstDestChn1); return 0; } int deinit_video_capture(void) { // 释放 VI、VENC 等资源 // fclose(file_h264); // rtsp_del_demo(g_rtsplive); RK_MPI_SYS_UnBind(&v_pstSrcChn,&v_pstDestChn); RK_MPI_SYS_UnBind(&v_pstSrcChn1, &v_pstDestChn1); RK_MPI_VENC_DestroyChn(0); RK_MPI_VENC_DestroyChn(1); RK_MPI_VI_DisableChn(s32CamId, 0); SAMPLE_COMM_ISP_Stop(s32CamId); return 0; }#include "hecheng.h" MPP_CHN_S muxer_pstSrcVideoChn = {0},muxer_pstSrcAudioChn = {0}; MUXER_CHN_S muxer_pstDestVideoChn = {0},muxer_pstDestAudioChn = {0}; void *muxer_thread_func(void *arg) { arg = arg; init_hecheng(); while (!end_flag) { sleep(1); } deinit_hecheng_capture(); return NULL; } int init_hecheng(void) { // char addrbuf[64]={0}; // time_t tim; // tim = time(NULL); // struct tm *now=localtime(&tim); // sprintf(addrbuf,"/xyd/videomp4/%02d%02d%02d",now->tm_hour,now->tm_min,now->tm_sec); // mkdir(addrbuf,0777); //合成器初始化 MUXER_CHN_ATTR_S muxer_pstAttr = {0}; muxer_pstAttr.enMode = MUXER_MODE_AUTOSPLIT; muxer_pstAttr.enType = MUXER_TYPE_MP4;//视频文件类型 muxer_pstAttr.stSplitAttr.enSplitNameType = MUXER_SPLIT_NAME_TYPE_AUTO; muxer_pstAttr.stSplitAttr.enSplitType = MUXER_SPLIT_TYPE_TIME; muxer_pstAttr.stSplitAttr.stNameAutoAttr.bTimeStampEnable = true;//使能时间戳 muxer_pstAttr.stSplitAttr.stNameAutoAttr.pcBaseDir = "/xyd";//生成设备文件的路径,后续生成在TF卡 muxer_pstAttr.stSplitAttr.stNameAutoAttr.pcPrefix = "xyd";//生成的设备文件名 muxer_pstAttr.stSplitAttr.stNameAutoAttr.u16StartIdx = 1;//Idx---索引---不要从0开始 muxer_pstAttr.stSplitAttr.u32TimeLenSec = 10;//当前是10s,但是实际应用中至少一个小时 muxer_pstAttr.u32MuxerId = 0;//合成器ID muxer_pstAttr.stVideoStreamParam.enCodecType = RK_CODEC_TYPE_H264; muxer_pstAttr.stVideoStreamParam.enImageType = IMAGE_TYPE_NV12; muxer_pstAttr.stVideoStreamParam.u16Fps = 30; muxer_pstAttr.stVideoStreamParam.u16Level = 41; muxer_pstAttr.stVideoStreamParam.u16Profile = 77; muxer_pstAttr.stVideoStreamParam.u32BitRate = Width*Heigh; muxer_pstAttr.stVideoStreamParam.u32Height = Heigh; muxer_pstAttr.stVideoStreamParam.u32Width = Width; muxer_pstAttr.stAudioStreamParam.enCodecType = RK_CODEC_TYPE_MP2; muxer_pstAttr.stAudioStreamParam.enSampFmt = RK_SAMPLE_FMT_S16; muxer_pstAttr.stAudioStreamParam.u32Channels = 2; muxer_pstAttr.stAudioStreamParam.u32NbSamples = nbsmp_mp2; muxer_pstAttr.stAudioStreamParam.u32SampleRate = srate_mp2; muxer_pstSrcVideoChn.enModId =RK_ID_VENC ; muxer_pstSrcVideoChn.s32ChnId = 1; muxer_pstSrcVideoChn.s32DevId = 0; muxer_pstDestVideoChn.enChnType = MUXER_CHN_TYPE_VIDEO; muxer_pstDestVideoChn.enModId = RK_ID_VENC; muxer_pstDestVideoChn.s32ChnId = 0; muxer_pstSrcAudioChn.enModId = RK_ID_AENC; muxer_pstSrcAudioChn.s32ChnId = 0; muxer_pstSrcAudioChn.s32DevId = 0; muxer_pstDestAudioChn.enChnType = MUXER_CHN_TYPE_AUDIO; muxer_pstDestAudioChn.enModId = RK_ID_AENC; muxer_pstDestAudioChn.s32ChnId = 0; RK_MPI_MUXER_EnableChn(0,&muxer_pstAttr); RK_MPI_MUXER_Bind(&muxer_pstSrcVideoChn,&muxer_pstDestVideoChn); RK_MPI_MUXER_Bind(&muxer_pstSrcAudioChn,&muxer_pstDestAudioChn); RK_MPI_MUXER_StreamStart(0); return 0; } int deinit_hecheng_capture(void) { RK_MPI_MUXER_StreamStop(0); RK_MPI_MUXER_UnBind(&muxer_pstSrcVideoChn,&muxer_pstDestVideoChn); RK_MPI_MUXER_UnBind(&muxer_pstSrcAudioChn,&muxer_pstDestAudioChn); RK_MPI_MUXER_DisableChn(0); return 0; }[root@RV1126_RV1109:/xyd]# ./main media get entity by name: stream_cif_dvp_id0 is null media get entity by name: stream_cif_dvp_id1 is null media get entity by name: stream_cif_dvp_id2 is null media get entity by name: stream_cif_dvp_id3 is null media get entity by name: rkcif-lvds-subdev is null media get entity by name: rkcif-lite-lvds-subdev is null media get entity by name: stream_cif is null media get entity by name: rkcif-dvp-sof is null media get entity by name: rkisp-mpfbc-subdev is null media get entity by name: rkisp_dmapath is null media get entity by name: rockchip-mipi-dphy-rx is null media get entity by name: rkcif_dvp is null media get entity by name: rkcif_dvp is null media get entity by name: rkcif_lite_mipi_lvds is null [00:17:42.994663][CAMHW]:XCAM ERROR CamHwIsp20.cpp:1022: No free isp&ispp needed by fake camera! register factory : rkmpp register factory : rkmpp register factory : live555_rtsp_server register factory : video_enc register factory : audio_enc register factory : video_dec register factory : file_read_flow register factory : file_write_flow register factory : filter register factory : link_flow register factory : source_stream register factory : muxer_flow register factory : audio_dec register factory : output_stream register factory : move_detec register factory : occlusion_detec register factory : file_write_stream register factory : file_read_stream register factory : alsa_playback_stream register factory : alsa_capture_stream register factory : v4l2_capture_stream register factory : v4l2_output_stream register factory : drm_output_stream rga_api version 1.3.0_[11] (RGA is compiling with meson base: $PRODUCT_BASE) register factory : rkrga register factory : through_guard register factory : ANR register factory : AEC register factory : rockx_filter register factory : nn_result_input register factory : draw_filter register factory : rknn register factory : face_capture register factory : rockface_detect register factory : rockface_evaluate register factory : rockface_bodydetect register factory : rockface_recognize register factory : rkaudio register factory : rkaudio_aud register factory : rkaudio_vid register factory : rkaudio_aud register factory : rkaudio_vid register factory : rkaudio_resample register factory : rkaudio_audio_fifo ##RKMEDIA Log level: 2 [RKMEDIA][SYS][Info]:text is all=2 [RKMEDIA][SYS][Info]:module is all, log_level is 2 [INFO rtsp_demo.c:281:rtsp_new_demo] rtsp server demo starting on port 554 [DEBUG rtsp_demo.c:481:rtsp_new_session] add session path: /xyd/9203 ID: 0, sensor_name is m01_f_gc2053 1-0037, iqfiles is /oem/etc/iqfiles [00:17:43.114601][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:6920: calib_check_getID_by_name(6920): subtag: focusInfPosition from parent tag: zoomfocus_tbl is unknown, assert!!! [00:17:43.115554][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:6998: calib_check_tag_attrs(6998): parent_tag_id:439 tag_id:1201 — tag id is is wrong: min:0 max:1201 [00:17:43.116765][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:7044: calib_check_tag_attrs(7044): parent_tag_id:439 parent_tag_name:zoomfocus_tbl tag_id:1201 tag_name:unknown — ASSERT!!! [00:17:43.118117][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:7188: calib_check_tag_mark(7188): parent_tag_id:439 tag_id:1201 — tag_id is wrong: min:0 max:1201 [00:17:43.119308][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:6920: calib_check_getID_by_name(6920): subtag: focusMacroPosition from parent tag: zoomfocus_tbl is unknown, assert!!! [00:17:43.120655][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:6998: calib_check_tag_attrs(6998): parent_tag_id:439 tag_id:1201 — tag id is is wrong: min:0 max:1201 [00:17:43.121833][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:7044: calib_check_tag_attrs(7044): parent_tag_id:439 parent_tag_name:zoomfocus_tbl tag_id:1201 tag_name:unknown — ASSERT!!! [00:17:43.123215][XCORE]:XCAM ERROR RkAiqCalibTag.cpp:7188: calib_check_tag_mark(7188): parent_tag_id:439 tag_id:1201 — tag_id is wrong: min:0 max:1201 [00:17:43.405121][XCORE]:XCAM ERROR v4l2_device.cpp:196: open device() failed [ 1063.408027] clk_mipicsi_out2io_fracdiv p_rate(297000000) is low than rate(24000000)*20, use integer or half-div [00:17:43.415449][CAMHW]:XCAM ERROR LensHw.cpp:199: get vcm cfg failed [00:17:43.432364][XCORE]:XCAM ERROR CamHwIsp20.cpp:3751: |||set DC-Iris PwmDuty: 100 [00:17:43.432618][CAMHW]:XCAM ERROR LensHw.cpp:411: iris is not supported [00:17:43.459533][CAMHW]:XCAM ERROR LensHw.cpp:296: focus is not supported rk_aiq_uapi_sysctl_init/prepare succeed [ 1063.464709] rkcif_mipi_lvds: stream[0] start streaming [ 1063.465696] rkcif_mipi_lvds: Allocate dummy buffer, size: 0x002a3000 [ 1063.465790] rockchip-mipi-csi2 ffb10000.mipi-csi2: stream on, src_sd: 28581007, sd_name:rockchip-mipi-dphy-rx [ 1063.465807] rockchip-mipi-csi2 ffb10000.mipi-csi2: stream ON [ 1063.465836] rockchip-mipi-dphy-rx ff4b0000.csi-dphy: stream on:1 [ 1063.465853] rockchip-mipi-dphy-rx: data_rate_mbps 594 [ 1063.466906] rockchip-mipi-dphy-rx ff4b0000.csi-dphy: stream on:1 rk_aiq_uapi_sysctl_start succeed SAMPLE_COMM_ISP_SetFrameRate start 30 SAMPLE_COMM_ISP_SetFrameRate 30 [RKMEDIA][SYS][Info]:RK_MPI_VI_EnableChn: Enable VI[0:0]:rkispp_scale0, 1280x720 Start… [RKMEDIA][SYS][Info]:RKAIQ: parsing /dev/media0 media get entity by name: rkcif-lvds-subdev is null media get entity by name: rkcif-lite-lvds-subdev is null [RKMEDIA][SYS][Info]:RKAIQ: parsing /dev/media1 media get entity by name: rkisp-mpfbc-subdev is null media get entity by name: rkisp_dmapath is null media get entity by name: rockchip-mipi-dphy-rx is null [RKMEDIA][SYS][Info]:RKAIQ: model(rkisp0): isp_info(0): isp-subdev entity name: /dev/v4l-subdev5 [RKMEDIA][SYS][Info]:RKAIQ: parsing /dev/media2 [RKMEDIA][SYS][Info]:RKAIQ: model(rkispp0): ispp_info(0): ispp-subdev entity name: /dev/v4l-subdev0 [RKMEDIA][SYS][Info]:#V4l2Stream: camraID:0, Device:rkispp_scale0 [RKMEDIA][SYS][Warn]:camera_id: 0, chn: rkispp_scale0 [RKMEDIA][SYS][Warn]:camera_id: 0, chn: rkispp_scale0, idx: 0 [RKMEDIA][SYS][Info]:#V4l2Stream: camera id:0, VideoNode:/dev/video19 [ 1063.508487] rkispp0: scale0:0x0 out of range: [ 1063.508487] [wUsing mplane plugin for capture idth max:3264 ratio max:8 min:1] [ 1063.508543] rkispp0: scale0:0x0 out of range: [ 1063.508543] [width max:2080 ratio max:8 min:1] [ 1063.508562] rkispp0: scale0:0x0 out of range: [ 1063.508562] [width max:3264 ratio max:8 m[RKMEDIA][SYS][Info]:#V4L2Ctx: open /dev/video19, fd 93 in:1] [ 1063.508577] rkispp0: scale0:0x0 out of range: [ 1063.508577] [width max:3264 ratio max:8 min:1] [ 1063.508593] rkispp0: scale0:0x0 out of range: [ 1063.508593] [width max:3264 ratio max:8 min:1] [RKMEDIA][SYS][Info]:RK_MPI_VI_EnableChn: Enable VI[0:0]:rkispp_scale0, 1280x720 End… [RKMEDIA][SYS][Info]:RK_MPI_VENC_CreateChn: Enable VENC[0], Type:5 Start… [RKMEDIA][SYS][Info]:ParseMediaConfigFromMap: rect_x = 0, rect_y = 0, rect.w = 1280, rect.h = 720 mpp[587]: mpp_rt: NOT found ion allocator mpp[587]: mpp_rt: found drm allocator mpp[587]: mpp_info: mpp version: 57ff4c6b author: Herman Chen 2021-09-13 [cmake]: Enable HAVE_DRM by default [RKMEDIA][VENC][Info]:MPP Encoder: MPPConfig: cfg init sucess! [RKMEDIA][VENC][Info]:MPP Encoder: qpMaxi use default value:48 [RKMEDIA][VENC][Info]:MPP Encoder: qpMini use default value:8 [RKMEDIA][VENC][Info]:MPP Encoder: qpMax use default value:48 [RKMEDIA][VENC][Info]:MPP Encoder: qpMin use default value:8 [RKMEDIA][VENC][Info]:MPP Encoder: qpInit use default value:-1 [RKMEDIA][VENC][Info]:MPP Encoder: qpStep use default value:2 [RKMEDIA][VENC][Info]:MPP Encoder: rect_x use default value:0 [RKMEDIA][VENC][Info]:MPP Encoder: rect_y use default value:0 [RKMEDIA][VENC][Info]:MPP Encoder: rotaion = 0 [RKMEDIA][VENC][Info]:MPP Encoder: automatically calculate bsp with bps_target [RKMEDIA][VENC][Info]:MPP Encoder: Set output block mode. [RKMEDIA][VENC][Info]:MPP Encoder: Set input block mode. [RKMEDIA][VENC][Info]:MPP Encoder: bps:[1024000,921600,819200] fps: [30/1]->[30/1], gop:30 qpInit:-1, qpMin:8, qpMax:48, qpMinI:8, qpMaxI:48. [RKMEDIA][VENC][Info]:MPP Encoder: AVC: encode profile 77 level 0 mpp[587]: mpp_enc: MPP_ENC_SET_RC_CFG bps 921600 [819200 : 1024000] fps [30:30] gop 30 mpp[587]: h264e_api_v2: MPP_ENC_SET_PREP_CFG w:h [1280:720] stride [1280:720] mpp[587]: mpp_enc: send header for set cfg change input/format [RKMEDIA][VENC][Info]:MPP Encoder: w x h(1280[1280] x 720[720]) mpp[587]: mpp_enc: mode cbr bps [819200:921600:1024000] fps fix [30/1] -> fix [30/1] gop i [30] v [0] [RKMEDIA][SYS][Info]:RK_MPI_VENC_CreateChn: Enable VENC[0], Type:5 End… [RKMEDIA][SYS][Info]:RK_MPI_VENC_CreateChn: Enable VENC[1], Type:5 Start… [RKMEDIA][SYS][Info]:ParseMediaConfigFromMap: rect_x = 0, rect_y = 0, rect.w = 1280, rect.h = 720 mpp[587]: mpp_info: mpp version: 57ff4c6b author: Herman Chen 2021-09-13 [cmake]: Enable HAVE_DRM by default [RKMEDIA][VENC][Info]:MPP Encoder: MPPConfig: cfg init sucess! [RKMEDIA][VENC][Info]:MPP Encoder: qpMaxi use default value:48 [RKMEDIA][VENC][Info]:MPP Encoder: qpMini use default value:8 [RKMEDIA][VENC][Info]:MPP Encoder: qpMax use default value:48 [RKMEDIA][VENC][Info]:MPP Encoder: qpMin use default value:8 [RKMEDIA][VENC][Info]:MPP Encoder: qpInit use default value:-1 [RKMEDIA][VENC][Info]:MPP Encoder: qpStep use default value:2 [RKMEDIA][VENC][Info]:MPP Encoder: rect_x use default value:0 [RKMEDIA][VENC][Info]:MPP Encoder: rect_y use default value:0 [RKMEDIA][VENC][Info]:MPP Encoder: rotaion = 0 [RKMEDIA][VENC][Info]:MPP Encoder: automatically calculate bsp with bps_target [RKMEDIA][VENC][Info]:MPP Encoder: Set output block mode. [RKMEDIA][VENC][Info]:MPP Encoder: Set input block mode. [RKMEDIA][VENC][Info]:MPP Encoder: bps:[1024000,921600,819200] fps: [30/1]->[30/1], gop:30 qpInit:-1, qpMin:8, qpMax:48, qpMinI:8, qpMaxI:48. [RKMEDIA][VENC][Info]:MPP Encoder: AVC: encode profile 77 level 0 mpp[587]: mpp_enc: MPP_ENC_SET_RC_CFG bps 921600 [819200 : 1024000] fps [30:30] gop 30 mpp[587]: h264e_api_v2: MPP_ENC_SET_PREP_CFG w:h [1280:720] stride [1280:720] mpp[587]: mpp_enc: send header for set cfg change input/format [RKMEDIA][VENC][Info]:MPP Encoder: w x h(1280[1280] x 720[720]) mpp[587]: mpp_enc: mode cbr bps [819200:921600:1024000] fps fix [30/1] -> fix [30/1] gop i [30] v [0] [RKMEDIA][SYS][Info]:RK_MPI_VENC_CreateChn: Enable VENC[1], Type:5 End… [RKMEDIA][SYS][Info]:RK_MPI_SYS_Bind: Bind Mode[VI]:Chn[0] to Mode[VENC]:Chn[0]… [RKMEDIA][SYS][Info]:RK_MPI_SYS_Bind: Bind Mode[VI]:Chn[0] to Mode[VENC]:Chn[1]… [RKMEDIA][SYS][Info]:RK_MPI_AI_EnableChn: Enable AI[0] Start… [RKMEDIA][SYS][Info]:AlsaCaptureStream: Layout 0, output chan 2, alsa chan 2 [RKMEDIA][SYS][Info]:Camera 0 stream 93 is started [RKMEDIA][SYS][Info]:RK_MPI_AI_EnableChn: Enable AI[0] End… [RKMEDIA][SYS][Info]:RK_MPI_AI_EnableChn: Enable AI[1] Start… [RKMEDIA][SYS][Info]:AlsaCaptureStream: Layout 0, output chan 1, alsa chan 1 [RKMEDIA][SYS][Info]:RK_MPI_AI_EnableChn: Enable AI[1] End… [RKMEDIA][AENC][Info]:rk codec name=MP2 (MPEG audio layer 2) [RKMEDIA][AENC][Info]:rk codec name=PCM A-law / G.711 A-law [RKMEDIA][SYS][Info]:RK_MPI_SYS_Bind: Bind Mode[AI]:Chn[0] to Mode[AENC]:Chn[0]… [RKMEDIA][SYS][Info]:RK_MPI_SYS_Bind: Bind Mode[AI]:Chn[1] to Mode[AENC]:Chn[1]… 为什么卡在这里不往下执行推流
08-02
跟网型逆变器小干扰稳定性分析与控制策略优化研究(Simulink仿真实现)内容概要:本文围绕跟网型逆变器的小干扰稳定性展开分析,重点研究其在电力系统中的动态响应特性及控制策略优化问题。通过构建基于Simulink的仿真模型,对逆变器在不同工况下的小信号稳定性进行建模与分析,识别系统可能存在的振荡风险,并提出相应的控制优化方法以提升系统稳定性和动态性能。研究内容涵盖数学建模、稳定性判据分析、控制器设计与参数优化,并结合仿真验证所提策略的有效性,为新能源并网系统的稳定运行提供理论支持和技术参考。; 适合人群:具备电力电子、自动控制或电力系统相关背景,熟悉Matlab/Simulink仿真工具,从事新能源并网、微电网或电力系统稳定性研究的研究生、科研人员及工程技术人员。; 使用场景及目标:① 分析跟网型逆变器在弱电网条件下的小干扰稳定性问题;② 设计并优化逆变器外环与内环控制器以提升系统阻尼特性;③ 利用Simulink搭建仿真模型验证理论分析与控制策略的有效性;④ 支持科研论文撰写、课题研究或工程项目中的稳定性评估与改进。; 阅读建议:建议读者结合文中提供的Simulink仿真模型,深入理解状态空间建模、特征值分析及控制器设计过程,重点关注控制参数变化对系统极点分布的影响,并通过动手仿真加深对小干扰稳定性机理的认识。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值