# Add codec attribute in SMIL file

**URL:** <https://community.wowza.com/t/add-codec-attribute-in-smil-file/46408>\
**Category:** Wowza Streaming Engine\
**Created:** [January 13, 2016, 3:38pm UTC](https://community.wowza.com/t/add-codec-attribute-in-smil-file/46408 "2016-01-13T15:38:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![monica\_fu](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@monica\_fu](https://community.wowza.com/u/monica_fu)\
**Post date:** [January 13, 2016, 3:38pm UTC](https://community.wowza.com/t/add-codec-attribute-in-smil-file/46408/1 "2016-01-13T15:38:04Z")

</div>

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](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.

```auto
<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

---

<div class="post-metadata">

**Author:** ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)\
**Post date:** [January 13, 2016, 7:23am UTC](https://community.wowza.com/t/add-codec-attribute-in-smil-file/46408/2 "2016-01-13T07:23:27Z")

</div>

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.xm**l:

```auto
<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

---

<div class="post-metadata">

**Author:** ![Paul\_Shields](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/paul_shields/32/390_2.png) [@Paul\_Shields](https://community.wowza.com/u/Paul_Shields)\
**Post date:** [January 14, 2016, 3:21pm UTC](https://community.wowza.com/t/add-codec-attribute-in-smil-file/46408/3 "2016-01-14T15:21:49Z")

</div>

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](https://www.wowza.com/docs/how-to-create-and-play-smil-files-with-streams-created-by-wowza-transcoder). This will not work for VOD streams though.

Paul

---

<div class="post-metadata">

**Author:** ![monica\_fu](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@monica\_fu](https://community.wowza.com/u/monica_fu)\
**Post date:** [January 14, 2016, 10:31am UTC](https://community.wowza.com/t/add-codec-attribute-in-smil-file/46408/4 "2016-01-14T10:31:18Z")

</div>

Hi Salvadore,

Thank you for your reply.

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

Single stream:

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

```

Multiple bitrates stream:

```auto
<?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 :

```auto
$ 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 :

```auto
$ 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

---

<div class="post-metadata">

**Author:** ![monica\_fu](https://avatars.discourse-cdn.com/v4/letter/m/c77e96/32.png) [@monica\_fu](https://community.wowza.com/u/monica_fu)\
**Post date:** [January 15, 2016, 12:13pm UTC](https://community.wowza.com/t/add-codec-attribute-in-smil-file/46408/5 "2016-01-15T12:13:14Z")

</div>

Hi Paul,

Thanks anyway.

Regards,

Monica
