Module ffmpeg
Lua bindings to FFmpeg libraries.
Info:
- Copyright: Aiden Nibali 2015
- License: MIT
- Author: Aiden Nibali
Functions
new (path) | Opens a video file for reading. |
Class Video
Video:filter (pixel_format_name[, filterchain='null']) | Sets a filter to apply to the video. |
Video:duration () | Gets the video duration in seconds. |
Video:pixel_format_name () | Gets the name of the video pixel format. |
Video:read_video_frame () | Reads the next video frame. |
Class VideoFrame
VideoFrame:to_ascii () | Converts the video frame to an ASCII visualisation. |
Functions
- new (path)
-
Opens a video file for reading.
Parameters:
- path string A relative or absolute path to the video file.
Returns:
Class Video
A Video class.
- Video:filter (pixel_format_name[, filterchain='null'])
-
Sets a filter to apply to the video.
Parameters:
- pixel_format_name string The name of the desired output pixel format. Pixel names can be found in pixdesc.c.
- filterchain string The filterchain to be applied. Refer to the libav documentation for the syntax of this string. (default 'null')
Returns:
Usage:
-- Set up a filter which scales the video to 128x128 pixels, flips it -- horizontally and sets the output pixel format to 24-bit RGB: video = video:filter('rgb24', 'scale=128x128,hflip')
- Video:duration ()
- Gets the video duration in seconds.
- Video:pixel_format_name ()
- Gets the name of the video pixel format.
- Video:read_video_frame ()
-
Reads the next video frame.
Returns:
Class VideoFrame
A VideoFrame class.