線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:4120
推到 Plurk!
推到 Facebook!

AVI轉成MPEG-2或MPEG-4的問題

答題得分者是:cmf
woung
一般會員


發表:1
回覆:4
積分:1
註冊:2003-01-31

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-01-31 12:16:57 IP:61.224.xxx.xxx 未訂閱
各位大大,新年快樂,小弟目前寫一個可定時從網路上截取一連串圖片(.bmp檔),並且可轉成avi的檔案,但是檔案實在是太大了,所以想要再另外轉成mpeg-2或mpeg-4的檔,我曾經看過討論區的文章,但是皆是在要截取攝影機的畫面,一邊截取一邊壓縮,詳請見http://delphi.ktop.com.tw/topic.php?topic_id=18980  不過我我狀況不同,我是已經有圖片了,不用再截取攝影機,我想過兩種方法來解決,但是皆卡在不會將
woung
一般會員


發表:1
回覆:4
積分:1
註冊:2003-01-31

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-02-02 23:04:37 IP:61.224.xxx.xxx 未訂閱
請教一下領航天使與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

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-02-02 23:04:51 IP:61.224.xxx.xxx 未訂閱
請教一下領航天使與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

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-02-03 21:06:28 IP:61.70.xxx.xxx 未訂閱
woung:          因目前休假中       所以 初五 再來回答你的問題          886        
------
︿︿
74205
一般會員


發表:8
回覆:16
積分:4
註冊:2002-10-23

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-02-04 23:22:37 IP:218.187.xxx.xxx 未訂閱
我也有類似的問題 不過我是一連串bitmap存在記憶體中(BCB6) 而我想把他們壓成mpeg-1 可以用iccompress或iccompressframes嗎 而且要用mpeg-1壓縮時的fccHandler該如何設定呢? 現在能抓到的mpeg lib好像都只能解壓縮而不能壓縮 希望各位前輩能夠幫幫忙 有夠頭大的
cmf
尊榮會員


發表:84
回覆:918
積分:1032
註冊:2002-06-26

發送簡訊給我
#6 引用回覆 回覆 發表時間:2003-02-05 09:11:29 IP:61.218.xxx.xxx 未訂閱
引言: 我也有類似的問題 不過我是一連串bitmap存在記憶體中(BCB6) 而我想把他們壓成mpeg-1 可以用iccompress或iccompressframes嗎 而且要用mpeg-1壓縮時的fccHandler該如何設定呢? 現在能抓到的mpeg lib好像都只能解壓縮而不能壓縮 希望各位前輩能夠幫幫忙 有夠頭大的
如果你知道 如何 解壓縮 ? 那就自然知道 如何 壓縮 只要你看通了 則 壓縮/解壓縮 是一樣的道理
------
︿︿
cmf
尊榮會員


發表:84
回覆:918
積分:1032
註冊:2002-06-26

發送簡訊給我
#7 引用回覆 回覆 發表時間:2003-02-05 09:45:54 IP:61.218.xxx.xxx 未訂閱

Encoder API

The 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

發送簡訊給我
#8 引用回覆 回覆 發表時間:2003-02-05 13:14:36 IP:61.218.xxx.xxx 未訂閱

Free Encoders, Decoders and other Tools

Description 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
------
︿︿
系統時間:2024-11-23 6:43:29
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!