Jmeter - bzm 流式采样器内容保护

Jmeter - bzm Streaming Sampler Content Protection

我们使用 Jmeter 和 BZM - Streaming Sampler 来加载测试流服务。有了这个,我们请求破折号 main.mpd 文件。 url 看起来像: https://url.com/5bf9c52c17e072d89e6527d45587d03826512bfa3b53a30bb90ecd7ed1bb7a77/dash/Main.mpd

在架构中,我们定义了 value="cenc" 的 ContentProtection:

<ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" cenc:default_KID="string" value="cenc"></ContentProtection>

此架构是通过第三方代码源自动生成的...因此,我们没有太多的灵活性来更改顺序...我提到这一点是因为使用以下架构(来自以前版本的xml 生成器)Jmeter 工作得很好:

<ContentProtection value="cenc" schemeIdUri="urn:mpeg:dash:mp4protection:2011" cenc:default_KID="string"/>

我们现在面临的问题是 jmeter 抛出这个错误:

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]

我的问题是,我能否在流式采样器摄取此负载以更改 ContentProtection 字符串之前更改它?或者,我可以自动将 ContentProtection 值设置为“cenc”吗?

编辑

通过我的 main.mpd XML 挖掘后,我发现“cenc”命名空间被遗漏了。添加后:

xmlns:cenc="urn:mpeg:cenc:2013"

对于文件,main.mpd 工作正常。

可以:

  1. 如果需要,请使用 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 文章下载播放列表以获得更全面的说明

  2. 根据需要使用 JSR223 Sampler or OS Process Sampler

    修改播放列表
  3. bzm - Streaming Sampler 中通过 file URI scheme 使用本地 URL 即

    file:///folder/anotherFolder/playlist.mpd 
    

你也可以raise an issue in the plugin repo or if you're a BlazeMeter Customer open a BlazeMeter support ticket