Next Page

Page: 1

Previous Page

Thread: MetaData of recorded streams - problem...

Created on: 02/02/10 01:26 PM

Replies: 3

MareleSef





Joined: 02/02/10

Posts: 3

MetaData of recorded streams - problem...
02/02/10 1:26 PM

Hello guys,

I have a problem with recorded stream: The MetaData its partialy correct.

Most of the informations are correct, but the 2 most important information for me width and height for the video are always 320 x 240 for any recorded stream althow they are published at different WxH.

I tried to get my head around this but cant seem to figure out were the problem is.

FMLE its used to publish the stream useing H.264 / MP3 codecs.
Here is the server side code used to record the stream:

    _isLive = true;   
    if ( _isRecording == false ) {


        function ISODateString(d){               
            function pad(n){return n<10 ? '0'+n : n}               
            return d.getFullYear()
              + pad(d.getMonth()+1)
              + pad(d.getDate())
              + pad(d.getHours())
              + pad(d.getMinutes())
              + pad(d.getSeconds())
        }
           
        var d = new Date();
        livefilename = streamname.name + "_" + ISODateString(d);
           
        s = Stream.get("mp4:"+livefilename + ".f4v");
           
        if(s) {
            s.record();
            s.play(streamname.name);
            _isRecording = true;
            trace("Recording: " + livefilename);
        }

Link | Top | Bottom

Graeme



Graeme's Gravatar

Joined: 10/18/07

Posts: 1107

RE: MetaData of recorded streams - problem...
02/02/10 3:44 PM

Not sure what to suggest if they metadata is incorrect.. FLVMDI is a good solution I think.

Link | Top | Bottom

MareleSef





Joined: 02/02/10

Posts: 3

RE: MetaData of recorded streams - problem...
02/03/10 2:41 AM

Ty for you replay Graeme, and also for the time invested in the grate FMS tutorials you have shared with the world.

Regarding the above issue FLVMDI can help but this will require human intervention. Or a server side code to call and run the command line for it. This both seem last resort solutions. Ideally idd like to be able to have correct metadata recorded on the fly.

Has anybody else encountered this problem, or did anybody had a positive experience with the metadata on recorded stream, like being able to retrieve the correct W x H metadata? If so what encoder do you use? I find this 2 information vital for the video player that i build.

There seem to be 2 leads on this matter:

http://kb2.adobe.com/cps/407/kb407850.html - Flash Media Live Encoder does not currently support F4V custom metadata - but this seem not to refer to standard FMLE metadata's

http://www.sti-media.com/blog/archives/000072.html - Sorenson Squeeze 4 problem - it doesn't put the right H x W metadata. But here i am not sure if FMLE is useing this encoder so it may have nothing to do with the subject.

Link | Top | Bottom

MareleSef





Joined: 02/02/10

Posts: 3

RE: MetaData of recorded streams - problem...
02/08/10 2:24 AM

OK problem solved.

So for anybody that experience the same problem, here is the conclusion:

Problem:
Server side recorded streams have wrong width and height metadata if you use the following code

s.play(streamname.name);
s.record();

in the same function. You always get 320x240 if you call both play() and record() inside the same function, even more then that you need a delay of at least 50-100 ms betwine play() and record() to actualy get the right width and height metadata's.

Solution:
I have used setInterval() to call record() at least 50-100 ms after i call play(). Here is the code I used

var recIntervalID;

function rec(s){
    clearInterval(recIntervalID);
    s.record();
}

...{
...
     s.play(streamname.name);              
     recIntervalID = setInterval(rec,5000,s);
}

This way u are sure u get metadata populated with the right information.


Yes i have used a delay of 5000 ms becouse of another interesting behaviour. It seems that MetaData its actualy added to a recording stream after second 4. If you call Stream.getOnMetaData() in the first 4 seconds after you start recording you get nothing back. Only at about 5 seconds after record() you get something back for Stream.getOnMetaData(). So becouse i announce all clients when i start a live stream recording i chose to do it after the first 5 sec of recording so the moment they start playing client side the stream they receive onMetaData almost instantly.

Link | Top | Bottom

New Post

Please login to post a response.