<?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 Good day. in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949718#M18514</link>
    <description>Good day.

&amp;gt; VideoStreamInfo.clip_info.height = 720; // target height
&amp;gt; VideoStreamInfo.clip_info.width = 1080; // target width

As I understand this is a misprint and you meant 1280
Yes, this is right. Container should have actual encoded frame size.

&amp;gt; VideoStreamInfo.disp_clip_info.height = 1080; // source height
&amp;gt; VideoStreamInfo.disp_clip_info.width = 1920; // source width

disp_clip_info is deprecated parameter and doesn't do anything useful.</description>
    <pubDate>Fri, 16 Nov 2012 08:04:44 GMT</pubDate>
    <dc:creator>Pavel_V_Intel</dc:creator>
    <dc:date>2012-11-16T08:04:44Z</dc:date>
    <item>
      <title>MPEG4VideoEncoder resizing frame resolution</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949710#M18506</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did anyone resize a resolution using MPEG4VideoEncoder? It looks that the encoder does not handle the resizing correctly. It works correctly with MPEG2VideoEncoder.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is my case: I have 1920x1080 YUV420 video streaming and I am trying to encode the data to mpeg4 file. With original 1920x1080 it works great but when I try a smaller frame size in file the video content doesn’t look correctly.&lt;/P&gt;
&lt;P&gt;This is simplified sample of my code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UMC::VideoStreamInfo VideoInfo;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VideoInfo.streamPID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VideoInfo.stream_type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= UMC::MPEG4_VIDEO;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VideoInfo.color_format&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = UMC::YUV420;&lt;/P&gt;
&lt;P&gt;VideoInfo.interlace_type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = UMC::PROGRESSIVE;&lt;/P&gt;
&lt;P&gt;VideoInfo.aspect_ratio_height&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 9;&lt;/P&gt;
&lt;P&gt;VideoInfo.aspect_ratio_width&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 16;&lt;/P&gt;
&lt;P&gt;VideoInfo.clip_info.height&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;= 1080;&lt;/P&gt;
&lt;P&gt;VideoInfo.clip_info.width&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 1920;&lt;/P&gt;
&lt;P&gt;VideoInfo.bitrate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 10000000;&lt;/P&gt;
&lt;P&gt;VideoInfo.framerate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 24;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UMC::FileWriter Writer;&lt;/P&gt;
&lt;P&gt;UMC::MuxerParams MuxerParams;&lt;/P&gt;
&lt;P&gt;MuxerParams.m_lpDataWriter = &amp;amp;Writer;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MuxerParams.m_SystemType&amp;nbsp; = UMC::MPEG4_PURE_VIDEO_STREAM;&lt;/P&gt;
&lt;P&gt;MuxerParams.m_nNumberOfTracks = 1;&lt;/P&gt;
&lt;P&gt;MuxerParams.pTrackParams = new UMC::TrackParams[MuxerParams.m_nNumberOfTracks];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UMC::MP4Muxer Muxer;&lt;/P&gt;
&lt;P&gt;Muxer.Init(&amp;amp;MuxerParams);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UMC::MPEG4EncoderParams videoParams;&lt;/P&gt;
&lt;P&gt;videoParams.info.clip_info.height = 780;&lt;/P&gt;
&lt;P&gt;videoParams.info.clip_info.width = 1280;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;videoParams.info.bitrate = 24000;&lt;/P&gt;
&lt;P&gt;videoParams.info.color_format = UMC::YUV420;&lt;/P&gt;
&lt;P&gt;videoParams.info.framerate = 10000000;&lt;/P&gt;
&lt;P&gt;videoParams.info.stream_type = UMC::MPEG4_VIDEO;&lt;/P&gt;
&lt;P&gt;videoParams.info.aspect_ratio_height = 9;&lt;/P&gt;
&lt;P&gt;videoParams.info.aspect_ratio_width = 16;&lt;/P&gt;
&lt;P&gt;videoParams.numThreads = 1;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UMC::MPEG4VideoEncoder Mpeg4Encoder;&lt;/P&gt;
&lt;P&gt;Mpeg4Encoder.Init(&amp;amp;videoParams);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;UMC::VideoData DataVideoIn;&lt;/P&gt;
&lt;P&gt;DataVideoIn.Init(1920,1080,UMC::YUV420,8);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Int VideoBufferSize = 1080x1920*3/2;&lt;/P&gt;
&lt;P&gt;DataVideoIn.SetBufferPointer(m_pVideoFrameBuffer, VideoBufferSize);&lt;/P&gt;
&lt;P&gt;DataVideoIn.SetDataSize(VideoBufferSize);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DataVideoOut.SetBufferPointer(pOutputVideoData, 100000000);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mpeg4Encoder.GetFrame(DataVideoIn, DataVideoOut);&lt;/P&gt;
&lt;P&gt;int nDataSize = DataVideoOut.GetDataSize();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;MuxVideoData.SetBufferPointer(pOutputVideoData, nDataSize);&lt;/P&gt;
&lt;P&gt;Mp4Muxer.PutVideoData(pMuxVideoData);&lt;/P&gt;
&lt;P&gt;memcpy(MuxVideoData-.GetDataPointer(),DataVideoOut.GetDataPointer(), nDataSize);&lt;/P&gt;
&lt;P&gt;MuxVideoData-&amp;gt;SetDataSize(nDataSize);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I attached the mpeg4 file.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2012 17:31:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949710#M18506</guid>
      <dc:creator>stsybikov</dc:creator>
      <dc:date>2012-11-13T17:31:50Z</dc:date>
    </item>
    <item>
      <title>I uploaded mpeg 2 file as</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949711#M18507</link>
      <description>I uploaded mpeg 2 file as well. This is what I expected to be. I zipped it because it's not allowed to upload mpg file.</description>
      <pubDate>Tue, 13 Nov 2012 17:41:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949711#M18507</guid>
      <dc:creator>stsybikov</dc:creator>
      <dc:date>2012-11-13T17:41:38Z</dc:date>
    </item>
    <item>
      <title>Sorry,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949712#M18508</link>
      <description>Sorry,
My name is Sergey Tsybikov, Smith &amp;amp; Nephew Endoscopy</description>
      <pubDate>Tue, 13 Nov 2012 18:48:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949712#M18508</guid>
      <dc:creator>stsybikov</dc:creator>
      <dc:date>2012-11-13T18:48:28Z</dc:date>
    </item>
    <item>
      <title>Good day.</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949713#M18509</link>
      <description>Good day.

As I understand you have 1920x1080 raw file and want the encoder to resize it to 1280x780 before encoding.
Well, encoders usually don't do that (MPEG2 does because it use VideoProcessing for frame copying). You need to use VideoProcessing class or VideoResizing class directly.

E.g. (schematically): 

VideoData inputData;
VideoData resizedData;
VideoResizing resizer;

inputData.Init(1920, 1080, YUV420);
inputData.Alloc();

resizedData.Init(1280, 780, YUV420);
resizedData.Alloc();

resizer.SetMethod(IPPI_INTER_LINEAR); // interpolation method, there is more

for(;;)
{
    readFrame(inputData);
    resizer.GetFrame(inputData, resizedData);

    decoder.GetFrame(resizedData, outputData);
}</description>
      <pubDate>Wed, 14 Nov 2012 10:29:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949713#M18509</guid>
      <dc:creator>Pavel_V_Intel</dc:creator>
      <dc:date>2012-11-14T10:29:48Z</dc:date>
    </item>
    <item>
      <title>Hi Pavel,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949714#M18510</link>
      <description>Hi Pavel,

Thank you for the answer. It helped and it works for h264 encoding as well.

