Skip to content

OpenMovie

Narta Xaymar Dirks edited this page Oct 28, 2026 · 9 revisions

Blitz3DBlitzPlusBlitzBasic

OpenMovie

OpenMovie:Int32 file:String
Parameter Mode Type Default Description
file In String required The path of the movie file.

Returns: A movie handle, or 0 if the movie could not be opened.

Description

Opens a movie file for playback and returns a handle for DrawMovie, MoviePlaying and the other movie commands. The original played AVI, MPEG and animated GIF files through DirectShow, and a movie starts playing as soon as it is opened. A program should always test for the result 0, which means the movie could not be opened, and carry on without it.

Differences

  • Movies are decoded by FFmpeg, whose shared libraries have to be next to the program: blitzcc copies them there when the program uses OpenMovie, and without them (or for a file that can't be played) the result is 0, which programs already have to handle. Containers: AVI, MP4/MOV, Matroska/WebM, MPEG program and transport streams, WMV/ASF, Ogg and FLV. Pictures: MPEG-1, MPEG-2, MPEG-4 part 2 (DivX and Xvid), H.264, H.265, VP8, VP9, Theora, WMV 1 to 3 and Motion JPEG. Sound: MP2, MP3, AAC, AC-3, Vorbis, Opus, FLAC, WMA 1 and 2, PCM and ADPCM. Animated GIF files are not played. The movie starts at the first DrawMovie or MoviePlaying after it was opened and not at OpenMovie, so time that a program spends loading doesn't skip the start of it. A file with only sound can't be opened. The picture and sound are shown in drawmovie.gif.

Examples

Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
Local m = OpenMovie("intro.avi")
Cls
If m = 0 Then
	Text 160, 120, "The movie could not be opened", 1, 1
Else
	Text 160, 120, "Movie size " + MovieWidth(m) + " x " + MovieHeight(m), 1, 1
	CloseMovie m
EndIf
Flip
WaitKey

Related Commands

CloseMovie, DrawMovie, GetMovieTexture 〔BlitzLLVM〕, LoopMovie 〔BlitzLLVM〕, PauseMovie 〔BlitzLLVM〕, PlayMovie 〔BlitzLLVM〕, SeekMovie 〔BlitzLLVM〕, StopMovie 〔BlitzLLVM〕

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally