gtk - playing a video by retrieving and manipulating frame by frame: is creating a new pixbuf at every frame the way to go or is there an easier way? -
using python3, gtk3. working on computer vision application needs manipulate , display (playback) frames video.
currently, create new pixbuf
static method new_from_data
, fed sequence of bytes created numpy array contained manipulated frame, , having performance problems, such not being able play video @ 20fps.
i wonder: way go kind of problem? creating new pixbuf every frame relatively cheap or expensive? should use other methods, such using new_from_stream
? (not familiar it)
this not "easier" way, if you're having performance issues, should try using clutter via clutter-gtk use hardware acceleration draw frames.
you can create gtkclutterembed widget, give clutterstage clutteractor. everytime have new frame, can create new clutterimage , clutter_image_set_data() (which new_from_data pixbuf) , set cluttercontent of clutteractor (eg: clutterstage) new clutterimage.
this how gnome-ring plays video, can take @ source code here inspiration.
Comments
Post a Comment