gpt4 book ai didi

android jcodec : how to set frame rate

转载 作者:行者123 更新时间:2023-11-29 00:25:10 26 4
gpt4 key购买 nike

我有一组图像,我想将幻灯片生成为视频文件。我正在使用 jcodec。当我对帧进行编码时,是否可以指定该帧必须显示一定时间(例如 1 秒)?

最佳答案

是的,可以指定帧的时间。在 https://github.com/jcodec/jcodec/issues/21#issuecomment-23095738 中进行了解释

     new MP4Packet(
result, // Bytebuffer that contains encoded frame
i, // Presentation timestamp ( think seconds ) expressed in timescale units ( just multiply second by
// timescale value below. This is to avoid floats.
// Example: timescale = 25, pts = 0, 1, 2, 3, 4, 5 .... ( PAL 25 fps )
// Example: timescale = 30000, pts = 1001, 2002, 3003, 4004, 5005, 6006, 7007 ( NTSC 29.97 fps )
timescale, // See above
1, // Duration of a frame in timescale units ( think seconds multiplied by number above)
// Examlle: timescale = 25, duration = 1 ( PAL 25 fps )
// Example: timescale = 30000, duration = 1001 ( NTSC 29.97 fps )
frameNo, // Just a number of frame, doesn't have anything to do with timing
true, // Is it an I-frame, i.e. is this a seek point? Players use this information to instantly know where to seek
null, // just ignore, should be null. This is used by the older brother of MP4 - Apple Quicktime which supports
// tape timecode
i, // just put the same as pts above
0 // sample entry, should be 0
)

关于android jcodec : how to set frame rate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20221836/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com