Transformer Feature Request: Ability to re-encode with different I-Frame intervals
- Dominant language
- Java
- Stars
- 21.9k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
### Use case description
This is a feature request for the new Transformer library. It would be great to be able to re-encode a video file with a different I-Frame configuration. The I-Frame distance in some codecs is pretty large which can make operations like seeking be fairly slow and inaccurate. Being able to re-encode with more I-Frames could make those operations work better.
### Proposed solution
An additional setter as part of the Builder would be ideal. Something like this, perhaps:
```kotlin
val transformer = Transformer.Builder()
.setContext(context)
.setRemoveAudio(true)
.setOutputMimeType(MimeTypes.VIDEO_MP4)
.setIFrameInterval(5f) //A float value for the config
.build()
```
This would appear to require actually rendering the source frames to a surface and then using that surface for the encoder. However this infrastructure would likely be needed for any resize operation and other related translation operation so it may already be planned.
### Alternatives considered
Right now there aren't many alternatives for this functionality on Android - grafika is one, very old option that comes to mind - so it'd be great to have it here!
Contributor guide
Assessment
This issue has not been assessed yet.