DOKK / manpages / debian 10 / allegro5-doc / al_get_video_frame.3alleg5.en
al_get_video_frame(3alleg5) al_get_video_frame(3alleg5)

al_get_video_frame - Allegro 5 API

#include <allegro5/allegro_video.h>
ALLEGRO_BITMAP *al_get_video_frame(ALLEGRO_VIDEO *video)
    

Returns the current video frame. The bitmap is owned by the video so do not attempt to free it. The bitmap will stay valid until the next call to al_get_video_frame.

Videos often do not use square pixels so the recommended way to draw a video frame would be using code like this:

float scale = 1.0; /* Adjust this to fit your target bitmap dimensions. */
ALLEGRO_BITMAP* frame = al_get_video_frame(video);
float sw = al_get_bitmap_width(frame);
float sh = al_get_bitmap_height(frame);
float dw = scale * al_get_video_scaled_width(video);
float dh = scale * al_get_video_scaled_height(video);
al_draw_scaled_bitmap(frame, 0, 0, sw, sh, 0, 0, dw, dh, 0);
    

5.1.0

al_get_video_scaled_width(3alleg5), al_get_video_scaled_height(3alleg5)

Allegro reference manual