# Custom module to create single frame snapshots of live and VOD stream

**URL:** https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38
**Category:** Wowza Streaming Engine
**Created:** [November 7, 2007, 7:44am UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38 "2007-11-07T07:44:04Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)
#### Post date: [November 6, 2009, 8:03am UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/21 "2009-11-06T08:03:15Z")

</div>

What do you see in the logs when you click the button? Please provide detail in how things are setup.

Charlie

---

<div class="post-metadata">

### Author: ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)
#### Post date: [November 16, 2009, 4:11am UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/22 "2009-11-16T04:11:45Z")

</div>

What version of Wowza Media Server are you building the code against? It needs to be the latest 1.7.2.

Charlie

---

<div class="post-metadata">

### Author: ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)
#### Post date: [July 20, 2010, 4:24pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/23 "2010-07-20T16:24:06Z")

</div>

I don’t know why ffmpeg cannot create a thumbnail. The Extremists.m4v file is an MP4 container (QuickTime container) formatted file. There are many file extensions used with the MP4 container. The extension doesn’t really matter. The common extensions are: mp4, m4v, m4a, mov. There are many more.

There is a new version of the Extremists video in the latest installer. We had a problem with the encoding params on the previous one. You can try unisntalling and re-installing 2.1.2 to get the latest sample movie.

Charlie

---

<div class="post-metadata">

### Author: ![Martin\_Bak](https://avatars.discourse-cdn.com/v4/letter/m/db5fbb/32.png) [@Martin\_Bak](https://community.wowza.com/u/Martin_Bak)
#### Post date: [November 20, 2007, 2:02pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/24 "2007-11-20T14:02:33Z")

</div>

Is it possible to convert the one frame snapshot to a JPEG at the moment? If it is, please tell me how! 🆒

---

<div class="post-metadata">

### Author: ![Frank\_Neznamy](https://avatars.discourse-cdn.com/v4/letter/f/b5e925/32.png) [@Frank\_Neznamy](https://community.wowza.com/u/Frank_Neznamy)
#### Post date: [February 11, 2010, 5:41pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/25 "2010-02-11T17:41:35Z")

</div>

Richard, could you please tell me how to implement this timer to the IMediaStreamActionNotify? The snapshots now work after the event is dispatched but I cannot seem to figure out how to make the Timer class work.

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [April 27, 2009, 1:06pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/26 "2009-04-27T13:06:10Z")

</div>

Markus,

It is [here](http://community.wowza.com/t/-/38) first page of this post.

Some forum posts like this have multiple pages, there are numered links to all the pages on top and bottom.

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [November 9, 2009, 3:29pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/27 "2009-11-09T15:29:40Z")

</div>

JW player recent versions are Actionscript 3 and that snip is Actionscript 2.

It should be something like this:

> private function snapshot():void
> 
> {
> 
> var resultObj:Object = new Object();
> 
> resultObj.onResult = function(fileName:String):void
> 
> {
> 
> trace("result: "+fileName);
> 
> }
> 
> nc.call(“createSnapshotLive”, null, new Responder(resultObj.onResult));
> 
> }
> 
> doSnapshot.addEventListener(MouseEvent.CLICK,snapshot);
> 
> Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [February 4, 2010, 7:55pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/28 "2010-02-04T19:55:14Z")

</div>

Without some input from a user, it would have to be done on a timer.

But have you tried it with FMLE? If you know the name of the stream and you are connected to the same application, calling this function from Flash app while FMLE is publishing should work.

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [February 5, 2010, 11:03am UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/29 "2010-02-05T11:03:35Z")

</div>

Yes, you can setup the IMediaStreamActionNotify interface, then use onPublish event handler to start a timer on the server. The timer would run the snapshot code instead of user action from Flash app.

IMediaStreamActionNotify:

[http://community.wowza.com/t/-/242](http://community.wowza.com/t/-/242)

Java Timer:

[https://www.wowza.com/forums/showthread.php?t=4219](https://www.wowza.com/forums/showthread.php?t=4219)

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [February 12, 2010, 1:38am UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/30 "2010-02-12T01:38:46Z")

</div>

Take a look at this example:

[http://community.wowza.com/t/-/243](http://community.wowza.com/t/-/243)

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [July 20, 2010, 11:25pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/31 "2010-07-20T23:25:52Z")

</div>

Wowza normally records with .flv extension, unless you using “mp4:” prefix in the stream name.

I don’t know the answer to the ffmpeg question.

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [July 21, 2010, 4:07pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/32 "2010-07-21T16:07:15Z")

</div>

To record this kind of stream to mp4 container, you would use “mp4:” prefix with the stream name in Stream Manager.

If you don’t use mp4: prefiix Wowza will record to flv container with .flv extension.

It would be better to use the mp4: prefix so Wowza records to mp4 container.

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [July 21, 2010, 4:59pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/33 "2010-07-21T16:59:40Z")

</div>

The Wowza recording will have an .mp4 extension.

JW Player can play videos with mp4 or m4v extension. You should use the mp4: prefix in the “file” Flashvar.

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [July 22, 2010, 5:18pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/34 "2010-07-22T17:18:46Z")

</div>

Here is an example of iterating over the files in the content folder:

[http://community.wowza.com/t/-/237&page=3#22](http://community.wowza.com/t/-/237&page=3#22)

The ffmpeg command has to run on the server. So you would have to install ffmpeg on the server.

You could initiate from the client with NetConnection.call(serversideFunctionName), for example:

netconnection.call(“doFiles”);

You have to create an appllcation module with a “doFiles” method that iterates over the files in content folder and runs ffmpeg.

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [July 26, 2010, 2:35pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/35 "2010-07-26T14:35:19Z")

</div>

To call a function from a client with a netconnection, you have to use a Flash application. There is a great working reference for this in the Wowza install-dir example folder: ServerSideModules. This includes a Flash application and server-side module and shows just about every way to communicate and pass data between Flash and Wowza.

To interface with Wowza from an application server like .net using a server page like aspx, you need a HTTProvider. This is a good starting place for that:

[http://community.wowza.com/t/-/245](http://community.wowza.com/t/-/245)

There are other HTTProviders that might be useful reference in the same forum section:

[http://community.wowza.com/c/-/10](http://community.wowza.com/c/-/10)

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [July 27, 2010, 1:33pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/36 "2010-07-27T13:33:05Z")

</div>

I showed you the example we have for that already, “ModuleVideoNameList” This one:

[http://community.wowza.com/t/-/237&page=3#22](http://community.wowza.com/t/-/237&page=3#22)

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [August 2, 2010, 8:42pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/37 "2010-08-02T20:42:37Z")

</div>

This is an AS3 version. If you are using Flex, you an use the Bindable ArrayCollection with a ComboBox. In Flash CS you can change it to an Array

```auto
netconnection.call("getVideoNames",new Responder(videoNamesHandler));
[Bindable]
privat var recordedStreamsDP = new ArrayCollection();
private function videoNamesHandler(results:Object):void
{	
for( var item:String in results ) 
{
	var obj:ObjectProxy = new ObjectProxy(); // In Flex use ObjectProxy to populate Bindable ArrayCollection.
	obj.label = results[item];
	obj.value = item;
	recordedStreamsDP.addItemAt(obj,0);    
}
}

```

This should work in Flash AS3 or AS2:

```auto
var result:Object = new Object();
result.onResult = function(results:Object)
{
  for( var item:String in results ) 
{
	trace(results[item]);
	trace(item);
}  
}
netconnection.call("getVideoNames", result);

```

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [August 2, 2010, 8:57pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/38 "2010-08-02T20:57:37Z")

</div>

You can’t use an Application module with .net. You can use a HTTProvider or a Web Service. But this code could be made to work in a HTTProvider and output xml instead of returning an object. You would have to tell it what application is involved.

Since you will be passing data in, start with this post:

[http://community.wowza.com/t/-/245](http://community.wowza.com/t/-/245)

And since you will be building xml output, you can look at this post for reference:

[https://www.wowza.com/forums/showthread.php?t=597](https://www.wowza.com/forums/showthread.php?t=597)

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [August 2, 2010, 10:02pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/39 "2010-08-02T22:02:25Z")

</div>

I really don’t have that exact thing. These are all the pieces, you just have to mix them together. The IDE has a Wizard for creating a new HTTProvider. The code in that module will work in a HTTProvider, except that where the Application is part of the context of a Module you will have to pass in the Application name and get a reference to it, there are examples of that in the HTTProvider examples.

Looks like I pasted in the wrong example for the 2nd link. I meant to give you this one:

[http://community.wowza.com/t/-/60](http://community.wowza.com/t/-/60)

Richard

---

<div class="post-metadata">

### Author: ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)
#### Post date: [August 4, 2011, 6:41pm UTC](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38/40 "2011-08-04T18:41:47Z")

</div>

If you mean a snapshot of a stream as in that post, that’s what we have for that purpose.

Richard

[Previous page](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38.md?page=1)

[Next page](https://community.wowza.com/t/custom-module-to-create-single-frame-snapshots-of-live-and-vod-stream/38.md?page=3)
