Skip to content

Preprocess

1. Preprocess Statement

The "Preprocess" statement allows users to preprocess data using ThanoSQL's "Preprocess" functions.

2. Preprocess Functions

2-1. video_to_df

The "video_to_df" is a function that divide video into fixed intervals to save as files and create a data table.

video_to_df Syntax

query_statement:
    query_expr

FUNCTION preprocess.video_to_df
OPTIONS (
    expression [ , ...]
    )
{ AS (query_expr) | FROM {file_path_expression} } 

OPTIONS Clause

OPTIONS (
    [method={'split'}],
    [interval=VALUE],
    (result_col=expression),
    (result_dir=expression)
    )

The "OPTIONS" clause allows you to change the value of a parameter. The definition of each parameter is as follows.

  • "method": video preprocessing method, currently only supports 'split' method (str)
  • "interval": setting of the interval in seconds (int, optional, default: 10)
  • "result_col": the name of the column containing paths of the preprocessed video (str)
  • "result_dir": the name of the folder where the split video will be stored after preprocessing (str)

video_to_df Example

%%thanosql
FUNCTION preprocess.video_to_df 
OPTIONS (
   method='split', 
   interval=1, 
   result_col='video_split_path', 
   result_dir='video_split_folder'
    )
FROM 'thanosql-dataset/kinetics700_data/video/1ejgHKw8E3Y.mp4'

Last update: 2022-12-28