How to get clean video in the mixer.

Discussion in 'Web Call Server 5' started by sangsoo, Dec 23, 2019.

  1. sangsoo

    sangsoo New Member

    Hello.
    I want to get clear video quality from a mixer.
    I had a similar question before.

    First of all, I published video with CBR fhd 30fps 4mbps using obs encoder. (named "obsrtmp")
    Create a new mixer and add the "obsrtmp" stream to the mixer. stream name "mixer1" has been created.
    Finally, play the stream name "mixer1". Well displayed.
    (* mixer related server setting)
    -mixer_video_width = 1920
    -mixer_video_height = 1080
    -mixer_video_bitrate_kbps = 4000

    We also play the first "obsrtmp" directly for comparison. The image of the clear quality was playable.

    Question =================
    "mixer1 with obsrtmp added" and "the original obsrtmp video" have the same resolution,fps,bitrate.
    The screen of "mixer1" (right)s often corrupted like an attachment. Please tell me how to keep the quality similar to the capture source(left).

    What's the way?
    Please comment.

    Best Regards.

    Attached Files:

  2. Max

    Max Administrator Staff Member

    Good day.
    As we wrote in another post, look at your gc_core.log. If Full GC works often, consider to use an instance with more RAM (32 Gb) and set Java heap size to 16 Gb (it is 8 Gb now as we see in screenshots).
    Problem persists if you increase mixer_video_bitrate_kbps to 6000 kbps (for example)?
    Please specify which version of WCS you are using.
  3. Max

    Max Administrator Staff Member

    Good day.
    We have some questions about your case:
    1. You are using custom lossless video processor for incoming streams handling?
    2. You have provided us video screenshots. Please specify how you played both videos?
    3. Try recording mixer (output stream). Video quality has changed?
  4. sangsoo

    sangsoo New Member

    Dear Max.
    Thank you for answer. It is very helpful.

    Previously, version 417 of WCS5.2 was used.
    And today I updated both origin-transcoding-edge to version 443. The mixer is tested on the ec2 c5.2xlarge.
    In the last log, Full GC was often observed. I also understood the instance upgrade proposal.
    However, on the 23rd, the gc-core ~ .log was not generated, probably there was no full gc. (See image "gc-corelog.png")
    and Since we updated version 443, the mixer has been very slow. "drop video frame ~" has also increased much more at server logs.
    What's up? Has the base specification for transcoding been upgraded since the update?
    We still need a lot of information. I will test more.

    * Custom lossless setting is false.
    * Mixer_video_bitrate_kbps to 6000 kbps was similar.
    * The recording mixer has not been tested yet.

    * The following is a test scenario. =================
    1. Stream "obsrtmp" publishing to origin server (obs, cbr, 4mbps, nvenc h264, FHD, 30fps)
    2. pulling obsrtmp using restapi from origin to mixer server (new stream "tobsrtmp", mixer name "mixer1")
    rest: /rest-api/pull/pull
    body:
    {
    "localStreamName": "tobsrtmp#mixer1",
    "uri": "ws://marioms.rsupport.com:8080",
    "remoteStreamName": "obsrtmp"
    }​

    3. The left screen plays at the edge (a publishing "obsrtmp" stream at origin)
    4. The right screen plays the "mixer1" stream directly from the mixer server. Frame drop phenomenon is observed in the right screen.

    Is it enough to create and play a single FHD Mixer stream with 8vcpu + 16G ram? need a memory upgrade?

    Please let me know if anything goes wrong with my test plan.
    Thanks.
    Best regards.

    Attached Files:

  5. Max

    Max Administrator Staff Member

    Hello,

    In addition to recording mixer stream, please also record the pulled obsrmtp stream (for that setting
    should be added to flashphoner.properties).
    There have not been any mixer related changes since 5.2.417. The instance parameters should be sufficient.
    Do the origin and edge servers have the same location?
  6. sangsoo

    sangsoo New Member

    Dear Max.
    It's been a while, but I'm still testing WCS Mixer functionality. Unfortunately, I did not get the expected results.
    So I summarized the questions into a single image. Please comment once again.
    * Goal: create a good quality FHD resolution mixer stream.
    * Expected Result: The attached image "3-2 Subscribe C" is implemented. (good quality)
    * WCS Version: v.0.5.28.2753-5.2.458-c43a655ff941298904d59db2d8cfcbf9bd1fc738

    I changed the following settings as in previous answers but as a result there was no difference.
    1.iperf test is ok (keep bandwidth 560 mpbs always)
    2. video_encoder_max_threads = 3
    3. Even if the mixing quality is poor, the cpu & memory is stable on mixer server
    4. record_flash_published_streams = true, same(poor quality) symptom occurs in recorded files. (here)
    5. Use mixer tweaks (bufferization and custom losless videoprocessor). I do not know the detailed control method.
    6. mixer_video_bitrate_kbps to 6000

    The most curious thing is the existence of two WCS server logs. The meaning of this log has been answered before.
    1.ERROR lient-mixer: // mixer1-MIXER-AGENT-mixer: // mixer1-4077b202-3ccf-421b-a995-304e9b3e3de6 TRANSCODER RESULT NULL
    2.Warn D-VideoProcessor-d58eaacd-e097-46ad-b965-a5e9b81cc701 Drop video frame from mixer's buffer

    In conclusion, I suspect that the mixing encoding timing is too fast, the rendering time is long, or the data is still insufficient to encode FHD frames.
    In fact, the 3-1 subscriber B image of the attached image is of good quality. iperf measurements are good enough, so I think the publish bandwidth channel is ok. Quality is usually good with less data in HD.

    The GC Full log occurs while this symptom lasts for a while. It happens even when the cpu or mem (java heap) is stable.
    So before we double the EC2 memory, we need to find the underlying reason.

    It was difficult to explain the test process.
    Please refer to the attached image to review FHD Mixing.
    Is it possible to mix FHD resolution in WCS only when HW specification is higher than now?
    I would like to hear your opinion again.
    Thank you.
    Best Regards.

    Attached Files:

    Last edited: Jan 15, 2020 at 9:52 AM
  7. Max

    Max Administrator Staff Member

    Hello,

    It is necessary to confirm quality of the stream pulled to the mixer server.
    Please try it first without creating mixer.

    1. In case of pulling as WebRTC (/rest-api/pull/pull), try using TCP: add this setting to flashphoner.properties on the mixer server
    Code:
    ice_tcp_transport=true
    and restart the server before the test.
    Then pull the stream without creating mixer
    Code:
    /rest-api/pull/pull
    {
    "localStreamName": "tobsrtmp",
    "uri": "ws://marioms.rsupport.com:8080",
    "remoteStreamName": "obsrtmp"
    }
    2. Instead of pulling as WebRTC, try pulling as RTMP
    Code:
    /rest-api/pull/rtmp/pull
    {
      "uri": "rtmp://marioms.rsupport.com:1935/live/obsrtmp"
    }
    To confirm quality without subscriber, stream can be recorded using REST:
    Code:
    /rest-api/stream/startRecording
    {
      "mediaSessionId": "<stream mediaSessionId>"
    }
    Use REST to find out stream mediaSessionId:
    Code:
    /rest-api/stream/find
    {
      "name": "<stream name / RTMP URL>",
      "published": true
    }
    Then, if pulled stream quality is satisfactory, it can be added to mixer using REST
    1. start mixer
    Code:
    /rest-api/mixer/startup
    {
      "uri": "mixer://mixer1",
      "localStreamName": "mixer1"
    }
    2. add stream to mixer
    Code:
    /rest-api/mixer/add
    {
      "uri": "mixer://mixer1",
      "remoteStreamName": "<stream name / RTMP URL>"
    }
  8. sangsoo

    sangsoo New Member

    Sorry. Max
    Subscriber B(obs#mixer1) and C(mixer1) Stream names were written incorrectly.
    I reattached the edited image.
    ice_tcp_transport = true I'll test it.
    Sorry.

    Attached Files:

Share This Page