#N canvas 163 143 704 623 10;
#X declare -lib Gem;
#X text 452 8 GEM object;
#X obj 9 272 cnv 15 430 340 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X text 40 274 Inlets:;
#X text 39 487 Outlets:;
#X obj 9 239 cnv 15 430 30 empty empty empty 20 12 0 14 #bcbcbc #404040 0;
#X text 18 238 Arguments:;
#X obj 8 56 cnv 15 430 180 empty empty empty 20 12 0 14 #e0e0e0 #404040 0;
#X obj 449 57 cnv 15 250 450 empty empty empty 20 12 0 14 #dce4fc #404040 0;
#X text 453 40 Example:;
#X obj 574 440 cnv 15 100 60 empty empty empty 20 12 0 14 #bcbcbc #404040 0;
#X obj 451 88 cnv 15 215 300 empty empty empty 20 12 0 14 #14e814 #404040 0;
#X obj 451 63 gemhead;
#X text 17 503 Outlet 1: gemlist;
#X text 18 288 Inlet 1: gemlist, f 68;
#X obj 463 90 bng 25 250 50 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000;
#X text 505 57 open a supported;
#X text 506 68 movie-clip;
#X floatatom 466 352 5 0 0 3 length - - 0;
#X floatatom 514 352 5 0 0 3 width - - 0;
#X floatatom 565 352 5 0 0 3 height - - 0;
#X floatatom 504 263 5 0 10000 1 frameNum - - 0;
#X text 71 31 Class: pix object (pix source);
#X text 29 57 Description: load in a movie-file;
#X obj 463 117 openpanel;
#X text 50 12 Synopsis: [pix_film];
#X text 15 78 [pix_film] loads in a preproduced digital-video to be used as a texture \, bitblit or something else., f 69;
#X text 64 249 symbol: file to load initially;
#X text 18 303 Inlet 1: message: open <filename> [RGBA|YUV|Grey]: opens the movie <filename> \, decodes it into the specified color-space if supported., f 69;
#X text 18 336 Inlet 1: message: colorspace "RGBA|YUV|Grey": decodes the current film into the specified colorspace \, if supported., f 69;
#X text 18 365 Inlet 1: message : auto 1|0 : starts/stops automatic playback. (default:0), f 69;
#X text 17 576 Outlet 3: bang: indicates that the last frame has been reached. (or: an illegal frame would have been decoded), f 69;
#X msg 469 174 auto \$1;
#X obj 469 156 tgl 15 0 empty empty empty 0 -6 0 8 #fcfcfc #000000 #000000 0 1;
#X msg 480 193 colorspace Grey;
#X text 17 520 Outlet 2: list: <length> <width> <height> <fps>: gets the dimensions (in frames and pixels) of a film when it gets loaded. if length is not available (video-streams) -1 is returned., f 69;
#N canvas 18 93 928 614 :: 0;
#X text 24 16 the format [pix_film] is able to decode depends on the system you are running Gem.;
#X text 33 52 basically Gem's decoding capabilities are handled by plugins. You should see \, which plugins are loaded \, when instantiating the first [pix_film] object: a line "[pix_film]: foo support" means \, that the 'foo' plugin has been loaded.;
#X text 453 50 you can add a plugin to your system by simply copying the plugin-binary called "gem_filmNAME.dll" (or gem_filmNAME.so if you are on a unix-like system) into your Gem-directory (where you find the Gem-binary \, e.g. Gem.dll);
#X text 456 103 if you want to remove a plugin (e.g. because you are not satisfied with the decoding quality of because it is unstable) \, you can simply remove the corresponding gem_filmNAME.dll file from your Gem-directory.;
#X text 35 123 which media can be decoded \, depends on the installed plugins and on the codecs you have installed on your system.;
#X obj 45 248 cnv 15 200 15 empty empty empty 20 12 0 14 #c4c4fc #404040 0;
#X obj 45 303 cnv 15 200 15 empty empty empty 20 12 0 14 #c4c4fc #404040 0;
#X obj 445 248 cnv 15 200 15 empty empty empty 20 12 0 14 #c4c4fc #404040 0;
#X text 449 249 Gmerlin (gem_filmGMERLIN);
#X text 49 249 QuickTime (gem_filmQT);
#X text 73 262 available on OS-X (PPC and i386 \, but not 64bit!) and W32;
#X text 73 277 should be able to decode any QuickTime MOV \, and probably a lot more;
#X text 49 304 DirectShow (gem_filmDS);
#X text 73 317 available on W32;
#X text 73 331 should be able to decode anything for which you have a DirectShow filter installed;
#X text 50 365 AVI (gem_filmAVI);
#X text 73 380 available on W32;
#X text 73 394 this uses the old (pre-XP) W32-API for decoding movies. Support for newer codecs is probably limited;
#X text 50 424 AVIPLAY (gem_filmAVIPLAY);
#X text 73 439 available on linux;
#X text 74 452 uses the meta-framework "avifile" to decode movies \, which itself has a plugin system to use ffmpeg \, vorbis \, w32-dlls \, ... to decode videos;
#X text 73 507 available on linux;
#X text 50 494 quicktime4linux (gem_filmQT4L);
#X text 73 522 uses libquicktime/lqt for decoding;
#X text 473 262 available on linux (probably also on OSX and W32);
#X text 473 277 uses Gmerlin-avdecoder to decode lots of formats;
#X text 449 304 MPEG3 (gem_filmMPEG3);
#X text 473 317 available on linux;
#X text 473 331 should be able to decode various MPEG-formats (e.g. MPEG-2-Video and MPEG-2-transportstreams);
#X text 473 380 available on linux;
#X text 473 394 uses an old \, buggy (and no longer developed) library to decode MPEG-streams;
#X text 450 365 MPEG (gem_filmMPEG1);
#X text 450 424 Darwin (gem_filmDarwin);
#X text 473 439 available on OS-X;
#X text 450 484 test (gem_TEST);
#X text 473 497 available on ALL platforms;
#X text 473 512 outputs test images rather than decoding real media files;
#X text 270 194 available film decoding plugins;
#X text 260 210 (recommended plugins are highlighted);
#X text 474 452 an alternative implementation of the QuickTime plugin for OS-X only;
#X restore 455 484 pd :: FORMATS;
#X obj 473 325 unpack 0 0 0 0;
#X floatatom 581 326 5 0 0 1 fps - - 0;
#X obj 451 281 pix_film;
#X msg 489 217 bang;
#X text 17 418 Inlet 1: message : bang: (re)send the l/w/h/fps info to the 2nd outlet, f 69;
#X text 14 151 Normally \, you will only get one specified (via the second inlet) frame of the film. To play back a complete film \, you have to change the frame accordingly \, OR use the "auto" message \, to automatically proceed to the next frame each rendering-cycle. In auto-mode \, the film is NOT looped. Instead you can reset the current-frame to zero when the end of the film is reached., f 69;
#X text 16 445 Inlet 2: float: <frame#> changes the frame to be decoded on rendering (starting with 0), f 69;
#X text 17 391 Inlet 1: message : backend <name>: open the film using only the specified backend(s), f 70;
#N canvas 484 243 450 300 META 0;
#X obj 10 25 declare -lib Gem;
#X text 10 45 DESCRIPTION load in a movie-file;
#X text 10 65 KEYWORDS Gem pix image;
#X text 20 85 INLET_0 gemlist open colorspace message;
#X text 20 105 INLET_1 float;
#X text 20 125 OUTLET_0 gemlist;
#X text 20 145 OUTLET_1 list;
#X text 20 165 OUTLET_2 bang;
#X text 10 185 AUTHOR IOhannes m zmölnig;
#X text 10 205 LICENSE GPL v2;
#X restore 578 8 pd META;
#N canvas 2 93 450 310 :: 0;
#X text 35 220 If a specific colorspace is required \, it is strongly recommended to convert using [pix_rgba] \, [pix_yuv] \, [pix_grey] etc. This is the only way to guarantee a colorspace., f 60;
#X text 35 33 Note that the default colorspace may vary on different operating systems \, even for the same patch and same video file. For instance \, [pix_film] may output YUV images in macOS \, while the same patch and same video file may obtain RGB images in Linux. While most downstream [pix] objects can adapt automatically to the incoming format \, there are some (e.g. [pix_chroma_key]) which take a user-specified color as an input. Such objects are sensitive to the image's colorspace \, and patches using them may exhibit variable behavior on different OSes.;
#X text 35 172 Note also that codecs may choose to disregard the colorspace passed to pix_film -- you may or may not get the requested colorspace.;
#X restore 217 133 pd :: COLORSPACES;
#X text 14 104 You can open a specified film via the "open" message \, which takes an optional argument for the colorspace \, to which the movie should be decoded (RGBA \, YUV or Grey). See, f 70;
#X msg 463 136 open \$1 RGBA;
#X text 546 129 Recommended to specify colorspace!, f 20;
#X obj 457 584 _backendinfo \$0 film;
#X obj 489 241 r \$0-ctl;
#X obj 463 241 t a;
#X obj 509 282 route bang;
#X obj 509 302 bng 18 250 50 0 \$0-end \$0-end end_reached 20 9 0 10 #fcfcfc #000000 #000000;
#N canvas 6 49 515 369 print 0;
#X obj 102 176 inlet;
#X obj 102 198 s \$0-info;
#X obj 102 220 r \$0-infoprint;
#X obj 102 242 print INFO;
#X text 62 90 actually you can just hook a [print] to the 3rd outlet.;
#X text 64 115 here it's a bit more complicated \, as we want to filter out the messages generated from the [pd PROPERTIES] window.;
#X connect 0 0 1 0;
#X connect 2 0 3 0;
#X restore 583 282 pd print;
#X obj 451 410 _pix2rectangle 3;
#X obj 582 445 _gemwin;
#X connect 11 0 38 0;
#X connect 14 0 23 0;
#X connect 20 0 38 1;
#X connect 23 0 47 0;
#X connect 31 0 51 0;
#X connect 32 0 31 0;
#X connect 33 0 51 0;
#X connect 36 0 17 0;
#X connect 36 1 18 0;
#X connect 36 2 19 0;
#X connect 36 3 37 0;
#X connect 38 0 55 0;
#X connect 38 1 36 0;
#X connect 38 2 52 0;
#X connect 39 0 51 0;
#X connect 47 0 51 0;
#X connect 50 0 51 0;
#X connect 51 0 38 0;
#X connect 52 0 53 0;
#X connect 52 1 54 0;
