在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\n", 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\n", rtsp_filename);
- }
- else {
- OSA_printf("Open file %s for server\n", rtsp_filename);
- }
- return 0;
- }
- write(rtsp_fd,pFullBuf->bufVirtAddr,pFullBuf->filledBufSize);
- int socket_server_init()
- {
- //删除文件,资源释放,数据清空
- }
复制代码
(笔记分享 技术交流 xubbwd@foxmail.com)
|