AVI轉成MPEG-2或MPEG-4的問題 |
答題得分者是:cmf
|
woung
一般會員 發表:1 回覆:4 積分:1 註冊:2003-01-31 發送簡訊給我 |
|
woung
一般會員 發表:1 回覆:4 積分:1 註冊:2003-01-31 發送簡訊給我 |
請教一下領航天使與cmf或熟SDK的大大,小弟有看到各位大大所發表的言論於http://delphi.ktop.com.tw/topic.php?TOPIC_ID=25435 與我的部分需求相同,
我查了很久,終於查到在SDK裡有一些關於AVI的function可用,我也有抓站長的capture camera的檔案來用,尤其是其中有vfw.pas可將原來的c轉成pascal的語法,我有截錄部分的function來達到我要的功能(avi to mpeg-4),下面為我的程式碼截錄,我使用兩個function來做,分別是(1)AVIStreamOpenFromFile或(2)AviFileOpen AviFileGetStream兩個方法來截取串流,但是兩個方法皆不能使用,我發現存檔的時後會發生錯誤,所以無法存檔,自然也無法轉檔,我已經試了很久,且知道stream有存入資料,但就是無法轉檔。是否我的認知有誤,或是對SDK不夠了解,煩請熟SDK的大大告知。感激不盡!! //須先use vfw.pas
procedure TForm1.Button1Click(Sender: TObject);
var
AviOptions:PAVICOMPRESSOPTIONS;
pStream: PAVISTREAM;
PFile: PAVIFile;
begin
AVIFileInit();
AviOptions.fccHandler:=$3234504D; //mmioFOURCC('m','p','4','2'); 方法(1)
AviFileOpen(PFile, 'c:\abc.avi', OF_READWRITE, nil);//指定檔案給PFILE的裝置
AviFileGetStream(PFile, pStream, streamtypeVIDEO, 0);//指定串流pStream
方法(2)
AVIStreamOpenFromFile(pStream,'c:\abc.avi',streamtypeVIDEO,0,
OF_READWRITE,NIL);////從檔案中指定串流給pStream AVISave('c:\123.avi',nil,@SaveCallback,1, pStream,AviOptions);
AVIFileRelease(PFile);
end; function SaveCallback(nPercent: Integer): Bool; pascal;
begin
Application.ProcessMessages; Form1.Progressbar.Position := nPercent;
Result := True; end;
|
woung
一般會員 發表:1 回覆:4 積分:1 註冊:2003-01-31 發送簡訊給我 |
請教一下領航天使與cmf或熟SDK的大大,小弟有看到各位大大所發表的言論於http://delphi.ktop.com.tw/topic.php?TOPIC_ID=25435 與我的部分需求相同,
我查了很久,終於查到在SDK裡有一些關於AVI的function可用,我也有抓站長的capture camera的檔案來用,尤其是其中有vfw.pas可將原來的c轉成pascal的語法,我有截錄部分的function來達到我要的功能(avi to mpeg-4),下面為我的程式碼截錄,我使用兩個function來做,分別是(1)AVIStreamOpenFromFile或(2)AviFileOpen+AviFileGetStream兩個方法來截取串流,但是兩個方法皆不能使用,我發現存檔的時後會發生錯誤,所以無法存檔,自然也無法轉檔,我已經試了很久,且知道stream有存入資料,但就是無法轉檔。是否我的認知有誤,或是對SDK不夠了解,煩請熟SDK的大大告知。感激不盡!! //須先use vfw.pas
procedure TForm1.Button1Click(Sender: TObject);
var
AviOptions:PAVICOMPRESSOPTIONS;
pStream: PAVISTREAM;
PFile: PAVIFile;
begin
AVIFileInit();
AviOptions.fccHandler:=$3234504D; //mmioFOURCC('m','p','4','2'); 方法(1)
AviFileOpen(PFile, 'c:\abc.avi', OF_READWRITE, nil);//指定檔案給PFILE的裝置
AviFileGetStream(PFile, pStream, streamtypeVIDEO, 0);//指定串流pStream
方法(2)
AVIStreamOpenFromFile(pStream,'c:\abc.avi',streamtypeVIDEO,0,
OF_READWRITE,NIL);////從檔案中指定串流給pStream AVISave('c:\123.avi',nil,@SaveCallback,1, pStream,AviOptions);
AVIFileRelease(PFile);
end; function SaveCallback(nPercent: Integer): Bool; pascal;
begin
Application.ProcessMessages; Form1.Progressbar.Position := nPercent;
Result := True; end;
|
cmf
尊榮會員 發表:84 回覆:918 積分:1032 註冊:2002-06-26 發送簡訊給我 |
|
74205
一般會員 發表:8 回覆:16 積分:4 註冊:2002-10-23 發送簡訊給我 |
|
cmf
尊榮會員 發表:84 回覆:918 積分:1032 註冊:2002-06-26 發送簡訊給我 |
|
cmf
尊榮會員 發表:84 回覆:918 積分:1032 註冊:2002-06-26 發送簡訊給我 |
Encoder APIThe Encoder API provides a uniform interface for configuring software and hardware encoders. Applications can use the Encoder API to configure an encoder and to store the configuration settings. Encoder vendors can use the Encoder API to expose the capabilities of an encoder. Although the Encoder API is designed primarily for encoders, it is general enough that decoders can support it as well. The Encoder API is exposed to applications through the ICodecAPI interface, which is exposed by the encoder filter. The encoder filter may be a native DirectShow filter, a hardware encoder, or a DirectX Media Object (DMO). Software filters: An encoder that is implemented as a native DirectShow filter should expose the ICodecAPI directly. Hardware encoders: The encoding device is exposed through one or more AVStream minidrivers, which are represented in user mode by KSProxy. KSProxy translates ICodecAPI method calls into KS property sets. For more information, see "Encoder Minidrivers" in the DDK. DMOs: The DMO should expose the ICodecAPI interface. DirectShow applications can query the DMO Wrapper filter, which exposes the interface by aggregating the DMO. Applications not based on DirectShow can query the DMO directly. Encoder Capabilties An encoder can register a list of high-level capabilities by storing them in the system registry. Each capability is identified by a GUID. To enumerate the capabilities of a particular encoder, do the following: Create the moniker that represents the encoder filter. (See Using the System Device Enumerator.) Query the filter moniker for the IGetCapabilitiesKey interface. Call IGetCapabilitiesKey::GetCapabilitiesKey. The method returns a handle to the registry key that contains the filter's capabilities list. Call RegEnumValue to enumerate the values for the returned key. If you are devloping an encoder, create the registry entries for the capabilities when the filter is registered. For software filters, create a key named Capabilities that is adjacent to the FilterData and FriendlyName keys. Typically, you would add this information after calling AMovieDllRegisterServer2 to register the standard filter data. For more information, see How to Register DirectShow Filters. Alternatively, you can create a CapabilitiesLocation key that contains a string giving the location of the Capabilities key in the registry. The string should start with "HKLM\", "HKCR\", or "HKCU\" to indicate the registry subtree. For Plug and Play devices, the driver's setup files should create a Capabilities key adjacent to the filter's FriendlyName key, or it can use a CapabilitiesLocation key as described for software filters. Once you have created the Capabilities key, create a value for each capability GUID. The name of the value should be the string form of the GUID, in the form {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. Each value type should be one of the following: Single numerical value. Use a DWORD value. GUID. Use the string form of the GUID. Numeric pairs. Use a string with the form "a,b" to represent pairs of values, such as width and height, or numerator and denominator for fractions. Arrays of values. Use multi-strings (REG_SZ_MULTI) to represent more than one value. The following example shows the registry layout for a software filter: \HKCR\CLSID\Filter Category\Instance\Filter CLSID\Capabilities Values: guid1: 1234 (REG_DWORD) guid2: "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" (REG_SZ) guid3: "2","4","6" (REG_SZ_MULTI) guid4: "720,480" (REG_SZ) Encoder Profiles An encoder profile is a fixed list of configuration settings that can be applied to an encoder at run time. Profiles are independent of the encoder; an application can select an encoder, then select a profile and apply the profile settings to the encoder. Profiles are identified by GUID and should be stored in the following location in the registry: \HKLM\Software\Microsoft\EncoderProfiles\Profile GUID where Profile GUID is the string form of the GUID that identifies the profile. Create values for each setting. Also create a string value named FriendlyName whose data identifies the profile (such as "LowBandwidthVideo"). IEncoderAPI interface http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/htm/iencoderapiinterface.asp
------
︿︿ |
cmf
尊榮會員 發表:84 回覆:918 積分:1032 註冊:2002-06-26 發送簡訊給我 |
Free Encoders, Decoders and other ToolsDescription of Test Sequences from Munich Technical University [TUM, 31 Jan 03] http://www.ldv.ei.tum.de/liquid.php?page=70 Test Sequences from Munich Technical University [TUM, 31 Jan 03] ftp://ftp.ldv.e-technik.tu-muenchen.de/dist/test_sequences/ QuickTime Encapsulation of Standard Video Test Sequences [MPEG] http://index.apple.com/~singer/sequences/testseq.html Masks for MPEG-4 video sequences [MPEG] ftp://ftp.tnt.uni-hannover.de/pub/MPEG/mpeg4_masks/ Streamcrest's tools for video coders [Streamcrest] http://www.hdtv.com/streamcrest/mp4.shtml Documentation and download link for mp4tool, MP4 / BIFS / XMT codec [ENST] http://www.m4if.org/Documentation%20and%20download%20link%20for%20mp4tool,%20MP4%20/%20BIFS%20/%20XMT%20codec UBC MPEG-4 Streaming System [UBC] http://www.ece.ubc.ca/~yasserp/research OpenDivX link (Project Mayo) - Open Source MPEG-4 Video [Project Mayo] http://www.projectmayo.com/projects MPEG4IP - Open Source [MPEG4IP] http://www.mpeg4ip.net/ The GSRT authoring tool for the creation of MPEG-4 scenes [GSRT] http://uranus.ee.auth.gr/pened99/Demos/Authoring_Tool/authoring_tool.html SigmaDesigns' Advanced Simple Video Codec [Sigma Designs] http://www.sigmadesigns.com/products/MPEG4_video_encoder.htm Apple's QuickTime 6 [Apple] http://www.apple.com/quicktime/download/ Envivio's EnvivioTV [Envivio] http://envivio.com/products/etv/index.html Free Eval Kit of dicas' MPEG-4 Consumer Codec [dicas] http://www.mpegable.com/showPage.php?SPRACHE=UK&PAGE=downloads IBM's Java MPEG-4 Simple Profile Video Decoder [IBM] http://www.alphaworks.ibm.com/tech/mpeg-4
------
︿︿ |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |