• SEARCH
  • DOWNLOADS
  • MY ACCOUNT
  • Buy (0)
  • CONTACT
  • Free Trial
Wowza Logo
  • PRODUCTS
  • DEVELOPER
  • SOLUTIONS
  • PRICING
  • RESOURCES
  • SUPPORT
  • My Account
  • Buy (0)
  • SEARCH
  • Ask a question
  • Forums
    • Wowza ClearCaster
    • Wowza Streaming Engine
    • Wowza Streaming Cloud
    • Wowza Player
    • Wowza GoCoder SDK
    • Wowza Developer Dojo
    • Topics
    • Questions
    • Articles
    • Users
    • Badges
  • Sign in
  • Community Home /
  • Wowza Streaming Engine /
  • Wowza Transcoder /
avatar image
Question by Karel Boek-Senior Consultant · Jun 06, 2014 at 08:56 PM · wowza transcoder

GetLiveStreamTranscoderList works, but GetLiveStreamTranscoder returns null

Note: This question has been asked before in http://www.wowza.com/forums/showthread.php?25585-Matching-the-original-stream-while-recording-a-transcoded-stream but was never answered (in the forums)

class StreamListener implements IMediaStreamActionNotify2 {
  // ...
  
  @Override
  public void onPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend) {
    String[] transcoders = stream.getLiveStreamTranscoderList().split(",");
    if (stream.isTranscodeResult() == true) {
      for (String transcoderName : transcoders) {
        getLogger().info("Ingrex SmilFactory: stream " + streamName + " has transcoder: " + transcoderName);
        ILiveStreamTranscoder transcoder = stream.getLiveStreamTranscoder(transcoderName);
        if (transcoder == null)
          break;
        getLogger().info("Ingrex SmilFactory: stream " + streamName + " has source stream: " + transcoder.getStreamName());
      }
    }
  }
}
How can it be that variable transcoderName within the for() loop returns "transcoder" (a valid string that represents the transcoder name), while stream.getLiveStreamTranscoder(transcoderName) returns null?

Wowza Streaming Engine 4.0.3 build 10989
Comment

People who like this

0 Show 0
10 |600 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image

Answer by Andrew Kennedy · Jun 09, 2014 at 02:06 AM

Hi,

I suspect as you are calling it on the transcoded stream, rather than the non transcoded stream. Looking at the API it suggests that this is only available for non transcoded streams.

Andrew.
Comment

People who like this

0 Show 2 · Share
10 |600 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Karel Boek-Senior Consultant · Jun 09, 2014 at 10:14 PM 0
Share
Tried the following code instead; but "transcoder" is still NULL!
@Override
public void onPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend) {
  String[] transcoders = stream.getLiveStreamTranscoderList().split(",");
  if (stream.isTranscodeResult()) 
    return;
  for (String transcoderName : transcoders) {
    getLogger().info("Stream " + streamName + " has transcoder: " + transcoderName);
    ILiveStreamTranscoder transcoder = stream.getLiveStreamTranscoder(transcoderName);
    if (transcoder == null) {
      getLogger().info("Ingrex SmilFactory: sorry, transcoder for stream " + streamName + " is NULL");
      continue;
    }
    getLogger().info("Ingrex SmilFactory: stream " + streamName + " has source stream: " + transcoder.getStreamName());
  }
}
avatar image Andrew Kennedy Karel Boek-Senior Consultant · Jun 13, 2014 at 07:56 AM 0
Share
Hi,

A couple of things

getLiveStreamTranscoder actually requires a stream name, not a transcoder name, documentation could be better and i'll flag that up.

The code

String[] transcoders = stream.getLiveStreamTranscoderList().split(",");

returns all available transcoder named objects, of which 99.9% of the time you will get back transcoder.

