elixir-webrtc / xav

Elixir wrapper over FFmpeg for reading and decoding audio and video data
Apache License 2.0
39 stars 4 forks source link

Add seeking #14

Closed kevinschweikert closed 1 month ago

kevinschweikert commented 1 month ago

Hey, I saw this in you TODO issue #1 and could need it myself. I've never written any C code, so I probably made some mistakes, but I hope this will help with some improvements.

I added a function to seek to a time in seconds, which will seek the reader. Additionally, I've added the frame rate to the Reader struct, so the user can use this information for further calculations

kevinschweikert commented 1 month ago

@mickel8 thank you very much for your feedback! I finally figured it out how to seek to the correct timestamp. See my comment. I've addressed almost all the comments and we just have to agree on the time_base calculation 😄

mickel8 commented 1 month ago

Perfect, thanks a lot! If we could just add a comment explaining what happens in timestamp calculation, we are ready to merge!

mickel8 commented 1 month ago

Merged, thank you!