You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to extract frames from a video starting at a specific offset. In the command line, this is typically done using the ss parameter in ffmpeg, e. g.: ffmpeg -ss 333300ms ...
I am wondering if there is an easy way to achieve this using the go-media API available in pkg, or if this functionality is only accessible using the bindings from the sys package?
If possible, could you provide any sample code or guidance on how to implement this using go-media?
Thank you for your assistance!
The text was updated successfully, but these errors were encountered:
Hi Vitalii
Sure the example you want is this one:
https://github.com/mutablelogic/go-media/blob/main/cmd/examples/decode/main.go
The decode method returns a frame from the media file and that has a method
Ts() which returns the current timestamp in seconds so you can ignore
frames up to that point.
It would be more efficient to add a Seek() method to the media file but I
didn't implement that yet.
Let me know if you have any other questions
Hi Vitalii Sure the example you want is this one: https://github.com/mutablelogic/go-media/blob/main/cmd/examples/decode/main.go The decode method returns a frame from the media file and that has a method Ts() which returns the current timestamp in seconds so you can ignore frames up to that point. It would be more efficient to add a Seek() method to the media file but I didn't implement that yet. Let me know if you have any other questions
I reviewed the sample you highlighted, but it's not going to work efficiently for my use case, where I need to capture sets of frames with a specific offset in batches (e.g., from frame N to N + 200, skipping every X frames).
I will likely reuse your bindings for now. Do you have any plans to support ffmpeg7?
Hi not sure the ffmoeg7 API is tons different so it may work. If there are significant differences when you try let me know. When I have some time I can create a seek method for file-based media that objects. In the meantime there might be a packet-based decode function (or I can easily add it) which allows you to skip forward quickly, but otherwise there should be enough sample code in the repo to allow you to use the bindings directly.
Hi,
I need to extract frames from a video starting at a specific offset. In the command line, this is typically done using the
ss
parameter in ffmpeg, e. g.:ffmpeg -ss 333300ms ...
I am wondering if there is an easy way to achieve this using the go-media API available in
pkg
, or if this functionality is only accessible using the bindings from thesys
package?If possible, could you provide any sample code or guidance on how to implement this using go-media?
Thank you for your assistance!
The text was updated successfully, but these errors were encountered: