LiTr icon indicating copy to clipboard operation
LiTr copied to clipboard

Increasing Frame Rate?

Open jwcharp opened this issue 1 year ago • 3 comments

@izzytwosheds This library has saved me a significant amount of time. I was on the verge of diving deep into the wormhole of implementing the MediaCodec from scratch, so I truly appreciate your assistance.

I have a query that might seem unusual, but I'm hopeful you might have a solution or at least guide me in the right direction.

Here are the scenarios I'm looking at:

Input: 1920x1080 resolution at 30fps, h264 (video/avc) Output: 1280x720 resolution at 120fps, h264 (video/avc)

Input: 1920x1080 resolution at 60fps, h264 (video/avc) Output: 1280x720 resolution at 120fps, h264 (video/avc)

I understand the frames required for 120fps don't actually exist in the input. However, is there a way to auto-multiply or duplicate the existing frames to achieve this?

Separately, I also have this scenario which I believe is achievable. I'll be working on it over the next few days:

Input: 1920x1080 resolution at 30fps, 40-second video, h264 (video/avc) Output: 1280x720 resolution at 120fps, 10-second video, h264 (video/avc)

For the latter scenario, I assume that by simply setting (MediaFormat.KEY_FRAME_RATE, 120) I can get the desired result. But I'm still not certain about how to approach the first two scenarios mentioned above.

Thanks once again for all your help!

Best regards, Joe

jwcharp avatar Aug 25 '23 21:08 jwcharp

Apologies for delayed response. Happy that you are enjoying LiTr! Can you elaborate why you need to increase the frame rate? As you said, effectively we will have to duplicate frames, so we will be increasing file size without any improvements in visual quality. That is the reason LiTr currently supports only frame rate reduction. But I am happy to learn more about your use case.

izzytwosheds avatar Oct 24 '23 15:10 izzytwosheds

Sorry for the delay response been doing a lot of business travel.

Unfortunately have an issue where some camera manufactures output a 120 FPS video at 30 FPS and 4x time length (mainly DJI drones and cameras) so need to downscale and time remap so the video is 120 fps at 1x time. currently doing ffmpeg to update the container, but though it would be faster and better to have this all done in LiTr.

jwcharp avatar Nov 17 '23 20:11 jwcharp

Hello @izzytwosheds I thought I would not have had issue with this, but I seem to be struggle also with this senario: Input: 1920x1080 resolution at 30fps, 40-second video, h264 (video/avc) Output: 1920x1080 resolution at 120fps, 10-second video, h264 (video/avc)

jwcharp avatar Feb 08 '24 20:02 jwcharp