VideoExample.Mod 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. MODULE VideoExample; (** AUTHOR "thomas.frey@alumni.ethz.ch"; PURPOSE "Webcam support for WinA2"; *)
  2. (*PH 100317: proposal for more video formats from webcams and built-in cameras delivering YUV422 data *)
  3. IMPORT
  4. Modules, Kernel, KernelLog, GDI32, Kernel32, User32, SYSTEM,
  5. WMWindowManager, Strings, WMRectangles, WMGraphics, Raster, RasterPixelFormats, VfW, Codecs, Commands, Files, Streams;
  6. TYPE
  7. FrameHandler* = PROCEDURE {DELEGATE} (buffer : Raster.Image);
  8. PreviewWindow* = OBJECT (WMWindowManager.BufferWindow);
  9. PROCEDURE &New*(width, height : LONGINT);
  10. BEGIN
  11. Init(width, height, FALSE);
  12. WMWindowManager.AddWindow(SELF, 200, 200);
  13. SetTitle(Strings.NewString("Preview Window"));
  14. canvas.Fill(WMRectangles.MakeRect(0, 0, GetWidth(), GetHeight()), WMGraphics.White, WMGraphics.ModeCopy);
  15. Invalidate(WMRectangles.MakeRect(0, 0, GetWidth(), GetHeight()));
  16. END New;
  17. (* Overwrite draw procedure because we do not want any interpolation *)
  18. PROCEDURE Draw*(canvas : WMGraphics.Canvas; w, h, q : LONGINT);
  19. BEGIN
  20. Draw^(canvas, w, h, 0);
  21. END Draw;
  22. END PreviewWindow;
  23. Starter* = OBJECT
  24. VAR opened, stopped : BOOLEAN;
  25. PROCEDURE Open;
  26. VAR str : ARRAY 16 OF CHAR;
  27. name, version : ARRAY 64 OF CHAR;
  28. i : LONGINT;
  29. info : GDI32.BitmapInfoHeader;
  30. capRec : VfW.Capturerec;
  31. found : BOOLEAN;
  32. BEGIN
  33. opened := FALSE;
  34. str := "";
  35. handle := VfW.CapCreateCaptureWindow(str, VfW.WS_POPUP, 0, 0, 1, 1, 0, 0);
  36. IF handle # 0 THEN
  37. i := 0; found := FALSE;
  38. WHILE ~found & (i < 10) DO
  39. IF VfW.CapGetDriverDescription(i, name, 64, version, 64) THEN
  40. IF VfW.CapDriverConnect(handle, i) THEN
  41. KernelLog.String("Connected to the driver"); KernelLog.Ln;
  42. IF VfW.CapGetVideoFormat(handle, info) THEN
  43. VfW.DumpBitmapInfoHeader(info);
  44. found:=TRUE;
  45. IF info.biCompression = 844715353 (*YUY2*) THEN (*keep it*)
  46. ELSE
  47. info.biBitCount := 24;
  48. (*info.biWidth := 960;
  49. info.biHeight := 720; *)
  50. info.biWidth := 640;
  51. info.biHeight := 480;
  52. IF VfW.CapSetVideoFormat(handle, info) THEN
  53. KernelLog.String("Set new info"); KernelLog.Ln;
  54. found := TRUE;
  55. ELSE
  56. KernelLog.String("SetVideoFormat failed"); KernelLog.Ln;
  57. IF VfW.CapDriverDisconnect(handle) THEN
  58. handle := 0;
  59. END;
  60. END;
  61. END;
  62. END;
  63. ELSE
  64. KernelLog.String("Connecting failed"); KernelLog.Ln
  65. END
  66. END;
  67. INC(i);
  68. END;
  69. IF found THEN
  70. IF VfW.CapGetSequenceSetup(handle, capRec) THEN
  71. VfW.DumpCapRec(capRec);
  72. (*capRec.dwRequestMicroSecPerFrame := 1000;*)
  73. capRec.wPercentDropForError := 100;
  74. (*capRec.fYield := 1;*)
  75. capRec.fAbortLeftMouse := 0;
  76. capRec.fAbortRightMouse := 0;
  77. IF VfW.CapSetSequenceSetup(handle, capRec) THEN
  78. KernelLog.String("new sequence setup"); KernelLog.Ln;
  79. END
  80. END;
  81. IF VfW.CapSetCallbackYield(handle, YieldCallback) THEN END;
  82. IF VfW.CapSetCallbackStream(handle, FrameReceived) THEN
  83. (* preview *)
  84. NEW(buffer);
  85. IF info.biCompression = 844715353 (*YUV422*) THEN
  86. Raster.Create(buffer, info.biWidth, info.biHeight, RasterPixelFormats.YUV422);
  87. ELSIF info.biBitCount = 24 THEN
  88. Raster.Create(buffer, info.biWidth, info.biHeight, Raster.BGR888);
  89. END;
  90. IF s # NIL THEN s.Close END; NEW(s, info.biWidth, info.biHeight);
  91. IF VfW.CapSequenceNoFile(handle) THEN
  92. END;
  93. END;
  94. END
  95. END
  96. END Open;
  97. PROCEDURE Stop;
  98. BEGIN
  99. stopped := TRUE;
  100. IF VfW.CapCaptureStop(handle) THEN KernelLog.String("Stoped"); KernelLog.Ln; END;
  101. END Stop;
  102. PROCEDURE MsgLoop;
  103. VAR msg: User32.Msg; i: LONGINT;
  104. BEGIN
  105. LOOP
  106. i := User32.GetMessage( msg, 0, 0, 0 );
  107. IF i = 0 THEN EXIT
  108. ELSIF i # -1 THEN
  109. IF ( msg.message = User32.WMKeyDown ) THEN
  110. (* Translate virtual key code to character. This generates a WMChar message if translation succeeds. Since
  111. AOS doesn't allow ALT-Printable-Keys combinations, we don't translate User32.WMSysKeyDown messages
  112. that would generate WMSysChar messages *)
  113. i := User32.TranslateMessage( msg );
  114. END;
  115. i := User32.DispatchMessage( msg )
  116. END;
  117. Kernel32.Sleep( 1 );
  118. END
  119. END MsgLoop;
  120. BEGIN {ACTIVE}
  121. stopped := FALSE;
  122. Open;
  123. MsgLoop;
  124. IF VfW.CapDriverDisconnect(handle) THEN
  125. KernelLog.String("Disonnected."); KernelLog.Ln;
  126. handle := 0;
  127. END
  128. END Starter;
  129. VAR
  130. s : PreviewWindow;
  131. handle : VfW.HWND;
  132. buffer : Raster.Image;
  133. starter : Starter;
  134. frameHandler : FrameHandler;
  135. (* Sends a single image through the video processing pipeline. *)
  136. PROCEDURE SimulateImage*(context : Commands.Context); (** filename ~ *)
  137. VAR
  138. fn, name : Files.FileName;
  139. res: WORD; w, h, x : LONGINT;
  140. dec : Codecs.ImageDecoder;
  141. rdr : Streams.Reader;
  142. ext : ARRAY 16 OF CHAR;
  143. BEGIN
  144. context.arg.SkipWhitespace; context.arg.String(fn);
  145. Strings.Trim(fn, '"');
  146. Strings.GetExtension(fn, name, ext);
  147. Strings.UpperCase(ext);
  148. dec := Codecs.GetImageDecoder(ext);
  149. IF dec = NIL THEN
  150. context.error.String("No decoder found for "); context.error.String(ext); context.error.Ln;
  151. RETURN
  152. END;
  153. rdr := Codecs.OpenInputStream(fn);
  154. IF rdr # NIL THEN
  155. dec.Open(rdr, res);
  156. IF res = 0 THEN
  157. dec.GetImageInfo(w, h, x, x);
  158. IF (buffer = NIL) THEN NEW(buffer); Raster.Create(buffer, w, h, Raster.BGR888) END;
  159. IF s = NIL THEN NEW(s, buffer.width, buffer.height) END;
  160. dec.Render(buffer);
  161. IF (frameHandler # NIL) & (buffer # NIL) THEN frameHandler(buffer) END;
  162. IF buffer # NIL THEN s.canvas.DrawImage(0, 0, buffer, WMGraphics.ModeCopy) END;
  163. s.Invalidate(WMRectangles.MakeRect(0, 0, s.GetWidth(), s.GetHeight()))
  164. ELSE
  165. context.error.String("WMPicView: Could not open decoder for file "); context.error.String(fn); context.error.Ln;
  166. END;
  167. ELSE
  168. context.error.String("WMPicView: Could not open inputstream for file "); context.error.String(fn); context.error.Ln;
  169. END;
  170. END SimulateImage;
  171. PROCEDURE GetTimer():HUGEINT;
  172. VAR t : HUGEINT;
  173. res : Kernel32.BOOL;
  174. BEGIN
  175. res := Kernel32.QueryPerformanceCounter(SYSTEM.VAL(Kernel32.LargeInteger, t));
  176. RETURN t;
  177. END GetTimer;
  178. PROCEDURE GetFreq():HUGEINT;
  179. VAR t : HUGEINT;
  180. res : Kernel32.BOOL;
  181. BEGIN
  182. res := Kernel32.QueryPerformanceFrequency(SYSTEM.VAL(Kernel32.LargeInteger, t));
  183. RETURN t;
  184. END GetFreq;
  185. PROCEDURE {WINAPI} FrameReceived (hWnd : VfW.HWND; VAR lpVHdr : VfW.VHdr) : User32.LResult;
  186. VAR y : LONGINT;
  187. i : ADDRESS;
  188. t0, t1 : HUGEINT;
  189. t, f : LONGREAL;
  190. trap : BOOLEAN;
  191. bytesperpixel:LONGINT;
  192. BEGIN
  193. trap := TRUE;
  194. t0 := GetTimer();
  195. IF s # NIL THEN
  196. i := lpVHdr.lpData;
  197. bytesperpixel:= buffer.fmt.bpp DIV 8;
  198. FOR y := buffer.height - 1 TO 0 BY -1 DO
  199. SYSTEM.MOVE(i, ADDRESSOF(buffer.mem[0]) + buffer.bpr * y, buffer.width * bytesperpixel);
  200. i := i + buffer.width * bytesperpixel;
  201. END;
  202. IF (frameHandler # NIL) & (buffer # NIL) THEN frameHandler(buffer) END;
  203. IF buffer # NIL THEN s.canvas.DrawImage(0, 0, buffer, WMGraphics.ModeCopy) END;
  204. s.Invalidate(WMRectangles.MakeRect(0, 0, s.GetWidth(), s.GetHeight()))
  205. END;
  206. t1 := GetTimer();
  207. t := t1 - t0;
  208. f := GetFreq();
  209. f := f / 1000;
  210. (*KernelLog.String("total = "); KernelLog.Int(ENTIER(t / f), 0); KernelLog.Ln; *)
  211. trap := FALSE;
  212. FINALLY
  213. IF trap THEN
  214. KernelLog.String("Handler failed, removing it."); KernelLog.Ln;
  215. frameHandler := NIL
  216. END;
  217. RETURN 1
  218. END FrameReceived;
  219. PROCEDURE {WINAPI} YieldCallback(hWnd : VfW.HWND) : User32.LResult;
  220. VAR msg: User32.Msg; i, j: LONGINT;
  221. BEGIN
  222. REPEAT
  223. i := VfW.PeekMessage( msg, hWnd, 0, 0, 1 );
  224. IF i # 0 THEN j := User32.DispatchMessage(msg) END
  225. UNTIL i = 0;
  226. RETURN 1
  227. END YieldCallback;
  228. PROCEDURE SnapshotFirstPossible*;
  229. VAR str : ARRAY 16 OF CHAR;
  230. name, version : ARRAY 64 OF CHAR;
  231. i : LONGINT;
  232. timer : Kernel.Timer;
  233. info : GDI32.BitmapInfoHeader;
  234. BEGIN
  235. str := "";
  236. handle := VfW.CapCreateCaptureWindow(str, VfW.WS_POPUP, 0, 0, 1, 1, 0, 0);
  237. IF handle = 0 THEN
  238. KernelLog.String("Failed to create the window"); KernelLog.Ln
  239. ELSE
  240. KernelLog.String("Created the window"); KernelLog.Ln;
  241. FOR i := 0 TO 9 DO
  242. IF VfW.CapGetDriverDescription(i, name, 64, version, 64) THEN
  243. KernelLog.String(name); KernelLog.String(" ");
  244. KernelLog.String(version); KernelLog.Ln;
  245. IF VfW.CapDriverConnect(handle, i) THEN
  246. KernelLog.String("Connected to the driver"); KernelLog.Ln;
  247. IF VfW.CapGetVideoFormat(handle, info) THEN VfW.DumpBitmapInfoHeader(info) END;
  248. IF info.biCompression=844715353 (*YUY2 format*) THEN (* keep it *)
  249. ELSE
  250. info.biBitCount := 24;
  251. info.biWidth := 640;
  252. info.biHeight := 480;
  253. IF VfW.CapSetVideoFormat(handle, info) THEN
  254. KernelLog.String("Set new info"); KernelLog.Ln;
  255. ELSE
  256. KernelLog.String("Setting new connection failed."); KernelLog.Ln;
  257. IF VfW.CapDriverDisconnect(handle) THEN
  258. KernelLog.String("Setting new connection failed. Disonnected."); KernelLog.Ln;
  259. handle := 0;
  260. END;
  261. END;
  262. END;
  263. IF VfW.CapSetCallbackStream(handle, FrameReceived) THEN
  264. (* preview *)
  265. NEW(buffer);
  266. IF info.biCompression = 844715353 (*YUV422*) THEN
  267. Raster.Create(buffer, info.biWidth, info.biHeight, RasterPixelFormats.YUV422);
  268. ELSIF info.biBitCount = 24 THEN
  269. Raster.Create(buffer, info.biWidth, info.biHeight, Raster.BGR888);
  270. END;
  271. IF s # NIL THEN s.Close END; NEW(s, info.biWidth, info.biHeight);
  272. IF VfW.CapSequenceNoFile(handle) THEN
  273. KernelLog.String("Started"); KernelLog.Ln;
  274. NEW(timer);
  275. timer.Sleep(10000);
  276. KernelLog.String("Stopping"); KernelLog.Ln;
  277. IF VfW.CapCaptureStop(handle) THEN KernelLog.String("Stop"); KernelLog.Ln; END
  278. END;
  279. (*FOR i := 0 TO 1000 DO
  280. IF CapGrabFrame(handle) THEN END;
  281. END*)
  282. END;
  283. IF VfW.CapDriverDisconnect(handle) THEN
  284. KernelLog.String("Disonnected."); KernelLog.Ln;
  285. handle := 0;
  286. END
  287. ELSE
  288. KernelLog.String("Connecting failed"); KernelLog.Ln
  289. END
  290. END
  291. END
  292. END
  293. END SnapshotFirstPossible;
  294. PROCEDURE Start*;
  295. BEGIN
  296. NEW(starter);
  297. END Start;
  298. PROCEDURE Stop*;
  299. BEGIN
  300. starter.Stop;
  301. END Stop;
  302. PROCEDURE InstallFrameHandler*(handler : FrameHandler);
  303. BEGIN
  304. frameHandler := handler
  305. END InstallFrameHandler;
  306. PROCEDURE Cleanup;
  307. BEGIN
  308. IF (handle = 0) & VfW.CapDriverDisconnect(handle) THEN
  309. KernelLog.String("Disconnected."); KernelLog.Ln;
  310. handle := 0;
  311. ELSE KernelLog.String("Disonnecting failed."); KernelLog.Ln;
  312. END;
  313. IF s # NIL THEN s.Close END
  314. END Cleanup;
  315. BEGIN
  316. Modules.InstallTermHandler(Cleanup)
  317. END VideoExample.
  318. VideoExample.Open ~
  319. VideoExample.SimulateImage "Picture 1.jpg" ~
  320. VideoExample.Start ~
  321. VideoExample.Stop ~
  322. System.Free TestVideo VideoExample VfW RasterPixelFormats~
  323. Video compression formats in Windows (FOURCC identifiers) :
  324. 810961203 {3IV0} : result := 'MPEG4-based codec 3ivx';
  325. 827738419 {3IV1} : result := 'MPEG4-based codec 3ivx';
  326. 844515635 {3IV2} : result := 'MPEG4-based codec 3ivx';
  327. 1482049843 {3IVX} : result := 'MPEG4-based codec 3ivx';
  328. 1129529665 {AASC} : result := 'Autodesk Animator codec';
  329. 1381581377 {ABYR} : result := 'Kensington codec';
  330. 1229800769 {AEMI} : result := 'Array VideoONE MPEG1-I Capture';
  331. 1129072193 {AFLC} : result := 'Autodesk Animator FLC (256 color)';
  332. 1229735489 {AFLI} : result := 'Autodesk Animator FLI (256 color)';
  333. 1196444993 {AMPG} : result := 'Array VideoONE MPEG';
  334. 1296649793 {ANIM} : result := 'Intel RDX';
  335. 825512001 {AP41} : result := 'AngelPotion Definitive (hack MS MP43)';
  336. 827740993 {ASV1} : result := 'Asus Video V1';
  337. 844518209 {ASV2} : result := 'Asus Video V2';
  338. 1482052417 {ASVX} : result := 'Asus Video 2.0';
  339. 844256577 {AUR2} : result := 'Aura 2 Codec - YUV 422';
  340. 1095914817 {AURA} : result := 'Aura 1 Codec - YUV 411';
  341. 1245992513 {AVDJ} : result := 'Avid Motion JPEG';
  342. 1314018881 {AVRN} : result := 'Avid Motion JPEG';
  343. 1380997697 {AZPR} : result := 'Quicktime Apple Video';
  344. 1263421762 {BINK} : result := 'Bink Video (RAD Game Tools) (256 color)';
  345. 808604738 {BT20} : result := 'Conexant (ex Brooktree) ProSummer MediaStream';
  346. 1447253058 {BTCV} : result := 'Conexant Composite Video';
  347. 1129731138 {BTVC} : result := 'Conexant Composite Video';
  348. 808539970 {BW10} : result := 'Data Translation Broadway MPEG Capture/Compression';
  349. 842089283 {CC12} : result := 'Intel YUV12 Codec';
  350. 1129727043 {CDVC} : result := 'Canopus DV Codec';
  351. 1128482371 {CFCC} : result := 'Conkrete DPS Perception Motion JPEG';
  352. 1229211459 {CGDI} : result := 'Camcorder Video (MS Office 97)';
  353. 1296123971 {CHAM} : result := 'WinNow Caviara Champagne';
  354. 1196444227 {CJPG} : result := 'Creative Video Blaster Webcam Go JPEG';
  355. 1380600899 {CLJR} : result := 'Cirrus Logic YUV 4:1:1';
  356. 1264143683 {CMYK} : result := 'Common Data Format in Printing';
  357. 1095520323 {CPLA} : result := 'Weitek YUV 4:2:0 Planar';
  358. 1296126531 {CRAM} : result := 'Microsoft Video 1';
  359. 1145656899 {CVID} : result := 'Cinepak by Radius YUV 4:2:2';
  360. 1414289219 {CWLT} : result := 'Microsoft Color WLT DIB';
  361. 1448433987 {CYUV} : result := 'Creative Labs YUV 4:2:2';
  362. 1498765635 {CYUY} : result := 'ATI Technologies YUV';
  363. 825635396 {D261} : result := 'H.261';
  364. 859189828 {D263} : result := 'H.263';
  365. 4344132 {DIB } : result := 'Full Frames (Uncompressed)';
  366. 827738436 {DIV1} : result := 'FFmpeg-4 V1 (hacked MS MPEG-4 V1)';
  367. 844515652 {DIV2} : result := 'FFmpeg-4 V2 (hacked MS MPEG-4 V2)';
  368. 861292868 {DIV3} : result := 'DivX;-) MPEG-4 Low-Motion';
  369. 878070084 {DIV4} : result := 'DivX;-) MPEG-4 Fast-Motion';
  370. 894847300 {DIV5} : result := 'DivX MPEG-4';
  371. 911624516 {DIV6} : result := 'DivX MPEG-4';
  372. 1482049860 {DIVX} : result := 'OpenDivX (DivX 4.0 and later)';
  373. 826428740 {DMB1} : result := 'Matrox Rainbow Runner hardware compression (Motion JPEG)';
  374. 843205956 {DMB2} : result := 'Motion JPEG codec used by Paradigm';
  375. 810766404 {DPS0} : result := 'DPS Reality Motion JPEG';
  376. 1129533508 {DPSC} : result := 'DPS PAR Motion JPEG';
  377. 1146508100 {DSVD} : result := 'Microsoft DirectShow DV';
  378. 1262703940 {DUCK} : result := 'True Motion 1.0';
  379. 892491332 {DV25} : result := 'Matrox DVCPRO codec';
  380. 808801860 {DV50} : result := 'Matrox DVCPRO50 codec';
  381. 4412996 {DVC } : result := 'MainConcept DV Codec';
  382. 1346590276 {DVCP} : result := 'Sony Digital Video (DV)';
  383. 843404868 {DVE2} : result := 'DVE-2 Videoconferencing Codec';
  384. 1145591364 {DVHD} : result := 'DV 1125 lines at 30.00 Hz or 1250 lines at 25.00 Hz';
  385. 1095587396 {DVMA} : result := 'Darim Vision DVMPEG';
  386. 827545156 {DVS1} : result := 'DV compressed in SD (SDL)';
  387. 1146312260 {DVSD} : result := 'Sony Digital Video (DV) 525 lines at 29.97 Hz or 625 lines at 25.00 Hz';
  388. 827872836 {DVX1} : result := 'DVX1000SP Video Decoder';
  389. 844650052 {DVX2} : result := 'DVX2000S Video Decoder';
  390. 861427268 {DVX3} : result := 'DVX3000S Video Decoder';
  391. 808802372 {DX50} : result := 'DivX 5.0 codec';
  392. 827611204 {DXT1} : result := 'DirectX Compressed Texture';
  393. 844388420 {DXT2} : result := 'DirectX Compressed Texture';
  394. 861165636 {DXT3} : result := 'DirectX Compressed Texture';
  395. 877942852 {DXT4} : result := 'DirectX Compressed Texture';
  396. 894720068 {DXT5} : result := 'DirectX Compressed Texture';
  397. 1129601092 {DXTC} : result := 'DirectX Texture Compression';
  398. 810634053 {EKQ0} : result := 'Else graphics card codec';
  399. 810241093 {ELK0} : result := 'Else graphics card codec';
  400. 1446137157 {EM2V} : result := 'Etymonix MPEG-2 I-frame';
  401. 1346589509 {ESCP} : result := 'Eidos Technologies Escape codec';
  402. 827741253 {ETV1} : result := 'eTreppid Video Codec';
  403. 844518469 {ETV2} : result := 'eTreppid Video Codec';
  404. 1129731141 {ETVC} : result := 'eTreppid Video Codec';
  405. 1347046470 {FLJP} : result := 'Field Encoded Motion JPEG (Targa emulation)';
  406. 1096241734 {FRWA} : result := 'Darim Vision Forward Motion JPEG with Alpha-channel';
  407. 1146573382 {FRWD} : result := 'Darim Vision Forward Motion JPEG';
  408. 1415008838 {FRWT} : result := 'Darim Vision Forward Motion JPEG';
  409. 1431786054 {FRWU} : result := 'Darim Vision Forward Uncompressed';
  410. 826693190 {FVF1} : result := 'Fractal Video Frame';
  411. 1464227398 {FVFW} : result := 'ff MPEG-4 based on XviD codec';
  412. 1465535559 {GLZW} : result := 'Motion LZW by gabest@freemail.hu';
  413. 1195724871 {GPEG} : result := 'Motion JPEG by gabest@freemail.hu (with floating point)';
  414. 1414289223 {GWLT} : result := 'Microsoft Greyscale WLT DIB';
  415. 808858184 {H260} : result := 'H.260';
  416. 825635400 {H261} : result := 'H.261';
  417. 842412616 {H262} : result := 'H.262';
  418. 859189832 {H263} : result := 'Intel ITU H.263';
  419. 875967048 {H264} : result := 'H.264';
  420. 892744264 {H265} : result := 'H.265';
  421. 909521480 {H266} : result := 'H.266';
  422. 926298696 {H267} : result := 'H.267';
  423. 943075912 {H268} : result := 'H.268';
  424. 959853128 {H269} : result := 'H.263 for POTS-based videoconferencing';
  425. 1431914056 {HFYU} : result := 'Huffman Lossless Codec YUV and RGB formats (with Alpha-channel)';
  426. 1380142408 {HMCR} : result := 'Rendition Motion Compensation Format';
  427. 1381125448 {HMRR} : result := 'Rendition Motion Compensation Format';
  428. 859189833 {I263} : result := 'Intel ITU H.263';
  429. 808596553 {I420} : result := 'Intel Indeo 4 H.263';
  430. 5128521 {IAN } : result := 'Indeo 4 (RDX) Codec';
  431. 1398161737 {IAVS} : result := 'interleaved audio and video stream';
  432. 1112294217 {ICLB} : result := 'CellB Videoconferencing Codec';
  433. 1380927305 {IGOR} : result := 'Power DVD';
  434. 1196444233 {IJPG} : result := 'Intergraph JPEG';
  435. 1129729097 {ILVC} : result := 'Intel Layered Video';
  436. 1381387337 {ILVR} : result := 'ITU H.263+ Codec';
  437. 1447317577 {IPDV} : result := 'Giga AVI DV Codec';
  438. 825381449 {IR21} : result := 'Intel Indeo 2.1';
  439. 1463898697 {IRAW} : result := 'Intel YUV Uncompressed';
  440. 1448695113 {IUYV} : result := 'Interlaced version of UYVY (line order 0, 2, 4,....,1, 3, 5....)';
  441. 808670793 {IV30} : result := 'Intel Indeo Video 3';
  442. 825448009 {IV31} : result := 'Intel Indeo Video 3.1';
  443. 842225225 {IV32} : result := 'Intel Indeo Video 3.2';
  444. 859002441 {IV33} : result := 'Intel Indeo Video 3.3';
  445. 875779657 {IV34} : result := 'Intel Indeo Video 3.4';
  446. 892556873 {IV35} : result := 'Intel Indeo Video 3.5';
  447. 909334089 {IV36} : result := 'Intel Indeo Video 3.6';
  448. 926111305 {IV37} : result := 'Intel Indeo Video 3.7';
  449. 942888521 {IV38} : result := 'Intel Indeo Video 3.8';
  450. 959665737 {IV39} : result := 'Intel Indeo Video 3.9';
  451. 808736329 {IV40} : result := 'Intel Indeo Video 4.0';
  452. 825513545 {IV41} : result := 'Intel Indeo Video 4.1';
  453. 842290761 {IV42} : result := 'Intel Indeo Video 4.2';
  454. 859067977 {IV43} : result := 'Intel Indeo Video 4.3';
  455. 875845193 {IV44} : result := 'Intel Indeo Video 4.4';
  456. 892622409 {IV45} : result := 'Intel Indeo Video 4.5';
  457. 909399625 {IV46} : result := 'Intel Indeo Video 4.6';
  458. 926176841 {IV47} : result := 'Intel Indeo Video 4.7';
  459. 942954057 {IV48} : result := 'Intel Indeo Video 4.8';
  460. 959731273 {IV49} : result := 'Intel Indeo Video 4.9';
  461. 808801865 {IV50} : result := 'Intel Indeo Video 5.0 Wavelet';
  462. 825514313 {IY41} : result := 'Interlaced version of Y41P (line order 0, 2, 4,....,1, 3, 5....)';
  463. 827677001 {IYU1} : result := '12 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec';
  464. 844454217 {IYU2} : result := '24 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec';
  465. 1448433993 {IYUV} : result := 'Intel Indeo iYUV 4:2:0';
  466. 1195724874 {JPEG} : result := 'Still Image JPEG DIB';
  467. 1279742026 {JPGL} : result := 'DIVIO JPEG Light for WebCams';
  468. 1129729355 {KMVC} : result := 'Karl Morton Video Codec';
  469. 1145128268 {LEAD} : result := 'LEAD Video Codec';
  470. 1196444236 {LJPG} : result := 'LEAD Motion JPEG Codec';
  471. 1297503052 {LSVM} : result := 'Vianet Lighting Strike Vmail (Streaming)';
  472. 825635405 {M261} : result := 'Microsoft H.261';
  473. 859189837 {M263} : result := 'Microsoft H.263';
  474. 844313677 {M4S2} : result := 'Microsoft MPEG-4 (hacked MS MPEG-4)';
  475. 842089293 {MC12} : result := 'ATI Motion Compensation Format';
  476. 1296122701 {MCAM} : result := 'ATI Motion Compensation Format';
  477. 1146504269 {MDVD} : result := 'Alex MicroDVD Video (hacked MS MPEG-4)';
  478. 1127369293 {MJ2C} : result := 'Morgan Multimedia JPEG2000 Compression';
  479. 1095780941 {MJPA} : result := 'Pinnacle Motion JPEG with Alpha-channel';
  480. 1112558157 {MJPB} : result := 'Motion JPEG codec';
  481. 1196444237 {MJPG} : result := 'IBM Motion JPEG including Huffman Tables';
  482. 1397050701 {MMES} : result := 'Matrox MPEG-2 I-frame';
  483. 842289229 {MP42} : result := 'Microsoft MPEG-4 V2';
  484. 859066445 {MP43} : result := 'Microsoft MPEG-4 V3';
  485. 1395937357 {MP4S} : result := 'Microsoft MPEG-4 (hacked MS MPEG-4)';
  486. 1446269005 {MP4V} : result := 'Microsoft MPEG-4 (hacked MS MPEG-4)';
  487. 1195724877 {MPEG} : result := 'Chromatic MPEG 1 Video I Frame';
  488. 826757197 {MPG1} : result := 'FFmpeg-1';
  489. 843534413 {MPG2} : result := 'FFmpeg-1';
  490. 860311629 {MPG3} : result := 'Same as Low motion DivX MPEG-4';
  491. 877088845 {MPG4} : result := 'Microsoft MPEG-4 V1';
  492. 1229410381 {MPGI} : result := 'Sigma Design MPEG-1 I-frame';
  493. 1196314701 {MPNG} : result := 'Motion PNG codec';
  494. 1094931021 {MRCA} : result := 'FAST Multimedia MR Codec';
  495. 1162629709 {MRLE} : result := 'Microsoft Run Length Encoding';
  496. 827544397 {MSS1} : result := 'Windows Screen Video';
  497. 1129730893 {MSVC} : result := 'Microsoft Video 1';
  498. 1213879117 {MSZH} : result := 'Lossless codec (ZIP compression)';
  499. 827872333 {MTX1} : result := 'Matrox codec';
  500. 844649549 {MTX2} : result := 'Matrox codec';
  501. 861426765 {MTX3} : result := 'Matrox codec';
  502. 878203981 {MTX4} : result := 'Matrox codec';
  503. 894981197 {MTX5} : result := 'Matrox codec';
  504. 911758413 {MTX6} : result := 'Matrox codec';
  505. 928535629 {MTX7} : result := 'Matrox codec';
  506. 945312845 {MTX8} : result := 'Matrox codec';
  507. 962090061 {MTX9} : result := 'Matrox codec';
  508. 827742029 {MWV1} : result := 'Aware Motion Wavelets';
  509. 1230389582 {NAVI} : result := 'nAVI video codec (hacked MS MPEG-4)';
  510. 808473678 {NT00} : result := 'NewTek LigtWave HDTV YUV with Alpha-channel';
  511. 827216974 {NTN1} : result := 'Nogatech Video Compression 1';
  512. 827741518 {NUV1} : result := 'NuppelVideo';
  513. 810767950 {NVS0} : result := 'Nvidia texture compression format';
  514. 827545166 {NVS1} : result := 'Nvidia texture compression format';
  515. 844322382 {NVS2} : result := 'Nvidia texture compression format';
  516. 861099598 {NVS3} : result := 'Nvidia texture compression format';
  517. 877876814 {NVS4} : result := 'Nvidia texture compression format';
  518. 894654030 {NVS5} : result := 'Nvidia texture compression format';
  519. 810833486 {NVT0} : result := 'Nvidia texture compression format';
  520. 827610702 {NVT1} : result := 'Nvidia texture compression format';
  521. 844387918 {NVT2} : result := 'Nvidia texture compression format';
  522. 861165134 {NVT3} : result := 'Nvidia texture compression format';
  523. 877942350 {NVT4} : result := 'Nvidia texture compression format';
  524. 894719566 {NVT5} : result := 'Nvidia texture compression format';
  525. 1129727056 {PDVC} : result := 'Panasonic DV codec';
  526. 1448494928 {PGVV} : result := 'Radius Video Vision Telecast (adaptive JPEG)';
  527. 1330464848 {PHMO} : result := 'Photomotion';
  528. 827148624 {PIM1} : result := 'Pegasus Imaging codec';
  529. 843925840 {PIM2} : result := 'Pegasus Imaging codec';
  530. 1246579024 {PIMJ} : result := 'Pegasus Imaging PICvideo Lossless JPEG';
  531. 1514493520 {PVEZ} : result := 'Horizons Technology PowerEZ codec';
  532. 1296914000 {PVMM} : result := 'PacketVideo Corporation MPEG-4';
  533. 844584528 {PVW2} : result := 'Pegasus Imaging Wavelet 2000';
  534. 808333649 {Q1.0} : result := 'Q-Team QPEG 1.0';
  535. 1195724881 {QPEG} : result := 'Q-Team QPEG 1.1';
  536. 1363497041 {QPEQ} : result := 'Q-Team QPEG 1.1';
  537. 5718354 {RAW } : result := 'Full Frames (Uncompressed)';
  538. 4343634 {RGB } : result := 'Full Frames (Uncompressed)';
  539. 1094862674 {RGBA} : result := 'Raw RGB with alpha';
  540. 1413629778 {RGBT} : result := 'Uncompressed RGB with transparency';
  541. 876956754 {RLE4} : result := 'Run length encoded 4bpp RGB image';
  542. 944065618 {RLE8} : result := 'Run length encoded 8bpp RGB image';
  543. 4541522 {RLE } : result := 'Raw RGB with arbitrary sample packing within a pixel';
  544. 877677906 {RMP4} : result := 'REALmagic MPEG-4 Video Codec';
  545. 1096437842 {RPZA} : result := 'Apple Video 16 bit "road pizza"';
  546. 825381970 {RT21} : result := 'Intel Real Time Video 2.1';
  547. 809784658 {RUD0} : result := 'Rududu video codec';
  548. 808539730 {RV10} : result := 'RealVideo codec';
  549. 858871378 {RV13} : result := 'RealVideo codec';
  550. 808605266 {RV20} : result := 'RealVideo G2';
  551. 808670802 {RV30} : result := 'RealVideo 8';
  552. 5789266 {RVX } : result := 'Intel RDX';
  553. 842150995 {S422} : result := 'VideoCap C210 YUV Codec';
  554. 1128481875 {SDCC} : result := 'Sun Digital Camera Codec';
  555. 1129137747 {SFMC} : result := 'Crystal Net SFM Codec';
  556. 1196444243 {SJPG} : result := 'White Pine (ex Paradigm Matrix) Motion JPEG';
  557. 4410707 {SMC } : result := 'Apple Graphics (SMC) codec (256 color)';
  558. 1129532755 {SMSC} : result := 'Radius proprietary codec';
  559. 1146309971 {SMSD} : result := 'Radius proprietary codec';
  560. 1448299859 {SMSV} : result := 'WorldConnect Wavelet Streaming Video';
  561. 1195987027 {SPIG} : result := 'Radius Spigot';
  562. 1129074771 {SPLC} : result := 'Splash Studios ACM Audio Codec';
  563. 844779859 {SQZ2} : result := 'Microsoft VXTreme Video Codec V2';
  564. 1096176723 {STVA} : result := 'ST CMOS Imager Data (Bayer)';
  565. 1112953939 {STVB} : result := 'ST CMOS Imager Data (Nudged Bayer)';
  566. 1129731155 {STVC} : result := 'ST CMOS Imager Data (Bunched)';
  567. 1482052691 {STVX} : result := 'ST CMOS Imager Data (Extended)';
  568. 1498829907 {STVY} : result := 'ST CMOS Imager Data (Extended with Correction Data)';
  569. 808539731 {SV10} : result := 'Sorenson Media Video R1';
  570. 827414099 {SVQ1} : result := 'Sorenson Video (Apple Quicktime 3)';
  571. 860968531 {SVQ3} : result := 'Sorenson Video 3 (Apple Quicktime 5)';
  572. 808596564 {T420} : result := 'Toshiba YUV 4:2:0';
  573. 1397574740 {TLMS} : result := 'TeraLogic Motion Infraframe Codec A';
  574. 1414745172 {TLST} : result := 'TeraLogic Motion Infraframe Codec B';
  575. 808602964 {TM20} : result := 'Duck TrueMotion 2.0';
  576. 1093815636 {TM2A} : result := 'Duck TrueMotion Archiver 2.0';
  577. 1479691604 {TM2X} : result := 'Duck TrueMotion 2X';
  578. 1128877396 {TMIC} : result := 'TeraLogic Motion Intraframe Codec 2';
  579. 1414483284 {TMOT} : result := 'TrueMotion Video Compression';
  580. 808604244 {TR20} : result := 'Duck TrueMotion RT 2.0';
  581. 1128485716 {TSCC} : result := 'TechSmith Screen Capture Codec';
  582. 808539732 {TV10} : result := 'Tecomac Low-Bit Rate Codec';
  583. 1246582356 {TVMJ} : result := 'Field Encoded Motion JPEG (Targa emulation)';
  584. 1311791444 {TY0N} : result := 'Trident Decompression Driver';
  585. 1127373140 {TY2C} : result := 'Trident Decompression Driver';
  586. 1311922516 {TY2N} : result := 'Trident Decompression Driver';
  587. 859189845 {U263} : result := 'UB Video StreamForce H.263';
  588. 1146045269 {UCOD} : result := 'ClearVideo (fractal compression-based codec)';
  589. 1230261333 {ULTI} : result := 'IBM Corp. Ultimotion';
  590. 1447975253 {UYNV} : result := 'A direct copy of UYVY registered by NVidia to work around problems in some old codecs which did not like hardware which offered more than 2 UYVY surfaces';
  591. 1347836245 {UYVP} : result := 'YCbCr 4:2:2 extended precision 10-bits per component in U0Y0V0Y1 order';
  592. 1498831189 {UYVY} : result := 'YUV 4:2:2 (Y sample at every pixel, U and V sampled at every second pixel horizontally on each line)';
  593. 825635414 {V261} : result := 'Lucent VX2000S';
  594. 842150998 {V422} : result := 'Vitec Multimedia YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel';
  595. 892679766 {V655} : result := 'Vitec Multimedia 16 bit YUV 4:2:2 (6:5:5) format';
  596. 827474774 {VCR1} : result := 'ATI VCR 1.0';
  597. 844251990 {VCR2} : result := 'ATI VCR 2.0 (MPEG YV12)';
  598. 861029206 {VCR3} : result := 'ATI VCR 3.0';
  599. 877806422 {VCR4} : result := 'ATI VCR 4.0';
  600. 894583638 {VCR5} : result := 'ATI VCR 5.0';
  601. 911360854 {VCR6} : result := 'ATI VCR 6.0';
  602. 928138070 {VCR7} : result := 'ATI VCR 7.0';
  603. 944915286 {VCR8} : result := 'ATI VCR 8.0';
  604. 961692502 {VCR9} : result := 'ATI VCR 9.0';
  605. 1413694550 {VDCT} : result := 'Video Maker Pro DIB';
  606. 1297040470 {VDOM} : result := 'VDOnet VDOWave';
  607. 1464812630 {VDOW} : result := 'VDOLive (H.263)';
  608. 1515471958 {VDTZ} : result := 'Darim Vision VideoTizer YUV';
  609. 1481656150 {VGPX} : result := 'Alaris VGPixel Codec';
  610. 1396984150 {VIDS} : result := 'Vitec Multimedia YUV 4:2:2 codec';
  611. 1346783574 {VIFP} : result := 'Virtual Frame API codec (VFAPI)';
  612. 827738454 {VIV1} : result := 'Vivo H.263';
  613. 844515670 {VIV2} : result := 'Vivo H.263';
  614. 1331054934 {VIVO} : result := 'Vivo H.263';
  615. 1280854358 {VIXL} : result := 'miroVideo XL';
  616. 827739222 {VLV1} : result := 'VideoLogic codec';
  617. 808669270 {VP30} : result := 'On2 (ex Duck TrueMotion) VP3';
  618. 825446486 {VP31} : result := 'On2 (ex Duck TrueMotion) VP3';
  619. 1261525078 {VX1K} : result := 'Lucent VX1000S Video Codec';
  620. 1261590614 {VX2K} : result := 'Lucent VX2000S Video Codec';
  621. 1347639382 {VXSP} : result := 'Lucent VX1000SP Video Codec';
  622. 1129726551 {WBVC} : result := 'Winbond W9960 codec';
  623. 1296123991 {WHAM} : result := 'Microsoft Video 1';
  624. 1481525591 {WINX} : result := 'Winnov Software Compression';
  625. 1196444247 {WJPG} : result := 'Winbond JPEG';
  626. 827739479 {WMV1} : result := 'Windows Media Video 7';
  627. 844516695 {WMV2} : result := 'Windows Media Video 8';
  628. 861293911 {WMV3} : result := 'Windows Media Video 9';
  629. 827739735 {WNV1} : result := 'WinNow Videum Hardware Compression';
  630. 859189848 {X263} : result := 'Xirlink H.263';
  631. 810962008 {XLV0} : result := 'NetXL Inc. XL Video Decoder';
  632. 1196445016 {XMPG} : result := 'XING MPEG (I frame only)';
  633. 1145656920 {XVID} : result := 'XviD MPEG-4 codec';
  634. 825307737 {Y211} : result := 'Packed YUV format with Y sampled at every second pixel across each line and U and V sampled at every fourth pixel';
  635. 825308249 {Y411} : result := 'YUV 4:1:1 Packed';
  636. 1110520921 {Y41B} : result := 'YUV 4:1:1 Planar';
  637. 1345401945 {Y41P} : result := 'Conexant (ex Brooktree) YUV 4:1:1 Raw';
  638. 1412510809 {Y41T} : result := 'Format as for Y41P but the lsb of each Y component is used to signal pixel transparency';
  639. 842151001 {Y422} : result := 'Direct copy of UYVY as used by ADS Technologies Pyro WebCam firewire camera';
  640. 1110586457 {Y42B} : result := 'YUV 4:2:2 Planar';
  641. 1412576345 {Y42T} : result := 'Format as for UYVY but the lsb of each Y component is used to signal pixel transparency';
  642. 808466521 {Y800} : result := 'Simple grayscale video';
  643. 536885337 {Y8 } : result := 'Simple grayscale video';
  644. 842089305 {YC12} : result := 'Intel YUV12 Codec';
  645. 1447974233 {YUNV} : result := 'A direct copy of YUY2 registered by NVidia to work around problems in some old codecs which did not like hardware which offered more than 2 YUY2 surfaces';
  646. 945182041 {YUV8} : result := 'Winnov Caviar YUV8';
  647. 961959257 {YUV9} : result := 'Intel YUV9';
  648. 1347835225 {YUVP} : result := 'YCbCr 4:2:2 extended precision 10-bits per component in Y0U0Y1V0 order';
  649. 844715353 {YUY2} : result := 'YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel';
  650. 1448695129 {YUYV} : result := 'Canopus YUV format';
  651. 842094169 {YV12} : result := 'ATI YVU12 4:2:0 Planar';
  652. 961893977 {YVU9} : result := 'Brooktree YVU9 Raw (YVU9 Planar)';
  653. 1431918169 {YVYU} : result := 'YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel';
  654. 1112099930 {ZLIB} : result := 'Lossless codec (ZIP compression)';
  655. 1195724890 {ZPEG} : result := 'Metheus Video Zipper';
  656. else
  657. result := W_STR_07;