<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic using MP4Muxer with H264 encoded Videodata in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/using-MP4Muxer-with-H264-encoded-Videodata/m-p/826645#M5230</link>
    <description>&lt;BR /&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;&amp;gt; And what color format do i need to feed to the Encoder? I thought the encoder needs YUV420 and not YV12.&lt;/P&gt;&lt;P&gt;It depends on the raw video youre feeding into the encoder.You can check color format values in the corresponding enum (audio-video-codecs\core\umc\include\umc_structures.h):&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;YV12 = 0, // Planar Y, V, U (4:2:0) (note V,U order!)&lt;/P&gt;&lt;P&gt;YUV420 , // Planar Y, U, V (4:2:0)&lt;BR /&gt;...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Chao &lt;/P&gt;</description>
    <pubDate>Mon, 28 Jun 2010 03:19:54 GMT</pubDate>
    <dc:creator>Chao_Y_Intel</dc:creator>
    <dc:date>2010-06-28T03:19:54Z</dc:date>
    <item>
      <title>using MP4Muxer with H264 encoded Videodata</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/using-MP4Muxer-with-H264-encoded-Videodata/m-p/826639#M5224</link>
      <description>Hello i have a monochrom (gray only) video.&lt;BR /&gt;Witch i can encode to a h264 video with the umc_video_enc_con without problems( VLC-Player plays it well ).&lt;BR /&gt;But i want a mp4 viedo witch can be played by Quicktime (and others).&lt;BR /&gt;&lt;BR /&gt;So i found out that i have to Mux the H264 data into a mp4 Container.&lt;BR /&gt;And that is my Problem.&lt;BR /&gt;I readed the "umc-manual.pdf" an tried to adapt the sampel code so that it works for me.&lt;BR /&gt;The program runs nice and it writes a mp4 file to the Harddrive.&lt;BR /&gt;But i could not oben that mp4-file with any player.&lt;BR /&gt;I downloaded a programm called MediaInfo witch gives me follwing Information:&lt;BR /&gt;&lt;PRE&gt;[bash]Allgemein
Format                           : MPEG-4
Format profile                   : Base Media / Version 1
Codec ID                         : mp41
File size                        : 129 MiB
Duration                         : 8s 300ms
Overall bit rate                 : 131 Mbps

