Results 1 to 3 of 3

Thread: onBeforeScaleFrame and frame rate

  1. Question onBeforeScaleFrame and frame rate

    Hi,

    I am developing a dynamic overlaying module and actually I don't understand what is the relation between the invocation frequency of "onBeforeScaleFrame" and the frame rate of my incoming stream to be transcoded. The generated Javadoc in the Server Side API does not contain a single line of documentation for this API call. (Actually it does so for most of the things..)

    I experimented with different frame rated input H.264 streams and based on my measurements, this method is called every ~120..130ms regardless of the frame rate.

    Please explain why "onBeforeScaleFrame" is not called more frequently for higher frame rated video streams, and what is the exact relation between the invocation rate and the frame rate. The method name would suggest me a one to one relationship.

    Thanks,
    wtb

  2. #2

    Default

    Hi,

    This is called every frame, as it is called each time before it is scaled, hence the name.

    What I would do is make your code as basic as possible to reduce the time it maybe taking for your code to do any additional processing. It is very important any custom code can keep up with the frame rate required.

    Andrew

  3. Default

    Hi Andrew,

    thanks for the quick response. According to your hint, I added a logging to see how long does my method run. Please check this log snipped below, as you can see my method is around 1ms and it is only invoked 7..8 times per second, regardless of the FPS (I tried 10,20,25). As you can see in this particular case the fps was 25.

    What's wrong?

    17:47:18 INFO server comment - LiveStreamPacketizerCupertino.handlePacket[clampexample1/_definst_/myStream_360p][avc1.77.21]: H.264 Video info: {H264CodecConfigInfo: code
    c:H264, profile:Main, level:2.1, frameSize:480x360, displaySize:480x360, frameRate:25.0, PAR:1:1, crop: l:0 r:0 t:0 b:4}
    17:47:18 INFO server comment - LiveStreamPacketizerSmoothStreaming.startStream[clampexample1/_definst_/myStream_360p]
    17:47:18 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:19 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:19 INFO server comment - LiveStreamPacketizerPacketHandler.handlePacket[clampexample1/_definst_/myStream_source]: Video codec:H264 isCompatible:true
    17:47:19 INFO server comment - onBeforeScaleFrame took 1ms
    17:47:19 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:19 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:19 INFO server comment - LiveStreamPacketizerPacketHandler.handlePacket[clampexample1/_definst_/myStream_360p]: Video codec:H264 isCompatible:true
    17:47:19 INFO server comment - LiveStreamPacketizerPacketHandler.handlePacket[clampexample1/_definst_/myStream_160p]: Video codec:H264 isCompatible:true
    17:47:19 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:19 INFO server comment - onBeforeScaleFrame took 1ms
    17:47:19 INFO server comment - onBeforeScaleFrame took 1ms
    17:47:19 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:20 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:20 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:20 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:20 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:20 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:20 INFO server comment - onBeforeScaleFrame took 1ms
    17:47:20 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:21 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:21 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:21 INFO server comment - onBeforeScaleFrame took 1ms
    17:47:21 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:21 INFO server comment - onBeforeScaleFrame took 1ms
    17:47:21 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:21 INFO server comment - onBeforeScaleFrame took 1ms
    17:47:21 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:22 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:22 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:22 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:22 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:22 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:22 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:22 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:22 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:23 INFO server comment - onBeforeScaleFrame took 0ms
    17:47:23 INFO server comment - onBeforeScaleFrame took 1ms

Similar Threads

  1. Replies: 3
    Last Post: 12-05-2013, 05:32 PM
  2. Is it possible to recors with frame rate of 1?
    By rubensd in forum Server-side Modules and Code Samples Discussion
    Replies: 2
    Last Post: 06-10-2013, 07:46 AM
  3. Transcode Frame Rate
    By Moresheth in forum AddOn: Transcoder
    Replies: 2
    Last Post: 05-01-2013, 12:57 PM
  4. Frame Rate Transcoding
    By srlindsey in forum Suggestions
    Replies: 4
    Last Post: 04-29-2012, 01:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •