MOVIETEXTURE 1. specs web3d movietexture http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/texturing.html#MovieTexture mpeg-1 http://en.wikipedia.org/wiki/MPEG-1 2. freewrl architecture choices and node analogies node analogies: - like AudioClip - like ImageTexture frame2texture strategies - hide behind .getFrame(tickTime) function a) batch convert once (previously attempted years ago, takes up RAM) b) convert as frames are being played a) synchronously, frame(t) interpolated from I,P frames, converted on demand b) in separate thread at speed, with last frame rendered available to rendering thread c) b) except yuv2rgb synchronously on demand/as needed - yuv2rgb conversion (technically it is YCrCb - the digital equivalent of analog YUV but some call it YUV) http://en.wikipedia.org/wiki/YCbCr http://en.wikipedia.org/wiki/YUV a) on cpu side - coprocessor/openCL/GPU accelleration, assembly language, or straight C b) yuv2rgb in shader(s) during render 3. #defining in freewrl - so not functional if not wanted/codec ban, but doesn't bomb if there's a .mpg / movietexture node - optional different library - host native, ffmpeg/libav, libmpeg2 - use or lose MPEG_Utils.c 4. libraries 1.a) https://www.ffmpeg.org/ - has mpeg2, with licensing issues 1.b) https://libav.org/ - ditto because based on ffmpeg ffmpeg vs libav: https://github.com/mpv-player/mpv/wiki/FFmpeg-versus-Libav 2) http://libmpeg2.sourceforge.net/ license GPL pollutes freewrl LGPL 3) berkley mpeg_play derivitives: a) berkley-brown - what freewrl used back in 2009 b) berkley-greg - http://www.gerg.ca/software/mpeglib/ license mostly berkley but ??? for hacker c) berkley-nabg http://www.uow.edu.au/~nabg/MPEG/mpeg1.html license berkley + dowhatyouwant/berkley from hacker comparisons: - stable vs modern - developer short-term and long-term ease - codecs > patents and licenses, downloads/installs vs compiled in - C API or C wrapper on C++ - faux C API (if needed) for DirectShow and winRT re-implementation https://msdn.microsoft.com/en-us/library/windows/desktop/bb970335(v=vs.85).aspx media foundation replaces directshow https://msdn.microsoft.com/en-us/library/windows/desktop/hh162912(v=VS.85).aspx - DX11 video apis - architecture for retrieving frames - register callback for receiving completed frames (lib has work thread) - write-buffer pointer passed in (lib has work thread) - we supply work thread: in loop, monitoring results of synchronous work - architecture for supplying mpg data/stream - local file path - blob - chunks on demand (could stream from mobile camera for augmented reality?) 5. test x3d scene(s) NIST - including mpeg1 sound, video, both, time, and imagetexture interfaces http://www.web3d.org/x3d/content/examples/ConformanceNist/Appearance/MovieTexture/ /movietexture/movie_control.wrl -vivaty does pause, resume, stop, start, loop. But not speed - and not no-loop if already at end, or is it Start's fault 6. July 2016 I like MPEG1 because a) the specs say that's what you should support, and b) patents expired The problem is finding a library that a) has only patent free mpeg1 b) LGPL compatible license ie MIT, berkley c) c/c++ d) audio and video e) interface API can be made to work for Sound node and MovieTexture I'll try re-constructing John's berkley-brown before trying anything else 7. Nov 2016 x berkley code from freewrl 2003 - bombs on vts.mpg x libmpeg2 - runs example file, but not documented, and I see no audio support, and GPL * I have ffmpeg working a bit, with video and audio, with decode_on_load method x won't play a 1min video because runs out of ram during decode_on_load ie apple1984.mp4 63 seconds x 30fps x 640x480x4 = 2GB