Wowza Community

ID3 Tags server side

Hello,

I have a rtmp encoder to publish live stream and I’m trying to inject meta-data on server side and send stream to iOS and Android.

i configured my server like this toturial

is it possible to use your id3 tags lib to send meta-data and the stream to all players? flash, ios, android?

Best regards,

Luís

Flash will work of course, and Android 2.2+ supports Flash. RTSP is not supported. iOS support for this using ID3 tags is not documented yet.

Richard

Yes, no problem. Add “cupertinostreamingpacketizer” to enable live streaming to iOS devices. It does not preclude other output (rtmp or rtsp)

Richard

I think it will depend on the key frame frequency and length of each chunk

Richard

How is this going? Do you have a handle on the client/device side of this? I was reading this inconclusive thread:

http://stackoverflow.com/questions/5085677/extracting-id3-tags-from-mp3-over-http-live-streaming

Richard

I’m not real clear on what you are asking and what the problem is. I don’t think live audio will trigger IHTTPStreamerCupertinoVODActionNotify events.

Richard

I created a module to add id3 tag for ios. The original application.xml looks like this:

		<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></LiveStreamPacketizers>			
			<!-- Properties defined here will override any properties defined in conf/Streams.xml for any streams types loaded by this application -->
			<Properties>
			</Properties>
		</Streams>
		<!-- HTTPStreamers (separate with commas): cupertinostreaming, smoothstreaming -->
		<HTTPStreamers>cupertinostreaming,smoothstreaming</HTTPStreamers>	

Can i add the cupertinostreamingpacketizer only to the LiveStreamPacketizers? will this change the other streams(rtmp and rstp) performance?

thanks

Thank you.

I have another doubt. Can i update ID3 tags every second?

LiveStreamPacketizerCupertino cupertinoPacketizer = (LiveStreamPacketizerCupertino)liveStreamPacketizer;
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);

if i execute this every second will the metadata sent to client be updated?

Thank you,

Im still trying to extract the ID3 tag in the client.

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