MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ can_read()

bool MayaFlux::IO::VideoFileReader::can_read ( const std::string &  filepath) const
overridevirtual

Check if a file can be read by this reader.

Parameters
filepathPath to the file.
Returns
true if the file format is supported.

Implements MayaFlux::IO::FileReader.

Definition at line 58 of file VideoFileReader.cpp.

59{
60 static const std::vector<std::string> exts = {
61 "mp4", "mkv", "avi", "mov", "webm", "flv", "wmv", "m4v", "ts", "mts"
62 };
63 auto dot = filepath.rfind('.');
64 if (dot == std::string::npos)
65 return false;
66 std::string ext = filepath.substr(dot + 1);
67 std::ranges::transform(ext, ext.begin(), ::tolower);
68 return std::ranges::find(exts, ext) != exts.end();
69}