ibllib.io.ffmpeg

Functions

compress

runs a command of the form ‘ffmpeg -i {file_in} -c:a flac -nostats {file_out}’ using a supbprocess audio compression for ephys: “ffmpeg -i {file_in} -c:a flac -nostats {file_out}” video compression for ephys: “(‘ffmpeg -i {file_in} -codec:v libx264 -preset slow -crf 17 ‘ ‘-nostats -loglevel 0 -codec:a copy {file_out}’)”

iblrig_video_compression

Compresses avi files from the raw_videao_data folder into mp4.

compress(file_in, file_out, command, remove_original=True)[source]

runs a command of the form ‘ffmpeg -i {file_in} -c:a flac -nostats {file_out}’ using a supbprocess audio compression for ephys: “ffmpeg -i {file_in} -c:a flac -nostats {file_out}” video compression for ephys: `”(‘ffmpeg -i {file_in} -codec:v libx264 -preset slow -crf 17 ‘

‘-nostats -loglevel 0 -codec:a copy {file_out}’)”`

Parameters
  • file_in – full file path of input

  • file_out – full file path of output

  • command – string ready to be formatted with file_in and file_out

return: file_out

iblrig_video_compression(session_path, command)[source]

Compresses avi files from the raw_videao_data folder into mp4. Once the compression completes the avi file is removed. If mp4 already exist, the funciton returns their file path :param session_path: :param command: for ephys: >>> command = (‘ffmpeg -i {file_in} -y -codec:v libx264 -preset slow -crf 17 ‘ >>> ‘-nostats -loglevel 0 -codec:a copy {file_out}’) for training: >>> command = (‘ffmpeg -i {file_in} -y -codec:v libx264 -preset slow -crf 29 ‘ >>> ‘-nostats -loglevel 0 -codec:a copy {file_out}’) :return: list of compressed files