Coder Social home page Coder Social logo

Comments (6)

secile avatar secile commented on June 19, 2024

Thank you for question.
Since this is only a wrapper library, you have to know about
original openh264 implementation.

Regarding from the article below, time stamp is two frames time interval in ms.
cisco/openh264#2391

And openh264 have rate control flag.
The flags are RC_QUALITY_MODE, RC_BITRATE_MODE, RC_TIMESTAMP_MODE, and so on.
Currentry, in my OpenH264Lib, bit rate control flag is 'RC_QUALITY_MODE'
in Encoder::Setup function.

So, it might be set

base.iRCMode = RC_TIMESTAMP_MODE;

instead of

base.iRCMode = RC_QUALITY_MODE;

If so, my OpenH264Lib have timestamp argument in Encode function,
but it is not work correctry.

from openh264lib.net.

secile avatar secile commented on June 19, 2024

Handling timestamp processing was incorrect.
It seems that I do not have to modify timestamp manually.

I deleted timestamp argument in encode function.
Encode(Bitmap, timestamp) function is obsoleted.
Please use Encode(Bitmap) function instead.

from openh264lib.net.

yaakovyitzchak avatar yaakovyitzchak commented on June 19, 2024

@secile how can I encode frames that were can captured with no set framerate then? I have the timestamps, why was this tribes, how can I get the same functionality, I need to line up the frames with the audio, and they weren't captured at a set framerate

from openh264lib.net.

secile avatar secile commented on June 19, 2024

Hello! You are saying that you have images and audio sampling data with different frame rate? You have images and audios that are not regularly sampled?
Anyway, openh264 requires frame rate parameter, so I think you have to calculate frame rate from timestamps, and you need to complement lacked image.

from openh264lib.net.

yaakovyitzchak avatar yaakovyitzchak commented on June 19, 2024

@secile no that would be impossible since it's not a set rate, I know you had a timestamp parameter before but it was "obsolete", in the original dll there is probably a way to do it

from openh264lib.net.

secile avatar secile commented on June 19, 2024

Encode(bmp, timestamp) overload is obsoleted because it seemed that timestamp value is not effect to output h264 frame data.

As I writed above, My library uses 'RC_QUALITY_MODE'. It may work fine if change the mode to 'RC_TIMESTAMP_MODE'. I don't know it works as you expected, but I will describe how to use timestamp and 'RC_TIMESTAMP_MODE'.
Even thought you use 'RC_TIMESTAMP_MODE', you have to pass fps parameter in Setup(). Set fps as maximum frame rate value.

[Encoder.cpp]
line48: add argument 'float timestamp'.
line60: uncomment the line.
line38: add argument 'float timestamp'.
line42: replace to 'int rc = Encode(ptr, timestamp)'
line24: add argument 'float timestamp'.
line30: replace to 'int rc = Encode(i420, timestamp)'
line18-21:delete lines
line125: replace from 'RC_QUALITY_MODE' to 'RC_TIMESTAMP_MODE'.

[Encoder.h]
line44: add argument 'float timestamp'.
line45: add argument 'float timestamp'.
line46: add argument 'float timestamp'.
line41-42:delete lines

[Your project]
call Encode(bmp, timestamp)
timestamp is two frame time interval in second.

from openh264lib.net.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.