- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
how can i get the total number of frames of a video?
regards,
michael
how can i get the total number of frames of a video?
regards,
michael
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From where do you want to get total number of video? What IPP component you are using?
Vladimir
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Vladimir Dudnik (Intel)
From where do you want to get total number of video? What IPP component you are using?
Vladimir
Vladimir
i'm using unified media classes to write a video-decoder/player. so i'd like to show the totalnumber of frames,e.g. of a mpeg2-video, in the gui.
michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - mikl_la
i'm using unified media classes to write a video-decoder/player. so i'd like to show the totalnumber of frames,e.g. of a mpeg2-video, in the gui.
michael
Unless your file wrapper contains this number, you have to partially decode the stream I think.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - shyaki
Unless your file wrapper contains this number, you have to partially decode the stream I think.
You can retreive video/audio/etc information using MediaInfo.
The sample code is followed..
[cpp]#include#include "MediaInfoDLL.h" using namespace MediaInfoLib; int GetMovieInfo( char* _inp08FilePath, { MediaInfo MI; char np08Buf[2048] int n32Result,n32FrameCount; n32Result = MI.Open(_T(_inp08FilePath)); if (n32Result == 0) return -1; /* * Retrieve general movie information */ sprintf(np08Buf,"%s", MI.Get(Stream_General, 0, _T("FileName" ), Info_Text, Info_Name).c_str()); sprintf(np08Cuf,"%s", MI.Get(Stream_General, 0, _T("FileExtension" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_General, 0, _T("FileSize" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_General, 0, _T("Format/String" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_General, 0, _T("Format/Family" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_General, 0, _T("PlayTime/String3"), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_General, 0, _T("Duration" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_General, 0, _T("BitRate" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_General, 0, _T("OveralBitRate" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_General, 0, _T("VideoCount" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_General, 0, _T("AudioCount" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_General, 0, _T("TextCount" ), Info_Text, Info_Name).c_str()); /* * Retrieve video information */ sprintf(np08Buf,"%s", MI.Get(Stream_Video, 0, _T("Codec/String" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Video, 0, _T("Codec/Family" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Video, 0, _T("Width" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Video, 0, _T("Height" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Video, 0, _T("BitRate" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Video, 0, _T("BitRate_Nominal" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Video, 0, _T("BitRate_Mode" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Video, 0, _T("DisplayAspectRatio" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Video, 0, _T("DisplayAspectRatio/String"), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Video, 0, _T("FrameRate" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Video, 0, _T("Interlacement/String" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Video, 0, _T("FrameCount" ), Info_Text, Info_Name).c_str()); n32FrameCount = atoi(np08Buf); /* * Retrieve audio information */ sprintf(np08Buf,"%s", MI.Get(Stream_Audio, 0, _T("Codec" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Audio, 0, _T("Codec/String" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Audio, 0, _T("BitRate" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Audio, 0, _T("BitRate_Mode" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Audio, 0, _T("Channel(s)" ), Info_Text, Info_Name).c_str()); sprintf(np08Buf,"%s", MI.Get(Stream_Audio, 0, _T("SamplingRate" ), Info_Text, Info_Name).c_str()); MI.Close(); return 1; } [/cpp]
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page