
A one-month record of identifying and reporting the official Wowza Transcoder CBR bug (ENG-2346), and adjustable VBR settings in Wowza Streaming Engine Transcoder.
Start of digging : Huh? Where is it?
When the writer started to write the transcoder section of the Wowza Streaming Engine(hearafter Wowza), the writer encountered a confusing situation.
Huh? Where is the VBR selection in the transcoding options?
Apart from the early days of handling satellite transmission systems or RealVideo, using VBR (Variable Bit Rate) configurations was almost never necessary. Most of the systems handled so far were based on CBR (Constant Bit Rate). In addition, the main approach has always been to avoid using Wowza’s transcoding feature whenever possible.
That is why, even after using Wowza for such a long period, the absence of a VBR setting went completely unnoticed. (Yeah, true. It’s actually an excuse…)
However, the writer had not seen a system without VBR-CBR selection during worked with countless encoders and transcoders until now. It was a moment of confusion for the writer, who had intended to cover this aspect while writing about the Wowza transcoder.
I knew it! Of course it exists!
The writer started investigation, but could not find significant information about VBR settings. While searching around, the writer eventually found a clue.
Updated transcoder VBR target to peak bitrate range from varying values per-implementation to 110% everywhere
Wowza Streaming Engine release note
I knew it! It’s a transcoder, after all. There’s no way it wouldn’t have a VBR option!Referring to the release notes, the writer contacted Wowza technical support to ask how to change the transcoder’s operating mode, and received a reply a few hours later. The response instructed that, add the following parameters to the transcoder’s template file.
<Parameter>
<Name>mainconcept.bit_rate_mode</Name>
<Value>2</Value> <!-- 0 = CBR, 1 = CQT, 2 = VBR, 3 = TQM -->
<Type>Long</Type>
</Parameter>
Happy about being able to continue the article, the writer added the parameters to the template file. Next, the writer attempted to capture the decoding bitrate in VLC to visually show the difference between CBR and VBR. And then, the real digging began.
The Real Digging: Huh? This Is odd.
What changed?
In a one live application, the writer created two transcoder profiles as follows, and then inputted a 9Mbps UDP Multicast MPEG TS stream.
- Applied 3.65Mbps to the video bitrate of the default Wowza transcoding profile.
- Applied 3.65Mbps to the video bitrate of the default Wowza transcoding profile, and then applied the VBR parameters.
Thinking the settings might have been entered incorrectly, the writer contacted Wowza again with the bitrate data measured by ffprobe
and the transrate.xml
file used. A few days later, a reply with the following content arrived.
I’d also suggest testing with a more dynamic source (fast movement, scene changes, etc.) to give the encoder more reason to vary the bitrate.
The moment the author read the reply, a hunch kicked in: Uh-oh… this won’t be easy.
Open Your Eyes and See!
When someone talking about the content issue, the best answer is a direct visual demonstration. Typically, dynamic content brings to mind things like concerts or sports broadcasts. The writer agrees, but there is another type of content that is just as dynamic: anime featuring transforming magical girls.
The video above is a mosaic version of the capture file sent to Wowza, edited to protect the copyright of the content used for the test. Although it is mosaiced, it is clear that the content is dynamic enough. The VLC information window is displayed below the video.
There are three factors to observe carefully here:
- Input Media Data Size
- This indicates the total amount of data transmitted in the stream. Since the two transcoders are operating with different profiles, the data sizes of the streams should not be identical.
- Input Bitrate Graph
- Because CBR and VBR use different encoding methods, the shapes of their graphs must be different.
- Demuxed Data Size
- This is the size of the data that VLC used for playback from the stream. Again, the sizes of the two streams should not be identical.
Serveral days later, Wowza sent a reply.
…Wowza Streaming Engine’s default behavior already uses VBR encoding. So, unless you’re explicitly changing it to a different mode (like CBR), VBR is the default behavior out-of-the-box….
Okay, Then What Is This?
The writer understands that technical support departments have standard verification factors and procedures. However, from the user’s perspective, the support team’s response can sometimes hard to understand. (The writer still remember Thomson’s first answer about about an encoder output stream issue. ‘Is the encoder grounded?’) What, you think I didn’t even try?
During reading the response, the writer suddenly realized that missed something. Typically, VBR settings requires additional options, usually around three likes,
- Max Bitrate
- The maximum bitrate not exceed
- Min Bitrate
- The minimum bitrate not exceed
- Q-Factor
- Quality factor: The level of image quality to be maintained.
The writer think that, understanding the default values or adjustment methods for these factors would clarify the transcoder’s behavior and support effective CBR implementation. So, along with mentioning that the CBR setting had already been tested in Wowza, the writer sent a reply requesting information about those three values.
The writer received a reply several days later.
..I could replicate the issue you reported… …we currently do not have any documented…Right! this is just the beginning. (Then what on earth have been doing until now?)
The Result of Digging: A Huge Rock
Hidden Parameters for the Transcoder
The next day, an email arrived from Wowza containing details about several options for fine-tuning the transcoder settings. It included explanations on how to modify the following hidden parameters:
- Average bitrate
- Maximum bitrate
- Buffer Size
- Q Factor : I-frame, B-frame, P-frame Quantization
This time, feeling there was something to gain, the writer excitedly applied the new settings and finally succeeded in observing a significant difference.
Encountering a Huge Rock in the End
If so, knowing the initial values for these settings would help in understanding the characteristics of the stream output by the Wowza transcoder, which would be beneficial for writing the article. So, the writer sent this inquiry to Wowza, and got a reply a few days later.
there are no internal defaults applied for these parameters they default to 0.
Furthermore, the reply stated:
I checked with our Product Management team, and they confirmed that this is indeed a bug. I’ve gone ahead and created a bug ticket for it in our internal system
The result of all the tirelessly diligent digging was hitting a huge rock that could no longer be moved with a shovel. Now, it is up to Wowza to remove this rock.
Conclusion and Final Thoughts
It took over a month from the initial question to the offcial bug registration. Although there were moments of frustration, the Wowza representative diligently responded to the writer’s issue over this long period (and is still responding). Regardless of the issue itself, the writer think that Wowza’s technical support is quite good.
Wowza has been used in the field for a long time. Its functionality and stability have been thoroughly verified over many years, and there is no dispute about this.
The writer think that Wowza is fundamentally an origin server and that the transcoding process should be handled by separate, external equipment.
However, this issue is not a critical problem that makes the practical use of Wowza Transcoder impossible. Even now, numerous streams are being delivered through Wowza Transcoder, as the use of CBR in the OTT environment is quite limited. The writer would also have continued using it without noticing the problem, just as before, if not for looking into it more deeply while preparing this blog.
This issue has been officially acknowledged as a bug and assigned the tracking ID ENG-2346. The next step is now up to Wowza to address.
As one of the Wowza users, this writer believes it is enough to have contributed in a small way to improving the program, to have gained deeper knowledge through the process, and to have written a post that may serve as a helpful reference for those who might otherwise waste their thoughts and time on the same issue..