| 99 | } |
| 100 | |
| 101 | std::vector<int> Load(agi::fs::path const& filename) { |
| 102 | auto file = io::Open(filename); |
| 103 | std::istream &is(*file); |
| 104 | |
| 105 | std::string header; |
| 106 | getline(is, header); |
| 107 | |
| 108 | if (header == "# keyframe format v1") return agi_keyframes(is); |
| 109 | if (header.starts_with("# XviD 2pass stat file")) return enumerated_keyframes(is, xvid); |
| 110 | if (header.starts_with("# ffmpeg 2-pass log file, using xvid codec")) return enumerated_keyframes(is, xvid); |
| 111 | if (header.starts_with("# avconv 2-pass log file, using xvid codec")) return enumerated_keyframes(is, xvid); |
| 112 | if (header.starts_with("##map version")) return enumerated_keyframes(is, divx); |
| 113 | if (header.starts_with("#options:")) return enumerated_keyframes(is, x264); |
| 114 | if (header.starts_with("# WWXD log file, using qpfile format")) return indexed_keyframes(is, wwxd); |
| 115 | |
| 116 | throw UnknownKeyframeFormatError("File header does not match any known formats"); |
| 117 | } |
| 118 | |
| 119 | } |