Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Create file playable in WMP or Quicktime

robatbcis
Beginner
250 Views
Can Intel's IPP create a file that is playable by Windows Media Player and/or QuickTime?
I have used the MP4Muxer to create an H264 Raw Datafile but I have to use another program to convert it into a playable format (AVS Video Converter 6).
Is there another option that I should use to create a playable file? Samples would be appreciated.
I have went through the examples, searched through the manual and looked through this forum but cannot find a definitive answer that I can create a playable file.

Perhaps I am using the MP4Muxer incorrectly to create a playable file. SettingsI am using:

MP4Muxer *theMuxer = new MP4Muxer;
MuxerParams muxerParams;
// Fill params structure
muxerParams.m_lpDataWriter = &theWriter;
muxerParams.m_SystemType = H264_PURE_VIDEO_STREAM;
videoInfo.stream_type = H264_VIDEO;
muxerParams.m_lFlags = FLAG_START_WITH_HEADER;
muxerParams.m_nNumberOfTracks = 1;
muxerParams.pTrackParams = new UMC::TrackParams[1];


muxerParams.pTrackParams[0].type = UMC::VIDEO_TRACK;
muxerParams.pTrackParams[0].info.video = &videoInfo;
muxerParams.pTrackParams[0].bufferParams.m_prefOutputBufferSize = 100000;
muxerParams.pTrackParams[0].bufferParams.m_prefInputBufferSize = 100000;
muxerParams.pTrackParams[0].bufferParams.m_numberOfFrames = 15;

retStatus = theMuxer->Init(&muxerParams);



Have also tried with these settings but still not playable (can convert)
muxerParams.m_SystemType = MPEG4_PURE_VIDEO_STREAM;
videoInfo.stream_type = MPEG4_VIDEO;



Thanks for any helpful responses.
0 Kudos
2 Replies
Sergey_O_Intel1
Employee
250 Views
MP4Muxer just only wraps encoded stream into a MP4 container.
The question is how do you get your H.264 stream? If you use IPP H.264 encoder your parameters are right. The easiest way for you hereis to update video_enc_con sample so that it multiplexes each output frame from the encoder.
The other way to use MP4Muxer is to split an available H.264 stream by MP4Splitter. In this case you should add

FLAG_DATA_FROM_SPLITTER to m_lFlags.
Besides it depends on codecs installed on your machinewheather QT and WMP playbacks your stream or not. I'm also interested in return statuses if you get any error. I'll also appriciate if you can attach your stream to the message.


0 Kudos
robatbcis
Beginner
250 Views

Thanks for your response.

I am using H264VideoEncoder to provide the encoded frames for Mp4Muxer. I am encoding video frames from a USB camera (currently just trying to get one video stream to display, later will add audio). I am able to decode the encoded frames with H264VideoDecoder and see the frames again.
I do not receive any errors in the return variables (when decoding get the VM_NOT_ENOUGH_DATA for the first few frames as expected).

You stated that it "wraps encoded stream into a MP4 container", are you saying that I should be able to play this file with Quicktime or WMP if I have a proper codec installed. Do you happen to know if the codec that I would need is available (or even what it is)? Since I am using the H264VideoEncoder from the IPP should that codec be installed/available? Should the extension be 'Mp4' for QT to play it?


Idid not understand what you mean "attach your stream to the message", please clarify.


//###################################
// ENCODER Values
//###################################
H264VideoEncoder *pvidEncoder = NULL;
pvidEncoder = new H264VideoEncoder();

H264EncoderParams *pvidEncoderParams = NULL;
pvidEncoderParams = new H264EncoderParams;
pvidEncoderParams->ReadParamFile("C:\temp\codec\h264.par");
pvidEncoderParams->coding_type = 0;

pvidEncoderParams->info.clip_info.width = w;
pvidEncoderParams->info.clip_info.height = h;
pvidEncoderParams->numThreads = 0;

retStatus = pvidEncoder->Init(pvidEncoderParams);



The h264.par is as follows
/* CommentLine: H.264 Sequence.*/
stream.yuv /* name of source files */
0 /* number of frames to encode */
1 0 1 /* 1(reserved) , N (# of frames in between I frames), IDR interval. */
1 0 /* Number of B frames between I (or P) and next P, treat B as a reference (only 0 is supported!) */
4 1 0/* num_ref_frames (2-16), minimum length of list1 for backward prediction (only 1 is supported!), number of slices. */
100 0 /* profile_idc (77-main, 100-high); level_idc (set 0 for automatic selection) (check that num_ref_frames and frame size are in accordance with the level) */
640 /* horizontal_size */
480 /* vertical_size */
5 /* frame_rate_code [0,8] (0-30 fps,1-15 fps,2-24 fps,3-25 fps,4-30 fps,5-30 fps,6-50 fps,7-60 fps,8-60 fps)*/
1 8 8 /* High profile: chroma_format_idc (0 - monochrom, 1 - 420, 2 - 422), bit_depth_luma [8,12], bit_depth_chroma [8,12] */
0 8 0 0 0 /* High profile: aux_format_idc: [0,3], bit_depth_aux: [8,12], alpha_incr_flag: 0, 1; alpha_opaque_value: [0, 2^(bit_depth_aux + 9) -1]; alpha_transparent_value: [0, 2^(bit_depth_aux + 9) - 1] */
2 0 0 0 1000000 /* RC method(0 - quant_codes, 1 - CBR MBwise, 2 - CBR framewise, 3 - Debug); start qp values for I, P, B slices; bitrate (bits per second) */
2 1 8 8 /* ME method (1-6), subblock split, search x,search_y */
0 0 0 /* weighted prediction, weighted biprediction implicit weighted biprediction (not supported!)*/
1 0 /* direct type (0 - temporal 1 - spatial 2 - auto); direct_inference_flag */
0 0 0 /* disable_deblocking_idc: 1-- off, 0 - on, 2 -- on(without crossing slice boundaries); deblocking_filter_alpha, deblocking_filter_beta */
1 0 0 /* High profile: transform_8x8_mode: 0 -- off, 1 - on; 0 -- use standard, 1 -- use default scaling matrices for 8x8 quantization; qpprime_y_zero_transform_bypass_flag: (0, 1) */
640 /* display_horizontal_size */
480 /* display_vertical_size */
1 2 /* entropy coding mode (0-cavlc,1-cabac); cabac_init_idc (0,1,2) */
0 /* picture coding type (0 - only FRM, 1 - only FLD , 2 - only AFRM, 3 - pure PicAFF(no MBAFF) 4 PicAFF + MBAFF). Only 0 (FRM) is supported! */
1 0 /* speed/quality grade [0,3] (0-maximum speed, 3-maximum quality); OptimalQuantization (0, 1) */


0 Kudos
Reply