Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag to use Chrome "Black Frame Decoder", skipping video decode complexity. #521

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion scripts/malleus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if [ -n "$DEBUG" ]; then
fi

usage() {
echo "Usage: $0 [--conferences=MALLEUS_CONFERENCES] [--participants=MALLEUS_PARTICIPANTS] [--senders=MALLEUS_SENDERS] [--audio-senders=MALLEUS_AUDIO_SENDERS] [--senders-per-tab=MALLEUS_SENDERS_PER_NODE] [--receivers-per-tab=MALLEUS_RECEIVERS_PER_NODE] [--senders-per-node=MALLEUS_SENDERS_PER_NODE] [--receivers-per-node=MALLEUS_RECEIVERS_PER_NODE] [--duration=MALLEUS_DURATION (s)] [--join-delay=MALLEUS_JOIN_DELAY (ms)] [--room-name-prefix=MALLEUS_ROOM_NAME_PREFIX] [--hub-url=MALLEUS_HUB_URL] [--instance-url=MALLEUS_INSTANCE_URL] [--regions=MALLEUS_REGIONS] [--use-node-types] [--use-load-test] [--max-disrupted-bridges-pct=MALLEUS_MAX_DISRUPTED_BRIDGES_PCT] [--extra-sender-params=EXTRA_SENDER_PARAMS] [--extra-receiver-params=EXTRA_RECEIVER_PARAMS] [--debug] [--switch-speakers] [--use-stage-view] [--headless]" >&2
echo "Usage: $0 [--conferences=MALLEUS_CONFERENCES] [--participants=MALLEUS_PARTICIPANTS] [--senders=MALLEUS_SENDERS] [--audio-senders=MALLEUS_AUDIO_SENDERS] [--senders-per-tab=MALLEUS_SENDERS_PER_NODE] [--receivers-per-tab=MALLEUS_RECEIVERS_PER_NODE] [--senders-per-node=MALLEUS_SENDERS_PER_NODE] [--receivers-per-node=MALLEUS_RECEIVERS_PER_NODE] [--duration=MALLEUS_DURATION (s)] [--join-delay=MALLEUS_JOIN_DELAY (ms)] [--room-name-prefix=MALLEUS_ROOM_NAME_PREFIX] [--hub-url=MALLEUS_HUB_URL] [--instance-url=MALLEUS_INSTANCE_URL] [--regions=MALLEUS_REGIONS] [--use-node-types] [--use-load-test] [--max-disrupted-bridges-pct=MALLEUS_MAX_DISRUPTED_BRIDGES_PCT] [--extra-sender-params=EXTRA_SENDER_PARAMS] [--extra-receiver-params=EXTRA_RECEIVER_PARAMS] [--debug] [--switch-speakers] [--use-stage-view] [--headless] [--enable-decoding]" >&2
exit 1
}

Expand Down Expand Up @@ -86,6 +86,10 @@ set_defaults() {
MALLEUS_USE_STAGE_VIEW=false
fi

if [ -z "$MALLEUS_ENABLE_DECODING" ]; then
MALLEUS_ENABLE_DECODING=false
fi

# Null is a fine default for MALLEUS_EXTRA_SENDER_PARAMS and MALLEUS_EXTRA_RECEIVER_PARAMS
}

Expand Down Expand Up @@ -120,6 +124,7 @@ case $1 in
--switch-speakers) if [ -n "$optvalue" ]; then MALLEUS_SWITCH_SPEAKERS=$optvalue; else MALLEUS_SWITCH_SPEAKERS=true; fi;;
--use-stage-view) if [ -n "$optvalue" ]; then MALLEUS_USE_STAGE_VIEW=$optvalue; else MALLEUS_USE_STAGE_VIEW=true; fi;;
--headless) if [ -n "$optvalue" ]; then MALLEUS_USE_HEADLESS=$optvalue; else MALLEUS_USE_HEADLESS=true; fi;;
--enable-decoding) if [ -n "$optvalue" ]; then MALLEUS_ENABLE_DECODING=$optvalue; else MALLEUS_ENABLE_DECODING=true; fi;;
--extra-sender-params) MALLEUS_EXTRA_SENDER_PARAMS=$optvalue;;
--extra-receiver-params) MALLEUS_EXTRA_RECEIVER_PARAMS=$optvalue;;
--max-disrupted-bridges-pct) MALLEUS_MAX_DISRUPTED_BRIDGES_PCT=$optvalue;;
Expand Down Expand Up @@ -203,6 +208,7 @@ mvn \
-Dorg.jitsi.malleus.switch_speakers=$MALLEUS_SWITCH_SPEAKERS \
-Dorg.jitsi.malleus.use_stage_view=$MALLEUS_USE_STAGE_VIEW \
-Dorg.jitsi.malleus.enable.headless=$MALLEUS_USE_HEADLESS \
-Dorg.jitsi.malleus.enable_decoding=$MALLEUS_ENABLE_DECODING \
-Dorg.jitsi.malleus.extra_sender_params=$MALLEUS_EXTRA_SENDER_PARAMS \
-Dorg.jitsi.malleus.extra_receiver_params=$MALLEUS_EXTRA_RECEIVER_PARAMS \
-Dremote.address=$MALLEUS_HUB_URL \
Expand Down
6 changes: 5 additions & 1 deletion src/test/java/org/jitsi/meet/test/MalleusJitsificus.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public class MalleusJitsificus
= "org.jitsi.malleus.use_stage_view";
public static final String USE_HEADLESS
= "org.jitsi.malleus.enable.headless";
public static final String ENABLE_DECODING
= "org.jitsi.malleus.enable_decoding";
public static final String SENDERS_PER_TAB
= "org.jitsi.malleus.senders_per_tab";
public static final String RECEIVERS_PER_TAB
Expand Down Expand Up @@ -427,12 +429,14 @@ private void join()
boolean useLoadTest = Boolean.parseBoolean(System.getProperty(USE_LOAD_TEST_PNAME));
boolean useNodeTypes = Boolean.parseBoolean(System.getProperty(USE_NODE_TYPES_PNAME));
boolean useHeadless = Boolean.parseBoolean(System.getProperty(USE_HEADLESS));
boolean enableDecoding = Boolean.parseBoolean(System.getProperty(ENABLE_DECODING));

WebParticipantOptions ops
= new WebParticipantOptions()
.setFakeStreamVideoFile(INPUT_VIDEO_FILE)
.setHeadless(useHeadless)
.setLoadTest(useLoadTest);
.setLoadTest(useLoadTest)
.setDisableDecoding(!enableDecoding);

if (useNodeTypes)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@ else if (participantType == ParticipantType.edge)
ops.addArguments("window-size=1200x600");
}

if (options.getDisableDecoding())
{
ops.addArguments("force-fieldtrials=WebRTC-BlackFrameDecoder/Enabled/");
Copy link
Member

@fippo fippo Jul 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beware, the current plan is to enable this as a separate flag for consistency with other decoders:
--use-black-frame-decoder-for-peer-connection
-- will update the webrtc CL description accordingly

}

// starting version 46 we see crashes of chrome GPU process when
// running in headless mode
// which leaves the browser opened and selenium hang forever.
Expand Down
19 changes: 19 additions & 0 deletions src/test/java/org/jitsi/meet/test/web/WebParticipantOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ public class WebParticipantOptions

private static final String PROP_REMOTE = "isRemote";

private static final String PROP_DISABLE_DECODING = "disableDecoding";

/**
* The property to evaluate for parent path of the resources used when
* loading chrome remotely like audio/video files.
Expand Down Expand Up @@ -333,6 +335,15 @@ public WebParticipantOptions setLoadTest(boolean value)
return this;
}

/**
* Sets whether to disable decoding in the browser
*/
public WebParticipantOptions setDisableDecoding(boolean value)
{
setProperty(PROP_DISABLE_DECODING, Boolean.toString(value));
return this;
}

/**
* Sets the name of y4m video file which will be streamed through fake video
* device by participants. The file location is relative to working folder.
Expand Down Expand Up @@ -426,6 +437,14 @@ public boolean getLoadTest()
return Boolean.parseBoolean(getProperty(PROP_LOADTEST));
}

/**
* Whether to disable video decoding in the browser
*/
public boolean getDisableDecoding()
{
return Boolean.parseBoolean(getProperty(PROP_DISABLE_DECODING));
}

/**
* Gets the path to the packet delivery trace file to use for the uplink
* direction in the mahimahi shell.
Expand Down