Some time ago, only specialized hardware platforms were able to provide high-quality conversion of video and audio signals into a digital compressed stream for transmission over IP networks. But the current level of computer technology evolution allows you to make almost any device based on a conventional PC. It is enough to add the necessary hardware and software components that will help in the implementation of the required functionality. If we talk about video and audio signal encoding devices, it’s enough to install the necessary software - Live encoder, a signal capture card (not required with HDMI or USB signal source), and if the CPU power is insufficient, additional hardware processing tools, for example, a video card ( GPU) with CUDA / NVENC support. Also, instead of installing a GPU, you can use an Intel CPU with QuickSync hardware encoding technology. You get a universal flexible solution, the configuration of which can be easily changed or supplemented at any time.
In this article, we will consider the currently available (2K2020) Live encoder software packages that allow you to publish a video stream from a PC to the Wowza Streaming Engine media server or to online broadcast services such as Wowza Cloud, YouTube social networks, etc. over RTMP and / or SRT.
Software products in the article:
This solution does not have a graphical interface. All actions are performed only through the command line. At its core, this is not even an application, but a framework, based which a developer can create his own products. You can design your own interface, and all the necessary actions can be implemented not by programming in any language, but by calling and executing ffmpeg commands with certain parameters. Supported operations are encoding, decoding, transcoding, multiplexing and demultiplexing, streaming, playback and processing of data sources.
It is important to note that ffmpeg is a free and open source program, available as source code, and can be compiled for any operating system. You can also download pre-compiled binaries to run ffmpeg on Windows, Linux, or MAC.
To publish a live stream to a Wowza server with a source in the form of an mp4 video file, a command such as:
ffmpeg -re -stream_loop -1 -i sample.mp4 -pix_fmt yuv420p -deinterlace -vf "scale=640:360" -vsync 1 -threads 0 -vcodec libx264 -r 29.970 -g 60 -sc_threshold 0 -b:v 1024k -bufsize 1216k -maxrate 1280k -preset medium -profile: v main -tune film -acodec aac -b:a 128k -ac 2 -ar 48000 -af "aresample=async=1:min_hard_comp=0.100000:first_pts=0" -vbsf h264_mp4toannexb -f flv rtmp://xxx.xxx.xxx.xxx/live/test
A huge number of media processing and transmuxing options are supported. The command line presented above is an example of applying the options for encoding a stream and publishing it to a server using the RTMP protocol. SRT publishing is also supported. In this case, the command will look like:
ffmpeg -re -stream_loop -1 -i sample.mp4 -pix_fmt yuv420p -deinterlace -vf "scale=640:360" -vsync 1 -threads 0 -vcodec libx264 -r 29.970 -g 60 -sc_threshold 0 -b:v 1024k -bufsize 1216k -maxrate 1280k -preset medium -profile: v main -tune film -acodec aac -b:a 128k -ac 2 -ar 48000 -af "aresample=async=1:min_hard_comp=0.100000:first_pts=0" -vbsf h264_mp4toannexb -f mpegts srt:// xxx.xxx.xxx.xxx:xxxxx
It should be noted that using ffmpeg as a live encoder has one significant misfeature - when the connection to the server is disconnected, publication does not resume automatically. To solve the problem, it is necessary to provide programmatic processing of such an event in bat./sh. script running ffmpeg.
Adobe FLME (Flash Media Live Encoder).
Originally it was intended to transfer the stream to the Adobe FMS server using the RTMP protocol, which is the company's own development. But with equal success, it can be used to publish a stream to Wowza Media Server. The product is free, appeared a long time ago and is not currently distributed and is not supported by Adobe, but you can find download links on the network both from adobe.com and from third-party sites. Very convenient to use, not overloaded with functionality and choice of options. Almost any DirectShow-compatible device can act as a signal source, from simple webcams to professional boards like AJA, Blackmagic or Osprey ..
The capabilities are more than enough to receive a signal from almost any audio and video capture device and transmit it to the server in the required quality. It should be noted that the signal can be broadcast simultaneously in a different bitrate and resolution, as well as record it on a local disk. Also a very convenient feature is the ability to transfer data to the primary and backup servers. FMLE was not positioned as a reliable professional application capable of working in 24/7 mode, but this is easily achieved by the operating system with the ability to run it from the command line with the required parameters without initializing the graphical interface. To do this, a command (.bat) file is created that defines the parameters for starting or stopping the main application (FMLE), for example, restarting it at fixed intervals, automatically cleaning folders with recorded content, etc., depending on the task. The batch file may automatically run when the OS boots.
Supports automatic republishing of a stream upon network failure. There are versions of the product for the Windows operating system and MAC.
A free product for Windows that allows you to publish a stream to Wowza using the RTMP protocol. One of the main advantages (which is also emphasized in the product name) is that this program does not block access to the webcam for other devices during operation. You can publish the webcam stream to the Wowza server and at the same time use the same camera for a Skype video call. The program can work with several video image sources: MP4 files, web camera, IP camera, broadcast PC screen. Images received from different sources can be combined into one final one and broadcast to several Wowza servers and / or broadcast services at the same time. Write to a file on the local disk is available. There are interesting options for adding text messages to the broadcast stream, mixing sound. The program is very easy to use and requires minimal effort to configure and start publishing a stream. The latest version of the software does not scroll advertisements and is free from the fleur of web-model themes, typical for previous versions. Apparently, "Зроблено в Україні".