We use Jmeter with the BZM - Streaming Sampler to load test a streaming service. With this we are requesting a dash main.mpd file. That url would look like: https://url.com/5bf9c52c17e072d89e6527d45587d03826512bfa3b53a30bb90ecd7ed1bb7a77/dash/Main.mpd
Within the schema we have defined ContentProtection with value="cenc" as such:
<ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" cenc:default_KID="string" value="cenc"></ContentProtection>
This schema is being auto-generated via a third party code source... So, we do not have much flexibility to change the order... I mention this because with the below schema (from a previous version of the xml generator) Jmeter works perfectly fine:
<ContentProtection value="cenc" schemeIdUri="urn:mpeg:dash:mp4protection:2011" cenc:default_KID="string"/>
The issue we are now facing is that jmeter is throwing this error:
2022-03-14 07:15:40,574 WARN c.b.j.v.c.VideoStreamingSampler: Problem downloading playlist
com.blazemeter.jmeter.videostreaming.core.exception.PlaylistParsingException: Error parsing contents from https://url/5bf9c52c17e072d89e6527d45587d03826512bfa3b53a30bb90ecd7ed1bb7a77/dash/Main.mpd
at com.blazemeter.jmeter.videostreaming.dash.Manifest.fromUriAndBody(Manifest.java:56) ~[jmeter-bzm-hls-3.0.3.jar:?]
at com.blazemeter.jmeter.videostreaming.core.VideoStreamingSampler.downloadPlaylist(VideoStreamingSampler.java:20) ~[jmeter-bzm-hls-3.0.3.jar:?]
at com.blazemeter.jmeter.videostreaming.dash.DashSampler.sample(DashSampler.java:34) ~[jmeter-bzm-hls-3.0.3.jar:?]
at com.blazemeter.jmeter.videostreaming.core.VideoStreamingSampler.sample(VideoStreamingSampler.java:79) [jmeter-bzm-hls-3.0.3.jar:?]
at com.blazemeter.jmeter.hls.logic.HlsSampler.sample(HlsSampler.java:198) [jmeter-bzm-hls-3.0.3.jar:?]
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1285) [ApacheJMeter_http.jar:5.4.1]
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:638) [ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) [ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.4.1]
at java.lang.Thread.run(Thread.java:832) [?:?]
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Undeclared namespace prefix "cenc" (for attribute "default_KID")
at [row,col {unknown-source}]: [5,141]
My question is, can I alter this payload before it is ingested by Streaming Sampler to change the ContentProtection string? Or, can I automatically set the ContentProtection value as "cenc"?
EDIT
After digging through my main.mpd XML I found that the "cenc" namespace was left out. After adding:
xmlns:cenc="urn:mpeg:cenc:2013"
To the file, the main.mpd worked correctly.
CodePudding user response:
It is possible to:
Download the playlist using HTTP Request sampler and Save Responses to a file listener so it would be saved to your local drive. See Performance Testing: Upload and Download Scenarios with Apache JMeter article for more comprehensive instructions if needed
Amend the playlist as needed using JSR223 Sampler or OS Process Sampler
In the bzm - Streaming Sampler use local URL via
file
URI scheme i.e.file:///folder/anotherFolder/playlist.mpd
You can also raise an issue in the plugin repo or if you're a BlazeMeter Customer open a BlazeMeter support ticket