Video
ID                               : 1
Codec ID                         : 0
Duration                         : 8s 300ms
Bit rate mode                    : konstant
Bit rate                         : 4 821 Kbps
Nominal bit rate                 : 705 Mbps
Width                            : 320 Pixel
Height                           : 220 Pixel
Display aspect ratio             : 3:2
Frame rate mode                  : konstant
Frame rate                       : 30,000 FPS
Bits/(Pixel*Frame)               : 2.283
Stream size                      : 4,79 MiB (4%)[/bash]&lt;/PRE&gt; The video should have a playtime from 3min 36sek but the info says its only 8sek long.&lt;BR /&gt;&lt;BR /&gt;So here is the code is use for creating the mp4 file:&lt;BR /&gt;&lt;B&gt;Initialization:&lt;/B&gt;&lt;BR /&gt;&lt;PRE&gt;[cpp]//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	// Initialize Encoder 
	pEncoder = new UMC::H264VideoEncoder();
	pEncoderParams = new UMC::H264EncoderParams;

	pEncoderParams-&amp;gt;info.clip_info.height    = height;  
	pEncoderParams-&amp;gt;info.clip_info.width     = widht;    
	pEncoderParams-&amp;gt;info.bitrate             = bitRate; 
	pEncoderParams-&amp;gt;info.framerate			= frameRate;
	pEncoderParams-&amp;gt;numFramesToEncode		= maxNumFrames;
	pEncoderParams-&amp;gt;chroma_format_idc		= 0; //chroma_format_idc (0 - monochrom, 1 - 420, 2 - 422)
	pEncoderParams-&amp;gt;info.color_format		= GRAY;
	pEncoderParams-&amp;gt;numThreads               = 1;     

	if ((status = pEncoder-&amp;gt;Init(pEncoderParams)) != UMC::UMC_OK) 
         return; 
	//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	// Initialize file writer
	pWriter = new UMC::FileWriter();
	UMC::FileWriterParams writerParams;
	vm_char dstFileName[MAX_FILELEN];
	vm_char *ext;
	vm_string_strcpy( dstFileName, srcFileName );
	ext = vm_string_strrchr( dstFileName, '.' );
	ext++;
	vm_string_strcpy( ext , "mp4" );

	writerParams.m_portion_size = 0;
	vm_string_strcpy(writerParams.m_file_name, 	dstFileName);
	if ((status = pWriter-&amp;gt;Init(&amp;amp;writerParams)) != UMC::UMC_OK) 
         return; 

	//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	// Initialize Muxer
	pMuxer = new UMC::MP4Muxer();
	UMC::MuxerParams        MuxerParams;      

	MuxerParams.m_lpDataWriter      = pWriter;    
	MuxerParams.m_SystemType        = UMC::MPEG4_SYSTEM_STREAM;    
	MuxerParams.m_lFlags            = UMC::FLAG_FRAGMENTED_AT_I_PICTURES; 
	MuxerParams.m_nNumberOfTracks   = 1;    
	MuxerParams.pTrackParams        = new UMC::TrackParams[MuxerParams.m_nNumberOfTracks]; 

	MuxerParams.pTrackParams[0].type = UMC::VIDEO_TRACK;    
	MuxerParams.pTrackParams[0].info.video = &amp;amp;pEncoderParams-&amp;gt;info;    
	MuxerParams.pTrackParams[0].bufferParams.m_prefInputBufferSize=2000000;    
	MuxerParams.pTrackParams[0].bufferParams.m_prefOutputBufferSize=2000000;    

	if ((status = pMuxer-&amp;gt;Init(&amp;amp;MuxerParams)) != UMC::UMC_OK)    
		return;   [/cpp]&lt;/PRE&gt; &lt;B&gt;Working Loop&lt;/B&gt;&lt;BR /&gt;&lt;PRE&gt;[bash]UMC::VideoData in;
	UMC::VideoData *p_dataIn = &amp;amp;in;
	UMC::MediaData out(4*mWidth*mHeight);
	UMC::MediaData *p_dataOut = &amp;amp;out;
	UMC::Status    ret = UMC::UMC_OK;
	Ipp32s    len;

	p_dataIn-&amp;gt;Init(mWidth, mHeight, mColorFormat, 8);
	p_dataIn-&amp;gt;Alloc();

	mFramesEncoded = 0;

	do
	{
		if (mFramesEncoded &amp;gt;= mMaxNumFrames)
			p_dataIn = NULL; // get frames buffered inside encoder

		if (p_dataIn) 
		{
			if (UMC_OK == GetInputData(p_dataIn)) 
			{
				p_dataIn-&amp;gt;SetTime((mFramesEncoded+1)/pEncoderParams-&amp;gt;info.framerate);
			}
			else 
			{
				p_dataIn = NULL;
			}
		}
		//code video data 
		
		ret = pEncoder-&amp;gt;GetFrame(p_dataIn, p_dataOut);

		if (ret != UMC_OK &amp;amp;&amp;amp; ret != UMC_ERR_NOT_ENOUGH_DATA &amp;amp;&amp;amp; ret != UMC_ERR_END_OF_STREAM) {
			vm_file_fprintf(vm_stderr, VM_STRING("Error: encoding failed at %d source frame (exit with %d)!\n"),&lt;BR /&gt;                                                         mFramesEncoded, ret);
			return UMC_ERR_FAILED;
		}

		len = (Ipp32s)p_dataOut-&amp;gt;GetDataSize();

		if (UMC::UMC_OK == ret)
		{
			ret = pMuxer-&amp;gt;PutVideoData( p_dataOut );	
			if (UMC::UMC_OK == ret)
			{
				p_dataOut-&amp;gt;SetDataSize(0);
			}
		}

		if ( p_dataIn ) 
		{
			mFramesEncoded++;
		}
		else 
		{
			if (!len || ret == UMC_ERR_END_OF_STREAM) break; // EOF
		}

		if (!(mFramesEncoded % 10)) 
		{
			vm_string_printf(VM_STRING("%d."), mFramesEncoded);
		}

	}while (1);

	// EOS for video, inform muxer about it
	pMuxer-&amp;gt;PutEndOfStream( pMuxer-&amp;gt;GetTrackIndex( VIDEO_TRACK ) );[/bash]&lt;/PRE&gt; So please can somebody help me?&lt;BR /&gt;Why is the mp4-file not playable?&lt;BR /&gt;&lt;BR /&gt;greetings maxi&lt;BR /&gt;</description>
      <pubDate>Wed, 05 May 2010 10:49:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/using-MP4Muxer-with-H264-encoded-Videodata/m-p/826639#M5224</guid>
      <dc:creator>llt</dc:creator>
      <dc:date>2010-05-05T10:49:40Z</dc:date>
    </item>
    <item>
      <title>using MP4Muxer with H264 encoded Videodata</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/using-MP4Muxer-with-H264-encoded-Videodata/m-p/826640#M5225</link>
      <description>&lt;P&gt;&lt;BR /&gt;Maxi, &lt;/P&gt;&lt;P&gt;There is an update muxer sample code at this page. Could you check if this one can help? &lt;/P&gt;&lt;P&gt;&lt;A href="http://software.intel.com/en-us/articles/getting-started-with-intel-ipp-unified-media-classes-sample/" target="_blank"&gt;http://software.intel.com/en-us/articles/getting-started-with-intel-ipp-unified-media-classes-sample/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chao &lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2010 08:29:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/using-MP4Muxer-with-H264-encoded-Videodata/m-p/826640#M5225</guid>
      <dc:creator>Chao_Y_Intel</dc:creator>
      <dc:date>2010-05-06T08:29:15Z</dc:date>
    </item>
    <item>
      <title>using MP4Muxer with H264 encoded Videodata</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/using-MP4Muxer-with-H264-encoded-Videodata/m-p/826641#M5226</link>
      <description>Hi again,&lt;BR /&gt;the sampel helped me to create mpeg files but the mp4 muxing does not work properly.&lt;BR /&gt;I still have the problem that the .mp4 Video is only a few seconds long.&lt;BR /&gt;&lt;BR /&gt;Is there any sampel for mp4 muxing?&lt;BR /&gt;Or can u give me some help in getting it work?&lt;BR /&gt;&lt;BR /&gt;Maxi</description>
      <pubDate>Wed, 23 Jun 2010 09:00:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/using-MP4Muxer-with-H264-encoded-Videodata/m-p/826641#M5226</guid>
      <dc:creator>llt</dc:creator>
      <dc:date>2010-06-23T09:00:07Z</dc:date>
    </item>
    <item>
      <title>using MP4Muxer with H264 encoded Videodata</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/using-MP4Muxer-with-H264-encoded-Videodata/m-p/826642#M5227</link>
      <description>&lt;P&gt;Maxi,&lt;/P&gt;&lt;P&gt;My colleague provided me simple sample for MP4 muxer, attached. Can you check if it works?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chao&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2010 05:42:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/using-MP4Muxer-with-H264-encoded-Videodata/m-p/826642#M5227</guid>
      <dc:creator>Chao_Y_Intel</dc:creator>
      <dc:date>2010-06-24T05:42:52Z</dc:date>
    </item>
    <item>
      <title>using MP4Muxer with H264 encoded Videodata</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/using-MP4Muxer-with-H264-encoded-Videodata/m-p/826643#M5228</link>
      <description>Hi Chao Y thanks for the answer.&lt;BR /&gt;&lt;BR /&gt;Tow more question:&lt;BR /&gt;&lt;BR /&gt;Why does the muxer need information about the color format?&lt;BR /&gt;&lt;BR /&gt;Line 46: VideoInfo.color_format=UMC::YV12;&lt;BR /&gt;&lt;BR /&gt;And what color format do i need to feed to the Encoder?&lt;BR /&gt;I thought the encoder needs YUV420 and not YV12.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Maxi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Edit:&lt;BR /&gt;The h264 encoding and mp4 muxing works fine now.&lt;BR /&gt;I feeded the encoder with YUV420 data.&lt;BR /&gt;But i still want to know why the muxer needs color format infos.&lt;BR /&gt;</description>
      <pubDate>Thu, 24 Jun 2010 10:14:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/using-MP4Muxer-with-H264-encoded-Videodata/m-p/826643#M5228</guid>
      <dc:creator>llt</dc:creator>
      <dc:date>2010-06-24T10:14:59Z</dc:date>
    </item>
    <item>
      <title>using MP4Muxer with H264 encoded Videodata</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/using-MP4Muxer-with-H264-encoded-Videodata/m-p/826644#M5229</link>
      <description>&lt;DIV id="tiny_quote"&gt;&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A jquery1277462798696="81" rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=476359" href="https://community.intel.com/en-us/profile/476359/" class="basic"&gt;llt&lt;/A&gt;&lt;/DIV&gt;&lt;DIV style="background-color: #e5e5e5; margin-left: 2px; margin-right: 2px; border: 1px inset; padding: 5px;"&gt;&lt;I&gt;Why does the muxer need information about the color format?&lt;BR /&gt;&lt;/I&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;The muxer dosn't use this info. You may check it yourself.&lt;BR /&gt;Color_format is used in encoders.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2010 10:48:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/using-MP4Muxer-with-H264-encoded-Videodata/m-p/826644#M5229</guid>
      <dc:creator>Sergey_O_Intel1</dc:creator>
      <dc:date>2010-06-25T10:48:54Z</dc:date>
    </item>
    <item>
      <title>using MP4Muxer with H264 encoded Videodata</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/using-MP4Muxer-with-H264-encoded-Videodata/m-p/826645#M5230</link>
      <description>&lt;BR /&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;&amp;gt; And what color format do i need to feed to the Encoder? I thought the encoder needs YUV420 and not YV12.&lt;/P&gt;&lt;P&gt;It depends on the raw video youre feeding into the encoder.You can check color format values in the corresponding enum (audio-video-codecs\core\umc\include\umc_structures.h):&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;YV12 = 0, // Planar Y, V, U (4:2:0) (note V,U order!)&lt;/P&gt;&lt;P&gt;YUV420 , // Planar Y, U, V (4:2:0)&lt;BR /&gt;...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Chao &lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2010 03:19:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/using-MP4Muxer-with-H264-encoded-Videodata/m-p/826645#M5230</guid>
      <dc:creator>Chao_Y_Intel</dc:creator>
      <dc:date>2010-06-28T03:19:54Z</dc:date>
    </item>
  </channel>
</rss>

