# How do i get the file name after streaming stopped?

**URL:** <https://community.wowza.com/t/how-do-i-get-the-file-name-after-streaming-stopped/54375>\
**Category:** Wowza Streaming Engine\
**Created:** [December 26, 2019, 12:26pm UTC](https://community.wowza.com/t/how-do-i-get-the-file-name-after-streaming-stopped/54375 "2019-12-26T12:26:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![prashant\_jha1](https://avatars.discourse-cdn.com/v4/letter/p/71e660/32.png) [@prashant\_jha1](https://community.wowza.com/u/prashant_jha1)\
**Post date:** [December 26, 2019, 12:26pm UTC](https://community.wowza.com/t/how-do-i-get-the-file-name-after-streaming-stopped/54375/1 "2019-12-26T12:26:11Z")

</div>

Hi,

I want get the file name after streaming ended and saved in the **content** folder.

Every time the filename increased by \_+1. So how do get that name?

Thanks

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [December 26, 2019, 4:41pm UTC](https://community.wowza.com/t/how-do-i-get-the-file-name-after-streaming-stopped/54375/2 "2019-12-26T16:41:10Z")

</div>

Was this for nDVR recording or an mp4 to play back as VOD @prashant jha?

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [December 26, 2019, 6:10pm UTC](https://community.wowza.com/t/how-do-i-get-the-file-name-after-streaming-stopped/54375/3 "2019-12-26T18:10:59Z")

</div>

You are correct @prashant jha, Wowza Streaming Engine appends \_[_SegmentNumber_] to the end of the file name of the current recording as needed to create a unique file name. This is done incrementally for the group of files that belong to the same recording session:

myStream\_2014-02-11-13.18.01.441-MST\_0.mp4Oldest recordingmyStream\_2014-02-11-13.18.01.441-MST\_1.mp4myStream\_2014-02-11-13.18.01.441-MST\_2.mp4Newest recording

* * *

To get the names please see the following article and I have shared some examples below:

[https://www.wowza.com/docs/how-to-record-live-streams-wowza-streaming-engine#setfiletemplate](https://www.wowza.com/docs/how-to-record-live-streams-wowza-streaming-engine#setfiletemplate)

_The default delegate allows you to specify a template string that defines the filenames of the recorded segments._

- public void setFileTemplate(String template) - Enables a custom filename template string to be specified.
- public String getFileTemplate() - Returns the current filename template string.

_The template string can contain any valid filename characters as well as any valid template key, in any order._

These strings are for used with:

- Start Recording Segment By Size
- Start Recording Segment By Duration
- Start Recording Segment By Schedule

_Valid template keys are:_

- _${SourceStreamName}_ - The name of the live stream.
- _${SegmentNumber}_ - An incrementing value that represents the current number of recorded segments that have been created for this live stream, starting at 0.
- _${RecordingStartTime}_ - The time at which the recording was started.
- _${SegmentTime}_ - The time at which the recorded segment was created.

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [December 26, 2019, 6:11pm UTC](https://community.wowza.com/t/how-do-i-get-the-file-name-after-streaming-stopped/54375/4 "2019-12-26T18:11:34Z")

</div>

Let me know if that is what you needed…
