Hey guys,
Some background: I’m building a module designed to automatically create grouped manifest/playlist files for multiple streams. This is very similar to what ngrp: does for grouped streams in the transcoder – but I have specific requirements where I need other streams grouped as well. My approach has been to create an IMediaListProvider module to return the manifest/playlist from a set of renditions within the amlst: namespace.
The question: Given only the name of a live stream, how can I build a rendition object complete with width, height, bitrates and codecs?
The simple way to illustrate the question is in code: What would I write in resolveMediaListRendition()?
package com.wowza.wms.plugin.testing;
import com.wowza.wms.medialist.*;
import com.wowza.wms.util.*;
import com.wowza.wms.module.*;
import com.wowza.wms.stream.*;
import com.wowza.wms.application.*;
import java.util.*;
public class ModuleTestingStreamList extends ModuleBase implements IMediaListProvider {
private IApplicationInstance appInstance = null;
public MediaListRendition resolveMediaListRendition(String streamName) {
// … do stuff to create a MediaListRendition streamRendition from the streamName
…
…
return streamRendition;
}
public MediaList resolveMediaList(IMediaListReader mediaListReader, IMediaStream stream, String streamName) {
MediaList mediaList = new MediaList();
MediaListSegment segment = new MediaListSegment();
mediaList.addSegment(segment);
List streams = this.appInstance.getStreams().getPublishStreamNames();
Iterator streamsIterator = streams.iterator();
while (streamsIterator.hasNext()) {
String renditionStreamName = streamsIterator.next();
segment.addRendition(resolveMediaListRendition(renditionStreamName));
}
return mediaList;
}
public void onAppStart(IApplicationInstance appInstance) {
this.appInstance = appInstance;
this.appInstance.setMediaListProvider(this);
}
}
Thanks,
Steffen