So if you do something like

	public void onPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend)
		{
			String[] transcoders = stream.getLiveStreamTranscoderList().split(",");
	
			  // assume streamName is <source>_<rendition>
			if (stream.isTranscodeResult() )
				{
				String sourceStream = streamName.split("_")[0];
				IMediaStream sourceStreamobj = stream.getStreams().getStream(sourceStream);
				for (String transcoderName : transcoders) 
					{
				    getLogger().info("Stream " + streamName + " has transcoder: " + transcoderName);
				    ILiveStreamTranscoder transcoder = sourceStreamobj.getLiveStreamTranscoder(transcoderName);
				    if (transcoder == null) 
				    	{
				    	getLogger().info("Ingrex SmilFactory: sorry, transcoder for stream " + streamName + " is NULL");
				    	continue;
				    	}
				    getLogger().info("Ingrex SmilFactory: stream " + streamName + " has source stream: " + sourceStreamobj.getName()+" transcoder object '"+transcoder);
					}
				}
		}


That should return the getLiveStreamTranscoder although not entirely sure its what you are after.

Andrew.
avatar image

Answer by Karel Boek-Senior Consultant · Jun 13, 2014 at 05:18 PM

I don't see how your code is different from mine, except that you've added a line that splits the streamname on underscore and tries to find the source stream for the transcoded stream. Besides of that, you're still trying to get the ILiveStreamTranscoder object from the source stream, which I already tried in my previous post. However, what your write above the code sample looks controversial to the code sample itself: if getLiveStreamTranscoder takes a streamname, not a transcodername, it would mean that stream.getLiveStreamTranscoder("teststream") would return the ILiveStreamTranscoder instance instead of stream.getLiveStreamTranscoder("transcoder")

My intention is: if I have a transcoded stream, I want to be able to find the source stream from that WITHOUT having to do a split on the streamname. Splitting on underscore is a weak solution; e.g. your sample code will fail if someone uses a streamname "test_stream".
Comment

People who like this

0 Show 1 · Share
10 |600 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Andrew Kennedy · Jun 13, 2014 at 09:31 AM 0
Share
Hi,

Yes you are completely correct. I mis-read both documentation and my testing, unfortunately the problem when trying to do multiple things at the same time.

The object you can only ever get back is the transcoder object, which is not the transcoder object for each stream, but the overall transcoder object inherited.

From a stream you can not determine where the source of the transcoding is.

To determine transcoded streams the simplest way is to use ILiveStreamTranscoderNotify when the transcoding session starts up. You get the source stream and using ILiveStreamTranscoderActionNotify you can then also determine the destination stream name.

I must apologise for the confusion and how you are trying to determine source stream there, wont work from a simple stream object.

Andrew.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

configure Quick Sync accelerated encoding on Linux problem on EC2 1 Answer

Doubt about PassThru on Wowza Transcoder Add-On 1 Answer

Auto redirect encoder to server wi least active transcoding sessions 1 Answer

Live Stream Transcoding output to Multicast 1 Answer

Ip camera video delay after G.711 transcoding 4 Answers

Hot Topics
  • AWS Hosting
  • Mobile SDK
  • Deployment Options
  • Load Balancing
  • Content Security
Product Sign-in
  • Wowza Streaming Cloud
  • Wowza Player
Under the Hood
  • Developer Tools
  • Wowza System Status
  • Test Players
  • Developer IDE
Resellers
  • Find a Reseller
  • Reseller Portal
  • Become a Reseller
Company
  • About Us
  • Blog
  • News
  • Events
  • Careers
  • Customers
  • Partners
  • Contact Us
Stay Connected
Get Monthly Newsletter
Select a Language
  • English
    • English
    • Español
    • 日本語
    • 한국어
    • हिन्दी भाषा
    • 中文
    • русский язык

© 2005–2019 Wowza Media Systems, LLC. All rights reserved.   Terms | Privacy | Trademarks | Legal


Enterprise
Social Q&A

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Forums
  • Wowza ClearCaster
  • Wowza Streaming Engine
  • Wowza Streaming Cloud
  • Wowza Player
  • Wowza GoCoder SDK
  • Wowza Developer Dojo
  • Explore
  • Topics
  • Questions
  • Articles
  • Users
  • Badges