Insight3D provides a robust video reader, implementing IAgGxDynamicImageData, that can be used to create dynamic images. The video reader supports streaming from various protocols, and can play a large variety of media formats, codecs, frame rates and frame sizes. See below for the complete list.
|
|
|
Subsequent animation steps of a Marker primitive using a texture from an image constructed with the IAgGxVideoData interface. The video is streamed in real-time from the website in the code snippet below. |
Both real-time playback of video and synchronization of video with the animation in Insight3D is provided. When playing in real-time mode, the video will play at the rate defined by the video stream, or at the frame rate specified with the VideoFrameRate property. If the VideoLoop property is set to true, the video will loop to the first frame when it reaches past the last frame of the video.
Below, an image is loaded with a video stream from the http protocol:
IAgGxVideoData videoData = new AgGxVideoData(); videoData.Initialize(@"http://www.agi.com/corporate/mediaCenter/news/videos/US_ASAT.wmv"); videoData.VideoMode = AgGxVideoMode.VideoModeRealTime; videoData.VideoLoop = true; IAgGxImage dynamicImage = new AgGxImage(); dynamicImage.LoadFromDynamic(videoData);
The VideoStartTime/VideoEndTime, and VideoStartFrame/VideoEndFrame properties can be used to adjust where the video starts playback and where it ends. Since these properties are interelated, changing the VideoStartTime will also change the VideoStartFrame, and vice versa. The VideoEndTime and VideoEndFrame properties follow the same convention.
|
|
|
Subsequent animation steps of a Marker primitive using a texture from an image constructed with the IAgGxVideoData interface. The video is synchronized with an animation interval in the code snippet below. |
When playback is set to synchronize with Insight3D animation by setting the VideoMode to VideoModeAnimationTime, the video will play synchronized with the animation interval specified with the AnimationStartDate and AnimationEndDate properties. The start time of the video will coincide with the start date of the animation interval, and the end time of the video will coincide with the end date of the animation interval. For example, when the animation is played in reverse, or stepped to a specific animation time, the video will similarly play in reverse or step to the corresponding frame in the video at that animation time.
Below, an AgGxVideoData object is configured to play synchronized over an animation interval and loaded into an AgGxImage:
IAgGxVideoData videoReader = new AgGxVideoData(); videoReader.Initialize(Program.localDataPath + "ProjectedImagery/fig8.avi"); videoReader.VideoMode = AgGxVideoMode.VideoModeAnimationTime; videoReader.AnimationStartDate = 0.0; videoReader.AnimationEndDate = new JulianDate( CameraUtil.Control3D.Epoch).SecondsDifference( new JulianDate(DateTime.Parse("30 May 2008 14:41:58.162", CultureInfo.InvariantCulture))); IAgGxImage projectedImage = new AgGxImage(); projectedImage.LoadFromDynamic(videoReader);
As with any IAgGxImage loaded with IAgGxDynamicImageData, the image can be queried for its attributes and other data as if it were a static image:
Console.WriteLine(dynamicImage.Attributes.ImageName); Console.WriteLine(dynamicImage.Attributes.Width); Console.WriteLine(dynamicImage.Attributes.Height); Console.WriteLine(dynamicImage.Attributes.PixelAspectRatio);
| Extension | Description |
|---|---|
| 3g2 | 3gp2 format |
| 3gp | 3gp format |
| 4xm | 4X Technologies format |
| IFF | IFF format |
| MTV | MTV format |
| RoQ | Id RoQ format |
| aac | ADTS AAC |
| ac3 | raw ac3 |
| adts | ADTS AAC |
| aiff | Audio IFF |
| alaw | pcm A law format |
| amr | 3gpp amr file format |
| apc | CRYO APC format |
| ape | Monkey's Audio |
| asf | asf format |
| asf_stream | asf format |
| au | SUN AU Format |
| avi | avi format |
| avm2 | Flash 9 (AVM2) format |
| avs | AVISynth |
| bethsoftvid | Bethesda Softworks 'Daggerfall' VID format |
| c93 | Interplay C93 |
| crc | crc testing format |
| daud | D-Cinema audio format |
| dsicin | Delphine Software International CIN format |
| dts | raw dts |
| dv | DV video format |
| dvd | MPEG2 PS format (DVD VOB) |
| dxa | dxa |
| ea | Electronic Arts Multimedia Format |
| ea_cdata | Electronic Arts cdata |
| ffm | ffm format |
| film_cpk | Sega FILM/CPK format |
| flac | raw flac |
| flic | FLI/FLC/FLX animation format |
| flv | flv format |
| framecrc | framecrc testing format |
| gif | GIF Animation |
| gxf | GXF format |
| h261 | raw h261 |
| h263 | raw h263 |
| h264 | raw H264 video format |
| idcin | Id CIN format |
| image2 | image2 sequence |
| image2pipe | piped image2 sequence |
| ingenient | Ingenient MJPEG |
| ipmovie | Interplay MVE format |
| ipod | iPod H.264 mp4 format |
| libnut | nut format |
| lmlm4 | lmlm4 raw format |
| m4v | raw MPEG4 video format |
| matroska | Matroska File Format |
| mjpeg | MJPEG video |
| mm | American Laser Games MM format |
| mmf | mmf format |
| mov | mov format |
| mov,mp4,m4a,3gp,3g2,mj2 | QuickTime/MPEG4/Motion JPEG 2000 format |
| mp2 | MPEG audio layer 2 |
| mp3 | MPEG audio layer 3 |
| mp4 | mp4 format |
| mpc | musepack |
| mpc8 | musepack8 |
| mpeg | MPEG1 System format |
| mpeg1video | MPEG video |
| mpeg2video | MPEG2 video |
| mpegts | MPEG2 transport stream format |
| mpegtsraw | MPEG2 raw transport stream format |
| mpegvideo | MPEG video |
| mpjpeg | Mime multipart JPEG format |
| msnwctcp | MSN TCP Webcam stream |
| mulaw | pcm mu law format |
| mxf | MXF format |
| nsv | NullSoft Video format |
| null | null video format |
| nut | nut format |
| nuv | NuppelVideo format |
| ogg | Ogg format |
| psp | psp mp4 format |
| psxstr | Sony Playstation STR format |
| pva | pva file and stream format |
| rawvideo | raw video format |
| redir | Redirector format |
| rl2 | rl2 format |
| rm | rm format |
| rpl | RPL/ARMovie format |
| rtp | RTP output format |
| rtsp | RTSP input format |
| s16be | pcm signed 16 bit big endian format |
| s16le | pcm signed 16 bit little endian format |
| s8 | pcm signed 8 bit format |
| sdp | SDP |
| shn | raw shorten |
| siff | Beam Software SIFF |
| smk | Smacker Video |
| sol | Sierra SOL Format |
| svcd | MPEG2 PS format (VOB) |
| swf | Flash format |
| thp | THP |
| tiertexseq | Tiertex Limited SEQ format |
| tta | true-audio |
| txd | txd format |
| u16be | pcm unsigned 16 bit big endian format |
| u16le | pcm unsigned 16 bit little endian format |
| u8 | pcm unsigned 8 bit format |
| vc1 | raw vc1 |
| vc1test | VC1 test bitstream format |
| vcd | MPEG1 System format (VCD) |
| vfwcap | VFW video capture |
| vmd | Sierra VMD format |
| vob | MPEG2 PS format (VOB) |
| voc | Creative Voice File format |
| wav | wav format |
| wc3movie | Wing Commander III movie format |
| wsaud | Westwood Studios audio format |
| wsvqa | Westwood Studios VQA format |
| wv | WavPack |
| yuv4mpegpipe | YUV4MPEG pipe format |
| 4xm | 8bps | 8svx exponential decoder | 8svx fibonacci decoder | VMware video | aasc |
| ac3 | adpcm_4xm | adpcm_adx | adpcm_ct | adpcm_ea | adpcm_ea_r1 |
| adpcm_ea_r2 | adpcm_ea_r3 | adpcm_ea_xas | adpcm_ima_amv | adpcm_ima_dk3 | adpcm_ima_dk4 |
| adpcm_ima_ea_eacs | adpcm_ima_ea_sead | adpcm_ima_qt | adpcm_ima_smjpeg | adpcm_ima_wav | adpcm_ima_ws |
| adpcm_ms | adpcm_sbpro_2 | adpcm_sbpro_3 | adpcm_sbpro_4 | adpcm_swf | adpcm_thp |
| adpcm_xa | adpcm_yamaha | alac | amv | ape | asv1 |
| asv2 | atrac 3 | avs | bethsoftvid | bmp | c93 |
| camstudio | camtasia | cavs | cinepak | cljr | cook |
| cyuv | dca | dnxhd | dsicinaudio | dsicinvideo | dvbsub |
| dvdsub | dvvideo | dxa | escape124 | ffv1 | ffvhuff |
| flac | flashsv | flic | flv | fraps | g726 |
| gif | h261 | h263 | h263i | h263p | h264 |
| huffyuv | idcinvideo | imc | indeo2 | indeo3 | interplay_dpcm |
| interplayvideo | jpegls | kmvc | liba52 | libfaac | libfaad |
| libgsm | libgsm_ms | libmp3lame | libtheora | libvorbis | libx264 |
| libxvid | ljpeg | loco | mace3 | mace6 | mdec |
| mimic | mjpeg | mjpegb | mmvideo | mp2 | mp3 |
| mp3adu | mp3on4 | mpc sv7 | mpc sv8 | mpeg1video | mpeg2video |
| mpeg4 | mpeg4aac | mpegvideo | msmpeg4 | msmpeg4v1 | msmpeg4v2 |
| msrle | msvideo1 | mszh | nellymoser | nuv | pam |
| pbm | pcm_alaw | pcm_mulaw | pcm_s16be | pcm_s16le | pcm_s16le_planar |
| pcm_s24be | pcm_s24daud | pcm_s24le | pcm_s32be | pcm_s32le | pcm_s8 |
| pcm_u16be | pcm_u16le | pcm_u24be | pcm_u24le | pcm_u32be | pcm_u32le |
| pcm_u8 | pcm_zork | pcx | pgm | pgmyuv | png |
| ppm | ptx | qdm2 | qdraw | qpeg | qtrle |
| rawvideo | real_144 | real_288 | rl2 | roq_dpcm | roqvideo |
| rpza | rv10 | rv20 | sgi | shorten | smackaud |
| smackvid | smc | snow | sol_dpcm | sonic | sonicls |
| sp5x | sunrast | svq1 | svq3 | targa | theora |
| thp | tiertexseqvideo | tiff | truemotion1 | truemotion2 | truespeech |
| tta | txd | ultimotion | vb | vc1 | vcr1 |
| vmdaudio | vmdvideo | vorbis | vp3 | vp5 | vp6 |
| vp6a | vp6f | vqavideo | wavpack | wmav1 | wmav2 |
| wmv1 | wmv2 | wmv3 | wnv1 | ws_snd1 | xan_dpcm |
| xan_wc3 | xl | xsub | zlib | zmbv |
| Protocol | Description |
|---|---|
| file: | Filesystem |
| http: | Hypertext Transfer Protocol |
| pipe: | Stream Pipeline |
| rtp: | Real-time Transport Protocol |
| tcp: | Transmission Control Protocol |
| udp: | User Datagram Protocol |
| ntsc | pal | qntsc | qpal |
| sntsc | spal | film | ntsc-film |
| sqcif | qcif | cif | 4cif |