converters.ffmpeg

Author: Ismael Seidel (ismael.seidel@ufsc.br) Affiliation: Embedded Computing Lab (ECL), Federal University of Santa Catarina (UFSC)

Description:

This module contains the implementation of PPM->YUV conversion. It is a wrapper class for calling FFMPEG. FFMPEG will perform the conversion considering the aspects of the LF, such as width, height, number of views, encoding order. Also, more importantly, it will deal with the colour conversion.

generate_list_for_ffmpeg(n_views_width, n_views_height, initial_width=0, initial_height=0, step_width=1, step_height=1, views_path='.', scan_order=<function get_serpentine_scan_list>)[source]

Generate a list of views for FFMPEG conversion.

Parameters:
  • n_views_width (int) – Number of views in width

  • n_views_height (int) – Number of views in height

  • initial_width (int) – Initial width offset

  • initial_height (int) – Initial height offset

  • step_width (int) – Step size in width

  • step_height (int) – Step size in height

  • views_path (Union[str, Path]) – Path to the views

  • scan_order (ScanFunctionType) – Function defining the scan order

Returns:

List string for FFMPEG

Return type:

str

create_list_file_for_ffmpeg(list_filename, n_views_width, n_views_height, initial_width=0, initial_height=0, step_width=1, step_height=1, views_path='.', scan_order=<function get_serpentine_scan_list>)[source]

Create a list file for FFMPEG conversion.

Parameters:
  • list_filename (Union[str, Path]) – Filename for the list file

  • n_views_width (int) – Number of views in width

  • n_views_height (int) – Number of views in height

  • initial_width (int) – Initial width offset

  • initial_height (int) – Initial height offset

  • step_width (int) – Step size in width

  • step_height (int) – Step size in height

  • views_path (Union[str, Path]) – Path to the views

  • scan_order (ScanFunctionType) – Function defining the scan order

Returns:

None

Return type:

None

class FFMPEGLightFieldFormatConverter[source]

Bases: object

convert_rgb_ppm_lf_to_bt709fr_yuv(yuv_path, remove_after_using=False)[source]

Convert RAW RGB PPM light field to BT.709 Full Range YUV.

Parameters:
  • raw_light_field_rgb_ppm (RAWLightFieldData) – RAW RGB PPM light field data

  • yuv_path (Union[str, Path]) – Path to save the YUV files

  • remove_after_using (bool) – Whether to remove intermediate files

Returns:

Converted YUV light field data

Return type:

RAW_BT709_FR_YUV444p10le_LightField_Data