srs icon indicating copy to clipboard operation
srs copied to clipboard

Windows: Support cygwin 64bits

Open winlinvip opened this issue 3 years ago • 9 comments

SRS for Windows

背景

SRS已经支持了Linux平台,mac平台,以及部分嵌入式平台,而Windows作为当今用户量最大的桌面系统, 在一定的场景下也有流媒体的诉求,甚至希望在Windows服务器上跑服务,特别是一些小型公司。

另外,很多的前端程序员对Windows的需求也很大,在一定的场景下对流媒体系统也有诉求。

SRS for Windows的编译成功,不仅仅解决了上述的问题,而且在一定的程度上补全了SRS对平台支持的完善。

为什么支持Windows:https://t.zsxq.com/imAaujQ

ST supports windows: https://github.com/ossrs/state-threads/issues/20

进展

目前已经完成了SRS for Windows版本的编译。编译脚本适配和代码兼容性修改已经提交到 feature/windows 分支, 并计划跟随SRS5 一起发布。

编译

目前SRS for Windows使用 Cygwin64 环境编译。

Cygwin是一个类UNIX模拟环境,运行在Windows之上,提供一个模拟的shell环境, 可以很方便的把基于Linux开发的程序移植到Windows环境。

Cygwin本身不提供VM环境,而是对等的API翻译,其运行效率基本等同于Windows Native API。

切换到SRS的 feature/windows 分支并编译:

git checkout feature/windows
./configure
make

编译成功后,就可以生成./objs/srs.exe执行文件。

如何使用SRS,请参考 SRS: Getting Started

安装包

SRS for Windows会使用Windows传统的安装包形式发布,可以在SRS版本发布的附件中下载 ,按照提示安装即可。

Note: 比如安装包 SRS-Windows-x86_64-5.0.12-setup.exe,可以在版本v5.0.19 附件中下载。Windows还不支持自动编译,建议自己从源代码编译。

SRS 安装过程中,会把SRS放到Windows的环境变量中,用户打开cmd控制台,直接可以调起来SRS。

目前只提供64位版本,请确认你的系统是64位Windows。

也可以自己编译,参考上面的编译

存在的问题

  1. 基于Cygwin环境无法生成pdb文件,则很难定位程序问题,这一点是很关键的。
  2. 目前SRS 协程库,没有对Windows 高并发框架iocp提供支持,只能使用select,可能无法达到超高并发,只能使用多进程模式来达到高并发。

后续计划

  1. 对SRS协程库支持iocp,使SRS在Windows上达到和Linux下同等的性能。
  2. 集成SRS到npm包,让前端程序员很方便的使用。

winlinvip avatar Aug 14 '21 03:08 winlinvip

My environment WSL + Ubuntu should be more efficient than cygwin.

TRANS_BY_GPT3

chenjim avatar Oct 21 '21 09:10 chenjim

During the SRS installation process, SRS will be added to the Windows environment variables. Users can open the cmd console and directly launch SRS.

How to solve the issue of not adding system environment variables? What variables should be manually added?

TRANS_BY_GPT3

290008282 avatar Nov 01 '21 10:11 290008282

During the SRS installation process, SRS will be added to the Windows environment variables. Users can directly launch SRS by opening the cmd console.

How to solve the issue of not adding system environment variables? What variables should be manually added?

Mine also didn't add environment variables? Does everyone use Windows?

TRANS_BY_GPT3

duliangheng avatar May 13 '22 07:05 duliangheng

During the SRS installation process, SRS will be added to the Windows environment variables, allowing users to directly launch SRS by opening the cmd console. What if the system environment variables are not added? How can it be resolved? Manually add which variables?

Mine also does not have the environment variables added? Does everyone use Windows? I have already given up and am waiting for future updates. Currently, I find CentOS more stable to use.

TRANS_BY_GPT3

290008282 avatar May 13 '22 09:05 290008282

Have you ever compiled a Windows version? When I compile it, it stops executing with an error at 'Building ffmpeg-4-fit'...

TRANS_BY_GPT3

duliangheng avatar May 14 '22 04:05 duliangheng

During the SRS installation process, SRS will be added to the Windows environment variables. Users can directly launch SRS by opening the cmd console. What should I do if I haven't added the system environment variables? How can I manually add the variables?

I also haven't added the environment variables. Does everyone use Windows? I have already given up and am waiting for future updates. Currently, I find CentOS more stable to use.

Have you ever compiled a Windows version? When I was compiling, I encountered two issues that prevented me from proceeding...

First issue: ./config Building libsrtp-2-fit. patching file crypto/math/datatypes.c Reversed (or previously applied) patch detected! Assume -R? [n]

This place, I don't know how to handle it?

Secondly, during the process of making. In file included from src/app/srs_app_threads.cpp:21: src/app/srs_app_rtc_dtls.hpp:16:10: fatal error: srtp2/srtp.h: No such file or directory 16 | #include <srtp2/srtp.h> | ^~~~~~~~~~~~~~ compilation terminated.

That's the end here.

TRANS_BY_GPT3

duliangheng avatar May 14 '22 11:05 duliangheng

