public void onLiveStreamPacketizerCreate(ILiveStreamPacketizer liveStreamPacketizer, String streamName)
{
name = streamName;
System.out.println(name);
liveStreamP = liveStreamPacketizer;
Runnable Meta = new Runnable() {
public void run() {
try {
boolean config = false;
String webServiceMeta = "";
String time = "";
int timing = 1000;
while (true) {
if (!(liveStreamP instanceof LiveStreamPacketizerCupertino))
break;
if (!config){
try{
System.out.println("A iniciar configurações...");
FileInputStream fstream = new FileInputStream("C:\\WOWZA_METADATA_CONFIG.txt");
FileInputStream fstream2 = new FileInputStream("C:\\WOWZA_TIMING_CONFIG.txt");
DataInputStream in = new DataInputStream(fstream);
DataInputStream in2 = new DataInputStream(fstream2);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
BufferedReader br2 = new BufferedReader(new InputStreamReader(in2));
while ((time = br2.readLine()) != null) {
timing = Integer.parseInt(time);
}
in2.close();
System.out.println("Timing da Thread: " + Integer.toString(timing));
while ((webServiceMeta = br.readLine()) != null) {
System.out.println("A ler linha: " + webServiceMeta);
System.out.println("A procurar: " + name + " na linha " + webServiceMeta.substring(0, webServiceMeta.indexOf(":")));
String remove = name + ":";
if(webServiceMeta.substring(0, webServiceMeta.indexOf(":")).contains(name)){
webServiceMeta = webServiceMeta.replaceAll(remove, "");
break;
}
}
in.close();
System.out.println("Configurações terminadas");
System.out.println("Serviço seleccionado: " + webServiceMeta);
config = true;
}
catch (Exception e){
getLogger().info("onStreamCreate: Error: " + e.getMessage());
}
}
LiveStreamPacketizerCupertino cupertinoPacketizer = (LiveStreamPacketizerCupertino)liveStreamP;
ID3V2FrameTextInformation comment_tag= null;
ID3Frames id3HeaderAudio = cupertinoPacketizer.getID3FramesHeaderAudio();
comment_tag = new ID3V2FrameTextInformation("COMM");
comment_tag.setTextEncoding(ID3V2FrameBase.TEXTENCODING_ISO_8859_1);
String metaDataValue = getMetadata(webServiceMeta);
comment_tag.setValue(metaDataValue);
System.out.println("add metadata to ID3Header");
id3HeaderAudio.putFrame(comment_tag);
Thread.sleep(1000L);
}
}
catch (InterruptedException iex) {}
}
};
metaThread = new Thread(Meta);
System.out.println("Thread criada para a stream: " + name);
metaThread.start();
}
if i have smoothstreamingpacketizer on the aplication.xml this only runs once.
<Streams>
<StreamType>live</StreamType>
<StorageDir>${com.wowza.wms.context.VHostConfigHome}/content</StorageDir>
<KeyDir>${com.wowza.wms.context.VHostConfigHome}/keys</KeyDir>
<!-- LiveStreamPacketizers (separate with commas): cupertinostreamingpacketizer, smoothstreamingpacketizer, cupertinostreamingrepeater, smoothstreamingrepeater -->
<LiveStreamPacketizers>cupertinostreamingpacketizer, smoothstreamingpacketizer</LiveStreamPacketizers>
<!-- Properties defined here will override any properties defined in conf/Streams.xml for any streams types loaded by this application -->
<Properties>cupertinostreamingpacketizer, smoothstreamingpacketizer</Properties>
</Streams>
Im streaming live audio can I use the IHTTPStreamerCupertinoVODActionNotify events?
thank you for your time