video
pixeltable.functions.video
Pixeltable UDFs for VideoType
.
Example:
import pixeltable as pxt
from pixeltable.functions import video as pxt_video
t = pxt.get_table(...)
t.select(pxt_video.extract_audio(t.video_col)).collect()
make_video
make_video(fps: int = 25)
Aggregator that creates a video from a sequence of images.
extract_audio
extract_audio(
video_path: VideoT,
stream_idx: int = 0,
format: str = "wav",
codec: Optional[str] = None,
) -> Optional[AudioT]
Extract an audio stream from a video file, save it as a media file and return its path.
Parameters:
-
stream_idx
(int
, default:0
) –Index of the audio stream to extract.
-
format
(str
, default:'wav'
) –The target audio format. (
'wav'
,'mp3'
,'flac'
). -
codec
(Optional[str]
, default:None
) –The codec to use for the audio stream. If not provided, a default codec will be used.
get_metadata
get_metadata(video: VideoT) -> JsonT
Gets various metadata associated with a video file and returns it as a dictionary.