在DM8168中通过live555实现rtsp的直播

2019-07-15 15:25发布

在DM8168中通过live555实现rtsp的直播


1、源码
   2、实现交叉编译
    vim config.armlinux
    修改: CROSS_COMPILE?=         arm-none-linux-gnueabi-
    ./genMakefiles armlinux
    make


    挂载:
    busybox mount -t nfs -o nolock 172.16.0.73:/xubinbin/live555/live /mnt

3、利用有名管道来实现数据的传输
    在live555中的testProgs/testH264VideoStreamer.cpp默认文件问test.264, 修改为/tmp/test.264

    在视频采集进程中添加:
  • int rtsp_fd;
  • char rtsp_filename[128];
  • int socket_server_init()
  • {
  •     memcpy(rtsp_filename,"/tmp/test.264",sizeof(rtsp_filename));
  •     unlink(rtsp_filename);
  •     if (access(rtsp_filename, F_OK) != 0) {
  •         if (mkfifo(rtsp_filename, 0666) < 0) {
  •             OSA_printf("Failed to mkfifo %s ", rtsp_filename);
  •             return FALSE;
  •         }
  •     }
  •     if (system("/home/testH264VideoStreamer &") != 0) {
  •         OSA_printf("Failed to execute system command");
  •         return FALSE;
  •     }
  •     rtsp_fd = open(rtsp_filename, O_WRONLY);
  •     if (rtsp_fd <= 0) {
  •         OSA_printf("Failed to open file %s ", rtsp_filename);
  •     }
  •     else {
  •         OSA_printf("Open file %s for server ", rtsp_filename);
  •     }
  •     return 0;
  • }
  • write(rtsp_fd,pFullBuf->bufVirtAddr,pFullBuf->filledBufSize);
  • int socket_server_init()
  • {
  •     //删除文件,资源释放,数据清空
  • }

[color=rgb(51, 102, 153) !important]复制代码

[color=rgb(51, 102, 153) !important]

0条回答

一周热门 更多>