Ask an FMS Guru #14: Is it possible to add metadata to a live video stream?
A rather interesting question today on metadata for FLV files recorded live with FMS.
The question: Is it possible to add metadata to a live video stream?
The answer:
Unfortunately, no. Neither FCS or FMS allow you to add metadata to a stream as you are recording it.
But, I think I get where this person is coming from and what they may want to do. Most of the time you would use the metadata to add in certain information like the length of the stream, size, subject etc. When you play an FLV you can get that metaData when the player first starts playing the video. FMS already adds in some info like the length and size but you can't add in your own personal info, which is what I am assuming the writer of this question would like to do.
In this case, I recommend using the NetStream's send() method. This will allow you to "embed" a call to a function that you set later in the player for the FLV file.
So, for example, when you start publishing:
myNS.publish("someRecording", "record);
Then make a send() call on it:
myNS.send("onMyMetaData", "This is a really cool video");
What this will do is call a function on the NetStream in the player when you set it. So you are setting it here in the first second or so. Before the player plays this video, create the function to handle that:
myNS.onMyMetaData = function(msg){
trace("myMetaData: " + msg);
}
and play it:
myNS.play("someRecording");
and you should see the data you "embedded" into the FLV file. This will work whether you play the video progressively or streaming with FMS.
Hope that helps a bit.
Posted by Graeme at September 21, 2006 08:20 AM