---
name: "al_open_video_f"
section: "3"
platform: "linux"
package: "allegro"
version: "5.2.11.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/al_open_video_f"
---

# al\_open\_video\_f(3)

Allegro 5 API

## NAME

al\_open\_video\_f - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro_video.h>
  ALLEGRO_VIDEO* al_open_video_f(ALLEGRO_FILE *fp, const char *ident)
  ```

## DESCRIPTION

Opens a video file from an existing `ALLEGRO_FILE*` using the Allegro file interface system. This allows videos to be loaded from custom sources such as memory streams, virtual file systems, archives, or any other source supported by a custom `ALLEGRO_FILE_INTERFACE`.

**Parameters:**

- •

  `file`: A pointer to an `ALLEGRO_FILE` object. Ownership of this file is transferred to the video object; the file will be closed automatically when `al_close_video` is called.

**Returns:** A pointer to a new `ALLEGRO_VIDEO` object if successful, or `NULL` on failure.

**Remarks:**

- •

  The function does **not** require the file to be seeked or rewound; it reads from the current position.

- •

  After calling `al_open_video_f`, you must not manually close the `ALLEGRO_FILE`; call `al_close_video` to free all associated resources.

- •

  This function mirrors the behavior of other `_f` variants in the Allegro API, enabling video streaming from custom file systems.

**Example:**

-

  ```
  ALLEGRO_FILE *f = al_fopen("video.ogv", "rb");
  if (f) {
      ALLEGRO_VIDEO *vid = al_open_video_f(f);
      if (vid) {
          float fps = al_get_video_fps(vid);
          // ... use the video ...
          al_close_video(vid); // also closes f
      }
  }
  ```

## SEE ALSO

[al\_open\_video(3)](/al_open_video/3.md)

## SINCE

5\.2.11
