nathanbabcock / ffmpeg-sidecar

Wrap a standalone FFmpeg binary in an intuitive Iterator interface. 🏍
MIT License
238 stars 16 forks source link

Would it be possible to include the frame timestamp in `OutputVideoFrame`? #1

Closed avsaase closed 1 year ago

avsaase commented 1 year ago

First, I want to thank you for making this crate. ffmpeg is a powerful tool but it can be a major pain to work with, especially via the rust bindings available in many crates. Dealing with the CLI is slightly better but still far from ergonomic. This crate makes it so much better!

I was wondering if ffmpeg emits the frame timestamp when outputting rawvideo, and if so if this data can be captured and included in OutputVideoFrame. I'm using your library to overlay images on top off the video frames and for aligning the images and the video frame it be a lot easier if I had access to each frame's timestamp. The Progress(FfmpegProgress) event does not get emitted for every decoded frame so it's not usable for this purpose.

nathanbabcock commented 1 year ago

Hey @avsaase. Great suggestion. I'll make a PR for this feature later this week. After that you can let me know if it works for your use case.