Video to DICOM using RZDCX
This code snippet performs the task of converting MPEG2 video file to a standard DICOM Instance using RZDCX DCXOBJ Class.
// Encode
ENCAPSULATED_VIDEO_PROPS props;
props.FrameDurationMiliSec = 40;
props.Height = 360;
props.width = 640;
props.NumberOfFrames = 1600;
props.PixelAspectRatioX = 1;
props.PixelAspectRatioY = 1;
props.VideoFormat = VIDEO_FORMAT.MPEG4;
DCXOBJ o1 = new DCXOBJ();
o1.SetVideoStream(@”test.m4v”, props);
o1.Dump(@”test.m4v.txt”);
o1.saveFile(@”test.m4v.dcm”);
This code snippet was taken from the example application in RZDCX Development package available as free evaluation. |
/// Set Video porperties
rzdcxLib::ENCAPSULATED_VIDEO_PROPS videoProps; videoProps.width = 352; videoProps.Height = 288; videoProps.PixelAspectRatioX = 4; videoProps.PixelAspectRatioY = 3; videoProps.FrameDurationMiliSec; // 40 msec = 25 FPS videoProps.NumberOfFrames = 1600; // 1600 frames videoProps.VideoFormat = rzdcxLib::MPEG2_AT_MAIN_LEVEL; /// Create a DCXOBJ IDCXOBJPtr obj(__uuidof(DCXOBJ)); obj->SetVideoStream(filename.c_str(), videoProps); |
The example applications source code is available in RZDCX Development package (free evaluation download).Learn more about RZDCX»