I have not compiled the Windows version before. The actual released version can run normally, but there are some differences in the command slashes (\ and /) compared to the tutorial. My problem at that time was that the conf file configured in Linux could not run properly in the Windows version.

So I found an old computer and set up a local Linux server with the help of Baota. It's very convenient. Why do we have to use Windows? I don't know what your application environment is, but I use the Linux version to convert RTSP from an internal network camera to RTMP+.flv for external live streaming. It is very stable, and I haven't made any changes since I set it up. The speed is also good, and you can directly upload the public network service to the cloud. Lightweight servers are not expensive nowadays.

L.HF @.***

Rongcheng Yijie Network Technology Co., Ltd.

 

------------------ Original Message ------------------ From: "ossrs/srs" @.>; Sent: May 14, 2022 (Saturday) 7:57 PM @.>; @.@.>; Subject: Re: [ossrs/srs] Windows: Support cygwin 64bits (#2532)

That being said, have you ever compiled the Windows version? When I tried to compile it, I encountered two issues that prevented further execution...

First issue: ./config Building libsrtp-2-fit. patching file crypto/math/datatypes.c Reversed (or previously applied) patch detected! Assume -R? [n]

In this situation, I'm not sure how to handle it.

The second issue is: When making, in the file src/app/srs_app_threads.cpp at line 21, there is an error. In the file src/app/srs_app_rtc_dtls.hpp at line 16, there is a fatal error: srtp2/srtp.h file or directory does not exist. The compilation is terminated.

And here it ends.

During the SRS installation process, SRS will be added to the Windows environment variables, allowing users to directly launch SRS from the cmd console. If the system environment variables are not added, how can this be resolved? What variables should be manually added?

I also didn't add the environment variables. Does everyone use Windows? I have already given up and am waiting for future updates. Currently, I find CentOS more stable to use.

So, may I ask if you have ever compiled a Windows version? When I was compiling, I encountered two issues that prevented me from proceeding...

First issue: ./config Building libsrtp-2-fit. patching file crypto/math/datatypes.c Reversed (or previously applied) patch detected! Assume -R? [n]

This place, I don't know how to handle it?

The second one: when making. In file included from src/app/srs_app_threads.cpp:21: src/app/srs_app_rtc_dtls.hpp:16:10: fatal error: srtp2/srtp.h: No such file or directory 16 | #include <srtp2/srtp.h> | ^~~~~~~~~~~~~~ compilation terminated.

That's the end here.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

TRANS_BY_GPT3

290008282 avatar May 18 '22 10:05 290008282

I have never compiled the Windows version before. The actual released version can run normally, but there are some differences in the command syntax between Linux and Windows. My problem at that time was that the conf file configured in Linux could not run properly in the Windows version. So I set up a local Linux server on an old computer with the help of Baota, which is very convenient. Why do you have to use Windows? I don't know what your application environment is, but I use the Linux version and it is very stable. I haven't made any changes since I set it up, and the speed is also good. Public network services can be directly deployed on the cloud, and lightweight servers are not expensive now. L.HF @.*** Rongcheng Yijie Network Technology Co., Ltd.

I just want to learn because I rarely use Linux, so I want to use it on Windows.

TRANS_BY_GPT3

duliangheng avatar May 26 '22 07:05 duliangheng

During the SRS installation process, SRS will be added to the Windows environment variables, allowing users to directly launch SRS from the cmd console. What if the system environment variables are not added? How to manually add the variables?

Mine also doesn't have the environment variables added? Does everyone use Windows? I have already given up and will wait for future updates. Currently, using CentOS is more stable.

Have you ever compiled a Windows version? When I was compiling, I encountered two issues that prevented me from proceeding...

First issue: ./config Building libsrtp-2-fit. patching file crypto/math/datatypes.c Reversed (or previously applied) patch detected! Assume -R? [n]

At this location, I don't know how to handle it.

Second: When making, in file included from src/app/srs_app_threads.cpp:21: src/app/srs_app_rtc_dtls.hpp:16:10: fatal error: srtp2/srtp.h: No such file or directory 16 | #include <srtp2/srtp.h> | ^~~~~~~~~~~~~~ compilation terminated.

This is the end.

Manually compile 3rdparty\libsrtp-2-fit. Move the files under the include directory to objs\srtp2\include\srtp2. Move the compiled .a file to objs\srtp2\lib. Then run make again, it should work.

TRANS_BY_GPT3

puttys avatar Jun 25 '22 12:06 puttys

Already merged commit:

commit e9503a9c9a4055a52a114f857a44c8d041fb0c1c Author: wenjie.zhao [email protected] Date: Fri Nov 18 23:02:35 2022 +0800

For #2532: Windows: Replace ln by cp for windows. v5.0.87 (#3246)

1. Replase ln by cp for windows.
2. Refine OS and CPU arch detecting.
3. Support configure from any directory by `SRS_WORKDIR`.
4. Support output to any directory by `SRS_OUTPUT`.
5. Disable sanitizer for gperf.
6. Use parallels build for make.
7. Refine bash variable check.

winlinvip avatar Nov 18 '22 16:11 winlinvip