The other problem – I did the encoding as 1280x720 and when I tried to play back the mpeg4 video file using VLC media player it shows the size of video as 1920x1080 with garbage data except 1280x720 where I have correct video data. Please check the attached video. When I tried to do it at QuickTime it plays at 1920x1080 but the content is correct. QuickTime Movie Inspector shows me Format as 1920x1080

H264 file does not have this issue.

Regards,
Sergey Tsybikov
Smith&amp;amp;Nephew Endoscopy</description>
      <pubDate>Wed, 14 Nov 2012 19:22:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949714#M18510</guid>
      <dc:creator>stsybikov</dc:creator>
      <dc:date>2012-11-14T19:22:39Z</dc:date>
    </item>
    <item>
      <title>You probably forgot to change</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949715#M18511</link>
      <description>You probably forgot to change resolution in parameters for muxer. Container report 1920x1080 and actual stream happens to be 1280x720.</description>
      <pubDate>Thu, 15 Nov 2012 10:35:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949715#M18511</guid>
      <dc:creator>Pavel_V_Intel</dc:creator>
      <dc:date>2012-11-15T10:35:55Z</dc:date>
    </item>
    <item>
      <title>Hi Pavel,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949716#M18512</link>
      <description>Hi Pavel,

I could not figure out where these parameters are for the muxer. 

I attached original video size to VideoStreamInfo
VideoStreamInfo.clip_info.height = 1080;
VideoStreamInfo.clip_info.width = 1920;

I attached VideoStreanInfo to MuxerParams
MuxerParams.pTrackParams[0].info.video = &amp;amp;VideoStreamInfo;

I did the init MP4Muxer with MuxerParams
MP4Muxer.Init(&amp;amp;MuxerParams);

Defined encoder params with final resolution
MPEG4EncoderParams.info.clip_info.height = 720;
MPEG4EncoderParams.info.clip_info.width = 1280;

Did the init of encoder
MPEG4VideoEncoder.Init(&amp;amp;MPEG4Encoder);

Plus based on you suggestion I used VideoResizing class with 1280 and 720

Thank you.
Sergey Tsybikov</description>
      <pubDate>Thu, 15 Nov 2012 16:25:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949716#M18512</guid>
      <dc:creator>stsybikov</dc:creator>
      <dc:date>2012-11-15T16:25:02Z</dc:date>
    </item>
    <item>
      <title>Hi Pavel:</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949717#M18513</link>
      <description>Hi Pavel:

Playing with parameters I figured out that I have a correct video I have to define the follong

VideoStreamInfo.clip_info.height = 720;    // target height
VideoStreamInfo.clip_info.width = 1080;     // target width

VideoStreamInfo.disp_clip_info.height = 1080;     // source height
VideoStreamInfo.disp_clip_info.width = 1920;      // source width

Is it right approach?

Thank you
Sergey T</description>
      <pubDate>Thu, 15 Nov 2012 16:46:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949717#M18513</guid>
      <dc:creator>stsybikov</dc:creator>
      <dc:date>2012-11-15T16:46:42Z</dc:date>
    </item>
    <item>
      <title>Good day.</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949718#M18514</link>
      <description>Good day.

&amp;gt; VideoStreamInfo.clip_info.height = 720; // target height
&amp;gt; VideoStreamInfo.clip_info.width = 1080; // target width

As I understand this is a misprint and you meant 1280
Yes, this is right. Container should have actual encoded frame size.

&amp;gt; VideoStreamInfo.disp_clip_info.height = 1080; // source height
&amp;gt; VideoStreamInfo.disp_clip_info.width = 1920; // source width

disp_clip_info is deprecated parameter and doesn't do anything useful.</description>
      <pubDate>Fri, 16 Nov 2012 08:04:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/MPEG4VideoEncoder-resizing-frame-resolution/m-p/949718#M18514</guid>
      <dc:creator>Pavel_V_Intel</dc:creator>
      <dc:date>2012-11-16T08:04:44Z</dc:date>
    </item>
  </channel>
</rss>

