Last active
August 29, 2015 14:06
-
-
Save sqbing/c0b0f38ee2a6e96d20c0 to your computer and use it in GitHub Desktop.
libmedia example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define UNICODE | |
#include <iostream> | |
#include <string> | |
#include <MediaInfo/MediaInfo.h> | |
#include <MediaInfo/MediaInfo_Const.h> | |
// Taking effect only for ascii charactors | |
void string_to_wstring(std::string &str, std::wstring &wstr){ | |
wstr = std::wstring(str.begin(), str.end()); | |
} | |
void wstring_to_string(std::wstring &wstr, std::string &str){ | |
str = std::string(wstr.begin(), wstr.end()); | |
} | |
int main(int argc, const char *argv[]) | |
{ | |
using namespace MediaInfoLib; | |
MediaInfo MI; | |
String file_path(L"/root/mp4/Harry.mp4"); | |
if(1 != MI.Open(file_path)){ | |
return -1; | |
} | |
std::wcout<<MI.Inform()<<std::endl; | |
std::wcout<<MI.Get(Stream_Video, 0, L"Encoded_Library_Settings", Info_Text)<<std::endl; | |
MI.Close(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment