/// \file flv_analyser.cpp /// Contains the code for the FLV Analysing tool. #include #include #include #include #include #include #include #include #include #include #include //FLV support #include ///Debugging tool for FLV data. /// Expects FLV data through stdin, outputs human-readable information to stderr. int main(int argc, char ** argv){ Util::Config conf = Util::Config(argv[0]); conf.addOption("filter", JSON::fromString("{\"arg\":\"num\", \"short\":\"f\", \"long\":\"filter\", \"default\":0, \"help\":\"Only print info about this tag type (8 = audio, 9 = video, 0 = all)\"}")); conf.parseArgs(argc, argv); long long filter = conf.getInteger("filter"); FLV::Tag flvData; // Temporary storage for incoming FLV data. while ( !feof(stdin)){ if (flvData.FileLoader(stdin)){ if (!filter || filter == flvData.data[0]){ std::cout << "[" << flvData.tagTime() << "+" << flvData.offset() << "] " << flvData.tagType() << std::endl; } } } return 0; }