Skip to content

Instantly share code, notes, and snippets.

@sqbing
Last active August 29, 2015 14:06
Show Gist options
  • Save sqbing/c0b0f38ee2a6e96d20c0 to your computer and use it in GitHub Desktop.
Save sqbing/c0b0f38ee2a6e96d20c0 to your computer and use it in GitHub Desktop.
libmedia example
#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