安卓ĴcodeC:如何设置帧率 [英] android jcodec: how to set frame rate

查看:357
本文介绍了安卓ĴcodeC:如何设置帧率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组图片,我想生成一个幻灯片,视频文件。我使用j个codeC。当我烯code进行帧,是否有可能以指定该帧必须被示出关于特定量的时间(例如1秒)

I have a set of images and I would like to generate a slideshow as a video file. I am using jcodec. When I encode a frame, is it possible to specify that that frame has to be shown for a certain amount of time (eg. 1 sec)?

推荐答案

是的,这是可能的指定帧的时间。它在 https://github.com/解释ĴcodeC / J codeC /问题/ 21#issuecomment-23095738

Yes,It's possible to specify the time for the frame. It's explained in 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
)

这篇关于安卓ĴcodeC:如何设置帧率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