Add codec attribute in SMIL file

Hi,

I’m using Wowza Streaming Engine 4.3 and want to get CODEC info in HLS stream.

I’ve tried the way in the following page and it works.

https://www.wowza.com/docs/how-to-add-resolution-and-codec-metadata-to-ios-streams

However I need to change SMIL file and add following statements in the file.

<param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
<param name="videoCodecId" value="avc1.66.30" valuetype="data"/>

I was wondering that is there a way to not add these info in SMIL file but just change the config file to achieve this? As I can get the codec info when I CURL a MP4 file stream link.

Thanks,

Monica

Hello Monica,

If you just want to add this metadata to single streams (Non ABR Streams) you can add these properties to the HTTPStreamer/Properties container in [install-dir]/conf/[application]/Application.xml:

<Property>
	<Name>cupertinoCalculateCodecs</Name>
	<Value>true</Value>
	<Type>Boolean</Type>
</Property>
<Property>
	<Name>cupertinoCalculateResolution</Name>
	<Value>true</Value>
	<Type>Boolean</Type>
</Property>

Only if you are adding this metadata to adaptive bitrate streams will you need to modify the SMIL file.

Perhaps I misunderstood your question? If so can you please clarify?

Thank you,

Salvadore

Hi,

no there is no way without custom modification to retrieve the codec info via HTTP fetches of the smil URL. It is possible to generate a smil file for an active live transcoded stream as shown here. This will not work for VOD streams though.

Paul

Hi Salvadore,

Thank you for your reply.

I do need to add “CODEC” in both single streams and multi bitrate streams.

Single stream:

<?xml version="1.0"?>
<smil>
        <head/>
        <body>
                <switch>
                        <video src="sample.mp4" system-bitrate="1500000"/>
                </switch>
        </body>
</smil>

Multiple bitrates stream:

<?xml version="1.0"?>
<smil>
        <head/>
        <body>
                <switch>
                        <video src="sample1.mp4" system-bitrate="100000"/>
                        <video src="sample2.mp4" system-bitrate="200000"/>
                        <video src="sample3.mp4" system-bitrate="400000"/>
                        <video src="sample4.mp4" system-bitrate="500000"/>
                        <video src="sample5.mp4" system-bitrate="800000"/>
                        <video src="sample6.mp4" system-bitrate="1000000"/>
                        <video src="sample7.mp4" system-bitrate="1200000"/>
                        <video src="sample8.mp4" system-bitrate="1500000"/>
                        <video src="sample1.mp4" system-bitrate="24000">
                                <param name="audioOnly" value="TRUE" valuetype="data"/>
                        </video>
                </switch>
        </body>
</smil>

I’ve change the config so I can get “CODEC” by CURL direct mp4 stream :

$ curl 'http://[HOSTNAME]/vod/mp4:sample.mp4/playlist.m3u8'
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=868638,CODECS="avc1.66.21,mp4a.40.2",RESOLUTION=512x288
chunklist_w1275854034.m3u8

But if I CURL the SMIL stream, I can’t get that information. Like I curl the single bitrate SMIL I listed before :

$ curl 'http://[HOSTNAME]/vod/smil:sample.smil/playlist.m3u8'
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=1500000
chunklist_w2025619132_b1500000.m3u8

So is there a way for wowza engine to get ‘CODEC’ showed without changing SMIL file?

Thanks,

Monica

Hi Paul,

Thanks anyway.

Regards,

Monica