- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Did anyone resize a resolution using MPEG4VideoEncoder? It looks that the encoder does not handle the resizing correctly. It works correctly with MPEG2VideoEncoder.
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.
This is simplified sample of my code:
UMC::VideoStreamInfo VideoInfo;
VideoInfo.streamPID = 0;
VideoInfo.stream_type = UMC::MPEG4_VIDEO;
VideoInfo.color_format = UMC::YUV420;
VideoInfo.interlace_type = UMC::PROGRESSIVE;
VideoInfo.aspect_ratio_height = 9;
VideoInfo.aspect_ratio_width = 16;
VideoInfo.clip_info.height = 1080;
VideoInfo.clip_info.width = 1920;
VideoInfo.bitrate = 10000000;
VideoInfo.framerate = 24;
UMC::FileWriter Writer;
UMC::MuxerParams MuxerParams;
MuxerParams.m_lpDataWriter = &Writer;
MuxerParams.m_SystemType = UMC::MPEG4_PURE_VIDEO_STREAM;
MuxerParams.m_nNumberOfTracks = 1;
MuxerParams.pTrackParams = new UMC::TrackParams[MuxerParams.m_nNumberOfTracks];
UMC::MP4Muxer Muxer;
Muxer.Init(&MuxerParams);
UMC::MPEG4EncoderParams videoParams;
videoParams.info.clip_info.height = 780;
videoParams.info.clip_info.width = 1280;
videoParams.info.bitrate = 24000;
videoParams.info.color_format = UMC::YUV420;
videoParams.info.framerate = 10000000;
videoParams.info.stream_type = UMC::MPEG4_VIDEO;
videoParams.info.aspect_ratio_height = 9;
videoParams.info.aspect_ratio_width = 16;
videoParams.numThreads = 1;
UMC::MPEG4VideoEncoder Mpeg4Encoder;
Mpeg4Encoder.Init(&videoParams);
UMC::VideoData DataVideoIn;
DataVideoIn.Init(1920,1080,UMC::YUV420,8);
Int VideoBufferSize = 1080x1920*3/2;
DataVideoIn.SetBufferPointer(m_pVideoFrameBuffer, VideoBufferSize);
DataVideoIn.SetDataSize(VideoBufferSize);
DataVideoOut.SetBufferPointer(pOutputVideoData, 100000000);
Mpeg4Encoder.GetFrame(DataVideoIn, DataVideoOut);
int nDataSize = DataVideoOut.GetDataSize();
MuxVideoData.SetBufferPointer(pOutputVideoData, nDataSize);
Mp4Muxer.PutVideoData(pMuxVideoData);
memcpy(MuxVideoData-.GetDataPointer(),DataVideoOut.GetDataPointer(), nDataSize);
MuxVideoData->SetDataSize(nDataSize);
I attached the mpeg4 file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page