1 / 16

Introduce the Windows audio & video techniques

Introduce the Windows audio & video techniques. Reference: ms-help://MS.MSDNQTR.2004JAN.1033/wmcodecs/htm /windowsmediaaudioandvideocodecinterfaces.htm. Introduction. Windows Media Audio and Video Codec Interfaces. compress and decompress audio and video content

thais
Download Presentation

Introduce the Windows audio & video techniques

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduce the Windows audio & video techniques Reference: ms-help://MS.MSDNQTR.2004JAN.1033/wmcodecs/htm /windowsmediaaudioandvideocodecinterfaces.htm

  2. Introduction

  3. Windows Media Audio and Video Codec Interfaces • compress and decompress audio and video content • The codec is implemented by DirectX media objects (DOMs)

  4. Overview of the Windows Media Format SDK • 提供存取 Advanced Systems Format(ASF) 的功能 • Configure the content of ASF files • Encode audio and video • Retrieve the content of ASF files • You can access the metadata using the Windows Media codecs stored in the header of ASF files. bit rate, # of video frame

  5. Windows Media SDK VS. Windows Media Audio and Video Codec Interface 接下頁

  6. Video Interlacing 簡單介紹 Deinterlaced properly before deinterlaced 參考資料: http://www.100fps.com/

  7. 類比攝影機的情況 1) Record field 1 (=frame1) (odd scan lines) 2) Record field 2 (=frame2) (even scan lines) 3) Record field 3 (=frame3) (odd scan lines) 4) Record field 4 (=frame4) (even scan lines) 甚麼叫做 interlacing • Your digital camcorder does the following • Records 50 pictures per second • intermixing every 2 consecutive pictures (with half the height) into1 frame • This mixing is called interlacing fields the timeline of your digital camcorder 1) Record field 1 2) Record field 2 3) Mix (=interlace) field 1 and field 2 into one frame and save the frame as frame 1. 4) Record field 3 5) Record field 4 6) Mix (=interlace) field 3 and field 4 into one frame and save the frame as frame 2

  8. 數位攝影機到底幫我們做了甚麼事? Field1 captures at half the height Field2 captures at half the height 看起來一樣, 可是兩張圖確實不一樣

  9. 組合成完整的 frame 實際上, 數位攝影機存放的 資料就是長這樣

  10. 另外的例子

  11. 程式設計指南

  12. 設定編譯環境 Setting Debug value Release value C/C++ Runtime library Debug Multithreaded DLL Ignore all default library Link tab, General Link tab, Library Msvcrtd.lib and Wmvcore.lib. Do not include Libc.lib Directories C:\WMSDK\WMFSDK9\include C:\WMSDK\WMFSDK9\lib

  13. 程式碼注意事項 1 * 呼叫任何 creation function 之前, 要先初始 COM HRESULT hr=CoInitialize(NULL); if (FAILED(hr)){ printf(“ERROR – 無法初始 COM library"); return -1; } 2 檢查錯誤: 應該使用 FAILED macro HRESULT hr; hr = SomeFunction(); if (FAILED(hr)) { // Check for specific error values. }

  14. 程式碼注意事項 3 Release 物件: 使用 SAFE_RELEASE macro 與 SAFE_ARRAY_DELETE macro #ifndef SAFE_RELEASE #define SAFE_RELEASE(x) if(x != NULL) { x->Release(); x = NULL; } #endif #ifndef SAFE_ARRAY_DELETE #define SAFE_ARRAY_DELETE(x) if(x != NULL) { delete[] x; x = NULL; } #endif

More Related