PS2 / PSP emulator + game play streaming (YouTube, Facebook, Twitch) = new version of Omega Red

    Hello to all readers!

    I continue the theme of the software emulator for the PlayStation 2 and PlayStation Portable - Omega Red. In details:


    I wrote this publication in connection with the new functionality that I added to the project - streaming broadcasting of live video and audio game process from the emulator to well-known streaming Internet services.
    Welcome to Kat.


    To start, I’ll note the following - the idea to integrate support for Internet broadcasting arose from my other project - CaptureManager SDK . I experimented with broadcasting from a webcam and got a workable code. And the idea “came” - to embed this code in the game console emulator!

    The task is interesting in the following aspects: capture of video and audio. Capturing from the camera is quite simple, but what to do with capturing video from the renderer of the emulator!?! You can find code to capture the entire desktop - but it is so SIMPLE. And what if you capture graphics directly from the graphics renderer! A similar idea with audio capture - usually the audio capture is carried out from the system mixer as duplication of the audio stream to the speakers. And what if you capture audio directly from the audio renderer BEFORE the system mixer!

    Interesting! Original!

    How it is implemented: Capture code is added to the DirectX 11 renderer and DirectSound renderer. The result of rendering graphics is directly transmitted to the H264 video encoder via DirectX 11 video texture - this allows you to use hardware-accelerated video encoding on a graphics accelerator. The audio stream is routed to the AAC audio encoder built into Windows.

    The capture control consists of two parts:

    • setting up encoding and selection of the streaming Internet service for broadcasting live video;
    • mixer setup - mixing live video with additional sources (webcam, JPG / PNG / GIF (animated) files).

    Encoding setting:


    Streaming setup begins with the choice of capture mode - “Streaming”. In this mode, you can adjust the data rate for video and audio streams in accordance with the available Internet connection speed. Separately, you can choose a streaming service or RETRIEVE MANUAL the full address of the streaming server - for example, OWN server based on MonaServer . It is important to note that not only an open connection is supported, but also a secure connection (SSL)! The streaming service Facebook (yes, there is one) published the following announcement:

    “From November 1, 2019, we will stop supporting RTMP server URLs. After that, unprotected URLs cannot be used for video broadcasts. Update the settings of the video coding device and use the secure RTMPS URLs ”- I decided that RTMPS support was promising and spent the time“ screwing ”OpenSSL to the RTMP library. And the code WORKS !!! Facebook takes stream over a secure connection!

    The stream starts by pressing the record / streaming button:


    Mixer settings become available after recording / streaming starts:



    In the Media panel, the Media Sources tab is available - this tab includes the video and audio stream sources available for mixing. In addition to webcams and microphones, you can add JPG / PNG / GIF (animated) files.

    For microphones, you can control the proportion of mixing audio streams. The microphone is selected by clicking on the check button, mixing control is performed by the slider.


    For a video source, you can control the mixing of video streams. The camera is selected by clicking on the check button, the image size from the camera is selected through the drop-down menu.



    The transparency (or non-transparency) of the mix can be controlled through a separate slider.


    The position and size of mixing video streams can be changed during streaming at any time:


    Streaming demo:





    Currently, the program is available at: Omega Red and is presented on GitHub: OmegaRed .

    PS The video quality on the stream is fig - I have ADSL Internet - a steady stream on YouTube only at a video stream speed of up to 256 Kbit - you don’t need to spit on the screen - it won’t help.

    Only registered users can participate in the survey. Please come in.

    Which emulator should be added to Omega Red?

    • 22.7% PS1 - I dream to stream MGS 5
    • 40.9% Nintendo64 - Dreaming Stream The Legend of Zelda: Ocarina of Time 9
    • 59% PS5 - how do you like it, Elon Musk? thirteen

    Also popular now: