$metadata = array
();
if ( !
defined( 'GETID3_TEMP_DIR'
) ) { define( 'GETID3_TEMP_DIR',
get_temp_dir() );
} if ( !
class_exists( 'getID3', false
) ) { require ABSPATH . WPINC . '/ID3/getid3.php';
} $id3 =
new getID3();
// Required to get the `created_timestamp` value.
$id3->options_audiovideo_quicktime_ReturnAtomData = true; // phpcs:ignore WordPress.NamingConventions.ValidVariableName
$data =
$id3->
analyze( $file );
if ( isset( $data['video'
]['lossless'
] ) ) { $metadata['lossless'
] =
$data['video'
]['lossless'
];
} if ( !
empty( $data['video'
]['bitrate'
] ) ) { $metadata['bitrate'
] =
(int) $data['video'
]['bitrate'
];
}