-
I want to manipulate frame images directly from go. I know ffmpeg has a filter feature, but this time I want to manipulate the frame directly. How can I do this? It seems to me that a function like |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
For now you can "export" the frame's data to a Go image and manipulate it, but you can't "save" your manipulations to a |
Beta Was this translation helpful? Give feedback.
-
@kurochan I've created the branch frame-data-write with the following:
Bare in mind that the developer is responsible for handling the writability of the frame. For that, I've added
I'm not sure I've implemented the most efficient way to do this but I couldn't think of a better way. Also, memory management shouldn't be a problem, but for those features only time can tell 😬 Could you try this new branch and let me know whether this work as expected? If so, I'll merge it in |
Beta Was this translation helpful? Give feedback.
-
Implemented at v0.22.0 🎉 |
Beta Was this translation helpful? Give feedback.
@kurochan I've created the branch frame-data-write with the following:
FrameData
.SetBytes(b []byte, align int) error
which allows you to copy a buffer inside a frame's dataFrameData
.FromImage(src image.Image) error
which allows you to copy a Goimage.Image
inside a frame's dataBare in mind that the developer is responsible for handling the writability of the frame. For that, I've added
Frame
.MakeWritable()
Frame
.IsWritable()
I'm not sure I've implemented the most efficient way to do this but I couldn't think of a better way. Also, memory management shouldn't be a problem, but for those features only time can tell 😬
Could you try this new branch and let me know whether this work as e…